Various hardware registers combine multiple meaningful values. For example, AUD1LEN and AUD2LEN (NR11 and NR21) combine the wave pattern in bits 6-7 and the sound length in bits 0-6; or AUD1SWEEP (NR10) combines the sweep time in bits 4-6, the sweep direction in bit 3, and the sweep shift in bits 0-2.
It would be convenient to have mask constants to do and a, <FOO>MASK to isolate these values.
However, the only such constant so far is OAMF_PALMASK EQU %00000111. I'd like to have more, such as AUDLEN_LENMASK EQU %0011111, AUD1SWEEP_TIMEMASK EQU %01110000, etc.
Various hardware registers combine multiple meaningful values. For example,
AUD1LENandAUD2LEN(NR11andNR21) combine the wave pattern in bits 6-7 and the sound length in bits 0-6; orAUD1SWEEP(NR10) combines the sweep time in bits 4-6, the sweep direction in bit 3, and the sweep shift in bits 0-2.It would be convenient to have mask constants to do
and a, <FOO>MASKto isolate these values.However, the only such constant so far is
OAMF_PALMASK EQU %00000111. I'd like to have more, such asAUDLEN_LENMASK EQU %0011111,AUD1SWEEP_TIMEMASK EQU %01110000, etc.