From c01425d99a3f48f5dd25a2d78aa2b82d01f27a71 Mon Sep 17 00:00:00 2001 From: Sergey Dvodnenko Date: Sun, 25 Oct 2020 17:59:56 +0200 Subject: [PATCH] snes: add special LoRom mapping (Derby Stallion 96 and Sound Novel Tsukuru) --- support/snes/snes.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/support/snes/snes.cpp b/support/snes/snes.cpp index ed5722d..a606183 100644 --- a/support/snes/snes.cpp +++ b/support/snes/snes.cpp @@ -166,8 +166,18 @@ uint8_t* snes_get_header(fileTYPE *f) } } - //Rom type: 0-Low, 1-High, 2-ExHigh - hdr[1] = (addr == 0x00ffc0) ? 1 : (addr == 0x40ffc0) ? 2 : 0; + bool has_bsx_slot = true; + if (buf[addr - 14] == 'Z' && buf[addr - 11] == 'J' && + ((buf[addr - 13] >= 'A' && buf[addr - 13] <= 'Z') || (buf[addr - 13] >= '0' && buf[addr - 13] <= '9')) && + (buf[addr + Company] == 0x33 || (buf[addr - 10] == 0x00 && buf[addr - 4] == 0x00)) ) { + has_bsx_slot = true; + } + + //Rom type: 0-Low, 1-High, 2-ExHigh, 3-SpecialLoRom + hdr[1] = (addr == 0x00ffc0) ? 1 : + (addr == 0x40ffc0) ? 2 : + has_bsx_slot ? 3 : + 0; //BSX 3 if (is_bsx_bios) {