@@ -214,44 +214,51 @@ public static int calcChecksum(WrappedInputStream s) {
214
214
}
215
215
}
216
216
217
- private static readonly Regex copyrightRegex = new Regex ( @"\(C\)(\S{4}.)(\d{4})\.(.{3})" ) ;
218
- public static void parseMegadriveROM ( ROMInfo info , WrappedInputStream s ) {
219
-
220
- bool isCD = "SEGADISCSYSTEM " . Equals ( s . read ( 15 , Encoding . ASCII ) ) ;
221
-
222
- s . Position = 0x100 ;
223
-
224
- string consoleName = s . read ( 16 , Encoding . ASCII ) . TrimEnd ( '\0 ' , ' ' ) ;
225
- info . addInfo ( "Console name" , consoleName ) ;
226
-
227
- //Is this actually the console name filed on Sega CD games? For Mega CD it definitely says "SEGA MEGA DRIVE"
228
- bool isUSA = consoleName . StartsWith ( "SEGA GENESIS" ) ;
229
-
217
+ static string getPlatformFromConsoleName ( string consoleName , bool isCD ) {
230
218
if ( consoleName . StartsWith ( "SEGA 32X" ) ) {
231
- // There are a few homebrew apps (32xfire, Shymmer) and also Doom
232
- // that misuse this field and say something else, so I've used
233
- // startswith instead, which should be safe, and picks up those three
234
- // except for 32xfire which claims to be a Megadrive game (it has
235
- // "32X GAME" as the domestic and overseas name)
236
- // Some cheeky buggers just use SEGA MEGADRIVE or SEGA GENESIS anyway even when they're 32X
237
- // Note that the TMSS present in Model 2 and Mega 3 Genesis/Megadrives requires
238
- // games to have something starting with "SEGA" or " SEGA" here
239
- info . addInfo ( "Platform" , "Sega 32X" ) ;
219
+ return "Sega 32X" ;
220
+ } else if ( consoleName . Equals ( "SAMSUNG PICO" ) ) {
221
+ return "Samsung Pico" ;
222
+ } else if ( consoleName . Equals ( "SEGA PICO" ) || consoleName . Equals ( "SEGATOYS PICO" ) || consoleName . Equals ( "SEGA TOYS PICO" )
223
+ || consoleName . Equals ( "IMA IKUNOJYUKU" ) || consoleName . Equals ( "IMA IKUNOUJYUKU" ) ) {
224
+ //I... have zero idea what those last two are about, but they're a thing in some Sega Pico titles
225
+ return "Sega Pico" ;
240
226
} else {
227
+ bool isUSA = consoleName . StartsWith ( "SEGA GENESIS" ) ;
228
+ bool isMD = consoleName . StartsWith ( "SEGA MEGA DRIVE" ) || consoleName . StartsWith ( "SEGA MEGADRIVE" ) ;
241
229
if ( isCD ) {
242
230
if ( isUSA ) {
243
- info . addInfo ( "Platform" , "Sega CD" ) ;
231
+ return "Sega CD" ;
232
+ } else if ( isMD ) {
233
+ return "Mega CD" ;
244
234
} else {
245
- info . addInfo ( "Platform" , " Mega CD") ;
235
+ return "Sega CD/ Mega CD";
246
236
}
247
237
} else {
248
238
if ( isUSA ) {
249
- info . addInfo ( "Platform" , "Sega Genesis" ) ;
239
+ return "Sega Genesis" ;
240
+ } else if ( isMD ) {
241
+ return "Sega Mega Drive" ;
250
242
} else {
251
- info . addInfo ( "Platform" , "Sega Megadrive" ) ;
243
+ return "Sega Genesis/Mega Drive" ;
252
244
}
253
245
}
254
246
}
247
+ }
248
+
249
+ private static readonly Regex copyrightRegex = new Regex ( @"\(C\)(\S{4}.)(\d{4})\.(.{3})" ) ;
250
+ public static void parseMegadriveROM ( ROMInfo info , WrappedInputStream s , bool isCD = false ) {
251
+ s . Position = 0x100 ;
252
+
253
+ //While we're here, it should be noted that some allegedly official licensed and final don't have correct header information
254
+ //of any kind, and as such you will see plain garbage all across here. Even the console name, which results in them not being
255
+ //able to boot on real Model 2 and Model 3 hardware. Point at them and laugh.
256
+ //These games are: Zany Golf (rev 0) and Budokan: The Martial Spirit, among others which aren't actually licensed.
257
+ //Anyway, I just thought that was interesting enough to comment on. I found it fascinating. Am I just kinda weird? Oh well.
258
+
259
+ string consoleName = s . read ( 16 , Encoding . ASCII ) . TrimEnd ( '\0 ' , ' ' ) ;
260
+ info . addInfo ( "Console name" , consoleName ) ;
261
+ info . addInfo ( "Platform" , getPlatformFromConsoleName ( consoleName . TrimStart ( ' ' ) , isCD ) ) ;
255
262
256
263
string copyright = s . read ( 16 , Encoding . ASCII ) . TrimEnd ( '\0 ' , ' ' ) ;
257
264
info . addInfo ( "Copyright" , copyright ) ;
0 commit comments