diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-10-09 07:42:33 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-10-09 07:42:33 -0700 |
commit | 155bdd259eb8909c579a1f28539ff15129ba00fd (patch) | |
tree | bfdda4437e8c11d071cf61dc6e5254fb66f61005 | |
parent | 982b68d0ca76aee937e4dd2aa990aea347371231 (diff) |
Added detection of XBAND test ROMs. None seem to actually work with my limited FRED chip implementation though
-rw-r--r-- | xband.c | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -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; } |