From 155bdd259eb8909c579a1f28539ff15129ba00fd Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 9 Oct 2017 07:42:33 -0700 Subject: Added detection of XBAND test ROMs. None seem to actually work with my limited FRED chip implementation though --- xband.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'xband.c') diff --git a/xband.c b/xband.c index 1a72839..f4a85ad 100644 --- a/xband.c +++ b/xband.c @@ -83,6 +83,23 @@ enum { uint8_t xband_detect(uint8_t *rom, uint32_t rom_size) { + if (rom_size < 0x200) { + return 0; + } + + //product ID is all NULL + for (int i = GAME_ID_OFF; i <= (GAME_ID_OFF + GAME_ID_LEN); i++) + { + if (rom[i]) { + return 0; + } + } + + if (!memcmp(rom+8, "DAVE", 4)) { + //XBAND test roms + return 1; + } + //Internal ROM is 512KB, accept larger ones for overdumps and custom firmware if (rom_size < (512*1024)) { return 0; @@ -93,13 +110,7 @@ uint8_t xband_detect(uint8_t *rom, uint32_t rom_size) return 0; } - //product ID is all NULL - for (int i = GAME_ID_OFF; i <= (GAME_ID_OFF + GAME_ID_LEN); i++) - { - if (rom[i]) { - return 0; - } - } + return 1; } -- cgit v1.2.3