Description
The PADF_*
and PADB_*
constants have been around for a long time, but they don't describe any hardware at all. Their values represent the bitfields of the synthetic joypad value computed by some games after reading both lines of inputs and packing them into a single value; they represent convention, not hardware, and as such, they don't belong here. (This is not a statement about their utility: regardless of their value, it's a fact that there's nothing at all in the GB/GBC hardware representing the "down" D-pad button by the value $80.)
The correct values for the F series of constants for the right, left, up and down buttons are respectively 1, 2, 4 and 8, not their current values of $10, $20, $40 and $80. (The B series should be likewise adjusted.) These values overlap with the respective values for A, B, select and start: those bits also overlap in hardware, and thus the correct hardware constants should have the same values. However, changing the values of the defined constants would represent a silent incompatible change, which would be undoubtedly undesirable.
Therefore, my proposal is:
- Create new constants for the inputs with the correct values and different names, so they don't collide with current constants. (For instance,
INPUTF_SELECT
andINPUTF_UP
, both equal to 4.) - Announce the current constants as deprecated.
- Remove the current constants in the next major version.
Any thoughts?
Activity