|
|
|
@ -6,15 +6,14 @@ |
|
|
|
#include <psxpad.h> |
|
|
|
|
|
|
|
static u_char padBuffer[2][34]; |
|
|
|
static u_short prevButtons = 0xFFFF; |
|
|
|
|
|
|
|
static const int moveSpeed = 1024; |
|
|
|
static const short rotSpeed = 1024; |
|
|
|
static const char deadZone = 0x30; |
|
|
|
|
|
|
|
static u_char dispmode = 0; |
|
|
|
static u_char dispmode_held = 0; |
|
|
|
static u_char widescreen = 0; |
|
|
|
static u_char widescreen_held = 0; |
|
|
|
|
|
|
|
void input_init() |
|
|
|
{ |
|
|
|
@ -96,33 +95,21 @@ void input_process() |
|
|
|
// Look up |
|
|
|
cam_rot.vx += rotInterval; |
|
|
|
} |
|
|
|
if (!(buttons & PAD_SELECT)) |
|
|
|
if (!(buttons & PAD_SELECT) && (prevButtons & PAD_SELECT)) |
|
|
|
{ |
|
|
|
// Switch display mode |
|
|
|
if (!dispmode_held) |
|
|
|
{ |
|
|
|
dispmode_held = 1; |
|
|
|
//dispmode = (dispmode + 1) & 0x3; |
|
|
|
//display_reset(!!(dispmode & 2), !!(dispmode & 1), widescreen, NULL); |
|
|
|
display_reset(!GetVideoMode(), 0, widescreen, NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
dispmode_held = 0; |
|
|
|
} |
|
|
|
if (!(buttons & PAD_START)) |
|
|
|
if (!(buttons & PAD_START) && (prevButtons & PAD_START)) |
|
|
|
{ |
|
|
|
if (!widescreen_held) |
|
|
|
{ |
|
|
|
widescreen_held = 1; |
|
|
|
widescreen = !widescreen; |
|
|
|
display_reset(GetVideoMode(), 0, widescreen, NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
if (!(buttons & PAD_CIRCLE) && (prevButtons & PAD_CIRCLE)) |
|
|
|
{ |
|
|
|
widescreen_held = 0; |
|
|
|
enableTexturing = !enableTexturing; |
|
|
|
} |
|
|
|
|
|
|
|
// Check for analog controller |
|
|
|
@ -153,4 +140,6 @@ void input_process() |
|
|
|
// Look up/down |
|
|
|
cam_rot.vx -= (rightJoyY * rotInterval) >> 7; |
|
|
|
} |
|
|
|
|
|
|
|
prevButtons = buttons; |
|
|
|
} |