-static int uncompress2(void *dest, int destLen, void *source, int sourceLen)\r
+static int uncompress_buf(void *dest, int destLen, void *source, int sourceLen)\r
- rret = uncompress2(tmp_dst, 2048, cso->in_buff, read_len);\r
+ rret = uncompress_buf(tmp_dst, 2048, cso->in_buff, read_len);\r
if (rret != 0) {\r
elprintf(EL_STATUS, "cso: uncompress failed @ %08x with %i", read_pos, rret);\r
break;\r
if (rret != 0) {\r
elprintf(EL_STATUS, "cso: uncompress failed @ %08x with %i", read_pos, rret);\r
break;\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
bytes_read = pm_read(rom,size,f); // Load up the rom\r
if (bytes_read <= 0) {\r
elprintf(EL_STATUS, "read failed");\r
bytes_read = pm_read(rom,size,f); // Load up the rom\r
if (bytes_read <= 0) {\r
elprintf(EL_STATUS, "read failed");\r
{\r
int line = 0, any_checks_passed = 0, skip_sect = 0;\r
const char *s, *builtin = builtin_carthw_cfg;\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
if (is_expr("hw", &p)) {\r
if (!any_checks_passed)\r
goto no_checks;\r
else {\r
elprintf(EL_STATUS, "carthw:%d: unsupported mapper: %s", line, p);\r
skip_sect = 1;\r
else {\r
elprintf(EL_STATUS, "carthw:%d: unsupported mapper: %s", line, p);\r
skip_sect = 1;\r
elprintf(EL_STATUS, "carthw:%d: bad sram_range: %08x - %08x", line, start, end);\r
goto bad_nomsg;\r
}\r
elprintf(EL_STATUS, "carthw:%d: bad sram_range: %08x - %08x", line, start, end);\r
goto bad_nomsg;\r
}\r
else if (strcmp(p, "filled_sram") == 0)\r
*fill_sram = 1;\r
else if (strcmp(p, "force_6btn") == 0)\r
else if (strcmp(p, "filled_sram") == 0)\r
*fill_sram = 1;\r
else if (strcmp(p, "force_6btn") == 0)\r
else {\r
elprintf(EL_STATUS, "carthw:%d: unsupported prop: %s", line, p);\r
goto bad_nomsg;\r
else {\r
elprintf(EL_STATUS, "carthw:%d: unsupported prop: %s", line, p);\r
goto bad_nomsg;\r
type = strtoul(p, &r, 0);\r
if (r == p || type < 0)\r
goto bad;\r
type = strtoul(p, &r, 0);\r
if (r == p || type < 0)\r
goto bad;\r
- SRam.eeprom_bit_cl = scl;\r
- SRam.eeprom_bit_in = sda_in;\r
- SRam.eeprom_bit_out= sda_out;\r
+ Pico.sv.eeprom_bit_cl = scl;\r
+ Pico.sv.eeprom_bit_in = sda_in;\r
+ Pico.sv.eeprom_bit_out= sda_out;\r
- SRam.start = rom_read32(0x1B4) & ~0xff000001; // align\r
- SRam.end = (rom_read32(0x1B8) & ~0xff000000) | 1;\r
+ Pico.sv.start = rom_read32(0x1B4) & ~0xff000001; // align\r
+ Pico.sv.end = (rom_read32(0x1B8) & ~0xff000000) | 1;\r
{\r
// some games may have bad headers, like S&K and Sonic3\r
// note: majority games use 0x200000 as starting address, but there are some which\r
// use something else (0x300000 by HardBall '95). Luckily they have good headers.\r
{\r
// some games may have bad headers, like S&K and Sonic3\r
// note: majority games use 0x200000 as starting address, but there are some which\r
// use something else (0x300000 by HardBall '95). Luckily they have good headers.\r
- SRam.start = 0x200000;\r
- SRam.end = 0x203FFF;\r
- SRam.flags |= SRF_ENABLED;\r
+ Pico.sv.start = 0x200000;\r
+ Pico.sv.end = 0x203FFF;\r
+ Pico.sv.flags |= SRF_ENABLED;\r
- SRam.eeprom_type = 0; // 7bit (24C01)\r
- SRam.eeprom_bit_cl = 1;\r
- SRam.eeprom_bit_in = 0;\r
- SRam.eeprom_bit_out= 0;\r
+ Pico.sv.eeprom_type = 0; // 7bit (24C01)\r
+ Pico.sv.eeprom_bit_cl = 1;\r
+ Pico.sv.eeprom_bit_in = 0;\r
+ Pico.sv.eeprom_bit_out= 0;\r
- if (SRam.flags & SRF_ENABLED)\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
- SRam.data = calloc(SRam.size, 1);\r
- if (SRam.data == NULL)\r
- SRam.flags &= ~SRF_ENABLED;\r
+ Pico.sv.data = calloc(Pico.sv.size, 1);\r
+ if (Pico.sv.data == NULL)\r
+ Pico.sv.flags &= ~SRF_ENABLED;\r