X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Finput.c;h=34bae72f72f30d6d6bb64537caa2182c53340a40;hp=6a51264ac4695b0bdf0c2c7cafe931c8457a0e9d;hb=890deff8bad82ef88678ac9c9cb7373677faf77a;hpb=9b4514550544ca3d0a451ba0a08eeb502961ec1c diff --git a/drivers/gp2x/input.c b/drivers/gp2x/input.c index 6a51264..34bae72 100644 --- a/drivers/gp2x/input.c +++ b/drivers/gp2x/input.c @@ -22,8 +22,6 @@ #include "../../video.h" #include "usbjoy.h" -extern int FSkip; - /* UsrInputType[] is user-specified. InputType[] is current (game loading can override user settings) */ @@ -49,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); @@ -88,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(); } @@ -107,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(); @@ -194,10 +199,9 @@ static 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; - FSkip = 0; /* force rendering the last frame for menu */ return; } else if (down(VOL_UP))