From 83ceaf371748aa4b0fe6e54e8aaf879de01ce1d1 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:50:11 +1100 Subject: z_kankyo Decompiled (3 non-matching) (#1451) * z_Kankyo progress * build OK * progress * more progress * Kankyo WIP * Add docs * func_800FEAF4 * more docs * func_800FEAF4 * improve Init * Small cleanup * kankyo data * data cleanup * Environment_DrawLensFlare * Match Environment_UpdateSkybox * Match Environment_DrawRainImpl * Start on Environment_UpdateLights * Match Environment_DrawSandstorm * gRainDropDL * Some light renamings * Fix merge * cleanup * improve non-equivalents * cleanup * PR Review * match Environment_UpdatePostmanEvents * PR Review * small improvement to Environment_UpdatePostmanEvents from anon * more cleanup * void * bits * fix comment * improve Environment_UpdateLights * Skybox Stars Docs * PR Review * fix merge * macros * Add comments * PR Review * gRandFloat * bug --------- Co-authored-by: Rozelette Co-authored-by: Derek Hensley --- src/boot/O2/rand.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/boot/O2') diff --git a/src/boot/O2/rand.c b/src/boot/O2/rand.c index 2db64e9d5..9f3051717 100644 --- a/src/boot/O2/rand.c +++ b/src/boot/O2/rand.c @@ -5,7 +5,7 @@ static u32 sRandInt = 1; //! Space to store a value to be re-interpreted as a float. //! This can't be static because it is used in z_kankyo. -u32 sRandFloat; +u32 gRandFloat; //! These values are recommended by the algorithms book *Numerical Recipes in C. The Art of Scientific Computing*, 2nd //! Edition, 1992, ISBN 0-521-43108-5. (p. 284): @@ -37,8 +37,8 @@ void Rand_Seed(u32 seed) { */ f32 Rand_ZeroOne(void) { sRandInt = (sRandInt * RAND_MULTIPLIER) + RAND_INCREMENT; - sRandFloat = ((sRandInt >> 9) | 0x3F800000); - return *((f32*)&sRandFloat) - 1.0f; + gRandFloat = ((sRandInt >> 9) | 0x3F800000); + return *((f32*)&gRandFloat) - 1.0f; } /** @@ -46,8 +46,8 @@ f32 Rand_ZeroOne(void) { */ f32 Rand_Centered(void) { sRandInt = (sRandInt * RAND_MULTIPLIER) + RAND_INCREMENT; - sRandFloat = ((sRandInt >> 9) | 0x3F800000); - return *((f32*)&sRandFloat) - 1.5f; + gRandFloat = ((sRandInt >> 9) | 0x3F800000); + return *((f32*)&gRandFloat) - 1.5f; } //! All functions below are unused variants of the above four, that use a provided random number variable instead of the @@ -79,8 +79,8 @@ u32 Rand_Next_Variable(u32* rndNum) { f32 Rand_ZeroOne_Variable(u32* rndNum) { u32 next = (*rndNum * RAND_MULTIPLIER) + RAND_INCREMENT; - sRandFloat = ((*rndNum = next) >> 9) | 0x3F800000; - return *((f32*)&sRandFloat) - 1.0f; + gRandFloat = ((*rndNum = next) >> 9) | 0x3F800000; + return *((f32*)&gRandFloat) - 1.0f; } /** @@ -91,6 +91,6 @@ f32 Rand_ZeroOne_Variable(u32* rndNum) { f32 Rand_Centered_Variable(u32* rndNum) { u32 next = (*rndNum * RAND_MULTIPLIER) + RAND_INCREMENT; - sRandFloat = ((*rndNum = next) >> 9) | 0x3F800000; - return *((f32*)&sRandFloat) - 1.5f; + gRandFloat = ((*rndNum = next) >> 9) | 0x3F800000; + return *((f32*)&gRandFloat) - 1.5f; } -- cgit v1.2.3