Mercurial > repos > blastem
comparison xband.c @ 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 | adb62000d296 |
children | d74d3998482c |
comparison
equal
deleted
inserted
replaced
1466:f2ee46d08b01 | 1468:17c1c30e0d6f |
---|---|
81 #define dputs | 81 #define dputs |
82 #endif | 82 #endif |
83 | 83 |
84 uint8_t xband_detect(uint8_t *rom, uint32_t rom_size) | 84 uint8_t xband_detect(uint8_t *rom, uint32_t rom_size) |
85 { | 85 { |
86 //Internal ROM is 512KB, accept larger ones for overdumps and custom firmware | 86 if (rom_size < 0x200) { |
87 if (rom_size < (512*1024)) { | |
88 return 0; | 87 return 0; |
89 } | 88 } |
90 | |
91 //ROM has no standard header, but does have a jump at $100 | |
92 if (rom[0x100] != 0x4E || rom[0x101] != 0xF9) { | |
93 return 0; | |
94 } | |
95 | 89 |
96 //product ID is all NULL | 90 //product ID is all NULL |
97 for (int i = GAME_ID_OFF; i <= (GAME_ID_OFF + GAME_ID_LEN); i++) | 91 for (int i = GAME_ID_OFF; i <= (GAME_ID_OFF + GAME_ID_LEN); i++) |
98 { | 92 { |
99 if (rom[i]) { | 93 if (rom[i]) { |
100 return 0; | 94 return 0; |
101 } | 95 } |
102 } | 96 } |
97 | |
98 if (!memcmp(rom+8, "DAVE", 4)) { | |
99 //XBAND test roms | |
100 return 1; | |
101 } | |
102 | |
103 //Internal ROM is 512KB, accept larger ones for overdumps and custom firmware | |
104 if (rom_size < (512*1024)) { | |
105 return 0; | |
106 } | |
107 | |
108 //ROM has no standard header, but does have a jump at $100 | |
109 if (rom[0x100] != 0x4E || rom[0x101] != 0xF9) { | |
110 return 0; | |
111 } | |
112 | |
113 | |
103 return 1; | 114 return 1; |
104 } | 115 } |
105 | 116 |
106 static xband *get_xband(genesis_context *gen) | 117 static xband *get_xband(genesis_context *gen) |
107 { | 118 { |