Repository navigation
Sound effects take the top voices, 8 - n to 7 - #93
Merged
Merged
Conversation
A song of Krautrecker leaves the voices from the top to the effects (reservedSfxVoices: 7, then 6, ...), and music will play on its driver (ADR-6FYT4Z4T). sfx_voice now looks at voices 8 - n to 7 instead of 0 to n - 1; the BRR Lab chooses and shows the same voices. The worst case of sfx_voice rises from 10970 to 11302 master cycles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
🤖 Merged develop at 03b5a9d (#94 and #95) Problem: CI failed on this pull request because of the random loop program with seed 20786007, a miscompile already on |
skerkewitz
approved these changes
Nov 29, 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
Sound effects now play on the top voices: with
"voices": ninsfx.jsonthey take voices 8 − n to 7, not 0 to n − 1. Krautrecker reserves the voices from the top for sound effects (reservedSfxVoices: 7, then 6 and so on). Music will play on Krautrecker's driver, as the record on the music driver (ADR-6FYT4Z4T) decides, so the effects have to sit where a song leaves them room.How
lib/sound/sfx_voices.h:sfx_voicelooks for a free voice, and else for the one to replace, among voices8 - nto 7. The rules are unchanged: a free voice first, then the lowest priority not above the new effect, the older of equal ones. The SNES and Rachael share this C, so both move together.tools/brr_lab.html: the Lab's pads choose and show the same voices. With one voice the view says "voice 7".tools/lab_test/brr_lab.spec.js: the voice test expects voice 7.docs/sound.md: thevoicesrow and the paragraph on how a voice is chosen.backend-output.txtandcost-baseline.txt, updated with-PbackendOutput=update. Only the library's code changed.I first tried scanning from 7 downwards (
v = 7 - i). That cost 12,666 master cycles at worst, so the loop counts up from8 - ninstead.Verified
./gradlew build: 1,269 tests. 1 failed:RandomProgramTestseed 20786007, which also fails ondevelopat 165ecf1 (see Open). 13 skipped.ExamplesTest: all 9 examples pass, so the emulator's and the desktop's sound logs agree.BrrLabTestskips here without Playwright, so I installed it and ran them intools/lab_test.dev/compare_example.sh(Mesen against the desktop):What follows
sfx_voicerises from 10,970 to 11,302 master cycles (+332, 3 %), for the start of the loop. Nothing else changes.StyleGuideTestrules: unchanged.docs/game-findings.md.docs/sound.md.Open
The CI build will probably fail on the random program test, just as it fails on
develop: its seed follows the day, and today's seed 20786007 finds a miscompile that is already there. dampf givesa3[1].xanda3[44].xas 0 where gcc gives 1. That needs a fix of its own in a separate pull request, before this one can merge green.🤖 Generated with Claude Code