refresh rate: comments
[fceu.git] / drivers / gp2x / input.c
index 7c33a96..34bae72 100644 (file)
@@ -47,6 +47,13 @@ static void setsoundvol(int soundvolume)
 {
        int soundvolIndex;
        static char soundvolmeter[24];
+       static int prev_snd_on = 0;
+
+       if ((!!soundvolume) ^ prev_snd_on)
+       {
+               FCEUI_Sound(Settings.sound_rate);
+               prev_snd_on = !!soundvolume;
+       }
 
        // draw on screen :D
        gp2x_sound_volume(soundvolume, soundvolume);
@@ -86,7 +93,7 @@ static void do_emu_acts(uint32 acts)
                                FCEUD_Update(XBuf+8,NULL,0);
                                while( !((keys = gp2x_joystick_read(1)) & (GP2X_X|GP2X_Y)) ) usleep(50*1024);
                                if (keys & GP2X_X) do_it = 0;
-                               FCEU_DispMessage("");
+                               FCEU_CancelDispMessage();
                        }
                        if (do_it) FCEUI_LoadState();
                }
@@ -105,7 +112,7 @@ static void do_emu_acts(uint32 acts)
                                        FCEUD_Update(XBuf+8,NULL,0);
                                        while( !((keys = gp2x_joystick_read(1)) & (GP2X_X|GP2X_Y)) ) usleep(50*1024);
                                        if (keys & GP2X_X) do_it = 0;
-                                       FCEU_DispMessage("");
+                                       FCEU_CancelDispMessage();
                                }
                        }
                        if (do_it) FCEUI_SaveState();
@@ -184,7 +191,7 @@ static void do_fake_mouse(unsigned long keys)
 }
 
 
-void FCEUD_UpdateInput(void)
+static void FCEUD_UpdateInput(void)
 {
        static int volpushed_frames = 0;
        static int turbo_rate_cnt_a[2] = {0,0}, turbo_rate_cnt_b[2] = {0,0};
@@ -192,7 +199,7 @@ void FCEUD_UpdateInput(void)
        uint32 all_acts[2] = {0,0};
        int i;
 
-       if ((down(VOL_DOWN) && down(VOL_UP)) || (keys & (GP2X_L|GP2X_L|GP2X_START)) == (GP2X_L|GP2X_L|GP2X_START))
+       if ((down(VOL_DOWN) && down(VOL_UP)) || (keys & (GP2X_L|GP2X_START)) == (GP2X_L|GP2X_START))
        {
                Exit = 1;
                return;
@@ -374,6 +381,6 @@ static void PrepareOtherInput(void)
                }
        }
 
-       printf("generated combo_acts: %08x, combo_keys: %08x\n", combo_acts, combo_keys);
+       // printf("generated combo_acts: %08x, combo_keys: %08x\n", combo_acts, combo_keys);
 }