Browse Source

Add support for the N64 mouse

For now, just recognizes it's a mouse and treat it like a controller.
pull/5/head
Raphael Assenat 3 years ago
parent
commit
74cf60d839
  1. 6
      gcn64_protocol.c
  2. 1
      gcn64_protocol.h
  3. 1
      main.c

6
gcn64_protocol.c

@ -181,6 +181,9 @@ int gcn64_detectController(unsigned char chn) @@ -181,6 +181,9 @@ int gcn64_detectController(unsigned char chn)
* 0000 0101 0000 0000 0000 0001 : 0x050001 With expansion pack
* 0000 0101 0000 0000 0000 0010 : 0x050002 Expansion pack removed
*
* -- N64 mouse --
* 0000 0010 0000 0000 0000 0000 : 0x020000
*
* -- Ascii keyboard (keyboard connector)
* 0000 1000 0010 0000 0000 0000 : 0x082000
*
@ -215,6 +218,9 @@ int gcn64_detectController(unsigned char chn) @@ -215,6 +218,9 @@ int gcn64_detectController(unsigned char chn)
#endif
switch ((id >> 8) & 0x0F) {
case 0x02:
return CONTROLLER_IS_N64_MOUSE;
case 0x05:
return CONTROLLER_IS_N64;

1
gcn64_protocol.h

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
#define CONTROLLER_IS_GC 2
#define CONTROLLER_IS_GC_KEYBOARD 3
#define CONTROLLER_IS_UNKNOWN 4
#define CONTROLLER_IS_N64_MOUSE 5
/* Return many unknown bits, but two are about the expansion port. */

1
main.c

@ -553,6 +553,7 @@ Gamepad *detectPad(unsigned char chn) @@ -553,6 +553,7 @@ Gamepad *detectPad(unsigned char chn)
case CONTROLLER_IS_UNKNOWN:
return NULL;
case CONTROLLER_IS_N64_MOUSE:
case CONTROLLER_IS_N64:
return n64GetGamepad();

Loading…
Cancel
Save