X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Finput.c;h=8345339185f41d3a5634acba6c47cab0c524ba9f;hp=c6f993634977ce5a9e7eaa8281c8c5443cf09ee5;hb=989672f4f2b4b4b2b373271374e6546546091c10;hpb=b547bda76671cf9c99973dd3faad97804949ced3 diff --git a/drivers/gp2x/input.c b/drivers/gp2x/input.c index c6f9936..8345339 100644 --- a/drivers/gp2x/input.c +++ b/drivers/gp2x/input.c @@ -31,9 +31,6 @@ extern uint8 Exit; // exit emu loop -extern int scaled_display; - - /* UsrInputType[] is user-specified. InputType[] is current (game loading can override user settings) @@ -55,13 +52,8 @@ static uint32 MouseData[3]; static uint8 fkbkeys[0x48]; unsigned long lastpad=0; -extern void ResetNES(void); -extern void CleanSurface(void); - char soundvolmeter[21]; int soundvolIndex=0; -int L_count=0; -int R_count=0; static void setsoundvol(int soundvolume) @@ -90,6 +82,7 @@ static void setsoundvol(int soundvolume) void FCEUD_UpdateInput(void) { static int volpushed_frames = 0; + static int turbo_rate_cnt_a = 0, turbo_rate_cnt_b = 0; long lastpad2 = lastpad; unsigned long keys = gp2x_joystick_read(0); uint32 JS = 0; // RLDU SEBA @@ -133,6 +126,14 @@ void FCEUD_UpdateInput(void) int acts = Settings.KeyBinds[i]; if (!acts) continue; JS |= acts & 0xff; + if (acts & 0x100) { // A turbo + turbo_rate_cnt_a += Settings.turbo_rate_add; + JS |= (turbo_rate_cnt_a >> 24) & 1; + } + if (acts & 0x200) { // B turbo + turbo_rate_cnt_b += Settings.turbo_rate_add; + JS |= (turbo_rate_cnt_b >> 23) & 2; + } } }