Ill take note of this if i do other things that need it. right now just kind of tinkering around as i am having a problem getting a version to run with NTR Mode 3 properly as it just kinda stops after swapping into NTR Mode 3.
Unfortunately, I don't know how much help I can offer for Mode 3 since I don't have an O3DS. If you have any success, let me know!
EDIT4: Just for reference, this is what I thought should work. It does literally nothing on the 3DS, though, and I have zero idea of where I'm going wrong.
ldr r3, =0x1
ldr r4, =0x401
bl .single
ldr r3, =0x2
ldr r4, =0x3
bl .single
ldr r3, =0x400
ldr r4, =0xC00
bl .single
ldr r3, =0x800
ldr r4, =0x802
bl .single
The values in r3 are the physical buttons pressed with the finger, "buttons [which] will activate the remapping", and the values in r4 are "the buttons that will be used to activate the remap, and the buttons you want activated by the remap." I'm completely lost as to how I'm not following the instructions as written, but I'm pretty clearly out of my depth.
For feeling out of your depth, you actually have a pretty good handle on things. This should be the correct mapping, and I also get no results when running it on my 3DS. I'll look into this more tomorrow. (While writing this post, I may have found the issue. I won't be able to test it until tomorrow)
And what the hell, for completeness, this is what I think the button values are, since I had to calculate them manually (no Java on this machine), I believe [incorrectly?] that these are the values:
These values are correct, but the hex form is more useful to us.
For a combo swap (e.g. L+B=R), this mask would require the L, B, and R fields to be active (a mask of 0x302), while the button mask would just be the L and R fields (a mask of 0x300).
For that matter, the last instruction there doesn't make any sense to me at all. If the button mask is supposed to be the buttons required to activate the remap, why would it be L+R? The combo is L+B to trigger R in that example, so shouldn't the button mask be L+B?
Um...wow, yeah. Thanks for catching that; I feel pretty stupid now. I'll update the original post.
I'm really not able to wrap my head about the button and XOR masks at all. [...] I'm trying to rotate multiple buttons, and that doesn't seem to be covered in the documentation.
I'll also review and revise the instructions to make sure it's a bit easier to understand. You're right that it's not covered in the current documentation; I guess it just made sense in my head what the documentation says.
For clarity right now though, 1:1 "swap" isn't the right terminology; it should be 1:1
map instead. What I meant by that is that one button would be mapped to another. This could be a swap where each button presses the other (e.g. A presses B, B presses A), or a map (e.g. A presses B, but B also presses B) depending on the masks. The button mask would be the button(s) that trigger it. In the case of an A/B swap, the button mask would indicate either can be pressed (0x3), and the XOR mask would indicate that both values should be switched (0x3 as well).
This is how it works: if you press A, your raw data would be 111111111110. We only care about 2 of these values in this case: A and B. We use our button mask to get the values we want. That mask is 0x3, or 11 in binary. We AND the raw data with 11, and we get our important values.
Code:
111111111110
& 11
------------
10
Now we can see if the buttons we want were pressed. In the .single function, we do this by checking to see if our specific values (10) do not match our button mask (11). If they do match, it means neither button was pressed.
Our XOR mask is used to perform an xor function on this data when the button mask matches. The XOR operation can be thought of as one or the other, but not both. So, our xor mask is 11 in binary. When we apply that to our data, we get this:
Since our B button was not pressed (the 1 in 10), we get the "not both" part of the XOR (0). Since A was pressed, we get "one or the other", resulting in 01 (B pressed, not A).
I hope this helps to clarify about how the masks are used. Let me know if I just made things more confusing.