X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2F940ctl.c;h=f01ffa3329b3950eda59f87f2492ce0eab3781f0;hb=68504c1c4f3ef4e799f5acf427b3ae063b3b975b;hp=b372d92ee08d4137411bed9039df9eb24a9f1ea0;hpb=389aa76ee60522348261b5310db3486375b05c1e;p=libpicofe.git diff --git a/gp2x/940ctl.c b/gp2x/940ctl.c index b372d92..f01ffa3 100644 --- a/gp2x/940ctl.c +++ b/gp2x/940ctl.c @@ -82,10 +82,6 @@ int YM2612Write_940(unsigned int a, unsigned int v, int scanline) upd = 0; break; - case 1: /* data port 0 */ - if (ST_address == 0x2b) upd = 0; /* DAC sel */ - break; - case 2: /* address port 1 */ if (addr_A1 == 1 && ST_address == v) return 0; @@ -403,8 +399,8 @@ int YM2612UpdateOne_940(int *buffer, int length, int stereo, int is_buf_empty) /* predict sample counter for next frame */ if (PsndLen_exc_add) { - if (PsndLen_exc_cnt + PsndLen_exc_add >= 0x10000) length = PsndLen + 1; - else length = PsndLen; + length = PsndLen; + if (PsndLen_exc_cnt + PsndLen_exc_add >= 0x10000) length++; } /* give 940 ym job */ @@ -512,7 +508,7 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023 shared_ctl->mp3_len = ftell(f); loaded_mp3 = f; - if (PicoOpt&0x200) { + if (PicoOpt & POPT_EXT_FM) { // as we are going to change 940's cacheable area, we must invalidate it's cache.. if (CHECK_BUSY(JOB940_MP3DECODE)) wait_busy_940(JOB940_MP3DECODE); add_job_940(JOB940_INVALIDATE_DCACHE); @@ -526,7 +522,7 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023 byte_offs *= pos; byte_offs >>= 6; } - // printf("mp3 pos1024: %i, byte_offs %i/%i\n", pos, byte_offs, shared_ctl->mp3_len); + printf(" mp3 pos1024: %i, byte_offs %i/%i\n", pos, byte_offs, shared_ctl->mp3_len); shared_ctl->mp3_offs = byte_offs; @@ -535,7 +531,13 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023 mp3_job_started = 0; shared_ctl->mp3_buffsel = 1; // will change to 0 on first decode - if (!(PicoOpt&0x200)) mp3_start_local(); + if (PicoOpt & POPT_EXT_FM) + { + add_job_940(JOB940_MP3RESET); + if (CHECK_BUSY(JOB940_MP3RESET)) wait_busy_940(JOB940_MP3RESET); + } + else + mp3_start_local(); }