summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas LEBRET <th.lebret@protonmail.com>2026-05-25 15:51:56 +0200
committerThomas LEBRET <thomaslebret@mac.home>2026-05-25 15:54:05 +0200
commit915553795aa552bb6c8faec653b5d679e10cc2e7 (patch)
treea84e98fb96f3e55ff0b3a173da8b17edc43f9698 /src
parent59af442eac2a5312704d5b3b6e9e6d2469e0efec (diff)
dSndRng_c::rndInt OK
Diffstat (limited to 'src')
-rw-r--r--src/d/snd/d_snd_rng.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/d/snd/d_snd_rng.cpp b/src/d/snd/d_snd_rng.cpp
index b1a5994e..96f2f44b 100644
--- a/src/d/snd/d_snd_rng.cpp
+++ b/src/d/snd/d_snd_rng.cpp
@@ -13,23 +13,8 @@ void dSndRng_c::init() {
}
u32 dSndRng_c::rndInt(s32 max) {
- // TODO
- return 0;
-/*
- s32 temp_r0;
- s32 temp_r11;
-
- temp_r11 = this->unkC;
- this->unkC = (temp_r11 * 0xB2E3D431) + 0x508EBD;
- temp_r0 = MULTU_HI(temp_r11, 0xB2E3D431) + (this->unk8 * 0xB2E3D431) + (temp_r11 * 0x690379B2) + M2C_CARRY;
- this->unk8 = temp_r0;
- return MULTU_HI(temp_r0, arg0) + (0 * arg0);
-=>
-
- lo_1 = (lo_0 * 0xB2E3D431) + 0x508EBD;
- hi_1 = MULTU_HI(lo_0, 0xB2E3D431) + (hi_0 * 0xB2E3D431) + (lo_0 * 0x690379B2) + M2C_CARRY;
- return MULTU_HI(hi_1, arg0) + (0 * arg0);
-*/
+ field_0x08 = field_0x08 * 0x690379B2B2E3D431ULL + 0x508EBD;
+ return (u32)(((u64)(field_0x08 >> 32) * (u64)(u32)max) >> 32);
}
bool dSndRng_c::rndBool(s32 chance) {