}\r
\r
\r
+int mp3_get_offset(void)\r
+{\r
+ int offs1024 = 0;\r
+ int cdda_on;\r
+\r
+ cdda_on = (PicoMCD & 1) && (currentConfig.EmuOpt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) &&\r
+ (Pico_mcd->scd.Status_CDC & 1) && loaded_mp3 && shared_ctl->mp3_offs < shared_ctl->mp3_len;\r
+\r
+ if (cdda_on) {\r
+ offs1024 = shared_ctl->mp3_offs << 7;\r
+ offs1024 /= shared_ctl->mp3_len;\r
+ offs1024 <<= 3;\r
+ }\r
+ printf("offs1024=%i (%i/%i)\n", offs1024, shared_ctl->mp3_offs, shared_ctl->mp3_len);\r
+\r
+ return offs1024;\r
+}\r
+\r
+\r
return gzwrite(file, p, _n);\r
}\r
\r
-typedef unsigned int (*STATE_SL_FUNC)(void *, unsigned int, unsigned int, void *);\r
\r
int emu_SaveLoadGame(int load, int sram)\r
{\r
areaRead = gzRead2;\r
areaWrite = gzWrite2;\r
areaEof = (areaeof *) gzeof;\r
+ areaSeek = (areaseek *) gzseek;\r
if(!load) gzsetparams(PmovFile, 9, Z_DEFAULT_STRATEGY);\r
} else\r
saveFname[strlen(saveFname)-3] = 0;\r
areaRead = (arearw *) fread;\r
areaWrite = (arearw *) fwrite;\r
areaEof = (areaeof *) feof;\r
+ areaSeek = (areaseek *) fseek;\r
}\r
}\r
if(PmovFile) {\r
- PmovState(load ? 6 : 5, PmovFile);\r
- strcpy(noticeMsg, load ? "GAME LOADED " : "GAME SAVED ");\r
+ ret = PmovState(load ? 6 : 5, PmovFile);\r
if(areaRead == gzRead2)\r
gzclose(PmovFile);\r
else fclose ((FILE *) PmovFile);\r
PmovFile = 0;\r
if (!load) sync();\r
else Pico.m.dirtyPal=1;\r
- } else {\r
+ }\r
+ else ret = -1;\r
+ if (!ret)\r
+ strcpy(noticeMsg, load ? "GAME LOADED " : "GAME SAVED ");\r
+ else\r
+ {\r
strcpy(noticeMsg, load ? "LOAD FAILED " : "SAVE FAILED ");\r
ret = -1;\r
}\r