mirror of https://github.com/LIJI32/SameBoy.git
Correct read emulation of the BANK register while still in the boot ROM
This commit is contained in:
parent
10d996330c
commit
4ab256d896
|
@ -192,7 +192,7 @@ enum {
|
||||||
/* Missing */
|
/* Missing */
|
||||||
|
|
||||||
GB_IO_VBK = 0x4F, // CGB Mode Only - VRAM Bank
|
GB_IO_VBK = 0x4F, // CGB Mode Only - VRAM Bank
|
||||||
GB_IO_BANK = 0x50, // Write to disable the BIOS mapping
|
GB_IO_BANK = 0x50, // Write to disable the boot ROM mapping
|
||||||
|
|
||||||
/* CGB DMA */
|
/* CGB DMA */
|
||||||
GB_IO_HDMA1 = 0x51, // CGB Mode Only - New DMA Source, High
|
GB_IO_HDMA1 = 0x51, // CGB Mode Only - New DMA Source, High
|
||||||
|
|
|
@ -702,7 +702,8 @@ static uint8_t read_high_memory(GB_gameboy_t *gb, uint16_t addr)
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
return (gb->io_registers[GB_IO_KEY1] & 0x7F) | (gb->cgb_double_speed? 0xFE : 0x7E);
|
return (gb->io_registers[GB_IO_KEY1] & 0x7F) | (gb->cgb_double_speed? 0xFE : 0x7E);
|
||||||
|
case GB_IO_BANK:
|
||||||
|
return 0xFE | gb->boot_rom_finished;
|
||||||
case GB_IO_RP: {
|
case GB_IO_RP: {
|
||||||
if (!gb->cgb_mode) return 0xFF;
|
if (!gb->cgb_mode) return 0xFF;
|
||||||
/* You will read your own IR LED if it's on. */
|
/* You will read your own IR LED if it's on. */
|
||||||
|
@ -1572,7 +1573,7 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GB_IO_BANK:
|
case GB_IO_BANK:
|
||||||
gb->boot_rom_finished = true;
|
gb->boot_rom_finished |= value & 1;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case GB_IO_KEY0:
|
case GB_IO_KEY0:
|
||||||
|
|
Loading…
Reference in New Issue