Slightly incorrect.
The template for the code is:
9XXXXXXX ZZZZYYYY : 16 bit "Is Equal To" conditional instruction.
XXXXXXX is the address to look at, YYYY is the value to check against, and ZZZZ is a mask. I'll get to that.
Each of the 16 bits at 0x04000130 represents one button. All of the values are 1 by default, and are changed to 0 as long as the button is pressed.
The value for YYYY should always be 0, and the mask singles out specific bits to look at so that the other bits don't affect the value. All the bits that are 1 in the mask "cover up" the real bits in the value and make them look like 0s, while the 0s are like holes in the mask that let the real value through.
FEFF in Binary is 1111 1110 1111 1111
FDFF in Binary is 1111 1101 1111 1111
This means bit 9 refers to the R button, and bit 8 to the L button. In order to make a code that only activates when both are pressed, you need to combine the masks to make:
1111 1100 1111 1111, which is FCFF.
By setting bits in the YYYY value equal to one, you can make codes that activate when a button is pressed as long as another button is not pressed at the same time. For example:
94000130 FCFF0100
(Binary for 0100 is 0000 0001 0000 0000)
This makes a code that will activate when R is pressed and L is not pressed. Try it by holding L, pressing R, then releasing L. The code won't activate that way. This happens because:
1) When neither button is pressed, the masked value is 0300.
2) When L is pressed, the masked value is 0200.
3) When R is pressed while L is held, the masked value is 0000. Since this isn't equal to 0100, it won't trigger the code.
---------- Post added at 03:06 PM ---------- Previous post was at 03:06 PM ----------
They go before the value.