X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2F940ctl.c;h=b0355916bb6aa2d8c464c80d66873a02362578f9;hb=48e8482fc2d74c9b96e581241390bade986acb22;hp=5c53761ed1fba1f29e9de1d56fc4b222d3f8b3b4;hpb=85f8e92973ca60968cfb844d2119b669ce610c2d;p=picodrive.git diff --git a/platform/gp2x/940ctl.c b/platform/gp2x/940ctl.c index 5c53761..b035591 100644 --- a/platform/gp2x/940ctl.c +++ b/platform/gp2x/940ctl.c @@ -99,7 +99,13 @@ int YM2612Write_940(unsigned int a, unsigned int v) switch( a ) { case 0: /* address port 0 */ + if (!addr_A1 && ST_address == v) + return 0; /* address already selected, don't send this command to 940 */ ST_address = v; + /* don't send DAC or timer related address changes to 940 */ + if (!addr_A1 && (v & 0xf0) == 0x20 && + (v == 0x24 || v == 0x25 || v == 0x26 || v == 0x2a)) + return 0; addr_A1 = 0; //ret=0; break; @@ -162,6 +168,8 @@ int YM2612Write_940(unsigned int a, unsigned int v) break; case 2: /* address port 1 */ + if (addr_A1 && ST_address == v) + return 0; ST_address = v; addr_A1 = 1; //ret=0; @@ -186,7 +194,7 @@ int YM2612Write_940(unsigned int a, unsigned int v) shared_ctl->writebuff1[writebuff_ptr++] = (a<<8)|v; } } else { - printf("warning: writebuff_ptr > 2047\n"); + printf("warning: writebuff_ptr > 2047 ([%i] %02x)\n", a, v); } } @@ -563,6 +571,12 @@ void mp3_start_play(FILE *f, int pos) // pos is 0-1023 if (loaded_mp3 != f) { // printf("loading mp3... "); fflush(stdout); + if (PicoMessage != NULL) + { + fseek(f, 0, SEEK_END); + if (ftell(f) > 2*1024*1024) + PicoMessage("Loading MP3..."); + } fseek(f, 0, SEEK_SET); fread(mp3_mem, 1, MP3_SIZE_MAX, f); // if (feof(f)) printf("done.\n");