From: notaz Date: Wed, 16 Jul 2008 12:50:33 +0000 (+0000) Subject: ABC turbo X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6589c840ca686751d15ebb127367af1378dd7de2;p=libpicofe.git ABC turbo git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@553 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/base_readme.txt b/base_readme.txt index d59baa7..d0f074b 100644 --- a/base_readme.txt +++ b/base_readme.txt @@ -245,10 +245,6 @@ This option causes PicoDrive to use ARM940T core (GP2X's second CPU) for sound (i.e. to generate YM2612 samples) to improve performance noticeably. #endif -@@0. "6 button pad" -If you enable this, games will think that 6 button gamepad is connected. If you -go and reconfigure your keys, you will be able to bind X,Y,Z and mode actions. - @@0. "Region" This option lets you force the game to think it is running on machine from the specified region, or just to set autodetection order. Also affects Sega/Mega CD. @@ -473,7 +469,10 @@ the right Giz ones, which are assigned to them. If you bind 2 different Giz butt the right PSP ones, which are assigned to them. If you bind 2 different PSP buttons #endif to the same action, you will get a combo (which means that you will have to press -both buttons for that action to happen. +both buttons for that action to happen). + +There is also option to enable 6 button pad (will allow you to configure XYZ +keys), and an option to set turbo rate (in Hz) for turbo buttons. Cheat support @@ -646,12 +645,13 @@ Additional thanks Changelog --------- -1.50a +1.51 * Improved bin_to_cso_mp3 tool, it should no longer complain about missing lame.exe even if it's in working dir. * Fixed a regression from 1.50, which caused slowdowns in Final Fight. * Fixed some regressions from 1.50 related to sprite limit and palette handling (caused graphical glitches in some games). + + Added ABC turbo actions to key config. * Some other minor adjustments. 1.50 diff --git a/common/config.c b/common/config.c index 3959706..55b1eae 100644 --- a/common/config.c +++ b/common/config.c @@ -20,9 +20,11 @@ static char *mystrip(char *str); extern menu_entry opt_entries[]; extern menu_entry opt2_entries[]; extern menu_entry cdopt_entries[]; +extern menu_entry ctrlopt_entries[]; extern const int opt_entry_count; extern const int opt2_entry_count; extern const int cdopt_entry_count; +extern const int ctrlopt_entry_count; #ifdef PSP extern menu_entry opt3_entries[]; extern const int opt3_entry_count; @@ -33,6 +35,7 @@ static menu_entry *cfg_opts[] = opt_entries, opt2_entries, cdopt_entries, + ctrlopt_entries, #ifdef PSP opt3_entries, #endif @@ -43,6 +46,7 @@ static const int *cfg_opt_counts[] = &opt_entry_count, &opt2_entry_count, &cdopt_entry_count, + &ctrlopt_entry_count, #ifdef PSP &opt3_entry_count, #endif @@ -277,6 +281,9 @@ static int default_var(const menu_entry *me) case MA_CDOPT_LEDS: return defaultConfig.EmuOpt; + case MA_CTRL_TURBO_RATE: + return defaultConfig.turbo_rate; + case MA_OPT_SAVE_SLOT: default: return 0; @@ -370,7 +377,7 @@ write: if (!no_defaults || ((*(int *)me->var ^ default_var(me)) & me->mask)) fprintf(fn, "%s = %i" NL, me->name, (*(int *)me->var & me->mask) ? 1 : 0); } else if (me->beh == MB_RANGE) { - if (!no_defaults || ((*(int *)me->var ^ default_var(me)) & me->mask)) + if (!no_defaults || (*(int *)me->var ^ default_var(me))) fprintf(fn, "%s = %i" NL, me->name, *(int *)me->var); } } diff --git a/common/emu.c b/common/emu.c index c482673..5b69357 100644 --- a/common/emu.c +++ b/common/emu.c @@ -1026,6 +1026,27 @@ void emu_RunEventsPico(unsigned int events) } } - - +void emu_DoTurbo(int *pad, int acts) +{ + static int turbo_pad = 0; + static unsigned char turbo_cnt[3] = { 0, 0, 0 }; + int inc = currentConfig.turbo_rate * 2; + + if (acts & 0x1000) { + turbo_cnt[0] += inc; + if (turbo_cnt[0] >= 60) + turbo_pad ^= 0x10, turbo_cnt[0] = 0; + } + if (acts & 0x2000) { + turbo_cnt[1] += inc; + if (turbo_cnt[1] >= 60) + turbo_pad ^= 0x20, turbo_cnt[1] = 0; + } + if (acts & 0x4000) { + turbo_cnt[2] += inc; + if (turbo_cnt[2] >= 60) + turbo_pad ^= 0x40, turbo_cnt[2] = 0; + } + *pad |= turbo_pad & (acts >> 8); +} diff --git a/common/emu.h b/common/emu.h index ac75dd0..9ba0219 100644 --- a/common/emu.h +++ b/common/emu.h @@ -25,6 +25,7 @@ typedef struct { float scale; // psp: screen scale float hscale32, hscale40; // psp: horizontal scale int gamma2; // psp: black level + int turbo_rate; } currentConfig_t; extern currentConfig_t currentConfig, defaultConfig; @@ -56,6 +57,7 @@ void emu_findKeyBindCombos(void); void emu_forcedFrame(int opts); void emu_changeFastForward(int set_on); void emu_RunEventsPico(unsigned int events); +void emu_DoTurbo(int *pad, int acts); extern const char * const keyNames[]; void emu_prepareDefaultConfig(void); diff --git a/common/menu.c b/common/menu.c index b3dc27a..7a97fc3 100644 --- a/common/menu.c +++ b/common/menu.c @@ -19,20 +19,23 @@ char menuErrorMsg[64] = { 0, }; // PicoPad[] format: MXYZ SACB RLDU -me_bind_action me_ctrl_actions[12] = +me_bind_action me_ctrl_actions[15] = { - { "UP ", 0x001 }, - { "DOWN ", 0x002 }, - { "LEFT ", 0x004 }, - { "RIGHT ", 0x008 }, - { "A ", 0x040 }, - { "B ", 0x010 }, - { "C ", 0x020 }, - { "START ", 0x080 }, - { "MODE ", 0x800 }, - { "X ", 0x400 }, - { "Y ", 0x200 }, - { "Z ", 0x100 } + { "UP ", 0x0001 }, + { "DOWN ", 0x0002 }, + { "LEFT ", 0x0004 }, + { "RIGHT ", 0x0008 }, + { "A ", 0x0040 }, + { "B ", 0x0010 }, + { "C ", 0x0020 }, + { "A turbo", 0x4000 }, + { "B turbo", 0x1000 }, + { "C turbo", 0x2000 }, + { "START ", 0x0080 }, + { "MODE ", 0x0800 }, + { "X ", 0x0400 }, + { "Y ", 0x0200 }, + { "Z ", 0x0100 } }; diff --git a/common/menu.h b/common/menu.h index 4c20b55..7a4213d 100644 --- a/common/menu.h +++ b/common/menu.h @@ -91,6 +91,11 @@ typedef enum MA_CDOPT_SCALEROT_CHIP, MA_CDOPT_BETTER_SYNC, MA_CDOPT_DONE, + MA_CTRL_PLAYER1, + MA_CTRL_PLAYER2, + MA_CTRL_EMU, + MA_CTRL_TURBO_RATE, + MA_CTRL_DONE, } menu_id; typedef struct @@ -112,7 +117,7 @@ typedef struct int mask; } me_bind_action; -extern me_bind_action me_ctrl_actions[12]; +extern me_bind_action me_ctrl_actions[15]; extern me_bind_action emuctrl_actions[]; // platform code diff --git a/gp2x/emu.c b/gp2x/emu.c index 570b0fc..9afa61b 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -164,6 +164,7 @@ void emu_prepareDefaultConfig(void) defaultConfig.KeyBinds[22] = 1<<30; // vol down defaultConfig.gamma = 100; defaultConfig.scaling = 0; + defaultConfig.turbo_rate = 15; } void emu_setDefaultConfig(void) @@ -436,33 +437,19 @@ static void emu_msg_tray_open(void) static void RunEventsPico(unsigned int events, unsigned int gp2x_keys) { - int ret, px, py; + int ret, px, py, lim_x; static int pdown_frames = 0; emu_RunEventsPico(events); - if (pico_inp_mode != 0) - { - PicoPad[0] &= ~0x0f; // release UDLR - if (gp2x_keys & GP2X_UP) { pico_pen_y--; if (pico_pen_y < 8) pico_pen_y = 8; } - if (gp2x_keys & GP2X_DOWN) { pico_pen_y++; if (pico_pen_y > 224-PICO_PEN_ADJUST_Y) pico_pen_y = 224-PICO_PEN_ADJUST_Y; } - if (gp2x_keys & GP2X_LEFT) { pico_pen_x--; if (pico_pen_x < 0) pico_pen_x = 0; } - if (gp2x_keys & GP2X_RIGHT) { - int lim = (Pico.video.reg[12]&1) ? 319 : 255; - pico_pen_x++; - if (pico_pen_x > lim-PICO_PEN_ADJUST_X) - pico_pen_x = lim-PICO_PEN_ADJUST_X; - } - PicoPicohw.pen_pos[0] = pico_pen_x; - if (!(Pico.video.reg[12]&1)) PicoPicohw.pen_pos[0] += pico_pen_x/4; - PicoPicohw.pen_pos[0] += 0x3c; - PicoPicohw.pen_pos[1] = pico_inp_mode == 1 ? (0x2f8 + pico_pen_y) : (0x1fc + pico_pen_y); - } + if (pico_inp_mode == 0) return; // for F200 ret = gp2x_touchpad_read(&px, &py); - if (ret >= 0) { - if (ret > 5000) { + if (ret >= 0) + { + if (ret > 35000) + { if (pdown_frames++ > 5) PicoPad[0] |= 0x20; @@ -476,11 +463,28 @@ static void RunEventsPico(unsigned int events, unsigned int gp2x_keys) if (pico_pen_y > 224) pico_pen_y = 224; } else - pdown_frames= 0; + pdown_frames = 0; //if (ret == 0) // PicoPicohw.pen_pos[0] = PicoPicohw.pen_pos[1] = 0x8000; } + + PicoPad[0] &= ~0x0f; // release UDLR + if (gp2x_keys & GP2X_UP) pico_pen_y--; + if (gp2x_keys & GP2X_DOWN) pico_pen_y++; + if (gp2x_keys & GP2X_LEFT) pico_pen_x--; + if (gp2x_keys & GP2X_RIGHT) pico_pen_x++; + + lim_x = (Pico.video.reg[12]&1) ? 319 : 255; + if (pico_pen_y < 8) pico_pen_y = 8; + if (pico_pen_y > 224-PICO_PEN_ADJUST_Y) pico_pen_y = 224-PICO_PEN_ADJUST_Y; + if (pico_pen_x < 0) pico_pen_x = 0; + if (pico_pen_x > lim_x-PICO_PEN_ADJUST_X) pico_pen_x = lim_x-PICO_PEN_ADJUST_X; + + PicoPicohw.pen_pos[0] = pico_pen_x; + if (!(Pico.video.reg[12]&1)) PicoPicohw.pen_pos[0] += pico_pen_x/4; + PicoPicohw.pen_pos[0] += 0x3c; + PicoPicohw.pen_pos[1] = pico_inp_mode == 1 ? (0x2f8 + pico_pen_y) : (0x1fc + pico_pen_y); } static void update_volume(int has_changed, int is_up) @@ -639,8 +643,11 @@ static void updateKeys(void) } } - PicoPad[0] = (unsigned short) allActions[0]; - PicoPad[1] = (unsigned short) allActions[1]; + PicoPad[0] = allActions[0] & 0xfff; + PicoPad[1] = allActions[1] & 0xfff; + + if (allActions[0] & 0x7000) emu_DoTurbo(&PicoPad[0], allActions[0]); + if (allActions[1] & 0x7000) emu_DoTurbo(&PicoPad[1], allActions[1]); events = (allActions[0] | allActions[1]) >> 16; diff --git a/gp2x/gp2x.c b/gp2x/gp2x.c index 78e8561..80b0486 100644 --- a/gp2x/gp2x.c +++ b/gp2x/gp2x.c @@ -231,6 +231,7 @@ typedef struct ucb1x00_ts_event int gp2x_touchpad_read(int *x, int *y) { UCB1X00_TS_EVENT event; + static int zero_seen = 0; int retval; if (touchdev < 0) return -1; @@ -240,12 +241,14 @@ int gp2x_touchpad_read(int *x, int *y) printf("touch read failed %i %i\n", retval, errno); return -1; } + // this is to ignore the messed-up 4.1.x driver + if (retval == 0) zero_seen = 1; if (x) *x = (event.x * touchcal[0] + touchcal[2]) >> 16; if (y) *y = (event.y * touchcal[4] + touchcal[5]) >> 16; // printf("read %i %i %i\n", event.pressure, *x, *y); - return event.pressure; + return zero_seen ? event.pressure : 0; } diff --git a/gp2x/menu.c b/gp2x/menu.c index 9bc880a..1dc829a 100644 --- a/gp2x/menu.c +++ b/gp2x/menu.c @@ -712,14 +712,14 @@ static int count_bound_keys(int action, int pl_idx, int joy) static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_idx, int sel) { - int x, y, tl_y = 40, i; + int x, y, tl_y = 30, i; gp2x_pd_clone_buffer2(); if (player_idx >= 0) { - text_out16(80, 20, "Player %i controls", player_idx + 1); + text_out16(80, 10, "Player %i controls", player_idx + 1); x = 80; } else { - text_out16(80, 20, "Emulator controls"); + text_out16(80, 10, "Emulator controls"); x = 40; } @@ -732,14 +732,14 @@ static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_ text_out16(x, y, "Done"); if (sel < opt_cnt) { - text_out16(30, 180, "Press a button to bind/unbind"); - text_out16(30, 190, "Use SELECT to clear"); - text_out16(30, 200, "To bind UP/DOWN, hold SELECT"); - text_out16(30, 210, "Select \"Done\" to exit"); + text_out16(30, 195, "Press a button to bind/unbind"); + text_out16(30, 205, "Use SELECT to clear"); + text_out16(30, 215, "To bind UP/DOWN, hold SELECT"); + text_out16(30, 225, "Select \"Done\" to exit"); } else { - text_out16(30, 190, "Use Options -> Save cfg"); - text_out16(30, 200, "to save controls"); - text_out16(30, 210, "Press B or X to exit"); + text_out16(30, 205, "Use Options -> Save cfg"); + text_out16(30, 215, "to save controls"); + text_out16(30, 225, "Press B or X to exit"); } menu_flip(); } @@ -800,6 +800,21 @@ static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_ } } + +menu_entry ctrlopt_entries[] = +{ + { "Player 1", MB_NONE, MA_CTRL_PLAYER1, NULL, 0, 0, 0, 1, 0 }, + { "Player 2", MB_NONE, MA_CTRL_PLAYER2, NULL, 0, 0, 0, 1, 0 }, + { "Emulator controls", MB_NONE, MA_CTRL_EMU, NULL, 0, 0, 0, 1, 0 }, + { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoOpt, 0x020, 0, 0, 1, 1 }, + { "Turbo rate", MB_RANGE, MA_CTRL_TURBO_RATE, ¤tConfig.turbo_rate, 0, 1, 30, 1, 1 }, + { "Done", MB_NONE, MA_CTRL_DONE, NULL, 0, 0, 0, 1, 0 }, +}; + +#define CTRLOPT_ENTRY_COUNT (sizeof(ctrlopt_entries) / sizeof(ctrlopt_entries[0])) +const int ctrlopt_entry_count = CTRLOPT_ENTRY_COUNT; + + static void draw_kc_sel(int menu_sel) { int tl_x = 25+40, tl_y = 60, y, i; @@ -809,13 +824,10 @@ static void draw_kc_sel(int menu_sel) gp2x_pd_clone_buffer2(); menu_draw_selection(tl_x - 16, tl_y + menu_sel*10, 138); - text_out16(tl_x, y, "Player 1"); - text_out16(tl_x, (y+=10), "Player 2"); - text_out16(tl_x, (y+=10), "Emulator controls"); - text_out16(tl_x, (y+=10), "Done"); + me_draw(ctrlopt_entries, ctrlopt_entry_count, tl_x, tl_y, NULL, NULL); tl_x = 25; - text_out16(tl_x, (y=110), "USB joys detected:"); + text_out16(tl_x, (y=130), "USB joys detected:"); if (num_of_joys > 0) { for (i = 0; i < num_of_joys; i++) { strncpy(joyname, joy_name(joys[i]), 33); joyname[33] = 0; @@ -852,23 +864,27 @@ me_bind_action emuctrl_actions[] = static void kc_sel_loop(void) { - int menu_sel = 3, menu_sel_max = 3; + int menu_sel = 5, menu_sel_max = 5; unsigned long inp = 0; - int is_6button = PicoOpt & POPT_6BTN_PAD; + menu_id selected_id; while (1) { draw_kc_sel(menu_sel); - inp = wait_for_input(GP2X_UP|GP2X_DOWN|GP2X_B|GP2X_X); + inp = wait_for_input(GP2X_UP|GP2X_DOWN|GP2X_RIGHT|GP2X_LEFT|GP2X_B|GP2X_X); + selected_id = me_index2id(ctrlopt_entries, CTRLOPT_ENTRY_COUNT, menu_sel); + if (inp & (GP2X_LEFT|GP2X_RIGHT)) // multi choise + me_process(ctrlopt_entries, CTRLOPT_ENTRY_COUNT, selected_id, (inp&GP2X_RIGHT) ? 1 : 0); if (inp & GP2X_UP ) { menu_sel--; if (menu_sel < 0) menu_sel = menu_sel_max; } if (inp & GP2X_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; } if (inp & GP2X_B) { - switch (menu_sel) { - case 0: key_config_loop(me_ctrl_actions, is_6button ? 12 : 8, 0); return; - case 1: key_config_loop(me_ctrl_actions, is_6button ? 12 : 8, 1); return; - case 2: key_config_loop(emuctrl_actions, - sizeof(emuctrl_actions)/sizeof(emuctrl_actions[0]) - 1, -1); return; - case 3: if (!rom_loaded) emu_WriteConfig(0); return; + int is_6button = PicoOpt & POPT_6BTN_PAD; + switch (selected_id) { + case MA_CTRL_PLAYER1: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 0); return; + case MA_CTRL_PLAYER2: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 1); return; + case MA_CTRL_EMU: key_config_loop(emuctrl_actions, + sizeof(emuctrl_actions)/sizeof(emuctrl_actions[0]) - 1, -1); return; + case MA_CTRL_DONE: if (!rom_loaded) emu_WriteConfig(0); return; default: return; } } @@ -1126,7 +1142,6 @@ menu_entry opt_entries[] = { "Enable sound", MB_ONOFF, MA_OPT_ENABLE_SOUND, ¤tConfig.EmuOpt, 0x004, 0, 0, 1, 1 }, { NULL, MB_NONE, MA_OPT_SOUND_QUALITY, NULL, 0, 0, 0, 1, 1 }, { "Use ARM940 core for sound", MB_ONOFF, MA_OPT_ARM940_SOUND, &PicoOpt, 0x200, 0, 0, 1, 1 }, - { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoOpt, 0x020, 0, 0, 1, 1 }, { NULL, MB_NONE, MA_OPT_REGION, NULL, 0, 0, 0, 1, 1 }, { "Use SRAM/BRAM savestates", MB_ONOFF, MA_OPT_SRAM_STATES, ¤tConfig.EmuOpt, 0x001, 0, 0, 1, 1 }, { NULL, MB_NONE, MA_OPT_CONFIRM_STATES,NULL, 0, 0, 0, 1, 1 }, diff --git a/gp2x/version.h b/gp2x/version.h index 076e6d8..d9dd3d3 100644 --- a/gp2x/version.h +++ b/gp2x/version.h @@ -1,2 +1,2 @@ -#define VERSION "1.50a" +#define VERSION "1.51" diff --git a/psp/emu.c b/psp/emu.c index e099d58..d6bc20c 100644 --- a/psp/emu.c +++ b/psp/emu.c @@ -151,6 +151,7 @@ void emu_prepareDefaultConfig(void) defaultConfig.scale = 1.20; // fullscreen defaultConfig.hscale40 = 1.25; defaultConfig.hscale32 = 1.56; + defaultConfig.turbo_rate = 15; } void emu_setDefaultConfig(void) @@ -862,8 +863,11 @@ static void updateKeys(void) } } - PicoPad[0] = (unsigned short) allActions[0]; - PicoPad[1] = (unsigned short) allActions[1]; + PicoPad[0] = allActions[0] & 0xfff; + PicoPad[1] = allActions[1] & 0xfff; + + if (allActions[0] & 0x7000) emu_DoTurbo(&PicoPad[0], allActions[0]); + if (allActions[1] & 0x7000) emu_DoTurbo(&PicoPad[1], allActions[1]); events = (allActions[0] | allActions[1]) >> 16; diff --git a/psp/menu.c b/psp/menu.c index 86b1022..20c3460 100644 --- a/psp/menu.c +++ b/psp/menu.c @@ -672,14 +672,14 @@ static int count_bound_keys(int action, int pl_idx) static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_idx, int sel) { - int x, y, tl_y = 16+40, i; + int x, y, tl_y = 16+20, i; menu_draw_begin(); if (player_idx >= 0) { - text_out16(80+80, 16+20, "Player %i controls", player_idx + 1); + text_out16(80+80, 16, "Player %i controls", player_idx + 1); x = 80+80; } else { - text_out16(80+80, 16+20, "Emulator controls"); + text_out16(80+80, 16, "Emulator controls"); x = 80+40; } @@ -692,14 +692,14 @@ static void draw_key_config(const me_bind_action *opts, int opt_cnt, int player_ text_out16(x, y, "Done"); if (sel < opt_cnt) { - text_out16(80+30, 220, "Press a button to bind/unbind"); - text_out16(80+30, 230, "Use SELECT to clear"); - text_out16(80+30, 240, "To bind UP/DOWN, hold SELECT"); - text_out16(80+30, 250, "Select \"Done\" to exit"); + text_out16(80+30, 225, "Press a button to bind/unbind"); + text_out16(80+30, 235, "Use SELECT to clear"); + text_out16(80+30, 245, "To bind UP/DOWN, hold SELECT"); + text_out16(80+30, 255, "Select \"Done\" to exit"); } else { - text_out16(80+30, 230, "Use Options -> Save cfg"); - text_out16(80+30, 240, "to save controls"); - text_out16(80+30, 250, "Press X or O to exit"); + text_out16(80+30, 235, "Use Options -> Save cfg"); + text_out16(80+30, 245, "to save controls"); + text_out16(80+30, 255, "Press X or O to exit"); } menu_draw_end(); } @@ -741,6 +741,19 @@ static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_ } } +menu_entry ctrlopt_entries[] = +{ + { "Player 1", MB_NONE, MA_CTRL_PLAYER1, NULL, 0, 0, 0, 1, 0 }, + { "Player 2", MB_NONE, MA_CTRL_PLAYER2, NULL, 0, 0, 0, 1, 0 }, + { "Emulator controls", MB_NONE, MA_CTRL_EMU, NULL, 0, 0, 0, 1, 0 }, + { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoOpt, 0x020, 0, 0, 1, 1 }, + { "Turbo rate", MB_RANGE, MA_CTRL_TURBO_RATE, ¤tConfig.turbo_rate, 0, 1, 30, 1, 1 }, + { "Done", MB_NONE, MA_CTRL_DONE, NULL, 0, 0, 0, 1, 0 }, +}; + +#define CTRLOPT_ENTRY_COUNT (sizeof(ctrlopt_entries) / sizeof(ctrlopt_entries[0])) +const int ctrlopt_entry_count = CTRLOPT_ENTRY_COUNT; + static void draw_kc_sel(int menu_sel) { int tl_x = 80+25+40, tl_y = 16+60, y; @@ -749,10 +762,7 @@ static void draw_kc_sel(int menu_sel) menu_draw_begin(); menu_draw_selection(tl_x - 16, tl_y + menu_sel*10, 138); - text_out16(tl_x, y, "Player 1"); - text_out16(tl_x, (y+=10), "Player 2"); - text_out16(tl_x, (y+=10), "Emulator controls"); - text_out16(tl_x, (y+=10), "Done"); + me_draw(ctrlopt_entries, ctrlopt_entry_count, tl_x, tl_y, NULL, NULL); menu_draw_end(); } @@ -779,21 +789,25 @@ static void kc_sel_loop(void) { int menu_sel = 3, menu_sel_max = 3; unsigned long inp = 0; - int is_6button = PicoOpt & POPT_6BTN_PAD; + menu_id selected_id; while (1) { draw_kc_sel(menu_sel); - inp = wait_for_input(BTN_UP|BTN_DOWN|BTN_X|BTN_CIRCLE, 0); + inp = wait_for_input(BTN_UP|BTN_DOWN|BTN_LEFT|BTN_RIGHT|BTN_X|BTN_CIRCLE, 0); + selected_id = me_index2id(ctrlopt_entries, CTRLOPT_ENTRY_COUNT, menu_sel); + if (inp & (BTN_LEFT|BTN_RIGHT)) // multi choise + me_process(ctrlopt_entries, CTRLOPT_ENTRY_COUNT, selected_id, (inp&BTN_RIGHT) ? 1 : 0); if (inp & BTN_UP ) { menu_sel--; if (menu_sel < 0) menu_sel = menu_sel_max; } if (inp & BTN_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; } if (inp & BTN_CIRCLE) { - switch (menu_sel) { - case 0: key_config_loop(me_ctrl_actions, is_6button ? 12 : 8, 0); return; - case 1: key_config_loop(me_ctrl_actions, is_6button ? 12 : 8, 1); return; - case 2: key_config_loop(emuctrl_actions, - sizeof(emuctrl_actions)/sizeof(emuctrl_actions[0]) - 1, -1); return; - case 3: if (!rom_loaded) emu_WriteConfig(0); return; + int is_6button = PicoOpt & POPT_6BTN_PAD; + switch (selected_id) { + case MA_CTRL_PLAYER1: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 0); return; + case MA_CTRL_PLAYER2: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 1); return; + case MA_CTRL_EMU: key_config_loop(emuctrl_actions, + sizeof(emuctrl_actions)/sizeof(emuctrl_actions[0]) - 1, -1); return; + case MA_CTRL_DONE: if (!rom_loaded) emu_WriteConfig(0); return; default: return; } } @@ -1205,12 +1219,11 @@ static void amenu_loop_options(void) menu_entry opt_entries[] = { { NULL, MB_NONE, MA_OPT_RENDERER, NULL, 0, 0, 0, 1, 1 }, - { "Accurate sprites", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoOpt, 0x0080, 0, 0, 0, 1 }, + { "Accurate sprites", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoOpt, 0x080, 0, 0, 0, 1 }, { "Show FPS", MB_ONOFF, MA_OPT_SHOW_FPS, ¤tConfig.EmuOpt, 0x0002, 0, 0, 1, 1 }, { NULL, MB_RANGE, MA_OPT_FRAMESKIP, ¤tConfig.Frameskip, 0, -1, 16, 1, 1 }, { "Enable sound", MB_ONOFF, MA_OPT_ENABLE_SOUND, ¤tConfig.EmuOpt, 0x0004, 0, 0, 1, 1 }, { NULL, MB_NONE, MA_OPT_SOUND_QUALITY, NULL, 0, 0, 0, 1, 1 }, - { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoOpt, 0x0020, 0, 0, 1, 1 }, { NULL, MB_NONE, MA_OPT_REGION, NULL, 0, 0, 0, 1, 1 }, { "Use SRAM/BRAM savestates", MB_ONOFF, MA_OPT_SRAM_STATES, ¤tConfig.EmuOpt, 0x0001, 0, 0, 1, 1 }, { NULL, MB_NONE, MA_OPT_CONFIRM_STATES,NULL, 0, 0, 0, 1, 1 }, diff --git a/psp/version.h b/psp/version.h index 076e6d8..d9dd3d3 100644 --- a/psp/version.h +++ b/psp/version.h @@ -1,2 +1,2 @@ -#define VERSION "1.50a" +#define VERSION "1.51"