weird bugged float harp mgr functions

This commit is contained in:
robojumper
2025-07-17 22:46:51 +02:00
parent 81e2b78249
commit 459e46cfdd
3 changed files with 40 additions and 3 deletions
+2 -2
View File
@@ -20913,8 +20913,8 @@ fn_803814B0 = .text:0x803814B0; // type:function size:0x8C
fn_80381540 = .text:0x80381540; // type:function size:0x1C
fn_80381560 = .text:0x80381560; // type:function size:0x14
fn_80381580 = .text:0x80381580; // type:function size:0x78
fn_80381600 = .text:0x80381600; // type:function size:0xA0
fn_803816A0 = .text:0x803816A0; // type:function size:0xC0
shiftFloat1__17dSndHarpSongMgr_cFf = .text:0x80381600; // type:function size:0xA0
shiftFloat2__17dSndHarpSongMgr_cFf = .text:0x803816A0; // type:function size:0xC0
resetFloatArr1__17dSndHarpSongMgr_cFv = .text:0x80381760; // type:function size:0x60
resetFloatArr2__17dSndHarpSongMgr_cFv = .text:0x803817C0; // type:function size:0x80
fn_80381840 = .text:0x80381840; // type:function size:0x28
+2 -1
View File
@@ -24,7 +24,8 @@ public:
}
private:
void shiftFloat1(f32 val);
void shiftFloat2(f32 val);
void resetFloatArr1();
void resetFloatArr2();
+36
View File
@@ -73,6 +73,42 @@ void dSndHarpSongMgr_c::setupState0() {
mDataLoaded = true;
}
void dSndHarpSongMgr_c::shiftFloat1(f32 val) {
if (val < 0.0f) {
val = 0.0f;
}
if (val > 150.0f) {
val = 150.0f;
}
// @bug (?) this loop ends up copying the value of field_0x07C[0]
// to all array elements when surely the intention was to
// move each of them back by one position. TODO: are array entries
// other than [0] read anywhere?
for (int i = 1; i < 300; i++) {
field_0x07C[i] = field_0x07C[i - 1];
}
field_0x07C[0] = val;
}
void dSndHarpSongMgr_c::shiftFloat2(f32 val) {
if (val < 0.0f) {
val = 0.0f;
}
if (val > 240.0f) {
val = 240.0f;
}
// @bug (?) this loop ends up copying the value of field_0x52C[0]
// to all array elements when surely the intention was to
// move each of them back by one position. TODO: are array entries
// other than [0] read anywhere?
for (int i = 1; i < 30; i++) {
field_0x52C[i] = field_0x52C[i - 1];
}
field_0x52C[0] = val;
}
void dSndHarpSongMgr_c::resetFloatArr1() {
for (int i = 0; i < 300; i++) {
field_0x07C[i] = 0.0f;