diff system.c @ 1503:a763523dadf4 segacd

Added code for initializing a combined Genesis + Sega CD system when a Sega CD ISO is loaded
author Michael Pavone <pavone@retrodev.com>
date Wed, 13 Dec 2017 09:44:41 -0800
parents aee2177a1630
children 5dacaef602a7
line wrap: on
line diff
--- a/system.c	Tue Dec 12 09:44:33 2017 -0800
+++ b/system.c	Wed Dec 13 09:44:41 2017 -0800
@@ -12,7 +12,11 @@
 system_type detect_system_type(system_media *media)
 {
 	if (safe_cmp("SEGA", 0x100, media->buffer, media->size)) {
-		//TODO: Differentiate between vanilla Genesis and Sega CD/32X games
+		//TODO: support other bootable identifiers
+		if (safe_cmp("SEGADISCSYSTEM", 0, media->buffer, media->size)) {
+			return SYSTEM_SEGACD;
+		}
+		//TODO: Differentiate between vanilla Genesis and 32X games
 		return SYSTEM_GENESIS;
 	}
 	if (safe_cmp("TMR SEGA", 0x1FF0, media->buffer, media->size)
@@ -60,6 +64,8 @@
 	{
 	case SYSTEM_GENESIS:
 		return &(alloc_config_genesis(media->buffer, media->size, lock_on, lock_on_size, opts, force_region, info_out))->header;
+	case SYSTEM_SEGACD:
+		return &(alloc_config_genesis_cdboot(media, opts, force_region, info_out))->header;
 #ifndef NO_Z80
 	case SYSTEM_SMS:
 		return &(alloc_configure_sms(media, opts, force_region, info_out))->header;