diff --git a/Makefile.inc b/Makefile.inc index df4c19e..9315d50 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,2 +1,2 @@ -OBJS=main.o usb.o usbpad.o mappings.o gcn64_protocol.o n64.o gamecube.o usart1.o bootloader.o eeprom.o config.o hiddata.o usbstrings.o intervaltimer.o version.o gcn64txrx.o +OBJS=main.o usb.o usbpad.o mappings.o gcn64_protocol.o n64.o gamecube.o usart1.o bootloader.o eeprom.o config.o hiddata.o usbstrings.o intervaltimer.o version.o gcn64txrx.o gamepads.o VERSIONSTR=\"3.0.0\" diff --git a/gamecube.c b/gamecube.c index a8ce9fb..b9e07b7 100644 --- a/gamecube.c +++ b/gamecube.c @@ -32,12 +32,6 @@ static void gamecubeInit(void); static char gamecubeUpdate(void); static char gamecubeChanged(void); -/* What was most recently read from the controller */ -static gamepad_data last_built_report; - -/* What was most recently sent to the host */ -static gamepad_data last_sent_report; - static char gc_rumbling = 0; static char origins_set = 0; static unsigned char orig_x, orig_y, orig_cx, orig_cy; diff --git a/gamepads.c b/gamepads.c new file mode 100644 index 0000000..f130360 --- /dev/null +++ b/gamepads.c @@ -0,0 +1,6 @@ +#include "gamepads.h" + +/* Shared between N64 and GC (only one is used at a time). Saves memory. */ + +gamepad_data last_sent_report; +gamepad_data last_built_report; diff --git a/gamepads.h b/gamepads.h index 3701846..33c47a2 100644 --- a/gamepads.h +++ b/gamepads.h @@ -80,6 +80,12 @@ typedef struct { char (*probe)(void); /* return true if found */ } Gamepad; +/* What was most recently read from the controller */ +extern gamepad_data last_built_report; + +/* What was most recently sent to the host */ +extern gamepad_data last_sent_report; + #endif // _gamepads_h__ diff --git a/n64.c b/n64.c index c74d5b2..edf9d35 100644 --- a/n64.c +++ b/n64.c @@ -36,13 +36,6 @@ static char must_rumble = 0; static char force_rumble = 0; #endif - -/* What was most recently read from the controller */ -static gamepad_data last_built_report; - -/* What was most recently reported through getReport */ -static gamepad_data last_sent_report; - static void n64Init(void) { n64Update();