Repository navigation
Krautrecker's driver on Rachael's SPC700 (step 4) - #107
Open
skerkewitz-agent[bot] wants to merge 1 commit into
Open
skerkewitz-agent[bot] wants to merge 1 commit into
skerkewitz-agent[bot] wants to merge 1 commit into
Conversation
In a game with songs Rachael now runs Krautrecker's driver, as the SNES does, in place of the kit's forwarding driver: the song plays on the desktop and the web, the effects pass through the driver, and the commands and the LOAD go through the ports, three bytes an exchange. The two hooks only Rachael needed (snd_driver_started, snd_played) are gone from sfx_voices.h. RachaelDriverTest starts the song of examples/music through lib/rachael/sfx.c and compares every DSP write of her SPC700, with the driver's tick, against a recording of Mesen (rachael/sprite_run-mesen.txt, dev/record_mesen_dsp.sh from the song's .spc): 15,189 writes in 3,112 ticks, the loop back included, all the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Step 4 of "the desktop plays Krautrecker's songs by running its driver" (ADR-6G3QXFJ0): in a game with songs, Rachael now runs Krautrecker's driver on her SPC700, as the SNES does. Until now she ran the kit's forwarding driver there. The songs now play on the desktop and the web, and the effects pass through Krautrecker's driver as on the SNES.
How
lib/rachael/sfx.c: the driver uploaded by the game stays at $0200 (no more swap for the forwarding driver). Commands go through the ports with their argument on ports 2-3, and a LOAD's bytes go three per exchange, aslib/snes/sfx.csends them. Thesound.txtlines are still taken on the CPU side, so the checks compare the same thing as before.lib/sound/sfx_voices.h,lib/snes/sfx.c:snd_driver_startedandsnd_playedare gone. They existed only so that Rachael could imitate the driver, and on the SNES they were empty.lib/rachael/apu.c: an optional hook on her SPC700's DSP writes (dsp_written, null unless a test sets it).RachaelDriverTestcompilesrachael/driver_run.cwith the library's ownsfx.cand starts the song ofexamples/musicthe way a game does:sdevkit_music_init, thensdevkit_music_play, which uploads, LOADs and PLAYs through the ports. It logs every DSP write from the PLAY on, together with the driver's tick, and compares the log with a recording of Mesen (rachael/sprite_run-mesen.txt)..spc, which is how Krautrecker's own Mesen check works. Sodev/record_mesen_dsp.shtakes the song's full export (withsong.spc), plays it in Mesen withdev/mesen_dsp.luato 40 ticks past the end, and writes "tick reg value" lines. The recording is checked in (163 KB), so the test runs in every build, in CI too, without Mesen.Verified
RachaelDriverTest: 15,189 DSP writes in 3,112 ticks of the driver, the loop back included, the same as Mesen's, each in the same tick. A write changed by hand in the recording fails the test, which names it ("write 4997 of 15189: 1152 32 a7 here, 1152 32 ff in Mesen")..spcdirectly on Rachael's APU: identical to Mesen too../gradlew build: 1,302 tests, 0 failed, 5 skipped. BackendOutputTest was re-recorded (hashes, and the two removed functions in the cost baseline).dev/compare_example.sh music: Mesen and the desktop give the same pictures, 300 ticks of the same checksums, and the same 33 lines ofsound.txt.examples/musichas the song: it is silent from the stop at tick 139 to the next start at 200, ascheck.txtpresses.What follows
snd_driver_started,snd_played, 42 cycles each in the cost baseline); nothing else changes.StyleGuideTestrules: unchanged.docs/game-findings.md.docs/sound.md(On Rachael, The checks, Music, Not built),docs/testing.md,docs/roadmap.md(step 4 built),lib/README.md,lib/SNES_HARDWARE.md,examples/music/README.md, and the comments insnes.h,main.c,rachael.h,music.c.reference/console-api.md(fromsnes.h), and the music part ofguide/graphics-and-sound.md, which was already out of date since the zips came in.Open
.spc. Krautrecker writes the full export ("Export for SNES").examples/musicin the site's gallery, comes next.🤖 Generated with Claude Code