fix rom boot read for cgb

This commit is contained in:
Tobias Gunkel
2025-08-24 09:01:36 +02:00
parent e14faf7df7
commit 7e7bc68519
+3 -2
View File
@@ -827,10 +827,11 @@ uint8_t __gb_read(struct gb_s *gb, uint16_t addr)
case 0x0:
/* IO_BOOT is only set to 1 if gb->gb_bootrom_read was not NULL
* on reset. */
if(gb->hram_io[IO_BOOT] == 0 && addr < 0x0100)
{
if(gb->hram_io[IO_BOOT] == 0) {
if ((gb->cgb.cgbMode && addr < 0x0900) || (!gb->cgb.cgbMode && addr < 0x0100)) {
return gb->gb_bootrom_read(gb, addr);
}
}
/* Fallthrough */
case 0x1: