Skip to content

Commit 65e86d7

Browse files
authored
Merge pull request #29 from sergiobenrocha2/master
Change button layout of some games
2 parents b90fb24 + 9d25750 commit 65e86d7

1 file changed

Lines changed: 88 additions & 2 deletions

File tree

src/osd/retro/retromain.c

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,8 @@ input_item_id PAD_DIR[4][4]=
810810
{ITEM_ID_8_PAD ,ITEM_ID_2_PAD ,ITEM_ID_4_PAD ,ITEM_ID_6_PAD }
811811
};
812812

813-
// Default : A ->B1 | B ->B2 | X ->B3 | Y ->B4 | L ->B5 | R ->B6
814-
int Buttons_mapping[6]={RETROPAD_A,RETROPAD_B,RETROPAD_X,RETROPAD_Y,RETROPAD_L,RETROPAD_R};
813+
// Default : A ->B1 | B ->B2 | X ->B3 | Y ->B4 | L ->B5 | R ->B6 | keyboard c ->B7 | keyboard v -> B8
814+
int Buttons_mapping[8]={RETROPAD_A,RETROPAD_B,RETROPAD_X,RETROPAD_Y,RETROPAD_L,RETROPAD_R,RETROK_c,RETROK_v};
815815

816816
static void Input_Binding(running_machine &machine);
817817

@@ -989,6 +989,16 @@ static void initInput(running_machine &machine)
989989
&joystate[i].button[Buttons_mapping[4]],(input_item_id)(ITEM_ID_BUTTON1+4),generic_button_get_state );
990990
input_device_item_add_joy (i,Buttons_Name[Buttons_mapping[5]],\
991991
&joystate[i].button[Buttons_mapping[5]],(input_item_id)(ITEM_ID_BUTTON1+5),generic_button_get_state );
992+
if (Buttons_mapping[6]!=RETROK_c)
993+
{
994+
input_device_item_add_joy (i,Buttons_Name[Buttons_mapping[6]],\
995+
&joystate[i].button[Buttons_mapping[6]],(input_item_id)(ITEM_ID_BUTTON1+6),generic_button_get_state );
996+
}
997+
if (Buttons_mapping[7]!=RETROK_v)
998+
{
999+
input_device_item_add_joy (i,Buttons_Name[Buttons_mapping[7]],\
1000+
&joystate[i].button[Buttons_mapping[7]],(input_item_id)(ITEM_ID_BUTTON1+7),generic_button_get_state );
1001+
}
9921002

9931003
sprintf(defname, "Pad%d", i);
9941004
Pad_device[i] = machine.input().device_class(DEVICE_CLASS_KEYBOARD).add_device(defname);
@@ -1183,6 +1193,34 @@ static void Input_Binding(running_machine &machine)
11831193
Buttons_mapping[5]=RETROPAD_R;
11841194

11851195
}
1196+
else if (
1197+
(core_stricmp(machine.system().name, "dynwar") == 0) ||
1198+
(core_stricmp(machine.system().parent, "dynwar") == 0)
1199+
)
1200+
{
1201+
/* Capcom CPS-1: Dynasty Wars */
1202+
1203+
Buttons_mapping[0]=RETROPAD_B;
1204+
Buttons_mapping[1]=RETROPAD_A;
1205+
Buttons_mapping[2]=RETROPAD_X;
1206+
Buttons_mapping[3]=RETROPAD_Y;
1207+
Buttons_mapping[4]=RETROPAD_L;
1208+
Buttons_mapping[5]=RETROPAD_R;
1209+
}
1210+
else if (
1211+
(core_stricmp(machine.system().name, "ddsom") == 0) ||
1212+
(core_stricmp(machine.system().parent, "ddsom") == 0)
1213+
)
1214+
{
1215+
/* Capcom CPS-2: Dungeons & Dragons: Shadow over Mystara (same layout of ddtod) */
1216+
1217+
Buttons_mapping[0]=RETROPAD_A;
1218+
Buttons_mapping[1]=RETROPAD_B;
1219+
Buttons_mapping[2]=RETROPAD_Y;
1220+
Buttons_mapping[3]=RETROPAD_X;
1221+
Buttons_mapping[4]=RETROPAD_L;
1222+
Buttons_mapping[5]=RETROPAD_R;
1223+
}
11861224
else if (
11871225
(core_stricmp(machine.system().parent, "aof") == 0) ||
11881226
(core_stricmp(machine.system().parent, "aof2") == 0) ||
@@ -1337,6 +1375,54 @@ static void Input_Binding(running_machine &machine)
13371375
Buttons_mapping[4]=RETROPAD_L;
13381376
Buttons_mapping[5]=RETROPAD_R;
13391377
}
1378+
else if (
1379+
(core_stricmp(machine.system().name, "chasehq") == 0) ||
1380+
(core_stricmp(machine.system().parent, "chasehq") == 0) ||
1381+
(core_stricmp(machine.system().name, "superchs") == 0) ||
1382+
(core_stricmp(machine.system().parent, "superchs") == 0)
1383+
)
1384+
{
1385+
/* Chase H.Q. / Super Chase - Criminal Termination */
1386+
1387+
Buttons_mapping[0]=RETROPAD_A;
1388+
Buttons_mapping[1]=RETROPAD_B;
1389+
Buttons_mapping[2]=RETROPAD_X;
1390+
Buttons_mapping[3]=RETROPAD_R;
1391+
Buttons_mapping[4]=RETROPAD_L;
1392+
Buttons_mapping[5]=RETROPAD_Y;
1393+
}
1394+
else if (
1395+
(core_stricmp(machine.system().name, "outrun") == 0) ||
1396+
(core_stricmp(machine.system().parent, "outrun") == 0) ||
1397+
(core_stricmp(machine.system().name, "turbo") == 0) ||
1398+
(core_stricmp(machine.system().parent, "turbo") == 0)
1399+
)
1400+
{
1401+
/* Out Run / Turbo */
1402+
1403+
Buttons_mapping[0]=RETROPAD_A;
1404+
Buttons_mapping[1]=RETROPAD_B;
1405+
Buttons_mapping[2]=RETROPAD_R;
1406+
Buttons_mapping[3]=RETROPAD_Y;
1407+
Buttons_mapping[4]=RETROPAD_L;
1408+
Buttons_mapping[5]=RETROPAD_X;
1409+
}
1410+
else if (
1411+
(core_stricmp(machine.system().name, "vr") == 0) ||
1412+
(core_stricmp(machine.system().parent, "vr") == 0)
1413+
)
1414+
{
1415+
/* Virtua Racing */
1416+
1417+
Buttons_mapping[0]=RETROPAD_A;
1418+
Buttons_mapping[1]=RETROPAD_B;
1419+
Buttons_mapping[2]=RETROPAD_X;
1420+
Buttons_mapping[3]=RETROPAD_Y;
1421+
Buttons_mapping[4]=RETROPAD_PAD_DOWN;
1422+
Buttons_mapping[5]=RETROPAD_PAD_UP;
1423+
Buttons_mapping[6]=RETROPAD_L;
1424+
Buttons_mapping[7]=RETROPAD_R;
1425+
}
13401426

13411427
}
13421428

0 commit comments

Comments
 (0)