From da46df490d417aa5af57ebecd81149e316356d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asier=20N=C3=BA=C3=B1ez?= <45818936+Asiern@users.noreply.github.com> Date: Sun, 16 Nov 2025 17:42:37 +0100 Subject: [PATCH] feat(d_snd_harp_song_mrg): isPlayingHarpRelated and ancestors (#264) * feat(d_snd_harp_song_mrg): isPlayingHarpRelated and ancestors * refactor(harp): change field_0x042 type to bool Updated field_0x042 from u8 to bool to better reflect its binary nature. Adjusted related logic accordingly. * refactor: rename fun_80381150 to fn_80381150 - Rename fn_80381150 to match real name - Reordered functions * feat: map symbols * reorder functions --- config/SOUE01/symbols.txt | 6 +++--- include/d/snd/d_snd_harp_song_mgr.h | 7 +++++-- src/d/snd/d_snd_harp_song_mgr.cpp | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index b824b3f8..59f0fc98 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -20902,9 +20902,9 @@ fn_80380DA0 = .text:0x80380DA0; // type:function size:0x7C fn_80380E20 = .text:0x80380E20; // type:function size:0x70 fn_80380E90 = .text:0x80380E90; // type:function size:0x230 fn_803810C0 = .text:0x803810C0; // type:function size:0x40 -isContinuousStrumming = .text:0x80381100; // type:function size:0x14 -isPlayingHarpRelated = .text:0x80381120; // type:function size:0x28 -fn_80381150 = .text:0x80381150; // type:function size:0x40 +isContinuousStrumming__17dSndHarpSongMgr_cFv = .text:0x80381100; // type:function size:0x14 +isPlayingHarpRelated__17dSndHarpSongMgr_cFv = .text:0x80381120; // type:function size:0x28 +fn_80381150__17dSndHarpSongMgr_cFv = .text:0x80381150; // type:function size:0x40 fn_80381190 = .text:0x80381190; // type:function size:0x5C fn_803811F0 = .text:0x803811F0; // type:function size:0x12C fn_80381320 = .text:0x80381320; // type:function size:0x188 diff --git a/include/d/snd/d_snd_harp_song_mgr.h b/include/d/snd/d_snd_harp_song_mgr.h index 934ffe0f..84b67e30 100644 --- a/include/d/snd/d_snd_harp_song_mgr.h +++ b/include/d/snd/d_snd_harp_song_mgr.h @@ -2,8 +2,8 @@ #define D_SND_HARP_SONG_MGR_H #include "common.h" -#include "d/snd/d_snd_util.h" #include "d/snd/d_snd_types.h" +#include "d/snd/d_snd_util.h" #include "nw4r/snd/snd_SoundHandle.h" SND_DISPOSER_FORWARD_DECL(dSndHarpSongMgr_c); @@ -31,6 +31,9 @@ private: void shiftFloat2(f32 val); void resetFloatArr1(); void resetFloatArr2(); + bool isContinuousStrumming(); + bool isPlayingHarpRelated(); + bool fn_80381150(); /* 0x010 */ u8 field_0x010; /* 0x011 */ u8 field_0x011; @@ -48,7 +51,7 @@ private: /* 0x03C */ f32 field_0x03C; /* 0x040 */ u8 field_0x040; /* 0x041 */ u8 field_0x041; - /* 0x042 */ u8 field_0x042; + /* 0x042 */ bool field_0x042; /* 0x043 */ u8 field_0x043; /* 0x044 */ u8 field_0x044; /* 0x048 */ UNKWORD field_0x048; diff --git a/src/d/snd/d_snd_harp_song_mgr.cpp b/src/d/snd/d_snd_harp_song_mgr.cpp index 6861b67e..f3b121fe 100644 --- a/src/d/snd/d_snd_harp_song_mgr.cpp +++ b/src/d/snd/d_snd_harp_song_mgr.cpp @@ -120,3 +120,18 @@ void dSndHarpSongMgr_c::resetFloatArr2() { field_0x52C[i] = 0.0f; } } + +bool dSndHarpSongMgr_c::isContinuousStrumming() { + return field_0x01C; +} + +bool dSndHarpSongMgr_c::isPlayingHarpRelated() { + return fn_80381150() == false; +} + +bool dSndHarpSongMgr_c::fn_80381150() { + if (isContinuousStrumming()) { + return field_0x042; + } + return true; +}