Replies: 3 comments 2 replies
-
So I'm trying to do this myself, just for my own personal use. What I'd like to do is map the NSO N64 controller's B/A buttons letter-for-letter, so I'm trying to indicate that they are the south/east buttons instead of the current west/south. I believe that's done here: BlueRetro/main/adapter/wireless/sw.c Lines 240 to 263 in 7be479e But so far I haven't been able to make the right changes. Right now, I have this: static const uint32_t sw_n64_mask[4] = {0x33D50FFF, 0x00000000, 0x00000000, 0x00000000};
static const uint32_t sw_n64_desc[4] = {0x0000000F, 0x00000000, 0x00000000, 0x00000000};
static const uint32_t sw_n64_btns_mask[2][32] = {
{
0, 0, 0, 0,
BIT(SW_N64_C_LEFT), BIT(SW_N64_C_RIGHT), BIT(SW_N64_C_DOWN), BIT(SW_N64_C_UP),
0, 0, 0, 0,
0, 0, 0, 0,
0, BIT(SW_N64_A), BIT(SW_N64_B), 0,
BIT(SW_N64_START), 0, BIT(SW_N64_HOME), BIT(SW_N64_CAPTURE),
BIT(SW_N64_Z), BIT(SW_N64_L), 0, 0,
BIT(SW_N64_ZR), BIT(SW_N64_R), 0, 0,
},
{
0, 0, 0, 0,
BIT(SW_N_X), BIT(SW_N_MINUS), BIT(SW_N_ZR), BIT(SW_N_Y),
BIT(SW_N_LEFT), BIT(SW_N_RIGHT), BIT(SW_N_DOWN), BIT(SW_N_UP),
0, 0, 0, 0,
0, BIT(SW_N_A), BIT(SW_N_B), 0,
BIT(SW_N_PLUS), 0, BIT(SW_N_HOME), BIT(SW_N_CAPTURE),
BIT(SW_N_ZL), BIT(SW_N_L), 0, 0,
BIT(SW_N_LJ), BIT(SW_N_R), 0, 0,
},
}; But with this setup, only the B button works, the A button is performing no function whatsoever. Can anyone advise what I'm doing wrong here? To be clear, I have no understanding of the code, I'm just going by the names of the enums. EDIT: The problem appears to be here: BlueRetro/main/adapter/wireless/sw.c Line 240 in 7be479e I need to adjust this mask to include the A button and disclude (word?) The Y button. But I have no idea what this mask represents. Can anybody advise as to what the bits signify so I know which to flip? |
Beta Was this translation helpful? Give feedback.
-
You need to update the active button mask first uint32: sw_n64_mask -> 0x33DF0FFF Also to answer the original question I do not make change to the default mapping anymore. Default mapping affect everything, every BT controller and every wired system. The main goal of the default mapping is:
So using an N64 controller on GC is not a use case were the default will be good. |
Beta Was this translation helpful? Give feedback.
-
I'll drop my diff here just in case anybody else finds themselves in the same situation: diff --git a/main/adapter/wired/gc.c b/main/adapter/wired/gc.c
index 1636c56..314ec64 100644
--- a/main/adapter/wired/gc.c
+++ b/main/adapter/wired/gc.c
@@ -60,7 +60,7 @@ static DRAM_ATTR const uint32_t gc_btns_mask[32] = {
0, 0, 0, 0,
BIT(GC_LD_LEFT), BIT(GC_LD_RIGHT), BIT(GC_LD_DOWN), BIT(GC_LD_UP),
0, 0, 0, 0,
- BIT(GC_B), BIT(GC_X), BIT(GC_A), BIT(GC_Y),
+ BIT(GC_Y), BIT(GC_A), BIT(GC_B), BIT(GC_X),
BIT(GC_START), 0, 0, 0,
0, BIT(GC_Z), BIT(GC_L), 0,
0, BIT(GC_Z), BIT(GC_R), 0,
diff --git a/main/adapter/wireless/sw.c b/main/adapter/wireless/sw.c
index dbf15d9..b0f3bc4 100644
--- a/main/adapter/wireless/sw.c
+++ b/main/adapter/wireless/sw.c
@@ -237,7 +237,7 @@ static const uint32_t sw_gen_btns_mask[2][32] = {
},
};
-static const uint32_t sw_n64_mask[4] = {0x33D50FFF, 0x00000000, 0x00000000, 0x00000000};
+static const uint32_t sw_n64_mask[4] = {0x33DF0FFF, 0x00000000, 0x00000000, 0x00000000};
static const uint32_t sw_n64_desc[4] = {0x0000000F, 0x00000000, 0x00000000, 0x00000000};
static const uint32_t sw_n64_btns_mask[2][32] = {
{
@@ -245,17 +245,17 @@ static const uint32_t sw_n64_btns_mask[2][32] = {
BIT(SW_N64_C_LEFT), BIT(SW_N64_C_RIGHT), BIT(SW_N64_C_DOWN), BIT(SW_N64_C_UP),
0, 0, 0, 0,
0, 0, 0, 0,
- BIT(SW_N64_B), 0, BIT(SW_N64_A), 0,
- BIT(SW_N64_START), 0, BIT(SW_N64_HOME), BIT(SW_N64_CAPTURE),
- BIT(SW_N64_Z), BIT(SW_N64_L), 0, 0,
- BIT(SW_N64_ZR), BIT(SW_N64_R), 0, 0,
+ 0, BIT(SW_N64_A), BIT(SW_N64_B), 0,
+ BIT(SW_N64_START), 0, BIT(SW_N64_HOME), 0,
+ BIT(SW_N64_Z) | BIT(SW_N64_L), BIT(SW_N64_CAPTURE), 0, 0,
+ BIT(SW_N64_R), BIT(SW_N64_ZR), 0, 0,
},
{
0, 0, 0, 0,
BIT(SW_N_X), BIT(SW_N_MINUS), BIT(SW_N_ZR), BIT(SW_N_Y),
BIT(SW_N_LEFT), BIT(SW_N_RIGHT), BIT(SW_N_DOWN), BIT(SW_N_UP),
0, 0, 0, 0,
- BIT(SW_N_B), 0, BIT(SW_N_A), 0,
+ 0, BIT(SW_N_A), BIT(SW_N_B), 0,
BIT(SW_N_PLUS), 0, BIT(SW_N_HOME), BIT(SW_N_CAPTURE),
BIT(SW_N_ZL), BIT(SW_N_L), 0, 0,
BIT(SW_N_LJ), BIT(SW_N_R), 0, 0,
I'm doing two things here: swapping the GameCube destination layout to the conventional Nintendo ABXY setup like on SNES, Switch, etc. and swapping the NSO N64 layout to also use the "SNES-style" B/A layout rather than the Y/B setup it has in the official builds. I'm also swapping the shoulder buttons around so that Z/L are mapped as the left trigger (ZL, L2, LT) and R is mapped as the right trigger (ZR, R2, RT), which makes it more appropriate for "modern" consoles like GameCube and Wii where the trigger buttons are preferred over the bumpers. Since those changes leave you with no way to press the left bumper (L, L1, LB), I assigned that to Capture, since it's a useless button on GameCube/Wii anyway. Lastly, the right bumper (R, R1, RB) is placed on the NSO N64 pad's miniscule ZR button up top. This allows me to use the NSO N64 pad on GameCube games (in particular, N64 re-releases like the Zelda collection discs and Nintendo Puzzle Collection) and Wii games (especially N64 Virtual Console titles) without needing to do any remapping between uses. If you're wanting to use this setup but also support an actual Nintendo 64, you'll need to adjust |
Beta Was this translation helpful? Give feedback.
-
GameCube
The face buttons are fine here, but I think the shoulder buttons could use some work. Currently, it's extremely difficult to press the destination GameCube R-button (it's mapped to the tiny ZR button on the top of the controller):
Instead, I think the shoulder buttons should be mapped like this:
This is just swapping the functionality of the source N64 R/ZR buttons with each other, so that the destination GameCube R-button is easier to press. I know it looks confusing, but Z and R are the equivalent of L and R on the GameCube for most purposes, so even though the shoulder buttons are "uneven" in this setup, it makes sense.
Wii EXT
I think the most common use case for people connecting a Switch Online N64 Controller to the Wii will be to play N64 Virtual Console games. Wii Virtual Console does not allow the user to remap the buttons and uses a different layout to the one in BlueRetro's firmware. You can see an example of the N64 Virtual Console button layout here: https://strategywiki.org/wiki/Super_Mario_64/Controls
The most important thing is that N64 VC expects the A/B face buttons to be mapped letter-for-letter, not B/Y like in BlueRetro. Even though BlueRetro's setup is more accurate to the physical layout of the respective controllers, I think it's worth breaking with that in order to support N64 Virtual Console titles.
However, it's also important to note that two N64 Virtual Console games (Kirby 64: The Crystal Shards and Pokémon Puzzle League) use a different layout where the L-button is preferred over the Z-button. To accommodate both setups, I suggest the following layout in BlueRetro:
Mapping both source N64 buttons Z and L to the Wii Classic L button allows both layouts to work as they did on the original N64, with the Z-button as an action button in 3D games and the L-button as an action button in 2D games. This layout sacrifices the Classic Controller ZL-button entirely. However, in N64 Virtual Console, the ZR-button, which we retain access to, performs the same functionality. If you feel strongly about it, you could do
N64 Capture -> ZL
in order to keep that button.EDIT: All of this assumes that individual controllers can have their mapping changed for individual consoles. The more I look into this, the less sure I am that that's the case. Rather than each controller being mapped appropriately to each target platform, is it rather something more general where each controller is mapped to a sort of hypothetical controller with all possible inputs, which then gets mapped on to the destination controller? So for the Switch Online N64 controller's case, it has a Y button which is classed as the "left face button" on the intermediate controller, which is then mapped to the destination console's "left face button" (B on GameCube, Y on Wii EXT, etc.). This essentially enforces the current "physical mapping-only" setup, because changing the layout to suit one console means changing the layout for all consoles. If that's the case, it does complicate things substantially.
Beta Was this translation helpful? Give feedback.
All reactions