gbdb: remove some conditionals from mem_read()

By reading directly from a "RAM" array, and copying in the cart data
over the old bootrom.

Also, some other fixups because I'm too lazy to properly split patches
for a personal project.
This commit is contained in:
2018-07-02 05:24:36 +00:00
parent 1bb3d8512a
commit 213c08fa18
4 changed files with 12 additions and 15 deletions

View File

@@ -14,16 +14,15 @@ void gb_video_init(struct gb_video *video)
void gb_video_cycle(struct gb_video *video)
{
video->line_counter++;
if (video->line_counter >= CYCLES_PER_LINE) {
if (video->line_counter < CYCLES_PER_LINE - 1) {
video->line_counter++;
} else {
video->line_counter = 0;
video->curline += 1;
if (video->curline > LCD_Y_MAX) {
video->curline = 0;
}
}
}
uint8_t gb_video_mem_read(struct gb_video *video, uint16_t addr)