Skip to content

Decomp snd_bank - #194

Merged
roengstrom merged 7 commits into
mainfrom
sound-snd-bank
Oct 29, 2026
Merged

roengstrom merged 7 commits into
mainfrom
sound-snd-bank

Conversation

@roengstrom

Copy link
Copy Markdown
Owner

Another big one, and again just getting it in so I can start the cleanup of the sound engine once it's all in

@decomp-dev

decomp-dev Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Report for SLUS_008.92 (b9e5996 - b7c1caf)

📈 Matched code: 69.35% (+0.64%, +9628 bytes)

✅ 30 new matches
Unit Item Bytes Before After
src/snd_bank func_80017DB0 +936 0.00% 100.00%
src/snd_bank func_800174E4 +924 0.00% 100.00%
src/snd_bank func_8001708C +900 0.00% 100.00%
src/snd_bank func_80017AAC +496 0.00% 100.00%
src/snd_bank func_80018438 +472 0.00% 100.00%
src/snd_bank func_80017880 +428 0.00% 100.00%
src/snd_bank func_8001966C +392 0.00% 100.00%
src/snd_bank func_80018F34 +384 0.00% 100.00%
src/snd_bank func_800192D8 +376 0.00% 100.00%
src/snd_bank func_80018908 +364 0.00% 100.00%
src/snd_bank func_80018784 +304 0.00% 100.00%
src/snd_bank func_80018234 +292 0.00% 100.00%
src/snd_bank func_80018B28 +288 0.00% 100.00%
src/snd_bank func_80018C48 +248 0.00% 100.00%
src/snd_bank func_80018E4C +232 0.00% 100.00%
src/snd_bank func_80016E5C +224 0.00% 100.00%
src/snd_bank func_80018358 +224 0.00% 100.00%
src/snd_bank func_800191F8 +224 0.00% 100.00%
src/snd_bank func_8001958C +224 0.00% 100.00%
src/snd_bank func_80017410 +212 0.00% 100.00%
src/snd_bank func_8001984C +204 0.00% 100.00%
src/snd_bank func_80019130 +200 0.00% 100.00%
src/snd_bank func_800194C8 +196 0.00% 100.00%
src/snd_bank func_80018A74 +180 0.00% 100.00%
src/snd_bank func_80018158 +124 0.00% 100.00%
src/snd_bank func_800190B4 +124 0.00% 100.00%
src/snd_bank func_80017C9C +120 0.00% 100.00%
src/snd_bank func_80019450 +120 0.00% 100.00%
src/snd_bank func_80018DDC +112 0.00% 100.00%
src/snd_bank func_80018D74 +104 0.00% 100.00%

func_8001A1E8_data moves from snd_param.c to sound.h with the fields snd_bank.c reads, and the music config's unk2C and unk30 point into the sequence data.
The sequence setup functions (func_8001708C, func_80017410, func_800174E4, func_80017DB0) and their helpers. sndBuildVoiceMask now takes the track array, and the sound command block's word is passed to func_8001708C as a pointer. Two loops count down because no ascending form matches, and func_80017AAC keeps a no-op continue for the match; comments say so.
Sound command handlers from the command table. func_80018908 keeps a do-while that does nothing at run time, and a loop that counts down because no ascending form matches; comments say both are needed for the match.
The rest of the sound command handlers in snd_bank.c.

@dargor123 dargor123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a change request, but I approve since you said that will clean up later

Comment thread src/snd_bank.c
sndTrackApplyInstrument(track, 0);
} else {
if (tracks & bit) {
if (!(bit & mask)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these ifs could be combined into a single one

@roengstrom
roengstrom merged commit eca60c0 into main Oct 29, 2026
1 check passed
@roengstrom
roengstrom deleted the sound-snd-bank branch October 29, 2026 22:56
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.

2 participants