Skip to content

The sound check records what the CPU sends to the sound CPU - #99

Merged
skerkewitz-agent[bot] merged 1 commit into
developfrom
sound-check-cpu
Nov 30, 2026
Merged

skerkewitz-agent[bot] merged 1 commit into
developfrom
sound-check-cpu

Conversation

@skerkewitz-agent

Copy link
Copy Markdown
Contributor

What

sound.txt, which the checks compare between dampf's emulator, the desktop and Mesen, now records what the 65816 sends to the sound CPU instead of the DSP writes the SPC700 makes. This prepares the ground for SNES music: Krautrecker's driver writes the DSP on its own timer, and Rachael doesn't run it, so only the CPU's side can match on all three. You chose this option when we planned the music.

The decision is a new record: the sound check compares what the CPU sends to the sound CPU (ADR-6G3E49C5). It amends the record on sound effects (ADR-6F60ZC7C) and the one on the Krautrecker driver (ADR-6FYT4Z4T). It also records your other decision: for now the desktop plays nothing for a Krautrecker song.

How

The file format stays the same: aram H after game_init, then init/tick, register, value. Only where the lines come from changes:

  • aram H is the FNV-1a of the bytes the CPU sent through the boot code (to $0200 and up), with their addresses.
  • One line for every message to the running driver whose port 1 is below $80, a DSP write the driver passes on: port 1 is the register, port 2 the value. The forwarding driver and Krautrecker's driver both read such a message this way. The commands of Krautrecker's driver ($80 and up) will get lines of their own with the music.

Where each side takes them:

  • dampf's emulator: Apu.onMessage reports every port-0 write after the jump. The upload hash comes only from the boot code's decoding, no longer from the SPC700's writes. onDspWrite is gone.
  • Mesen (dev/example_check.lua): decodes the boot protocol itself from the CPU's writes to $2140-$2143, the same rules as Apu. It no longer hooks the SPC700.
  • The desktop: Rachael's sfx_dsp calls the log where the CPU hands the write over, no longer sdevkit__dsp_write.

Verified

  • ./gradlew build: 1280 tests, 0 failed. ExamplesTest compares the emulator's sound.txt with the desktop's for all nine examples.
  • dev/compare_example.sh against Mesen:
    • steinschlag: 780 sound lines the same;
    • schach: 1052 lines;
    • hello: 1 line.
    • All three examples also had the same checksums and screenshots.

What follows

  • What sound.txt checks: the check no longer sees what the SPC700 does with the messages. dampf's SPC700 is checked against SingleStepTests (A complete SPC700 in dampf's emulator, with its timers and I/O registers #97), and Krautrecker checks its driver against Mesen.
  • dampf's generated code is unchanged (no compiler change), and so are the C guide and its rules.
  • The game: nothing changes, and today's sound.txt files keep their contents. No entry in docs/game-findings.md.
  • Documents changed:
    • docs/sound.md, "The checks". It also mentioned the old, incomplete SPC700, which is now fixed.
    • docs/testing.md, dev/README.md, lib/README.md, and the comments in the check scripts and lib/desktop/main.c.
  • The book: the desktop page names sound.txt without describing its lines, so nothing goes stale.

🤖 Generated with Claude Code

…49C5)

sound.txt no longer lists the DSP writes the SPC700 makes, but the messages
the 65816 sends: the bytes uploaded through the boot code ("aram H") and
every message to the driver with port 1 below $80, a DSP write it passes on.
Krautrecker's driver writes the DSP on its own timer, which Rachael does
not run, so only the CPU's side can match on all three.

dampf's emulator reports the messages from Apu.cpuWrite and hashes only
the CPU's uploads; Mesen's script decodes the boot protocol from the CPU's
writes to $2140-$2143; Rachael logs in sfx_dsp, not in her DSP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@skerkewitz-agent
skerkewitz-agent Bot merged commit a69e64f into develop Nov 30, 2026
1 check passed
@skerkewitz-agent
skerkewitz-agent Bot deleted the sound-check-cpu branch November 30, 2026 16:33
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