X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fgp2x%2Fmenu.c;h=6abe0095e19b31363f4c75432f920404a5927504;hb=ca5c359d908ce4d89239f3250a7c227d062b32e0;hp=e4b3488e1c5abb4882451e0ba85289c1ac8b1404;hpb=9b4514550544ca3d0a451ba0a08eeb502961ec1c;p=fceu.git diff --git a/drivers/gp2x/menu.c b/drivers/gp2x/menu.c index e4b3488..6abe009 100644 --- a/drivers/gp2x/menu.c +++ b/drivers/gp2x/menu.c @@ -1,7 +1,5 @@ +// menu system for gpfce - FCE Ultra port // (c) Copyright 2006,2007 notaz, All rights reserved. -// Free for non-commercial use. - -// For commercial use, separate licencing terms must be obtained. #include #include @@ -733,15 +731,14 @@ static void unbind_action(int action) Settings.JoyBinds[u][i] &= ~action; } -static int count_bound_keys(int action, int is_joy) +static int count_bound_keys(int action, int joy) { - int i, u, keys = 0; + int i, keys = 0; - if (is_joy) + if (joy) { - for (u = 0; u < 4; u++) - for (i = 0; i < 32; i++) - if (Settings.JoyBinds[u][i] & action) keys++; + for (i = 0; i < 32; i++) + if (Settings.JoyBinds[joy-1][i] & action) keys++; } else { @@ -826,7 +823,7 @@ static void key_config_loop(const bind_action_t *opts, int opt_cnt, int player_i { for (i = 0; i < 32; i++) if (inp & (1 << i)) { - if (count_bound_keys(opts[sel].mask, 1) >= 1) // disallow combos for usbjoy + if (count_bound_keys(opts[sel].mask, joy) >= 1) // disallow combos for usbjoy Settings.JoyBinds[joy-1][i] &= ~opts[sel].mask; else Settings.JoyBinds[joy-1][i] ^= opts[sel].mask; if (player_idx >= 0) { @@ -1386,10 +1383,17 @@ static void menu_prepare_bg(void) if (fceugi) { /* raw emu frame should now be at gp2x_screen */ - soft_scale((char *)gp2x_screen + 32, gp2x_palette16, srendline, erendline-srendline); - if (srendline) - memset32((int *)((char *)gp2x_screen + 32), 0, srendline*320*2/4); - memcpy(menu_bg, gp2x_screen + 32, 320*240*2); + if (Settings.scaling != 0) + { + soft_scale((char *)gp2x_screen + 32, gp2x_palette16, srendline, erendline-srendline); + if (srendline) + memset32((int *)((char *)gp2x_screen + 32), 0, srendline*320*2/4); + memcpy(menu_bg, gp2x_screen + 32, 320*240*2); + } + else + { + convert2RGB555(menu_bg, gp2x_screen, gp2x_palette16, 320*240); + } } else {