sms, add basic sg-1000 support
authorkub <derkub@gmail.com>
Sat, 26 Feb 2022 10:19:07 +0000 (10:19 +0000)
committerkub <derkub@gmail.com>
Sat, 26 Feb 2022 10:19:07 +0000 (10:19 +0000)
pico/sms.c
platform/common/menu_pico.c
platform/libretro/libretro.c
platform/opendingux/data/default.gcw0.desktop
platform/opendingux/data/default.retrofw.desktop

index 3908136..dd301b0 100644 (file)
@@ -454,6 +454,14 @@ static void write_bank_jang(unsigned short a, unsigned char d)
   }
 }
 
+static void write_bank_x8k(unsigned short a, unsigned char d)
+{
+  if ((a&0xe000) != 0x2000) return;
+  ((unsigned char *)PicoMem.vram)[a+0x6000] = d;
+  z80_map_set(z80_read_map,  0x2000, 0x3fff, PicoMem.vram+0x4000, 0);
+  z80_map_set(z80_write_map, 0x2000, 0x3fff, PicoMem.vram+0x4000, 0);
+}
+
 // TODO auto-selecting is not really reliable.
 // Before adding more mappers this should be revised.
 static void xwrite(unsigned int a, unsigned char d)
@@ -480,11 +488,12 @@ static void xwrite(unsigned int a, unsigned char d)
         write_bank_codem(a, d);
         write_bank_korea(a, d);
         write_bank_n16k(a, d);
+        write_bank_x8k(a, d);
         break;
   }
 }
 
-// TMR product codes and hardware type for know 50Hz-only games */
+// TMR product codes and hardware type for know 50Hz-only games
 static u32 region_pal[] = { // cf. GX+, core/cart_hw/sms_cartc.c
   0x40207067 /* Addams Family */, 0x40207020 /* Back.Future 3 */,
   0x40207058 /* Battlemaniacs */, 0x40007105 /* Cal.Games 2 */,
index 8ea8432..3ebaa4e 100644 (file)
@@ -42,7 +42,7 @@ static const char *rom_exts[] = {
        "bin", "smd", "gen", "md",
        "iso", "cso", "cue", "chd",
        "32x",
-       "sms", "gg",
+       "sms", "gg",  "sg",
        NULL
 };
 
index 2399a3c..b24028e 100644 (file)
@@ -733,7 +733,7 @@ void retro_get_system_info(struct retro_system_info *info)
 #define _GIT_VERSION "-" GIT_VERSION
 #endif
    info->library_version = VERSION _GIT_VERSION;
-   info->valid_extensions = "bin|gen|smd|md|32x|cue|iso|chd|sms|gg";
+   info->valid_extensions = "bin|gen|smd|md|32x|cue|iso|chd|sms|gg|sg";
    info->need_fullpath = true;
 }
 
index 73094f0..49668c3 100644 (file)
@@ -6,4 +6,4 @@ Exec=PicoDrive %f
 Icon=megadrive
 Terminal=false
 Categories=emulators;
-MimeType=.md;.smd;.bin;.sms;.gg;.cue;.chd;.32x;.zip;.7z
+MimeType=.md;.smd;.bin;.sms;.gg;.sg;.cue;.chd;.32x;.zip;.7z
index 2ea9e04..7fcce63 100644 (file)
@@ -6,7 +6,7 @@ Icon=megadrive
 Categories=emulators;
 X-OD-Manual=
 X-OD-Selector=
-X-OD-Filter=.md,.smd,.bin,.sms,.gg,.cue,.chd,.32x,.zip,.7z
+X-OD-Filter=.md,.smd,.bin,.sms,.gg,.sg,.cue,.chd,.32x,.zip,.7z
 Terminal=true
 Type=Application
 StartupNotify=true