diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-07-27 07:41:25 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-07-27 07:41:25 +0200 |
| commit | 153f078ec20cc442dd4dbe802dbd5fcb1748fcca (patch) | |
| tree | db82fe5fe9f6165b2239f3523d5f02ec8d9fa02b /Source/Pad.c | |
| parent | cb1c0345c766fada621b521ca39aac02ae25056b (diff) | |
| download | airport-153f078ec20cc442dd4dbe802dbd5fcb1748fcca.tar.gz | |
* Added comments on System.
* Files needed for Game are now only loaded once, except from LEVEL1.PLT.
* Added DevMenu to get debug info.
* ISR_LoadMenuVBlank() does not stop when accessing SIO.
* On fopen() and SERIAL_INTERFACE defined, "#" is prepended and "@" is appended to filename string.
Diffstat (limited to 'Source/Pad.c')
| -rw-r--r-- | Source/Pad.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/Source/Pad.c b/Source/Pad.c index 6689020..9e892a6 100644 --- a/Source/Pad.c +++ b/Source/Pad.c @@ -100,11 +100,30 @@ psx_pad_state PadOneGetState(void) { psx_pad_state PadOne; - PSX_PollPad_Fast(PAD_ONE,&PadOne); + PSX_PollPad_Fast(PAD_ONE, &PadOne); return PadOne; } +unsigned char PadOneGetType(void) +{ + return PadOneGetState().type; +} + +psx_pad_state PadTwoGetState(void) +{ + psx_pad_state PadTwo; + + PSX_PollPad_Fast(PAD_TWO, &PadTwo); + + return PadTwo; +} + +unsigned char PadTwoGetType(void) +{ + return PadTwoGetState().type; +} + bool PadOneConnected(void) { psx_pad_state PadOne = PadOneGetState(); @@ -117,6 +136,28 @@ bool PadOneConnected(void) return true; } +bool PadTwoConnected(void) +{ + psx_pad_state PadTwo = PadTwoGetState(); + + if(PadTwo.status != PAD_STATUS_OK) + { + return false; + } + + return true; +} + +unsigned char PadOneGetID(void) +{ + return PadOneGetState().id; +} + +unsigned char PadTwoGetID(void) +{ + return PadTwoGetState().id; +} + bool PadOneAnyKeyPressed(void) { return (bool)pad1; |
