Skip to content

Commit 0012929

Browse files
Detect GBA-via-link-cable as a separate Style.
SI_GBA (0x00040000) sits in libogc's N64-family group because it shares the SI protocol bus, but logically it's a different device. Adds N64_KIND_GBA + STYLE_GBA so a GBA tethered to a GameCube via the link cable shows 'Style: GBA' on its port. Like the mic, GBA doesn't answer cmd 0x01; we surface present=true with all input fields zero. Per-GBA polling (e.g. for connection status) would need its own path.
1 parent 681b70d commit 0012929

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

gamecube/ppc/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ typedef enum {
152152
STYLE_WHEEL,
153153
STYLE_MOUSE,
154154
STYLE_MIC,
155+
STYLE_GBA,
155156
STYLE_KEYBOARD,
156157
} pad_style_t;
157158

@@ -163,6 +164,7 @@ static const char *format_style(pad_style_t s) {
163164
case STYLE_WHEEL: return "Wheel ";
164165
case STYLE_MOUSE: return "Mouse ";
165166
case STYLE_MIC: return "Mic ";
167+
case STYLE_GBA: return "GBA ";
166168
case STYLE_KEYBOARD: return "Keyboard";
167169
default: return "None ";
168170
}
@@ -285,6 +287,7 @@ static void snap_n64(pad_snap_t *out, int chan, const N64State *s) {
285287
switch (s->kind) {
286288
case N64_KIND_MOUSE: out->style = STYLE_MOUSE; break;
287289
case N64_KIND_MIC: out->style = STYLE_MIC; break;
290+
case N64_KIND_GBA: out->style = STYLE_GBA; break;
288291
default: out->style = STYLE_N64; break;
289292
}
290293
switch (s->pak) {

gamecube/ppc/n64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define N64_TYPE_CONTROLLER 0x05000000
1616
#define N64_TYPE_MOUSE 0x02000000
1717
#define N64_TYPE_MIC 0x00010000
18+
#define N64_TYPE_GBA 0x00040000
1819

1920
#define PAK_ADDR_LABEL 0x0000
2021
#define PAK_ADDR_PROBE 0x8000
@@ -274,6 +275,7 @@ static n64_kind_t kind_for_type(u32 raw) {
274275
if (hi == N64_TYPE_CONTROLLER) return N64_KIND_CONTROLLER;
275276
if (hi == N64_TYPE_MOUSE) return N64_KIND_MOUSE;
276277
if (hi == N64_TYPE_MIC) return N64_KIND_MIC;
278+
if (hi == N64_TYPE_GBA) return N64_KIND_GBA;
277279
return N64_KIND_NONE;
278280
}
279281

gamecube/ppc/n64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ typedef enum {
2525
N64_KIND_CONTROLLER,
2626
N64_KIND_MOUSE,
2727
N64_KIND_MIC,
28+
N64_KIND_GBA, // GBA connected via link cable
2829
} n64_kind_t;
2930

3031
typedef enum {

0 commit comments

Comments
 (0)