Skip to content

Add individual bit/flag constants for audio registers #55

@Rangi42

Description

@Rangi42

Version 2.8 (0b46188) added bit/flag constants for the audio register aliases, but did so in an unusual way: since many audio registers are basically the same but for different channels, it reused constants.

  • AUDLENF_DUTY applies to AUD1LEN (NR11) and AUD2LEN (NR21)
    • (...but not AUD3LEN (NR31) or AUD4LEN (NR41)!)
  • AUDLENF_TIMER applies to AUD1LEN (NR11), AUD2LEN (NR21), and AUD4LEN (NR41)
    • (...but not AUD3LEN (NR31)!)
  • AUDENV_* apply to AUD1ENV (NR12), AUD2ENV (NR22), and AUD4ENV (NR42)
    • (there is no AUD3ENV!)
  • AUDHIGH_* apply to AUD1HIGH (NR14), AUD2HIGH (NR24), and AUD3HIGH (NR34)
    • (there is no AUD4HIGH!)

I find this harder to keep track of than just having "redundant" bit/flag constants named after each individual register. It's too easy to mistake that e.g. AUDLENF_DUTY would apply to AUD3LEN based on the name, or wonder why AUD3ENV is missing.

Also, we provide separate bit/flag constants for rIF and rIE, even though they both have the same correspondence of interrupts to bits.

I'd like to define individual constants, and deprecate (but still define) these.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions