changeset 1468:17c1c30e0d6f

Added detection of XBAND test ROMs. None seem to actually work with my limited FRED chip implementation though
author Michael Pavone <pavone@retrodev.com>
date Mon, 09 Oct 2017 07:42:33 -0700
parents f2ee46d08b01
children 723f6381cffa
files xband.c
diffstat 1 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/xband.c	Wed Sep 13 21:13:11 2017 -0700
+++ b/xband.c	Mon Oct 09 07:42:33 2017 -0700
@@ -83,6 +83,23 @@
 
 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 @@
 		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;
 }