Pico.m.dirtyPal = 1;
}
+ Pico.m.hardware &= ~PMS_HW_TMS;
+ if (PicoIn.tmsPalette || (PicoIn.AHW & (PAHW_SG|PAHW_SC)))
+ Pico.m.hardware |= PMS_HW_TMS;
+
// Copy LCD enable flag for easier handling
Pico.m.hardware &= ~PMS_HW_LCD;
if ((PicoIn.opt & POPT_EN_GG_LCD) && (PicoIn.AHW & PAHW_GG)) {
* hence GG/SMS/TMS can all be handled the same here */
for (j = cnt; j > 0; j--) {
if (!(Pico.video.reg[0] & 0x4)) // fixed palette in TMS modes
- spal = (u32 *)tmspal + (PicoIn.AHW & (PAHW_SG|PAHW_SC) ? 16/2:0);
+ spal = (u32 *)tmspal + (Pico.m.hardware & PMS_HW_TMS ? 16/2:0);
for (i = 0x20/2; i > 0; i--, spal++, dpal++) {
t = *spal;
#if defined(USE_BGR555)
unsigned short autoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP\r
unsigned int hwSelect; // hardware preselected via option menu\r
unsigned int mapper; // mapper selection for SMS, 0 = auto\r
+ unsigned int tmsPalette; // palette used by SMS in TMS graphic modes\r
\r
unsigned short quirks; // game-specific quirks: PQUIRK_*\r
unsigned short overclockM68k; // overclock the emulated 68k, in %\r
#define PMS_HW_LCD 0x2 // GG LCD\r
#define PMS_HW_JAP 0x4 // japanese system\r
#define PMS_HW_FM 0x8 // FM sound\r
-#define PMS_HW_FMUSED 0x10 // FM sound accessed\r
+#define PMS_HW_TMS 0x10 // assume TMS9918\r
+#define PMS_HW_FMUSED 0x80 // FM sound accessed\r
\r
#define PMS_MAP_AUTO 0\r
#define PMS_MAP_SEGA 1\r
static const char *sms_hardwares[] = { "auto", "Game Gear", "Master System", "SG-1000", "SC-3000", NULL };
static const char *gg_ghosting_opts[] = { "OFF", "weak", "normal", NULL };
static const char *sms_mappers[] = { "auto", "Sega", "Codemasters", "Korea", "Korea MSX", "Korea X-in-1", "Korea 4-Pak", "Korea Janggun", "Korea Nemesis", "Taiwan 8K RAM", "Korea XOR", "Sega 32K RAM", NULL };
+static const char *sms_tmspalette[] = { "SMS", "SG-1000" };
static const char h_smsfm[] = "FM sound is only supported by few games,\n"
"some games may crash with FM enabled";
static const char h_ghost[] = "Simulate the inertia of the GG LCD display";
+static const char h_smspal[] = "Selects the color palette used for SMS games\n"
+ "using the original TMS9918 graphics modes";
static menu_entry e_menu_sms_options[] =
{
mee_enum ("Cartridge mapping", MA_SMSOPT_MAPPER, PicoIn.mapper, sms_mappers),
mee_enum_h ("Game Gear LCD ghosting", MA_SMSOPT_GHOSTING, currentConfig.ghosting, gg_ghosting_opts, h_ghost),
mee_onoff_h ("FM Sound Unit", MA_OPT2_ENABLE_YM2413, PicoIn.opt, POPT_EN_YM2413, h_smsfm),
+ mee_enum_h ("SMS palette in TMS mode", MA_SMSOPT_TMSPALETTE, PicoIn.tmsPalette, sms_tmspalette, h_smspal),
mee_end,
};
MA_SMSOPT_HARDWARE,
MA_SMSOPT_MAPPER,
MA_SMSOPT_GHOSTING,
+ MA_SMSOPT_TMSPALETTE,
MA_CTRL_PLAYER1,
MA_CTRL_PLAYER2,
MA_CTRL_PLAYER3,
PicoIn.opt &= ~POPT_EN_YM2413;
}
+ var.value = NULL;
+ var.key = "picodrive_smstms";
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
+ if (strcmp(var.value, "SG-1000") == 0)
+ PicoIn.tmsPalette = 1;
+ else
+ PicoIn.tmsPalette = 0;
+ }
+
var.value = NULL;
var.key = "picodrive_smsmapper";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
},
"Auto"
},
+ {
+ "picodrive_smstms",
+ "Master System Palette in TMS modes",
+ NULL,
+ "Choose which colour palette should be used when an SMS game runs in one of the SG-1000 graphics modes.",
+ NULL,
+ "system",
+ {
+ { "SMS", NULL },
+ { "SG-1000", NULL },
+ { NULL, NULL },
+ },
+ "SMS"
+ },
{
"picodrive_ramcart",
"Sega CD RAM Cart",