Added autofire

This commit is contained in:
fabio.olimpieri 2015-01-06 11:41:40 +00:00
parent bf65a989fe
commit abe44a9e15
5 changed files with 24 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -63,7 +63,7 @@ static virtkey_t keys[KEY_COLS * KEY_ROWS] = {
N("Sft","SHIFT_LEFT",304),K("Z",122),K("X",120),K("C",99), K("V",118), K("B",98), K("N",110), K("M",109),N(",","COMMA",44),N(".","PERIOD",46), N("/","SLASH",47), N("Sft","SHIFT_RIGHT",303), N("Lft","CURSOR_LEFT",276), N("Dwn","CURSOR_DOWN",274), N("Rgt", "CURSOR_RIGHT",275),K("KP1",257),K("KP2",258), K("KP3",259), N("Enter","KP_ENTERENTER",271),KNL(),KNL(), N("Sft","SHIFT_LEFT",304),K("Z",122),K("X",120),K("C",99), K("V",118), K("B",98), K("N",110), K("M",109),N(",","COMMA",44),N(".","PERIOD",46), N("/","SLASH",47), N("Sft","SHIFT_RIGHT",303), N("Lft","CURSOR_LEFT",276), N("Dwn","CURSOR_DOWN",274), N("Rgt", "CURSOR_RIGHT",275),K("KP1",257),K("KP2",258), K("KP3",259), N("Enter","KP_ENTERENTER",271),KNL(),KNL(),
N("Alt","ALT_LEFT",308), N("Amg","AMIGA_LEFT",310),N("space", "SPACE",32),N("Amg","AMIGA_RIGHT",309),N("Alt","ALT_RIGHT",307),KNL(),K("KP0",256),N(".","KP_PERIOD",266),N("Enter","KP_ENTER",271),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(), N("Alt","ALT_LEFT",308), N("Amg","AMIGA_LEFT",310),N("space", "SPACE",32),N("Amg","AMIGA_RIGHT",309),N("Alt","ALT_RIGHT",307),KNL(),K("KP0",256),N(".","KP_PERIOD",266),N("Enter","KP_ENTER",271),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),
NJ("Fire","JOY_FIRE_BUTTON"),NJ("Joy 2nd button","JOY_2ND_BUTTON"),NJ("Joy 3rd button","JOY_3RD_BUTTON"), NJ("Joy left","JOY_LEFT"),NJ("Joy right","JOY_RIGHT"),NJ("Joy up","JOY_UP"),NJ("Joy down","JOY_DOWN"),D("None"),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(), KNL()}; NJ("Fire","JOY_FIRE_BUTTON"),NJ("AutoFire","JOY_AUTOFIRE_BUTTON"),NJ("Joy 2nd button","JOY_2ND_BUTTON"),NJ("Joy 3rd button","JOY_3RD_BUTTON"), NJ("Joy left","JOY_LEFT"),NJ("Joy right","JOY_RIGHT"),NJ("Joy up","JOY_UP"),NJ("Joy down","JOY_DOWN"),D("None"),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL(),KNL()};
static int rows_margins[KEY_ROWS+1] = {26, 49, 74, 98, 122, 145, 172, 198}; static int rows_margins[KEY_ROWS+1] = {26, 49, 74, 98, 122, 145, 172, 198};
@ -74,7 +74,7 @@ static int buttons_margins[KEY_ROWS][KEY_COLS+1] = {
{14,42,67,93,119,145,171,197,223,249,275,301,327,353,412,449,476,515,541,567,593,620}, {14,42,67,93,119,145,171,197,223,249,275,301,327,353,412,449,476,515,541,567,593,620},
{14,80,106,132,158,184,210,236,262,288,314,340,417,449,476,515,541,567,593,620 }, {14,80,106,132,158,184,210,236,262,288,314,340,417,449,476,515,541,567,593,620 },
{28,63,95,329,361,396,515,567,593,620}, {28,63,95,329,361,396,515,567,593,620},
{14,80,146,212,278,344,411,476,543}}; {14,80,146,212,278,344,411,476,543,609}};
extern int RATIO; extern int RATIO;

View File

