Browse Source

Share common N64 and GC buffers

pull/5/head
Raphael Assenat 7 years ago
parent
commit
831487efe2
  1. 2
      Makefile.inc
  2. 6
      gamecube.c
  3. 6
      gamepads.c
  4. 6
      gamepads.h
  5. 7
      n64.c

2
Makefile.inc

@ -1,2 +1,2 @@ @@ -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\"

6
gamecube.c

@ -32,12 +32,6 @@ static void gamecubeInit(void); @@ -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;

6
gamepads.c

@ -0,0 +1,6 @@ @@ -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;

6
gamepads.h

@ -80,6 +80,12 @@ typedef struct { @@ -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__

7
n64.c

@ -36,13 +36,6 @@ static char must_rumble = 0; @@ -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();

Loading…
Cancel
Save