Browse Source

gp2x: hack to avoid 940 reinit

..it used to rely on upper layer to avoid YM2612Init_940() calls
on menu entry
notaz 10 years ago
parent
commit
2d6460655c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      platform/gp2x/940ctl.c

+ 8 - 0
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;
 }