giz rc1 release
[libpicofe.git] / gp2x / 940ctl.c
index 0cbdb1c..a927913 100644 (file)
@@ -14,7 +14,7 @@
 #include "gp2x.h"\r
 #include "emu.h"\r
 #include "menu.h"\r
-#include "mp3.h"\r
+#include "../common/mp3.h"\r
 #include "../common/arm_utils.h"\r
 #include "../common/menu.h"\r
 #include "../common/emu.h"\r
@@ -533,9 +533,8 @@ void mp3_update(int *buffer, int length, int stereo)
        int length_mp3;\r
        int cdda_on;\r
 \r
-       // not data track, CDC is reading, playback was started, track not ended\r
-       cdda_on = !(Pico_mcd->s68k_regs[0x36] & 1) && (Pico_mcd->scd.Status_CDC & 1) &&\r
-                       loaded_mp3 && shared_ctl->mp3_offs < shared_ctl->mp3_len;\r
+       // playback was started, track not ended\r
+       cdda_on = loaded_mp3 && shared_ctl->mp3_offs < shared_ctl->mp3_len;\r
 \r
        if (!cdda_on) return;\r
 \r
@@ -649,7 +648,7 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023
 \r
 int mp3_get_offset(void)\r
 {\r
-       int offs1024 = 0;\r
+       unsigned int offs1024 = 0;\r
        int cdda_on;\r
 \r
        cdda_on = (PicoMCD & 1) && (PicoOpt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) &&\r
@@ -657,10 +656,9 @@ int mp3_get_offset(void)
 \r
        if (cdda_on) {\r
                offs1024  = shared_ctl->mp3_offs << 7;\r
-               offs1024 /= shared_ctl->mp3_len;\r
-               offs1024 <<= 3;\r
+               offs1024 /= shared_ctl->mp3_len  >> 3;\r
        }\r
-       printf("offs1024=%i (%i/%i)\n", offs1024, shared_ctl->mp3_offs, shared_ctl->mp3_len);\r
+       printf("offs1024=%u (%i/%i)\n", offs1024, shared_ctl->mp3_offs, shared_ctl->mp3_len);\r
 \r
        return offs1024;\r
 }\r