pokered-deaf: disable audio engine, preserve sound trigger IDs#1
Open
1hedu wants to merge 5 commits into
Open
Conversation
Stub all audio entry points (PlayMusic, PlaySound, PlayDefaultMusic, FadeOutAudio, StopAllSounds, WaitForSoundToFinish) so they return immediately. Remove the VBlank audio update block to reclaim ~5-10% of frame time. Disable the APU via rNR52 in Init for total silence. Audio data (audio.asm) and WRAM labels are kept intact to avoid linker errors - they serve as a stable baseline for future mods. https://claude.ai/code/session_01CjEMsJS9aiLy2ZUdpdkwiA
This reverts commit 9bdf9ce.
Remove audio engine processing (UpdateMusic, PlaySound engine calls, FadeOutAudio) while keeping all music/SFX selection logic intact. Sound IDs still flow into wNewSoundID and wLastMusicSoundID so MegaGB link code can read them and forward triggers to the Genesis. - home/audio.asm: PlaySound writes ID to wNewSoundID, skips engine bankswitch. PlayDefaultMusic/PlayMusic selection logic preserved. UpdateMusic6Times stubbed (no engine to tick). - home/vblank.asm: Audio engine tick block removed (~5-10% frame time) - home/fade_audio.asm: FadeOutAudio stubbed (no APU to fade) - home/delay.asm: WaitForSoundToFinish returns immediately (would infinite-loop with no engine clearing channel IDs) - home/init.asm: APU disabled via rNR52, StopAllSounds writes SFX_STOP_ALL_MUSIC to wNewSoundID then returns https://claude.ai/code/session_01CjEMsJS9aiLy2ZUdpdkwiA
Tested both vanilla and deaf builds side-by-side in SameBoy. Intro, Oak, and name selection all render identically. Game progresses normally with silent audio. https://claude.ai/code/session_01CjEMsJS9aiLy2ZUdpdkwiA
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.
Summary
Baseline for MegaGB (SuperGameboy-on-Genesis via link cable). Removes the audio engine processing to free CPU cycles and WRAM, while preserving all sound trigger infrastructure so the GB can still determine which music/SFX to play — the IDs land in
wNewSoundID/wLastMusicSoundIDwhere MegaGB link code can forward them to the Genesis for playback.What's removed (cycle/RAM savings)
Audio1/2/3_UpdateMusic,Music_DoLowHealthAlarm,FadeOutAudiocalls removed (~5-10% frame time)PlaySound— no more ROM bank juggling to callAudio1/2/3_PlaySoundUpdateMusic6Times— stubbed (no engine to tick)WaitForSoundToFinish— returns immediately (would infinite-loop without engine clearing channel IDs)rNR52 = $00inInitWhat's preserved (MegaGB trigger points)
PlayDefaultMusic/PlayDefaultMusicFadeOutCurrent— full map/bike/surf music selection logic intactPlayMusic— writes sound ID + bank to WRAM, falls through toPlaySoundPlaySound— writes the sound ID towNewSoundID(readable by MegaGB link code)PlayBattleMusic— battle music selection (wild/trainer/gym leader/final) intactStopAllSounds— writesSFX_STOP_ALL_MUSICtowNewSoundIDcall PlaySound,call PlayCry,call PlayMusicthroughout the codebase is untouchedFiles changed
home/audio.asmPlaySoundpreserves ID in WRAM, skips engine.UpdateMusic6Timesstubbed. Selection logic kept.home/fade_audio.asmFadeOutAudiostubbedhome/delay.asmWaitForSoundToFinishreturns immediatelyhome/vblank.asmhome/init.asmStopAllSoundswrites stop ID and returnsFreed resources
Test plan
make clean && makebuilds successfully (pokered.gbc + pokeblue.gbc)wNewSoundIDupdates with battle music IDhttps://claude.ai/code/session_01CjEMsJS9aiLy2ZUdpdkwiA