- transform mapped pad constants into meaningful defines

This commit is contained in:
InspirationByte 2022-01-03 12:59:26 +03:00
parent 9afa35c52c
commit 9a2b2d27cb
8 changed files with 173 additions and 151 deletions

View File

@ -40,7 +40,7 @@ extern int CutRec_SaveChase();
#define _CutRec_StorePingInfo(a,b) CutRec_StorePingInfo(a,b)
#define _CutRec_CheckInvalidatePing(a,b) CutRec_CheckInvalidatePing(a, b)
#define _CutRec_NextChase(a) CutRec_NextChase(a)
#define _CutRec_ReserveSlots() CutRec_ReserveSlots
#define _CutRec_ReserveSlots() CutRec_ReserveSlots()
#define _CutRec_HandleCarRequest() CutRec_HandleCarRequest()
#define _CutRec_InitPlayers() CutRec_InitPlayers()
#define _CutRec_InitMission(a) CutRec_InitMission(a)

View File

@ -17,6 +17,7 @@
#include "pres.h"
#include "sound.h"
#include "system.h"
#include "pad.h"
struct REPLAY_ICON
{
@ -1053,27 +1054,27 @@ void ControlReplay(void)
}
// register pads
if ((padd & 0x8000) && debounce == 0)
if ((padd & MPAD_D_LEFT) && debounce == 0)
{
move = 2;
debounce = 1;
}
if ((padd & 0x2000) && debounce == 0)
if ((padd & MPAD_D_RIGHT) && debounce == 0)
{
move = 1;
debounce = 1;
}
if ((padd & 0x1000) && debounce == 0)
if ((padd & MPAD_D_UP) && debounce == 0)
{
move = 3;
debounce = 1;
}
if ((padd & 0x4000) && debounce == 0)
if ((padd & MPAD_D_DOWN) && debounce == 0)
{
move = 4;
debounce = 1;
}
if ((padd & 0x40) && debounce == 0)
if ((padd & MPAD_CROSS) && debounce == 0)
{
if (DirectorMenuActive == 0)
pauseflag = 1;
@ -1085,14 +1086,14 @@ void ControlReplay(void)
debounce = 1;
}
if ((padd & 0x100) && debounce == 0)
if ((padd & MPAD_SELECT) && debounce == 0) // [A]
{
// Retro: Press Select to toggle overlays
gDoOverlays ^= 1;
debounce = 1;
}
if ((padd & 0x8000) == 0 && (padd & 0x7140) == 0)
if ((padd & (MPAD_D_LEFT | MPAD_CROSS | MPAD_SELECT | MPAD_D_DOWN | MPAD_D_RIGHT | MPAD_D_UP)) == 0)
{
debounce = 0;
}
@ -1103,7 +1104,7 @@ void ControlReplay(void)
move = 0;
speed = 1;
if (padd & 8)
if (padd & MPAD_R1)
speed = 8;
// control camera position and rotation
@ -1111,12 +1112,12 @@ void ControlReplay(void)
if (EditMode == 1)
{
// edit start time
if ((padd & 0x2000U) != 0 && LastChange->FrameCnt < CameraCnt)
if ((padd & MPAD_D_RIGHT) != 0 && LastChange->FrameCnt < CameraCnt)
{
LastChange->FrameCnt++;
}
if ((padd & 0x8000U) != 0 && PlaybackCamera[LastChange->prev].FrameCnt < LastChange->FrameCnt)
if ((padd & MPAD_D_LEFT) != 0 && PlaybackCamera[LastChange->prev].FrameCnt < LastChange->FrameCnt)
{
LastChange->FrameCnt--;
}
@ -1124,30 +1125,30 @@ void ControlReplay(void)
else if (EditMode == 2)
{
// Chase camera angle
if ((padd & 0x1000) != 0 && gCameraDistance > 500)
if ((padd & MPAD_D_UP) != 0 && gCameraDistance > 500)
{
gCameraDistance -= speed * 16; // [A] restore
gCameraMaxDistance -= speed * 16;
player[0].cameraDist = gCameraDistance;
}
if ((padd & 0x4000) != 0 && gCameraDistance < 2750)
if ((padd & MPAD_D_DOWN) != 0 && gCameraDistance < 2750)
{
gCameraDistance += speed * 16; // [A] restore
gCameraMaxDistance += speed * 16;
player[0].cameraDist = gCameraDistance;
}
if ((padd & 0x8000) != 0)
if ((padd & MPAD_D_LEFT) != 0)
gCameraAngle = gCameraAngle + speed * 16;
if ((padd & 0x2000) != 0)
if ((padd & MPAD_D_RIGHT) != 0)
gCameraAngle = gCameraAngle - speed * 16;
if ((padd & 4) && gCameraOffset.vy > -840)
if ((padd & MPAD_L1) && gCameraOffset.vy > -840)
gCameraOffset.vy -= speed * 16;
if ((padd & 1) && gCameraOffset.vy < 50)
if ((padd & MPAD_L2) && gCameraOffset.vy < 50)
gCameraOffset.vy += speed * 16;
// OBSOLETE DRIVER 1 CODE
@ -1217,28 +1218,28 @@ void ControlReplay(void)
else
dir = ratan2(dz, dx);
if (padd & 2)
if (padd & MPAD_R2) // [A] use R2 as a modifier hor camera Y offset
{
if ((padd & 0x1000U) && gCameraOffset.vy > -150)
if ((padd & MPAD_D_UP) && gCameraOffset.vy > -150)
gCameraOffset.vy -= speed * 16;
if ((padd & 0x4000) && gCameraOffset.vy < 150)
if ((padd & MPAD_D_DOWN) && gCameraOffset.vy < 150)
gCameraOffset.vy += speed * 16;
}
else
{
if ((padd & 0x1000) != 0 && (tracking_car == 0 || d > 500))
if ((padd & MPAD_D_UP) != 0 && (tracking_car == 0 || d > 500))
x = speed * -16;
if ((padd & 0x4000) != 0)
if ((padd & MPAD_D_DOWN) != 0)
x = speed * 16;
}
if ((padd & 0x8000) != 0 && (tracking_car == 0 || d > 500))
if ((padd & MPAD_D_LEFT) != 0 && (tracking_car == 0 || d > 500))
z = speed * -16;
if ((padd & 0x2000) != 0)
if ((padd & MPAD_D_RIGHT) != 0)
z = speed * 16;
if (tracking_car == 0)
@ -1271,10 +1272,10 @@ void ControlReplay(void)
player[0].cameraPos.vz = old_camera.vz;
}
if (padd & 4)
if (padd & MPAD_L1)
player[0].cameraPos.vy -= speed * 16;
if (padd & 1)
if (padd & MPAD_L2)
player[0].cameraPos.vy += speed * 16;
height = -MapHeight(&tmpPos);
@ -1303,7 +1304,7 @@ void ControlReplay(void)
{
// Tripod camera angle
if(padd & 0x1000)
if(padd & MPAD_D_UP)
{
camera_angle.vx += speed * 4;
@ -1311,7 +1312,7 @@ void ControlReplay(void)
camera_angle.vx = 300;
}
if (padd & 0x4000)
if (padd & MPAD_D_DOWN)
{
camera_angle.vx -= speed * 4;
@ -1319,10 +1320,10 @@ void ControlReplay(void)
camera_angle.vx = 3900;
}
if (padd & 0x8000)
if (padd & MPAD_D_LEFT)
camera_angle.vy += speed * 4;
if (padd & 0x2000)
if (padd & MPAD_D_RIGHT)
camera_angle.vy -= speed * 4;
camera_angle.vx = camera_angle.vx & 0xfff;
@ -1331,7 +1332,7 @@ void ControlReplay(void)
}
else if (EditMode == 5)
{
if(padd & 0x1000)
if(padd & MPAD_D_UP)
{
scr_z += speed * 4;
@ -1339,7 +1340,7 @@ void ControlReplay(void)
scr_z = 1000;
}
if (padd & 0x4000)
if (padd & MPAD_D_DOWN)
{
scr_z -= speed * 4;
@ -1558,7 +1559,7 @@ void ControlReplay(void)
break;
}
if ((padd & 0x40U) == 0)
if ((padd & MPAD_CROSS) == 0)
{
first_time = 0;
CursorY = 0;

View File

@ -250,7 +250,7 @@ int MapCarIndexToBank(int index)
}
static char cop_model = 0;
int gDoCopSpeech = 1;
int gDoCopSpeech = 1; // [A]
// [D] [T]
void LoadLevelSFX(int missionNum)

View File

@ -1433,7 +1433,7 @@ void DrawCiv(PEDESTRIAN* pPed)
int boneId;
int frame;
int i, j;
u_int phase;
int phase;
SVECTOR pos;
VECTOR pos1;
SVECTOR rot;
@ -1563,7 +1563,7 @@ void DrawCiv(PEDESTRIAN* pPed)
ppos.vy = pPed->position.vy;
ppos.vz = pPed->position.vz;
phase = (pPed->frame1 & 0xf) * 2;
phase = (pPed->frame1 & 15) * 2;
cv.b = 40;
cv.g = 40;

View File

@ -74,7 +74,7 @@ void InitControllers(void)
for (j = 0; j < 16; j++)
{
pad->mappings.button_lookup[j] = 1 << (j & 0x1f);
pad->mappings.button_lookup[j] = 1 << j;
}
pad->mappings.swap_analog = 0;
@ -186,36 +186,36 @@ void MapPad(int pad, PADRAW *pData)
Pads[pad].diranalog[2] = pData->analog[2] - 128;
Pads[pad].diranalog[3] = pData->analog[3] - 128;
if (Pads[pad].active)
if (!Pads[pad].active)
return;
mapped = 0;
for (i = 0; i < 16; i++)
{
mapped = 0;
for (i = 0; i < 16; i++)
if (((buttons >> i) & 1) != 0)
{
if (((buttons >> i) & 1) != 0)
{
mapped |= Pads[pad].mappings.button_lookup[i];
}
mapped |= Pads[pad].mappings.button_lookup[i];
}
}
Pads[pad].mapnew = mapped & ~Pads[pad].mapped;
Pads[pad].mapped = mapped;
Pads[pad].mapnew = mapped & ~Pads[pad].mapped;
Pads[pad].mapped = mapped;
if (Pads[pad].mappings.swap_analog == 0)
{
Pads[pad].mapanalog[1] = Pads[pad].diranalog[1];
Pads[pad].mapanalog[2] = Pads[pad].diranalog[2];
Pads[pad].mapanalog[3] = Pads[pad].diranalog[3];
Pads[pad].mapanalog[0] = Pads[pad].diranalog[0];
}
else
{
Pads[pad].mapanalog[1] = Pads[pad].diranalog[3];
Pads[pad].mapanalog[2] = Pads[pad].diranalog[0];
Pads[pad].mapanalog[3] = Pads[pad].diranalog[1];
Pads[pad].mapanalog[0] = Pads[pad].diranalog[2];
}
if (Pads[pad].mappings.swap_analog == 0)
{
Pads[pad].mapanalog[1] = Pads[pad].diranalog[1];
Pads[pad].mapanalog[2] = Pads[pad].diranalog[2];
Pads[pad].mapanalog[3] = Pads[pad].diranalog[3];
Pads[pad].mapanalog[0] = Pads[pad].diranalog[0];
}
else
{
Pads[pad].mapanalog[1] = Pads[pad].diranalog[3];
Pads[pad].mapanalog[2] = Pads[pad].diranalog[0];
Pads[pad].mapanalog[3] = Pads[pad].diranalog[1];
Pads[pad].mapanalog[0] = Pads[pad].diranalog[2];
}
}

View File

@ -3,41 +3,62 @@
#define PADBUFFER_SIZE 34
// mapped pad identifiers
#define MPAD_L2 0x1
#define MPAD_R2 0x2
#define MPAD_L1 0x4
#define MPAD_R1 0x8
#define MPAD_TRIANGLE 0x10
#define MPAD_CIRCLE 0x20
#define MPAD_CROSS 0x40
#define MPAD_SQUARE 0x80
#define MPAD_SELECT 0x100
#define MPAD_L3 0x200
#define MPAD_R3 0x400
#define MPAD_START 0x800
#define MPAD_D_UP 0x1000
#define MPAD_D_RIGHT 0x2000
#define MPAD_D_DOWN 0x4000
#define MPAD_D_LEFT 0x8000
enum ECameraPad
{
CAMERA_PAD_LOOK_LEFT = 0x1,
CAMERA_PAD_LOOK_RIGHT = 0x2,
CAMERA_PAD_LOOK_LEFT = MPAD_L2,
CAMERA_PAD_LOOK_RIGHT = MPAD_R2,
CAMERA_PAD_LOOK_BACK = CAMERA_PAD_LOOK_LEFT | CAMERA_PAD_LOOK_RIGHT,
CAMERA_PAD_LOOK_BACK_DED = 0x200
CAMERA_PAD_LOOK_BACK = MPAD_L2 | MPAD_R2,
CAMERA_PAD_LOOK_BACK_DED = MPAD_L3
};
enum ETannerPad
{
TANNER_PAD_ACTION = 0x10,
TANNER_PAD_POWER = 0x20,
TANNER_PAD_GOFORWARD = 0x40 | 0x1000,
TANNER_PAD_GOBACK = 0x80 | 0x4000,
TANNER_PAD_TURNLEFT = 0x8000,
TANNER_PAD_TURNRIGHT = 0x2000,
TANNER_PAD_ACTION = MPAD_TRIANGLE,
TANNER_PAD_POWER = MPAD_CIRCLE,
TANNER_PAD_GOFORWARD = MPAD_CROSS | MPAD_D_UP,
TANNER_PAD_GOBACK = MPAD_SQUARE | MPAD_D_DOWN,
TANNER_PAD_TURNLEFT = MPAD_D_LEFT,
TANNER_PAD_TURNRIGHT = MPAD_D_RIGHT,
TANNER_PAD_ACTION_DED = 0x400, // R3 mapped for car entrance
TANNER_PAD_ACTION_DED = MPAD_R3, // R3 mapped for car entrance
};
enum ECarPads
{
CAR_PAD_FASTSTEER = 0x4,
CAR_PAD_HANDBRAKE = 0x10,
CAR_PAD_WHEELSPIN = 0x20,
CAR_PAD_ACCEL = 0x40,
CAR_PAD_BRAKE = 0x80,
CAR_PAD_UP = 0x1000,
CAR_PAD_LEFT = 0x8000,
CAR_PAD_RIGHT = 0x2000,
CAR_PAD_FASTSTEER = MPAD_L1,
CAR_PAD_HANDBRAKE = MPAD_TRIANGLE,
CAR_PAD_WHEELSPIN = MPAD_CIRCLE,
CAR_PAD_ACCEL = MPAD_CROSS,
CAR_PAD_BRAKE = MPAD_SQUARE,
CAR_PAD_UP = MPAD_D_UP,
CAR_PAD_LEFT = MPAD_D_LEFT,
CAR_PAD_RIGHT = MPAD_D_RIGHT,
CAR_PAD_LEAVECAR_DED = 0x400, // R3 mapped
CAR_PAD_LEAVECAR_DED = MPAD_R3, // R3 mapped
CAR_PAD_LEAVECAR = (CAR_PAD_UP | CAR_PAD_HANDBRAKE), // fixme: combinations?
CAR_PAD_LEAVECAR = (MPAD_D_UP | MPAD_TRIANGLE),
};
extern int pad_connected;

View File

@ -1178,7 +1178,7 @@ void ControlMenu(void)
// toggle map off
if (gShowMap)
{
if (paddata & 0x50)
if (paddata & (MPAD_CROSS | MPAD_TRIANGLE))
PauseMap(0);
return;
@ -1219,13 +1219,13 @@ void ControlMenu(void)
#ifndef PSX
// Pause fix for PC mapping
if ((paddata & 0x10) && paddata & (0x1000 | 0x4000))
if ((paddata & MPAD_TRIANGLE) && paddata & (MPAD_D_UP | MPAD_D_DOWN))
{
paddata = 0;
}
#endif
if (paddata & 0x1000)
if (paddata & MPAD_D_UP)
{
// go up
ActiveMenuItem--;
@ -1235,7 +1235,7 @@ void ControlMenu(void)
ActiveItem[VisibleMenu] = &ActiveMenu->MenuItems[ActiveMenuItem];
}
else if (paddata & 0x4000)
else if (paddata & MPAD_D_DOWN)
{
// go down
ActiveMenuItem++;
@ -1245,7 +1245,7 @@ void ControlMenu(void)
ActiveItem[VisibleMenu] = &ActiveMenu->MenuItems[ActiveMenuItem];
}
else if (paddata & 0x40)
else if (paddata & MPAD_CROSS)
{
// Enter submenu
if (pItem->Type & PAUSE_TYPE_SUBMENU)
@ -1274,7 +1274,7 @@ void ControlMenu(void)
else
PauseReturnValue = pItem->ExitValue;
}
else if ((paddata & 0x10) || (paddata & 0x800)) // Triangle or Start
else if ((paddata & MPAD_TRIANGLE) || (paddata & MPAD_START)) // Triangle or Start
{
// continue game if needed
@ -1282,7 +1282,7 @@ void ControlMenu(void)
{
#ifndef PSX
// hack for keyboard swap
if(!(paddata & 0x800))
if(!(paddata & MPAD_START))
return;
#endif
for (i = 0; i < ActiveMenu->NumItems; i++)

View File

@ -1227,19 +1227,19 @@ void NewSelection(short dir)
addPrim(current->ot + 9, &In);
#endif
if ((dir & 0x1000) != 0)
if ((dir & MPAD_D_UP) != 0)
{
btn = pCurrButton->u;
}
else if ((dir & 0x4000) != 0)
else if ((dir & MPAD_D_DOWN) != 0)
{
btn = pCurrButton->d;
}
else if ((dir & 0x8000) != 0)
else if ((dir & MPAD_D_LEFT) != 0)
{
btn = pCurrButton->l;
}
else if ((dir & 0x2000) != 0)
else if ((dir & MPAD_D_RIGHT) != 0)
{
btn = pCurrButton->r;
}
@ -1293,7 +1293,7 @@ int HandleKeyPress(void)
}
}
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
int action = pCurrButton->action >> 8;
@ -1347,7 +1347,7 @@ int HandleKeyPress(void)
}
}
}
else if (feNewPad & 0x10)
else if (feNewPad & MPAD_TRIANGLE)
{
if (ScreenDepth > 0)
{
@ -1370,7 +1370,7 @@ int HandleKeyPress(void)
else
{
// any d-pad buttons pressed?
if ((feNewPad & (0x8000 | 0x4000 | 0x2000 | 0x1000)) != 0)
if ((feNewPad & (MPAD_D_UP | MPAD_D_RIGHT | MPAD_D_DOWN | MPAD_D_LEFT)) != 0)
{
NewSelection(feNewPad);
}
@ -1416,7 +1416,7 @@ void PadChecks(void)
#ifndef PSX
// [A] quit to system
if(feNewPad & 0x10)
if(feNewPad & MPAD_TRIANGLE)
{
if(ScreenDepth == 0)
{
@ -1427,7 +1427,7 @@ void PadChecks(void)
if(bQuitToSystem)
{
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
if(bQuitToSystemSel == 1)
bQuitToSystem = 2;
@ -1436,7 +1436,7 @@ void PadChecks(void)
FESound(2);
}
else if ((feNewPad & 0x8000) || (feNewPad & 0x2000))
else if ((feNewPad & MPAD_D_LEFT) || (feNewPad & MPAD_D_RIGHT))
{
bQuitToSystemSel += 1;
bQuitToSystemSel &= 1;
@ -1607,7 +1607,7 @@ void State_FrontEnd(void* param)
{
if (Pads[1].type < 2)
{
feNewPad = ((feNewPad & 0x10) != 0) ? 0x10 : 0;
feNewPad = ((feNewPad & MPAD_TRIANGLE) != 0) ? MPAD_TRIANGLE : 0;
}
else
{
@ -1883,14 +1883,14 @@ int CentreScreen(int bSetup)
FEPrintStringSized(text, 25, 75, 0xC00, 0, 128, 0, 0);
#endif
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
draw_mode_pal.framex = current->disp.screen.x / 2;
draw_mode_pal.framey = current->disp.screen.y;
draw_mode_ntsc.framex = current->disp.screen.x / 2;
draw_mode_ntsc.framey = current->disp.screen.y;
}
else if (feNewPad & 0x10)
else if (feNewPad & MPAD_TRIANGLE)
{
current->disp.screen.x = draw_mode.framex * 2;
current->disp.screen.y = draw_mode.framey;
@ -1901,7 +1901,7 @@ int CentreScreen(int bSetup)
{
bool done = false;
if (feNewPad & 0x1000)
if (feNewPad & MPAD_D_UP)
{
if (current->disp.screen.y >= screen_limits[video_mode].miny)
{
@ -1910,7 +1910,7 @@ int CentreScreen(int bSetup)
done = true;
}
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
if (current->disp.screen.y <= screen_limits[video_mode].maxy)
{
@ -1919,7 +1919,7 @@ int CentreScreen(int bSetup)
done = true;
}
}
else if (feNewPad & 0x8000)
else if (feNewPad & MPAD_D_LEFT)
{
if (current->disp.screen.x >= screen_limits[video_mode].minx)
{
@ -1928,7 +1928,7 @@ int CentreScreen(int bSetup)
done = true;
}
}
else if (feNewPad & 0x2000)
else if (feNewPad & MPAD_D_RIGHT)
{
if (current->disp.screen.x <= screen_limits[video_mode].maxx)
{
@ -2049,7 +2049,7 @@ int CarSelectScreen(int bSetup)
return 1;
}
if (feNewPad & 0x10)
if (feNewPad & MPAD_TRIANGLE)
{
FESound(0);
bDoneAllready = 1;
@ -2076,7 +2076,7 @@ int CarSelectScreen(int bSetup)
iScreenSelect = SCREEN_NONE;
}
else if (feNewPad & 0x40)
else if (feNewPad & MPAD_CROSS)
{
if (currSelIndex == 0)
{
@ -2136,11 +2136,11 @@ int CarSelectScreen(int bSetup)
EndFrame();
#endif
}
else if (feNewPad & 0x1000)
else if (feNewPad & MPAD_D_UP)
{
currSelIndex = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currSelIndex = pCurrButton->d - 1;
}
@ -2157,15 +2157,15 @@ int CopDiffLevelScreen(int bSetup)
return 1;
}
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
gCopDifficultyLevel = currSelIndex;
}
else if (feNewPad & 0x1000)
else if (feNewPad & MPAD_D_UP)
{
currSelIndex = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currSelIndex = pCurrButton->d - 1;
}
@ -2183,15 +2183,15 @@ int VibroOnOffScreen(int bSetup)
return 1;
}
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
gVibration = (currSelIndex ^ 1);
}
else if (feNewPad & 0x1000)
else if (feNewPad & MPAD_D_UP)
{
currSelIndex = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currSelIndex = pCurrButton->d - 1;
}
@ -2376,7 +2376,7 @@ int MissionSelectScreen(int bSetup)
return 1;
}
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
i = currMission;
@ -2413,16 +2413,16 @@ int MissionSelectScreen(int bSetup)
return 1;
}
else if (feNewPad & 0x10)
else if (feNewPad & MPAD_TRIANGLE)
{
missionSetup = 0;
iScreenSelect = SCREEN_NONE;
}
else if (feNewPad & 0x1000)
else if (feNewPad & MPAD_D_UP)
{
currSelIndex = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currSelIndex = pCurrButton->d - 1;
}
@ -2489,7 +2489,7 @@ int MissionCityScreen(int bSetup)
return 0;
}
if (feNewPad & 0x10)
if (feNewPad & MPAD_TRIANGLE)
{
// BUGFIX: unload city image
loaded[0] = -1;
@ -2501,11 +2501,11 @@ int MissionCityScreen(int bSetup)
}
else
{
if (feNewPad & 0x1000)
if (feNewPad & MPAD_D_UP)
{
currCity = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currCity = pCurrButton->d - 1;
}
@ -2578,12 +2578,12 @@ int CutSceneSelectScreen(int bSetup)
return 1;
}
if (feNewPad & 0x10)
if (feNewPad & MPAD_TRIANGLE)
{
bDrawExtra = 0;
iScreenSelect = SCREEN_NONE;
}
else if (feNewPad & 0x40)
else if (feNewPad & MPAD_CROSS)
{
if (currSelIndex == 0)
{
@ -2642,11 +2642,11 @@ int CutSceneSelectScreen(int bSetup)
return 0;
}
else if (feNewPad & 0x1000)
else if (feNewPad & MPAD_D_UP)
{
currSelIndex = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currSelIndex = pCurrButton->d - 1;
}
@ -2746,7 +2746,7 @@ int CutSceneCitySelectScreen(int bSetup)
return 0;
}
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
lastCity = -1;
lastCutCity = GameLevel;
@ -2772,7 +2772,7 @@ int CutSceneCitySelectScreen(int bSetup)
return 0;
}
else if (feNewPad & 0x10)
else if (feNewPad & MPAD_TRIANGLE)
{
FESound(0);
bDoneAllready = 1;
@ -2782,11 +2782,11 @@ int CutSceneCitySelectScreen(int bSetup)
return 0;
}
else if (feNewPad & 0x1000)
else if (feNewPad & MPAD_D_UP)
{
currCity = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currCity = pCurrButton->d - 1;
}
@ -2860,7 +2860,7 @@ int SetVolumeScreen(int bSetup)
currSelIndex = (pCurrButton->u & 3);
if (feNewPad & 0x10)
if (feNewPad & MPAD_TRIANGLE)
{
FESound(0);
bDoneAllready = 1;
@ -2875,7 +2875,7 @@ int SetVolumeScreen(int bSetup)
return 0;
}
else if (feNewPad & 0x40)
else if (feNewPad & MPAD_CROSS)
{
if (currSelIndex == 2)
LoadBackgroundFile("DATA\\GFX.RAW");
@ -2886,7 +2886,7 @@ int SetVolumeScreen(int bSetup)
{
int dir = -1; // -1: no action, 0: limit reached, 1: OK
if (fePad & 0x8000)
if (fePad & MPAD_D_LEFT)
{
switch (currSelIndex)
{
@ -2922,7 +2922,7 @@ int SetVolumeScreen(int bSetup)
break;
}
}
else if (fePad & 0x2000)
else if (fePad & MPAD_D_RIGHT)
{
switch (currSelIndex)
{
@ -3080,7 +3080,7 @@ int ScoreScreen(int bSetup)
return 0;
}
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
if (currSelIndex == 0)
{
@ -3128,12 +3128,12 @@ int ScoreScreen(int bSetup)
bRedrawFrontend = 1;
#endif
}
else if (feNewPad & 0x10)
else if (feNewPad & MPAD_TRIANGLE)
{
iScreenSelect = SCREEN_NONE;
return 0;
}
else if ((feNewPad & 0x1000) || (feNewPad & 0x4000))
else if ((feNewPad & MPAD_D_UP) || (feNewPad & MPAD_D_DOWN))
{
currSelIndex ^= 1;
}
@ -3202,7 +3202,7 @@ int CityCutOffScreen(int bSetup)
#ifndef PSX
/*
if ((fePad & 0x40U) != 0)
if ((fePad & MPAD_CROSS) != 0)
{
lastCity = currCity;
@ -3214,7 +3214,7 @@ int CityCutOffScreen(int bSetup)
return 0;
}*/
if (feNewPad & 0x10)
if (feNewPad & MPAD_TRIANGLE)
{
lastCity = -1;
@ -3227,11 +3227,11 @@ int CityCutOffScreen(int bSetup)
return 0;
}
else if (feNewPad & 0x1000)
else if (feNewPad & MPAD_D_UP)
{
currCity = pCurrButton->u - 1;
}
else if (feNewPad & 0x4000)
else if (feNewPad & MPAD_D_DOWN)
{
currCity = pCurrButton->d - 1;
}
@ -3267,14 +3267,14 @@ int ControllerScreen(int bSetup)
}
else
{
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
currSelIndex = currSelIndex ^ 1;
LoadBackgroundFile(contNames[currSelIndex]);
bRedrawFrontend = 1;
}
else if (feNewPad & 0x10)
else if (feNewPad & MPAD_TRIANGLE)
{
iScreenSelect = SCREEN_SCORES;
LoadBackgroundFile("DATA\\GFX.RAW");
@ -3725,7 +3725,7 @@ int UserReplaySelectScreen(int bSetup)
if (gFEReplayCount)
{
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
char filename[64];
int selectedReplay = pCurrButton->var;
@ -3810,7 +3810,7 @@ int TimeOfDaySelectScreen(int bSetup)
FEPrintString(GET_GAME_TXT(TimeOfDayNames[wantedTimeOfDay]), 590, ypos[0], 4, 128, 128, 128);
FEPrintString(GET_GAME_TXT(WeatherNames[wantedWeather]), 590, ypos[1], 4, 128, 128, 128);
if (feNewPad & 0x10)
if (feNewPad & MPAD_TRIANGLE)
{
// reset back
wantedWeather = -1;
@ -3821,11 +3821,11 @@ int TimeOfDaySelectScreen(int bSetup)
dir = 0;
if (feNewPad & 0x8000)
if (feNewPad & MPAD_D_LEFT)
{
dir = -1;
}
else if (feNewPad & 0x2000)
else if (feNewPad & MPAD_D_RIGHT)
{
dir = 1;
}
@ -3861,7 +3861,7 @@ int DemoScreen(int bSetup)
if (bSetup)
return 0;
if (feNewPad & 0x40)
if (feNewPad & MPAD_CROSS)
{
pScreenStack[ScreenDepth] = pCurrScreen;
pButtonStack[ScreenDepth] = pCurrButton;
@ -3880,7 +3880,7 @@ int DemoScreen(int bSetup)
if(mainScreenLoaded)
{
if (feNewPad & 0x20)
if (feNewPad & MPAD_CIRCLE)
{
LoadBackgroundFile(contNames[0]);
FESound(2);