Repository navigation
Rachael's sound through the ports and her SPC700 - #105
Merged
Merged
Conversation
The library's DSP writes go through the ports to the kit's forwarding driver on Rachael's SPC700, which writes her DSP, as on the SNES. The SPC700 and the DSP run together, 32 cycles a sample; what they make while the library waits for the driver is played by the next frame, and of a long wait more than 2,048 samples are skipped. A driver that hangs or reads the boot ROM fails the desktop's check. In a game with songs she runs the forwarding driver too, since her DSP does not play yet what Krautrecker's driver writes; the roadmap moves Krautrecker's driver on Rachael after the DSP's step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
skerkewitz
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This is step 2 of "Krautrecker's songs on the desktop and the web". The library on Rachael now talks to her sound CPU through the four ports, as on the SNES. A driver runs on her SPC700 (from #104) and writes her DSP; before, the library wrote the DSP itself.
One change from the roadmap: the driver is the kit's forwarding driver in every game, including games with Krautrecker songs. In dampf's emulator, Sprite Run's driver sets ADSR envelopes (ADSR1
$CF), echo (EDL 3) and looped samples, none of which Rachael's DSP plays yet. Running Krautrecker's driver on her now would fail the desktop check of both music projects onunheard. So it moves after the DSP step and becomes step 4. The roadmap says so.How
lib/rachael/apu.c): the SPC700 and the DSP run together, 32 SPC700 cycles per sample (sdevkit__sound_render), so a driver's write lands on the sample it would on the SNES. The desktop frontend takes each tick's samples there instead of fromsdevkit__dsp_render.sdevkit__apu_wait), the APU runs on, and the samples it makes are played first in the next frame. Beyond 2,048 samples they're skipped, as during a song's load: the desktop doesn't stand still for it the way the SNES does.lib/rachael/sfx.c):$0200and the backend waits for$5D.sfx_dspis now an exchange through the ports, as on the SNES.$0200in place of Krautrecker's, after thearamhash took what the SNES uploads. The writes Rachael makes for the effects in that case (unmute, DIR at PLAY) also go through it; they aren't logged, since the SNES doesn't send them.lib/sound/sfx_voices.h: the music driver state is set before the jump, so the backend knows what it starts. On the SNES this moves two stores; no worst case changed.ppu.cresets the APU with the sound. The C tests that link Rachael's files now listapu.candspc700.c.Verified
./gradlew build: 1300 tests, 0 failed.ExamplesTestchecks thatsound.txtis still the same on the emulator and the desktop for every example.backend-output.txtis re-recorded: hashes only,cost-baseline.txtunchanged.Desktop checks: steinschlag, schach, music and hello all pass, with
unheard 0and no hangs.The effects sound as before. I compared each example's
--wavoutput with the same run on develop:The shift is the driver's exchanges: an effect starts after them, as on the SNES, where it used to start at once.
dampf's output and the SNES are unchanged apart from the two stores, so I didn't run the benchmark.
What follows
docs/game-findings.md.docs/sound.md(On Rachael),docs/roadmap.md(step 2 built, Krautrecker's driver as step 4, the gallery as step 5).Open
Step 3, the rest of Rachael's DSP (ADSR, GAIN's modes, loops, noise, pitch modulation, echo), then step 4, Krautrecker's driver on her.
🤖 Generated with Claude Code