Skip to content

Add constants for the base addresses of all four audio channels #68

@Rangi42

Description

@Rangi42

The four audio channels use registers NRxy, where the channel number x goes from 1 to 4 (as well as 5 for general-purpose audio control), and the register kind y goes from 0 to 4 (as described in Pan Docs). However, not every channel uses all 0-4 "slots". In particular, there is no "NR20" or "NR40".

Despite this, some people have channel-generic audio routines, e.g. "reset all of this channel's registers to 0". It's safe to write to the nonexistent "slots" of some channel, because every channel has all five NRx0-NRx4 addresses reserved for it, even though some are unused.

It would thus be convenient to have "start of channel" address constants:

  • Channel 1 starts at NR10/AUD1SWEEP
  • Channel 2 starts at NR21/AUD2LEN - 1
  • Channel 3 starts at NR30/AUD3ENA
  • Channel 4 starts at NR41/AUD4LEN - 1

To match the AUD3WAVERAM address constant, I propose:

  • def AUD1RAM equ $FF10 ($FF10-$FF14)
  • def AUD2RAM equ $FF15 ($FF15-$FF19)
  • def AUD3RAM equ $FF1A ($FF1A-$FF1E)
  • def AUD4RAM equ $FF1F ($FF1F-$FF23)
  • def AUDRAM_SIZE equ 5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions