void (*PicoCartLoadProgressCB)(int percent) = NULL;\r
void (*PicoCDLoadProgressCB)(const char *fname, int percent) = NULL; // handled in Pico/cd/cd_file.c\r
\r
-static void PicoCartDetect(void);\r
+static void PicoCartDetect(const char *carthw_cfg);\r
\r
/* cso struct */\r
typedef struct _cso_struct\r
}\r
\r
// Insert a cartridge:\r
-int PicoCartInsert(unsigned char *rom,unsigned int romsize)\r
+int PicoCartInsert(unsigned char *rom, unsigned int romsize, const char *carthw_cfg)\r
{\r
// notaz: add a 68k "jump one op back" opcode to the end of ROM.\r
// This will hang the emu, but will prevent nasty crashes.\r
carthw_chunks = NULL;\r
\r
if (!(PicoAHW & (PAHW_MCD|PAHW_SMS)))\r
- PicoCartDetect();\r
+ PicoCartDetect(carthw_cfg);\r
\r
// setup correct memory map for loaded ROM\r
switch (PicoAHW) {\r
return 1;\r
}\r
\r
-static void parse_carthw(int *fill_sram)\r
+static void parse_carthw(const char *carthw_cfg, int *fill_sram)\r
{\r
int line = 0, any_checks_passed = 0, skip_sect = 0;\r
int tmp, rom_crc = 0;\r
char buff[256], *p, *r;\r
FILE *f;\r
\r
- f = fopen("carthw.cfg", "r");\r
+ f = fopen(carthw_cfg, "r");\r
if (f == NULL) {\r
- elprintf(EL_STATUS, "couldn't open carthw.txt!");\r
+ elprintf(EL_STATUS, "couldn't open carthw.cfg!");\r
return;\r
}\r
\r
/*\r
* various cart-specific things, which can't be handled by generic code\r
*/\r
-static void PicoCartDetect(void)\r
+static void PicoCartDetect(const char *carthw_cfg)\r
{\r
int fill_sram = 0;\r
\r
SRam.eeprom_bit_in = 0;\r
SRam.eeprom_bit_out= 0;\r
\r
- parse_carthw(&fill_sram);\r
+ if (carthw_cfg != NULL)\r
+ parse_carthw(carthw_cfg, &fill_sram);\r
\r
if (SRam.flags & SRF_ENABLED)\r
{\r