\r
int crashed_940 = 0;\r
\r
+static FILE *loaded_mp3 = 0;\r
\r
/***********************************************************/\r
\r
\r
internal_reset();\r
\r
+ loaded_mp3 = 0;\r
+\r
/* now cause 940 to init it's ym2612 stuff */\r
shared_ctl->baseclock = baseclock;\r
shared_ctl->rate = rate;\r
\r
// here we assume that length is different between games, but constant in one game\r
\r
-static FILE *loaded_mp3 = 0;\r
+static int mp3_samples_ready = 0, mp3_buffer_offs = 0;\r
+static int mp3_play_bufsel = 0;\r
\r
void YM2612UpdateOne_940(short *buffer, int length, int stereo)\r
{\r
int cdda_on, *ym_buffer = shared_data->mix_buffer, mp3_job = 0;\r
- static int mp3_samples_ready = 0, mp3_buffer_offs = 0;\r
- static int mp3_play_bufsel = 1;\r
\r
//printf("YM2612UpdateOne_940()\n");\r
if (shared_ctl->busy) wait_busy_940();\r
printf("mp3 pos1024: %i, byte_offs %i/%i\n", pos, byte_offs, shared_ctl->mp3_len);\r
\r
shared_ctl->mp3_offs = byte_offs;\r
+\r
+ // reset buffer pointers..\r
+ mp3_samples_ready = mp3_buffer_offs = mp3_play_bufsel = 0;\r
+ shared_ctl->mp3_buffsel = 1; // will change to 0 on first decode\r
+}\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