offset = pos;\r
}\r
\r
- if (PicoMessage != NULL && offset > 4 * 1024 * 1024)\r
- PicoMessage("Decompressing data...");\r
+ if (PicoIn.osdMessage != NULL && offset > 4 * 1024 * 1024)\r
+ PicoIn.osdMessage("Decompressing data...");\r
\r
while (offset > 0) {\r
char buf[16 * 1024];\r
if (!is_sms)\r
{\r
// maybe we are loading MegaCD BIOS?\r
- if (!(PicoAHW & PAHW_MCD) && size == 0x20000 && (!strncmp((char *)rom+0x124, "BOOT", 4) ||\r
+ if (!(PicoIn.AHW & PAHW_MCD) && size == 0x20000 && (!strncmp((char *)rom+0x124, "BOOT", 4) ||\r
!strncmp((char *)rom+0x128, "BOOT", 4))) {\r
- PicoAHW |= PAHW_MCD;\r
+ PicoIn.AHW |= PAHW_MCD;\r
}\r
\r
// Check for SMD:\r
}\r
pdb_cleanup();\r
\r
- PicoAHW &= PAHW_MCD|PAHW_SMS;\r
+ PicoIn.AHW &= PAHW_MCD|PAHW_SMS;\r
\r
PicoCartMemSetup = NULL;\r
PicoDmaHook = NULL;\r
PicoLoadStateHook = NULL;\r
carthw_chunks = NULL;\r
\r
- if (!(PicoAHW & (PAHW_MCD|PAHW_SMS)))\r
+ if (!(PicoIn.AHW & (PAHW_MCD|PAHW_SMS)))\r
PicoCartDetect(carthw_cfg);\r
\r
// setup correct memory map for loaded ROM\r
- switch (PicoAHW) {\r
+ switch (PicoIn.AHW) {\r
default:\r
- elprintf(EL_STATUS|EL_ANOMALY, "starting in unknown hw configuration: %x", PicoAHW);\r
+ elprintf(EL_STATUS|EL_ANOMALY, "starting in unknown hw configuration: %x", PicoIn.AHW);\r
case 0:\r
case PAHW_SVP: PicoMemSetup(); break;\r
case PAHW_MCD: PicoMemSetupCD(); break;\r
if (PicoCartMemSetup != NULL)\r
PicoCartMemSetup();\r
\r
- if (PicoAHW & PAHW_SMS)\r
+ if (PicoIn.AHW & PAHW_SMS)\r
PicoPowerMS();\r
else\r
PicoPower();\r
PicoCartUnloadHook = NULL;\r
}\r
\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
PicoUnload32x();\r
\r
if (Pico.rom != NULL) {\r
\r
#include "carthw_cfg.c"\r
\r
-static void parse_carthw(const char *carthw_cfg, int *fill_sram)\r
+static void parse_carthw(const char *carthw_cfg, int *fill_sram,\r
+ int *hw_detected)\r
{\r
int line = 0, any_checks_passed = 0, skip_sect = 0;\r
const char *s, *builtin = builtin_carthw_cfg;\r
if (is_expr("hw", &p)) {\r
if (!any_checks_passed)\r
goto no_checks;\r
+ *hw_detected = 1;\r
rstrip(p);\r
\r
if (strcmp(p, "svp") == 0)\r
else {\r
elprintf(EL_STATUS, "carthw:%d: unsupported mapper: %s", line, p);\r
skip_sect = 1;\r
+ *hw_detected = 0;\r
}\r
continue;\r
}\r
else if (strcmp(p, "filled_sram") == 0)\r
*fill_sram = 1;\r
else if (strcmp(p, "force_6btn") == 0)\r
- PicoQuirks |= PQUIRK_FORCE_6BTN;\r
+ PicoIn.quirks |= PQUIRK_FORCE_6BTN;\r
else {\r
elprintf(EL_STATUS, "carthw:%d: unsupported prop: %s", line, p);\r
goto bad_nomsg;\r
*/\r
static void PicoCartDetect(const char *carthw_cfg)\r
{\r
+ int carthw_detected = 0;\r
int fill_sram = 0;\r
\r
memset(&Pico.sv, 0, sizeof(Pico.sv));\r
Pico.sv.eeprom_bit_out= 0;\r
\r
if (carthw_cfg != NULL)\r
- parse_carthw(carthw_cfg, &fill_sram);\r
+ parse_carthw(carthw_cfg, &fill_sram, &carthw_detected);\r
+\r
+ // assume the standard mapper for large roms\r
+ if (!carthw_detected && Pico.romsize > 0x400000)\r
+ carthw_ssf2_startup();\r
\r
if (Pico.sv.flags & SRF_ENABLED)\r
{\r