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:
@@ -164,8 +164,10 @@ static void init(void)
|
||||
|
||||
static void cycle()
|
||||
{
|
||||
lr35902_cycle(&cpu);
|
||||
gb_video_cycle(&video);
|
||||
int cycles;
|
||||
|
||||
cycles = lr35902_cycle(&cpu);
|
||||
gb_video_cycle(&video, cycles);
|
||||
}
|
||||
|
||||
static void show_prompt()
|
||||
|
||||
Reference in New Issue
Block a user