summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-10-09 07:42:33 -0700
committerMichael Pavone <pavone@retrodev.com>2017-10-09 07:42:33 -0700
commit155bdd259eb8909c579a1f28539ff15129ba00fd (patch)
treebfdda4437e8c11d071cf61dc6e5254fb66f61005
parent982b68d0ca76aee937e4dd2aa990aea347371231 (diff)
Added detection of XBAND test ROMs. None seem to actually work with my limited FRED chip implementation though
-rw-r--r--xband.c25
1 files changed, 18 insertions, 7 deletions
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;
}