@ -73,6 +73,8 @@ static const char *input_messages[] = {
/*09*/ "^|On|Off", /*09*/ "^|On|Off",
/*10*/ "Rumble", /*10*/ "Rumble",
/*11*/ "^|on|off", /*11*/ "^|on|off",
/*12*/ "Autofire delay",
/*13*/ "^|3|6|9|12|15",
NULL NULL
}; };
@ -1412,14 +1414,16 @@ static void input_options(int joy)
const int classic_to_sdl[] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18}; const int classic_to_sdl[] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18};
int sdl_key = 1; int sdl_key = 1;
const char *key; const char *key;
int submenus[6]; int submenus[7];
int opt; int opt, autofire;
struct virtkey *virtualkey; struct virtkey *virtualkey;
memset(submenus, 0, sizeof(submenus)); memset(submenus, 0, sizeof(submenus));
submenus[3] = !changed_prefs.joystick_settings[1][joy].eventid[ID_AXIS_OFFSET + 6][0]; submenus[3] = !changed_prefs.joystick_settings[1][joy].eventid[ID_AXIS_OFFSET + 6][0];
submenus[4] = (changed_prefs.mouse_settings[1][joy].enabled == 0); submenus[4] = (changed_prefs.mouse_settings[1][joy].enabled == 0);
submenus[5] = !changed_prefs.rumble[joy]; submenus[5] = !changed_prefs.rumble[joy];
submenus[6] = changed_prefs.input_autofire_framecnt/3-1;
if (submenus[6]<0) submenus[6] = 0;
opt = menu_select_title("Input menu", opt = menu_select_title("Input menu",
input_messages, submenus); input_messages, submenus);
@ -1459,6 +1463,13 @@ static void input_options(int joy)
return; return;
} }
if (opt == 12) //Autofire delay
{
changed_prefs.input_autofire_framecnt = (submenus[6]+1)*3;
currprefs.input_autofire_framecnt = changed_prefs.input_autofire_framecnt;
return;
}
virtualkey = virtkbd_get_key(); virtualkey = virtkbd_get_key();
if (virtualkey == NULL) if (virtualkey == NULL)
return; return;
@ -1478,7 +1489,7 @@ static void input_options(int joy)
break; break;
} }
if (!strcmp(key,"JOY_FIRE_BUTTON")) if (!strcmp(key,"JOY_FIRE_BUTTON"))
key= joy ? "JOY1_FIRE_BUTTON": "JOY2_FIRE_BUTTON"; key= joy ? "JOY1_FIRE_BUTTON.0": "JOY2_FIRE_BUTTON.0";
if (!strcmp(key,"JOY_2ND_BUTTON")) if (!strcmp(key,"JOY_2ND_BUTTON"))
key= joy ? "JOY1_2ND_BUTTON": "JOY2_2ND_BUTTON"; key= joy ? "JOY1_2ND_BUTTON": "JOY2_2ND_BUTTON";
@ -1498,6 +1509,10 @@ static void input_options(int joy)
if (!strcmp(key,"JOY_DOWN")) if (!strcmp(key,"JOY_DOWN"))
key= joy ? "JOY1_DOWN": "JOY2_DOWN"; key= joy ? "JOY1_DOWN": "JOY2_DOWN";
if (!strcmp(key,"JOY_AUTOFIRE_BUTTON"))
{
key= joy ? "JOY1_FIRE_BUTTON.1": "JOY2_FIRE_BUTTON.1";
}
setup_joystick(joy, key, sdl_key); setup_joystick(joy, key, sdl_key);

View File

@ -1724,7 +1724,7 @@ void inputdevice_default_prefs (struct uae_prefs *p)
p->input_joystick_deadzone = 33; p->input_joystick_deadzone = 33;
p->input_joymouse_speed = 10; p->input_joymouse_speed = 10;
p->input_mouse_speed = 100; p->input_mouse_speed = 100;
p->input_autofire_framecnt = 10; p->input_autofire_framecnt = 9;
for (i = 0; i <= MAX_INPUT_SETTINGS; i++) { for (i = 0; i <= MAX_INPUT_SETTINGS; i++) {
set_kbr_default (p, i, 0); set_kbr_default (p, i, 0);
input_get_default_mouse (p->mouse_settings[i]); input_get_default_mouse (p->mouse_settings[i]);