From 627de0d81f81ad60d26d782f2425be1e6f5a3dbc Mon Sep 17 00:00:00 2001 From: XaviDCR92 Date: Fri, 21 Jul 2017 00:09:35 +0200 Subject: + First commit. It works painfully slow, but gets the job done. Still lots of room for improvement. --- Source/Pad.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Source/Pad.h (limited to 'Source/Pad.h') diff --git a/Source/Pad.h b/Source/Pad.h new file mode 100644 index 0000000..5b5fa1d --- /dev/null +++ b/Source/Pad.h @@ -0,0 +1,62 @@ +#ifndef __PAD_HEADER__ +#define __PAD_HEADER__ + +/* ************************************* + * Includes + * *************************************/ + +#include "Global_Inc.h" +#include "System.h" +#include "GameStructures.h" + +/* ************************************* + * Defines + * *************************************/ + +#define PAD_ALWAYS_REPEAT 1 + +/* ************************************* + * Global prototypes + * *************************************/ + +void PadInit(void); +void PadClearData(void); + +bool PadOneConnected(void); + +bool PadOneAnyKeyPressed(void); +bool PadTwoAnyKeyPressed(void); + +bool PadOneKeyPressed(unsigned short key); +bool PadTwoKeyPressed(unsigned short key); + +bool PadOneKeyRepeat(unsigned short key, uint8_t time); +bool PadTwoKeyRepeat(unsigned short key, uint8_t time); + +bool PadOneKeyReleased(unsigned short key); +bool PadTwoKeyReleased(unsigned short key); + +bool PadOneKeySinglePress(unsigned short key); +bool PadTwoKeySinglePress(unsigned short key); + +unsigned short PadOneGetLastKeySinglePressed(void); +unsigned short PadTwoGetLastKeySinglePressed(void); + +bool PadOneDirectionKeyPressed(void); +bool PadTwoDirectionKeyPressed(void); + +bool PadOneDirectionKeyReleased(void); +bool PadTwoDirectionKeyReleased(void); + +bool UpdatePads(void); +bool PadOneIsVibrationEnabled(void); +bool PadTwoIsVibrationEnabled(void); + +bool PadAddCheat(TYPE_CHEAT * cheat); + +unsigned short* PadGetPlayerOneCheatArray(void); + +// Experimental (to be removed) +unsigned short* PadOneGetAddress(void); + +#endif //__PAD_HEADER__ -- cgit v1.2.3