Skip to content

audio naming done#1236

Merged
ethteck merged 22 commits intopmret:mainfrom
z64a:audio
Jun 15, 2025
Merged

audio naming done#1236
ethteck merged 22 commits intopmret:mainfrom
z64a:audio

Conversation

@z64a
Copy link
Copy Markdown
Collaborator

@z64a z64a commented May 24, 2025

All audio source files, functions, and data are named and partially documented.

@ethteck ethteck requested a review from Copilot May 28, 2025 11:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The PR standardizes and clarifies audio subsystem naming, replaces magic values with named constants, and prunes legacy declarations.

  • Renamed sfx and snd functions/macros for consistent sfx_ and snd_ prefixes, and replaced hard-coded masks/limits with named macros.
  • Updated public/private headers to expose the new API surface and removed obsolete stubs.
  • Improved code comments and removed some outdated logic comments.

Reviewed Changes

Copilot reviewed 585 out of 585 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/audio/sfx_control.c Refactored special-sound detection and renamed related functions.
src/audio/public.h Added new API declarations; removed old stubs.
src/audio/core/reverb.c Renamed reverb helper functions; simplified buffer swap macro.
src/audio/mseq_player.c Renamed ambient functions to mseq; updated fade calculations.
src/audio/ambience.c Renamed ambient state flags to “AMBIENCE_” prefix.
Comments suppressed due to low confidence (5)

src/audio/core/reverb.c:5

  • The SWAP16 macro is incomplete and uses an undefined variable t. Restore the correct swap logic (e.g., using a temporary variable) to ensure it actually swaps the two values.
#define SWAP16(in, out) \

src/audio/ambience.c:12

  • [nitpick] The enum is named AmbientSoundState but its values use AMBIENCE_ prefixes. Consider renaming the enum to AmbienceSoundState for consistency.
typedef enum AmbientSoundState {

src/audio/sfx_control.c:534

  • The masking logic may be incorrect: combining FLAG and MASK bits could mis-detect looping sounds. Consider using (soundID & SOUND_ID_TYPE_MASK) == SOUND_TYPE_LOOPING for clarity.
if ((soundID & (SOUND_ID_TYPE_FLAG | SOUND_ID_TYPE_MASK)) == (SOUND_ID_TYPE_FLAG | SOUND_TYPE_LOOPING)) {

src/audio/public.h:9

  • Duplicate declaration of snd_notify_engine_ready; please remove the redundant prototype to avoid confusion.
void snd_notify_engine_ready(ALHeap* heap);

src/audio/mseq_player.c:273

  • This in-code @bug comment is a TODO; consider removing or turning it into an actionable issue rather than leaving it in production code.
        // potential @bug, any voice which is not properly released via MSEQ_CMD_80_STOP_SOUND will eventaully

Comment thread src/audio/bgm_control.c
Comment thread src/audio/bgm_control.c
Comment thread include/enums.h
Comment thread src/audio/core/system.c Outdated
Comment thread src/audio/core/voice.c Outdated
@ethteck ethteck merged commit bb936b7 into pmret:main Jun 15, 2025
3 checks passed
@ethteck ethteck deleted the audio branch June 15, 2025 15:27
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.

4 participants