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:
@@ -93,7 +93,7 @@ struct gb_video {
|
||||
};
|
||||
|
||||
void gb_video_init(struct gb_video *video);
|
||||
void gb_video_cycle(struct gb_video *video);
|
||||
void gb_video_cycle(struct gb_video *video, int cycles);
|
||||
uint8_t gb_video_mem_read(struct gb_video *video, uint16_t addr);
|
||||
void gb_video_mem_write(struct gb_video *video, uint16_t addr, uint8_t val);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user