Skip to content

NES: FDS Accuracy Improvements#133

Open
TakuikaNinja wants to merge 11 commits into
nesdev-org:masterfrom
TakuikaNinja:FDS-Registers-Redo
Open

NES: FDS Accuracy Improvements#133
TakuikaNinja wants to merge 11 commits into
nesdev-org:masterfrom
TakuikaNinja:FDS-Registers-Redo

Conversation

@TakuikaNinja
Copy link
Copy Markdown

@TakuikaNinja TakuikaNinja commented May 21, 2026

This is a redo of #85 which avoids changing the current audio implementation.

Working

  • $4023.D0 only affects writable disk registers, forces certain values for $4025 and $4026
  • $4023.D1 only directly affects $4080 (volume envelope), $4085 (mod counter), and $4088 (mod table write), apply instant volume mute for now
  • External connector: Mask $4026 writes to 7 bits, and force bit 7 = 1 for $4033 reads (i.e. always return good battery/power status)
  • $4030 reads do not clear byte transfer flag/disk IRQs
  • Move byte transfer flag to $4030.D7 (eventually needed by Tonkachi Editor)
  • $4090-$4097 reads (debug audio registers), handled by manually calculating the necessary values this time
  • Add remaining registers to register view
  • Fix off-by-one in envelope timer init

Not addressing

  • Register peeking
  • Actual audio reset state when $4023.D1 = 0 (research ongoing) + rename _soundRegEnabled to reflect its purpose
  • $4095 upper nybble
  • DRAM refresh watchdog ($4030.D1)
  • CRC handling ($4025.D4 & D6)
  • End of head behaviour ($4030.D6)
  • Byte transfer flag behaviour ($4030.D7)
  • Wavetable volume/modulation accuracy improvements
  • Non-linear DAC + volume PWM + filtering (probably not worth the performance hit for a minuscule audio improvement)

Test programs

Passes latest FDS-Mirroring-Test
Disk registers behave closer to hardware in FDS-4023-Test
$4023.D0 = 0 forces output to $7F
Always return good battery status in $4033.D7
Eventually needed by Tonkachi Editor, though it still fails to access disks for editing
Clarify external connector implementation
Clarify comment for $4024 IRQ handling
Move $4025 IRQ handling into SetFdsControlReg()
Allows audio to play properly in FDS-Audio-Registers
@TakuikaNinja
Copy link
Copy Markdown
Author

Here's how the register view currently looks:
image
image

@TakuikaNinja TakuikaNinja marked this pull request as ready for review May 21, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant