bugfixes, new config system and messed code for it

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@393 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2008-03-24 23:11:47 +00:00
parent c46ffd310f
commit 1ca2ea4f60
16 changed files with 352 additions and 192 deletions

View file

@ -687,9 +687,7 @@ static int count_bound_keys(int action, int pl_idx)
return keys;
}
typedef struct { char *name; int mask; } bind_action_t;
static void draw_key_config(const bind_action_t *opts, int opt_cnt, int player_idx, int sel)
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;
@ -723,7 +721,7 @@ static void draw_key_config(const bind_action_t *opts, int opt_cnt, int player_i
menu_draw_end();
}
static void key_config_loop(const bind_action_t *opts, int opt_cnt, int player_idx)
static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_idx)
{
int sel = 0, menu_sel_max = opt_cnt, prev_select = 0, i;
unsigned long inp = 0;
@ -777,27 +775,10 @@ static void draw_kc_sel(int menu_sel)
}
// PicoPad[] format: MXYZ SACB RLDU
static bind_action_t ctrl_actions[] =
{
{ "UP ", 0x001 },
{ "DOWN ", 0x002 },
{ "LEFT ", 0x004 },
{ "RIGHT ", 0x008 },
{ "A ", 0x040 },
{ "B ", 0x010 },
{ "C ", 0x020 },
{ "START ", 0x080 },
{ "MODE ", 0x800 },
{ "X ", 0x400 },
{ "Y ", 0x200 },
{ "Z ", 0x100 },
};
// player2_flag, ?, ?, ?, ?, ?, ?, menu
// "NEXT SAVE SLOT", "PREV SAVE SLOT", "SWITCH RENDERER", "SAVE STATE",
// "LOAD STATE", "VOLUME UP", "VOLUME DOWN", "DONE"
static bind_action_t emuctrl_actions[] =
me_bind_action emuctrl_actions[] =
{
{ "Load State ", 1<<28 },
{ "Save State ", 1<<27 },
@ -806,6 +787,7 @@ static bind_action_t emuctrl_actions[] =
{ "Switch Renderer", 1<<26 },
{ "Volume Down ", 1<<30 },
{ "Volume Up ", 1<<29 },
{ NULL, 0 }
};
static void kc_sel_loop(void)
@ -822,8 +804,8 @@ static void kc_sel_loop(void)
if (inp & BTN_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }
if (inp & BTN_PLAY) {
switch (menu_sel) {
case 0: key_config_loop(ctrl_actions, is_6button ? 12 : 8, 0); return;
case 1: key_config_loop(ctrl_actions, is_6button ? 12 : 8, 1); return;
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); return;
case 3: if (!rom_loaded) emu_WriteConfig(0); return;