X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2F940ctl.c;h=a9279139e6d87de8082bb63467ce38a38430bca7;hb=f3dc5a3a95396bd5b156678769b4434c123a9880;hp=0cbdb1c5bce06f87b131da590eb8f290d8c7a37c;hpb=f013066e974c7d35b818a6fca43a9deba1ce5c3e;p=libpicofe.git diff --git a/gp2x/940ctl.c b/gp2x/940ctl.c index 0cbdb1c..a927913 100644 --- a/gp2x/940ctl.c +++ b/gp2x/940ctl.c @@ -14,7 +14,7 @@ #include "gp2x.h" #include "emu.h" #include "menu.h" -#include "mp3.h" +#include "../common/mp3.h" #include "../common/arm_utils.h" #include "../common/menu.h" #include "../common/emu.h" @@ -533,9 +533,8 @@ void mp3_update(int *buffer, int length, int stereo) int length_mp3; int cdda_on; - // not data track, CDC is reading, playback was started, track not ended - cdda_on = !(Pico_mcd->s68k_regs[0x36] & 1) && (Pico_mcd->scd.Status_CDC & 1) && - loaded_mp3 && shared_ctl->mp3_offs < shared_ctl->mp3_len; + // playback was started, track not ended + cdda_on = loaded_mp3 && shared_ctl->mp3_offs < shared_ctl->mp3_len; if (!cdda_on) return; @@ -649,7 +648,7 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023 int mp3_get_offset(void) { - int offs1024 = 0; + unsigned int offs1024 = 0; int cdda_on; cdda_on = (PicoMCD & 1) && (PicoOpt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) && @@ -657,10 +656,9 @@ int mp3_get_offset(void) if (cdda_on) { offs1024 = shared_ctl->mp3_offs << 7; - offs1024 /= shared_ctl->mp3_len; - offs1024 <<= 3; + offs1024 /= shared_ctl->mp3_len >> 3; } - printf("offs1024=%i (%i/%i)\n", offs1024, shared_ctl->mp3_offs, shared_ctl->mp3_len); + printf("offs1024=%u (%i/%i)\n", offs1024, shared_ctl->mp3_offs, shared_ctl->mp3_len); return offs1024; }