gbdb,cpu,video: reduce number of calls to cycle functions

Instead of calling cpu_cycle() and video_cycle() once per emulated
cycle, call cpu_cycle() once per emulated instruction. This should not
have any obvious effects on the emulation (as currently written),
because all of the memory reads and writes are done in the first
"cycle" of the instruction.

This patch results in a substantial performance gain (>100%, if I
recall correctly).
This commit is contained in:
2018-07-02 00:12:07 -07:00
parent 447276d029
commit ea2ea1e293
5 changed files with 17 additions and 19 deletions

View File

@@ -135,6 +135,6 @@ void lr35902_set_reg_8(struct lr35902_state *cpu,
lr35902_regs_8 reg,
uint8_t val);
void lr35902_cycle(struct lr35902_state *cpu);
int lr35902_cycle(struct lr35902_state *cpu);
#endif