X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2F940ctl.c;h=ff79c88ab6f27852633614aa0d22b4db6a3d4e33;hb=a90cc666d08526ada34a87c3e6d9a5312d90be84;hp=d376957065ad5036ea3e471c190e2b041108e3e8;hpb=9a1f192a146e9b9752ec1a760745b1261fe9bdec;p=picodrive.git diff --git a/platform/gp2x/940ctl.c b/platform/gp2x/940ctl.c index d376957..ff79c88 100644 --- a/platform/gp2x/940ctl.c +++ b/platform/gp2x/940ctl.c @@ -284,6 +284,12 @@ void sharedmem940_finish(void) void YM2612Init_940(int baseclock, int rate) { + static int oldrate; + + // HACK + if (Pico.m.frame_count > 0 && !crashed_940 && rate == oldrate) + return; + printf("YM2612Init_940()\n"); printf("Mem usage: shared_data: %i, shared_ctl: %i\n", sizeof(*shared_data), sizeof(*shared_ctl)); @@ -353,6 +359,8 @@ void YM2612Init_940(int baseclock, int rate) shared_ctl->baseclock = baseclock; shared_ctl->rate = rate; add_job_940(JOB940_INITALL); + + oldrate = rate; } @@ -383,7 +391,7 @@ int YM2612UpdateOne_940(int *buffer, int length, int stereo, int is_buf_empty) ym_active_chs = shared_ctl->ym_active_chs; // mix in ym buffer. is_buf_empty means nobody mixed there anything yet and it may contain trash - if (is_buf_empty && ym_active_chs) memcpy32(buffer, ym_buf, length<writebuffsel == 1) {