CGB palettes are not accessible during Mode 3, closes #84

This commit is contained in:
Lior Halphon 2019-01-14 22:22:46 +02:00
parent 879d3b607d
commit 312478e509
1 changed files with 8 additions and 0 deletions

View File

@ -357,6 +357,10 @@ static uint8_t read_high_memory(GB_gameboy_t *gb, uint16_t addr)
if (!gb->cgb_mode && gb->boot_rom_finished) {
return 0xFF;
}
/* TODO: Verify actual access timing */
if (gb->vram_read_blocked) {
return 0xFF;
}
uint8_t index_reg = (addr & 0xFF) - 1;
return ((addr & 0xFF) == GB_IO_BGPD?
gb->background_palettes_data :
@ -788,6 +792,10 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value)
is required. */
return;
}
/* TODO: Verify actual access timing */
if (gb->vram_write_blocked) {
return;
}
uint8_t index_reg = (addr & 0xFF) - 1;
((addr & 0xFF) == GB_IO_BGPD?
gb->background_palettes_data :