savestates works
[libpicofe.git] / gp2x / 940ctl_ym2612.c
index 1352172..63d1e48 100644 (file)
@@ -576,3 +576,22 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023
 }\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