summaryrefslogtreecommitdiff
path: root/include/z64audio.h
AgeCommit message (Collapse)Author
2025-06-04Remove "z64" prefix from all headers (#2518)fig02
* z64 - a * z64 - b * z64 - c * z64 - d * z64 - e * z64 - f * z64 - g * z64 - h * z64 - i * z64 - l * z64 - m * z64 - o * z64 - p * z64 - q * z64 - r * z64 - s * z64 - t * z64 - v * restore file * fix merge * fix merge --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2025-04-19Remove Variables.h; Decouple z64.h from global.h (#2507)fig02
* progress * z64.h issues sorted * remove variables.h * format * n64 fix * another fix * did the wrong fix * fix libleo * fix bss * review * remove instead of comment
2025-04-11variables.h cleaning: migrate audio variables (#2504)fig02
* migrate audio variables, fix libultra thing * remove extra newlines * fix * add required pragmas * fix bss * audio table fixes * fix bss
2025-03-27SoundMode -> SoundOutputMode (#2475)fig02
* SoundOutputMode, and move SoundSetting * missed a couple * format * move SoundSetting
2025-02-15Use enums for settings in SRAM header (#2429)cadmic
* Use enums for settings in SRAM header * Fix bss * Uglify z_en_mag to match ique
2025-01-02[iQue] Build some C files with EGCS (#2396)cadmic
2024-09-25[headers] audio functions to z64audio.h and z64ocarina.h (#2223)Dragorn421
* [headers] audio functions to z64audio.h and z64ocarina.h * bss
2024-08-27[Audio 6/?] Build Soundfonts and the Soundfont Table (#2056)Tharo
* [Audio 6/?] Build Soundfonts and the Soundfont Table * Improve lots of error messages * First suggested changes * Make audio build debugging more friendly Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Some fixes from MM review * Make soundfont_table.h generation depend on the samplebank xmls since they are read, report from which soundfont the invalid pointer indirect warning originates from --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2024-08-17[Audio 5/?] Build the Samplebank Table (#2044)Tharo
2024-08-12Add names to all typedef'd structs, unions, and enums (#2028)cadmic
* Add names to all typedef'd structs, unions, and enums * wtf vs code * Use a better regex
2024-01-31Document Audio Thread Commands (#1399)engineer124
* begin docs * cleanup * copy over progress * cleanup * small cleanup * more docs, fill out cmds * small touchup * pan weight ganon comment * fix specId * seqcmd cleanup * format * small cleanup * one more thing * small feedback from MM * partial PR * some PR Suggestions * small adjustments * ticks, seqticks, frames, updates: term cleanup * small fix * PR Review * PR Review * PR Review * rm param * adjust comment * update renamed functions * format --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2023-11-30Documentation for audio_thread_manager.c (#1562)Tharo
* Documentation for audio_thread_manager.c * Fixes * Move AudioTask back to z64audio.h and include in audiomgr.h, adjust bug comment * Adjust AudioMgrDebugLevel enum
2023-02-26Minor Misc Cleanup 2 (#1422)engineer124
* misc cleanup * more cleanup * more cleanup * PR Suggestions * cleanup cond
2022-10-13Fix misc 17 (#1392)Dragorn421
* Some cleanup on bgcheck waterbox y funcs * Fix some typo/spelling * EnFz_ApplyDamage match fixup * Turn another sus construction into a switch * Fixup comment on restoring MS as adult * "doesnt, isnt" -> "doesn't, isn't" * Hunt down whitespace at end of lines * Format (clang-format does not like figs bug comment on bongo cutscene unskip sadge) * Viewport z scale/translation: `0x1FF` -> `G_MAXZ/2` (see proman "9.7 Mixing CPU and SP Addresses", "12.7.6 Depth Source") * static symbols: g -> s prefix * Link young/old -> child/adult * Fixups * Get rid of signed vs unsigned comparison warning by changing room temps to s32 * waterbox search funcs consistency * Revert "waterbox search funcs consistency" This reverts commit 8f386e038f5e735f0f5f1240fc4da7bec4e8c7e2. * `curWaterBox` -> `waterBox`
2022-10-09Document Scene Sequences and Remaining SeqFlags (#1308)engineer124
* Begin scene sequence docs * Better docs * cleanup * Better Docs * cleanup * Move flag * Off -> None * Fix comment * spacing * address pr, spot -> resumePoint * SEQ_IO_VAL_NONE * missed one
2022-10-07rename audio context (#1388)engineer124
2022-10-07Document code_800F9280.c -> audio_seqcmd.c i.e. (Audio_QueueSeqCmd) (#1234)engineer124
* Document SoundSources * PR Suggestions * Duration timers to dec * `PlaySfxByPosAndId` -> `PlaySoundByPosition` * Begin importing docs from MM * Finish cleanup using code from MM * Start documenting commands * First attempt at thorough AudioSeqCmd wrappers * Improve names * Merge branch 'master' into audio_seqCmd fix name to minimize conflicts * Combine macros, implement them through repo * Improve docs * More progress, begin sequence command docs * seqcmd.h * More documentation of seqcmd.h * More docs * cleanup * More cleanup * More docs * VOL_SCALE_INDEX enum * missed enums * More Cleanup * docs * More docs * Add comments about sfxChannelLayout * More cleanup * Even better docs * Add a file description * small touchups * More cleanup of comments * more * More cleanup * More cleanup * Missing space * typos * Audio_SetVolumeScaleNow * More cleanup * Fill in enum * one more cleanup * Capitalize macros * remove AUDIO_ * cleanup * more cleanup * Small Fix * Add a lot of backticks for docs * Restructuring docs * More cleanup * swap channel args, cleanup * Typos * Many suggestions, revert filename * pr suggestions * even more PR * more pr suggestions * pr suggestion
2022-08-28Document the Haas Effect (#1302)engineer124
* Document Haas Effect * More docs * cleanup * add comments * Adjust comment * More cleanup * Fix * Add description of the Haas Effect * roman suggestion
2022-07-27Clean up audio sample counts: bytes, samples, frames (#1289)engineer124
* Clean up bytes, samples, frames * Improve macro usage * More missed macros * rename macro now that it crosses files * redefine macros in terms of frames * Another use of macro * Fix, it's number of samples, not size * Partial PR Suggestions * Small change * size to length * Correct/Clarify comments * remove comment * More PR suggestions, cleanup * Bad formatting, fixed
2022-07-11Introduce Sfx Tables (#1296)engineer124
* sfx tables * return audio sound params * Add docs for tables * REF -> BASE * Fix description * Small fix * Reorder phrase * Return sfx.h * Better docs * Roman PR Suggestions
2022-07-04Introduce Mutebehavior Flags (#1304)engineer124
* Add muteBehavior flags * touchup * Adjust comment
2022-06-24Document File-Select Audio Settings: Sound Modes (#1281)engineer124
* Round 1 * Cleanup * Cleanup * Space * More spacing * Apply -> Set (consistency) * round 1 pr * Revert some names
2022-06-21audio_seqplayer.c cleanup (#1274)engineer124
* Audio Seqplayer Cleanup * More * Edit description * PR Suggestions * while true * Cleanup function declarations * Extra space, oops * Small fix * PR Suggestions * tatums per beat * Edit comment
2022-06-20Synthetic Waves Documentation (#1256)engineer124
* Synthetic wave documentation * Better docs * harmonicIndex * More * typo * Complete the abi buffer docs * Small change * Revert change * PR suggestions * Missed one * PR Feedback * Better documents * Well that was a silly copy-pasta mistake * Typo * Another comment * Plural * Make it more block-like * Capitalization * Add comments for gWaveSamples[8] * Adjust comment * More PR Suggestions * PR Suggestions * missed a phrasing * PR Suggestions * Update include/z64audio.h Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-06-20Introduce Sfx Flags (#1278)engineer124
* Sfx Flags * Discord Discussion * Move macro to sound_params * Oops * PR Suggestions * Clarify comment * Missed switch * More suggestions * Update src/code/audio_sound_params.c Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * sfxs * PR Suggestions * revert back to flag Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-06-19Restructuring SoundFont Structs (#1277)engineer124
* Document fontData relocation * Fix * More cleanup * typo * sample -> sampleHeader * Revert name * Just a little more * Another comment change * Fix Drum * fix * K0BASE * Update relocs * consistency * clearer phrasing * Fix * PR/Discord Suggestions * typo * Revert Sound Font Sample Struct for another PR * Missed a function * Organize structs, tuned samples * New sound effects struct * fix func name * wave samples * consistency * Fix * More suggestions * PR Suggestions * sample bank reloc * Revert header description * better text * SoundFount Relocation: some cleanup (#6) * `fontDataStartAddr` for relocation, `fontData` for reading data (`AudioLoad_RelocateFont`) * Comment "cleanup" in `AudioLoad_RelocateFont` * Comment "cleanup" in `AudioLoad_RelocateSample` * Cleanup cast and compares to 0 (offsets) / NULL (pointers) * Cleanup * soundFont info * Revert waveSamples * cleanup * Plural * PR suggestions * A few name changes and suggestions * small changes * Drop Info on SoundFont * Missed some * One more function change Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-06-15Enable int-conversion warnings and fix all current instances (#1280)Roman971
* Enable int-conversion warnings for gcc/clang * Fix all current int-conversion warnings * Run format.sh * Apply review suggestions
2022-06-12Audio_Init_Params.c Cleanup (#1273)engineer124
* Document Audio Heap Init Sizes * Swap order * Another small change * Another * Plural * swap order * Reverb Settings * Return comment * more cleanup * Fix data names
2022-06-12Document SoundFont Relocation (#1237)engineer124
* Document fontData relocation * Fix * More cleanup * typo * sample -> sampleHeader * Revert name * Just a little more * Another comment change * Fix Drum * fix * K0BASE * Update relocs * consistency * clearer phrasing * Fix * PR/Discord Suggestions * typo * Revert Sound Font Sample Struct for another PR * Missed a function * PR Suggestions * sample bank reloc * Revert header description * better text * SoundFount Relocation: some cleanup (#6) * `fontDataStartAddr` for relocation, `fontData` for reading data (`AudioLoad_RelocateFont`) * Comment "cleanup" in `AudioLoad_RelocateFont` * Comment "cleanup" in `AudioLoad_RelocateSample` * Cleanup cast and compares to 0 (offsets) / NULL (pointers) * Cleanup * Edit comments * phrasing Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-06-04Cleanup NotePlaybackState (#1255)engineer124
* Audio Cleanup * more * missed one * Audio docs imported from MM * Suggestions from Discord * Small fix * Fix sizes in z64audio.h * numSamples * Cleanup comments * Revert overlap with soundFont PR * revert Audio_AdsrUpdate cleanup (move to different PR) * PR Suggestion * Mainly typos * PR suggestion, vol -> volume * Better description * Name sampling frequency * A good number of PR suggestions * Missed a suggestion * More PR Suggestions * Cleanup NotePlaybackState * one more * Add comments for new variable names * Reverb samplePosInt * Missed one * Remove `Always set to 0`
2022-06-03Audio Misc Docs and Cleanup (#1221)engineer124
* Audio Cleanup * more * missed one * Audio docs imported from MM * Suggestions from Discord * Small fix * Fix sizes in z64audio.h * numSamples * Cleanup comments * Revert overlap with soundFont PR * revert Audio_AdsrUpdate cleanup (move to different PR) * PR Suggestion * Mainly typos * PR suggestion, vol -> volume * Better description * Name sampling frequency * A good number of PR suggestions * Missed a suggestion * More PR Suggestions Co-authored-by: fig02 <fig02srl@gmail.com>
2022-05-29Audio Docs: Adsr Decay Rate (#1238)engineer124
* Init adsr decay docs * cleanup * cleanup * Revert some docs * Cleaner docs * count hex to dec * scaled updates per frame * Consistency * Oops, fix meaning * Avoid `decayRate` conflict with reverb `decayRate` * PR suggestion
2022-05-09Audio Ocarina Documentation (#1026)engineer124
* Begin ocarina documentation * Many ocarina-related docs * More ocarina docs * Introduce Ocarina Fonts Enum * Fix ocarina font enum * Fix incorrect documentation, more documentation * Ocarina recording documentation * cleanup * Small touch-ups * Fix font -> instrument * format * Better docs on playback, memory game * more cleanup * Add z64ocarina.h * Clean up names * final cleanup * typo * Fix description * better docs * Fix channel -> channelIdx * Fix old "font" name to correct "instrument" name, add io port docs * Add comments to clarify certain lines/functions * format * Rename noteIdx to pitch * Missed a name * Add comment on pitch * `reset` -> `SetInstrument` and `displayed` -> `playback` * Clarify audio_update and windmill comment * Minor PR fixes * Revert Audio_Update because there are 2 different Audio_Update functions * PR Feedback * Ocarina Idx -> Index * Introduce OCARINA_BTN_C_RIGHT_OR_C_LEFT * PR Suggestions * Next PR Suggestions * Next PR Feedback * consistency * Better docs (PR) * Better comment
2022-04-08Message Queues, Threads, and surroundings cleanup (#1178)Tharo
* message queues, threads, and surroundings cleanup * Format, make the formatter prefer clang-format-11 if found * Fix __osThreadTail type * Q -> Queue, thread defines renamed * Reformat, add missing NULL * Suggested changes and further casting cleanup * Reformat * padmgr name fixes
2021-11-22z_message_PAL, message_data_static and surrounding doc (#996)Tharo
* Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-07Document parts of audio (#1000)zelda2774
* Minor labelling * progress * play percentage -> delay * duration -> gatetime * more * more * more * seqIdx -> playerIdx * more * more * more * more * format * fix comment * filters * more * media * confusion * Sync load is actually slow load * AudioHeap prefix * more * more * reformat * more * more * AudioLoad * more * more * seq banks * more consistent * more * name last function in audio_load * More audio_synthesis * clean up audio tables * minor * slow/fast load ramAddr * format * remove unused * Remove union * remove padding * audio bank -> sound font * seqLayer -> layer * stuff * seqChannel -> channel * ChannelLayer -> Layer * remove define, add bug comment * format * more * cache enum * more * AudioSeq function prefix * naming * bankIdx -> bankId * more * format * review * more * fixes * avoid hardcoded sfxid's * SE -> Sfx Co-authored-by: zelda2774 <zelda2774@invalid>
2021-09-15Fix all headers to comply with C standard (#957)louist103
* Fix all headers to comply with C standard * fix a file in libultra * Update include/stdbool.h Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update stdbool.h * Update z64animation.h Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2021-09-07audio_load OK (#948)zelda2774
* Match func_800DDB64 * Match func_800DC910 * remove stack comments * Move nop padding to ucode_disas * Partially label audio_synthesis To some extent copied from sm64. * cleanup * Reverb and ReverbBits have nothing to do with reverbs * review * naming * Revert "reduce diff" This reverts commit cd4ac24d8809f3f8e5b0f91788bffd72b47d15af. * Match func_800E283C * Audio_DmaSampleData * Warning fixes * func_800E4198 * func_800E4918 * Fix compiler warnings in z_camera/db_camera * cleanup * terminology * tiny bit of doc * undo permuter_settings change * Revert "Fix compiler warnings in z_camera/db_camera" This reverts commit dfdfac47f2bb972056eb70b4f1ffb4df907166a0. * review Co-authored-by: zelda2774 <zelda2774@invalid>
2021-09-07code_800F9280 OK (#945)zelda2774
* Match func_800F9280 * Match func_800FA3DC * Audio_ProcessSeqCmd * macro cleanup * review Co-authored-by: zelda2774 <zelda2774@invalid>
2021-09-01code_800EC960 OK + data migrated (#937)zelda2774
* Match AudioDebug_ProcessInput_SEFlagSwap * Data migration * Migrate in-function statics for func_800EE824 * More data migration * Migrate in-function static for func_800F510C * Last bit of migration * formatting * naming fix * Prune variables.h Co-authored-by: zelda2774 <zelda2774@invalid>
2021-08-31audio_synthesis OK + partially documented (#920)zelda2774
* Match func_800DDB64 * Match func_800DC910 * remove stack comments * Move nop padding to ucode_disas * Partially label audio_synthesis To some extent copied from sm64. * cleanup * Reverb and ReverbBits have nothing to do with reverbs * review * naming * Undo changes to permuter_settings.toml Co-authored-by: zelda2774 <zelda2774@invalid>
2021-08-31Match Audio_ProcessSoundRequest (#935)zelda2774
Co-authored-by: zelda2774 <zelda2774@invalid>
2021-08-29Match func_800E4590 (#922)zelda2774
Co-authored-by: zelda2774 <zelda2774@invalid>
2021-08-29Match func_800EEA50 + some surrounding doc (#916)zelda2774
* Match func_800EEA50 * Document some audio debug stuff * more doc * more doc * formatting * Fix enums, and some more bits of doc * review * LIM -> MAX * missed review suggestion... * more review * ganon comments * more review * 🐍☠️ * more review * Update functions.h * quotes * review Co-authored-by: zelda2774 <zelda2774@invalid>
2021-08-12Match some audio functions (#896)zelda2774
* cleanups * Improve Audio_SequencePlayerProcessSequence * cleanup * labeling * progress on func_800E5000 * func_800F6268 * func_800ECDF8 * Improve func_800F2464 * reorder variables * labelling * non-equivalent func_800EEA50 * minor doc * func_800E6590 * minor doc * Reformat abi.h * Very slight improvements * func_800DC384 * func_800E1618 * formatting Co-authored-by: zelda2774 <zelda2774@invalid>
2021-07-27Audio WIP (#836)krimtonz
* being code_800EC960 * wip * wip * more audio progress * migrate data in code_800E11F0 * wip * make ok * remove asm * wip * move some variables outside of gAudioContext to the AudioContext structure due to the size used in func_800E3094 * more progress * wip * wip * split code_800E11F0 * migrate rodata in code_800E11F0 * match functions that couldn't because of data issues * move code_800E4FE0 asm files * wip * more wip * fix global functions, and forward declarations * wip * wip * wip * ocarina wip * match a couple functions * some progress * separate some bss * match func_800EDA3C * some matching * more matches * migrate audio rodata * some matches * more matchess * start on synthesis * work on synthesis * fix function declaration * Merge branch 'master' into audio * match a few more functions * wip * wip * more matching, rename Audio_SetBGM to Audio_QueueSeqCmd * name several audio functions, and audiocontext members * more naming, rename code_800E11F0 to audio_load, code_800DAAC0 to audio_synthesis * audio wip * match a few more functions. * wip * add missing NON_MATCHING directive * wip * some matching, data reogranization * match cursed function * wip * wip * formatting * remove prefix from struct memebers * missed function rename * review Co-authored-by: fig02 <fig02srl@gmail.com>
2021-04-12Add near-matching decomped functions for SeqPlayer (#729)MNGoldenEagle
* Add nearmatching decomped functions * improved match * greatly improved match * small thing * almost matching * small cleanup * remove commented array * pad -> unk Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Fig02 <fig02srl@gmail.com>
2021-03-27Finished decomp of code_800F7260 (1 non-matching) (#733)petrie911
* improved match * decomped * I dunno * matched Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2020-11-16Fix prototype for Audio_PlaySoundGeneral and fix related types in structs (#481)Tharo
2020-10-26code_800F7260 (#433)Tharo
* Split code_800F7260 * More function splits, migrate rodata * Initial progress * Small progress * More substantial progress, finally figured out structs * 2 functions left * Move prototypes to functions.h * Remove unused asm, move most externs to variables.h * Fix merge * Ran formatter * Brackets to avoid && & Co-authored-by: krimtonz <33664508+krimtonz@users.noreply.github.com> * More variables to variables.h * Braces around early return Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * ARRAY_COUNT in sBankSizes and remove unnecessary temp vars Co-authored-by: krimtonz <33664508+krimtonz@users.noreply.github.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>