Commit bb2a7b7
committed
gc: sticky-cache GCN detection to ride out GBA-disconnect transients
After a GBA cable pull, libogc's SI_GetType walks through transient
values where bits 27-28 land on SI_TYPE_GC (sometimes with
SI_GC_STANDARD set, sometimes not) before settling on NO_RESPONSE.
The bare "(raw_type & SI_TYPE_MASK) == SI_TYPE_GC" fallback at the
bottom of the per-port priority chain was latching that as a real
GameCube controller, so the port re-labelled itself "GCN" for the
window between the gba_state debounce expiring and libogc reaching
NO_RESPONSE. Previously the same transients latched as "Wheel" and
got the sticky-cache treatment in wheel_chan; this is the same
problem one slot over.
Fix: add gc_chan[4] parallel to kbd_chan/wheel_chan.
- Latch true when (t & SI_TYPE_MASK) == SI_TYPE_GC && SI_GC_STANDARD
set && no NO_RESPONSE. SI_GC_STANDARD covers wired controllers and
Wavebird (which is GC | WIRELESS | STANDARD | ...).
- Clear on NO_RESPONSE or on any definitive non-controller GC reading
(keyboard, wheel) or a non-GC family type altogether.
- Replace the bare-type fallback in the display priority chain with
gc_chan[i].
Drops the unused raw_type local that the old fallback referenced.
Tested on hardware: GBA disconnect now settles to "None" instead of
flickering through GCN.1 parent 3ad831c commit bb2a7b7
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
550 | 558 | | |
551 | 559 | | |
552 | 560 | | |
| |||
564 | 572 | | |
565 | 573 | | |
566 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
567 | 583 | | |
568 | 584 | | |
569 | 585 | | |
| |||
653 | 669 | | |
654 | 670 | | |
655 | 671 | | |
656 | | - | |
657 | 672 | | |
658 | 673 | | |
659 | 674 | | |
| |||
694 | 709 | | |
695 | 710 | | |
696 | 711 | | |
697 | | - | |
| 712 | + | |
698 | 713 | | |
699 | 714 | | |
700 | 715 | | |
| |||
0 commit comments