1
0
mirror of https://github.com/raphnet/gc_n64_usb-v3 synced 2024-12-21 23:08:53 -05:00

Add support for the N64 mouse

For now, just recognizes it's a mouse and treat it like a controller.
This commit is contained in:
Raphael Assenat 2019-02-04 17:08:52 -05:00
parent 4999f07c14
commit 74cf60d839
3 changed files with 8 additions and 0 deletions

View File

@ -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)
#endif
switch ((id >> 8) & 0x0F) {
case 0x02:
return CONTROLLER_IS_N64_MOUSE;
case 0x05:
return CONTROLLER_IS_N64;

View File

@ -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
View File

@ -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();