X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcart.c;h=9fcb01a4daf6323f824489efc7ba40b773a6aa32;hb=8b9dbcde387f567a154e15ca14a0c6e5b3efa3ef;hp=3148f36d600c90f49c24562d2c58235fff8fa7b1;hpb=93f9619ed819dee07948416c98ca2f1c70a22666;p=picodrive.git diff --git a/pico/cart.c b/pico/cart.c index 3148f36..9fcb01a 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -391,8 +391,8 @@ int pm_seek(pm_file *stream, long offset, int whence) offset = pos; } - if (PicoMessage != NULL && offset > 4 * 1024 * 1024) - PicoMessage("Decompressing data..."); + if (PicoIn.osdMessage != NULL && offset > 4 * 1024 * 1024) + PicoIn.osdMessage("Decompressing data..."); while (offset > 0) { char buf[16 * 1024]; @@ -778,7 +778,8 @@ static int is_expr(const char *expr, char **pr) #include "carthw_cfg.c" -static void parse_carthw(const char *carthw_cfg, int *fill_sram) +static void parse_carthw(const char *carthw_cfg, int *fill_sram, + int *hw_detected) { int line = 0, any_checks_passed = 0, skip_sect = 0; const char *s, *builtin = builtin_carthw_cfg; @@ -902,6 +903,7 @@ static void parse_carthw(const char *carthw_cfg, int *fill_sram) if (is_expr("hw", &p)) { if (!any_checks_passed) goto no_checks; + *hw_detected = 1; rstrip(p); if (strcmp(p, "svp") == 0) @@ -925,6 +927,7 @@ static void parse_carthw(const char *carthw_cfg, int *fill_sram) else { elprintf(EL_STATUS, "carthw:%d: unsupported mapper: %s", line, p); skip_sect = 1; + *hw_detected = 0; } continue; } @@ -1038,6 +1041,7 @@ no_checks: */ static void PicoCartDetect(const char *carthw_cfg) { + int carthw_detected = 0; int fill_sram = 0; memset(&Pico.sv, 0, sizeof(Pico.sv)); @@ -1067,7 +1071,11 @@ static void PicoCartDetect(const char *carthw_cfg) Pico.sv.eeprom_bit_out= 0; if (carthw_cfg != NULL) - parse_carthw(carthw_cfg, &fill_sram); + parse_carthw(carthw_cfg, &fill_sram, &carthw_detected); + + // assume the standard mapper for large roms + if (!carthw_detected && Pico.romsize > 0x400000) + carthw_ssf2_startup(); if (Pico.sv.flags & SRF_ENABLED) {