diff options
| author | cadmic <cadmic24@gmail.com> | 2024-09-04 02:10:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-04 11:10:14 +0200 |
| commit | c6d7cc7697c67989b1f018ae2bc934f6677c09b7 (patch) | |
| tree | cadb909a8c2adde978320b8505fc1bda48e3342c /src/code/rand.c | |
| parent | af24970d8919e4e6bb8356fd5672c938582dfcb8 (diff) | |
[ntsc-1.2] Match __osMalloc.c and code_800FC620.c (new/delete) (#2106)
* Match __osMalloc
* Match src/code/code_800FC620.c (new/delete)
* Wrap versions-specific files in ifdefs to fix compilation
* Fix bss
* Remove {FAULT,RAND,OSMALLOC}_VERSION in favor of PLATFORM_N64
* Fix __osMalloc data splits, add unused strings
* __osMalloc.h -> osMalloc.h
* Fix merge
Diffstat (limited to 'src/code/rand.c')
| -rw-r--r-- | src/code/rand.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/code/rand.c b/src/code/rand.c index ce2beb9e3..917b1ecfc 100644 --- a/src/code/rand.c +++ b/src/code/rand.c @@ -42,7 +42,6 @@ * @note Original name: qrand.c */ #include "rand.h" -#include "versions.h" #define RAND_MULTIPLIER 1664525 #define RAND_INCREMENT 1013904223 @@ -54,7 +53,7 @@ */ static u32 sRandInt = 1; -#if RAND_VERSION == RAND_GC +#if PLATFORM_GC /** * Space to store a value to be re-interpreted as a float. * @@ -69,7 +68,7 @@ static fu sRandFloat; * @note Original name: qrand */ u32 Rand_Next(void) { -#if RAND_VERSION == RAND_N64 +#if PLATFORM_N64 u32 next = sRandInt * RAND_MULTIPLIER + RAND_INCREMENT; sRandInt = next; @@ -98,7 +97,7 @@ void Rand_Seed(u32 seed) { * @note Original name: fqrand */ f32 Rand_ZeroOne(void) { -#if RAND_VERSION == RAND_N64 +#if PLATFORM_N64 fu v; f32 vf; @@ -115,7 +114,7 @@ f32 Rand_ZeroOne(void) { #endif } -#if RAND_VERSION == RAND_GC +#if PLATFORM_GC /** * Returns a pseudo-random floating-point number between -0.5f and 0.5f by the same manner in which Rand_ZeroOne * generates its result. @@ -164,7 +163,7 @@ u32 Rand_Next_Variable(u32* rndNum) { * @note Original name: fqrand_r */ f32 Rand_ZeroOne_Variable(u32* rndNum) { -#if RAND_VERSION == RAND_N64 +#if PLATFORM_N64 fu v; f32 vf; u32 next = Rand_Next_Variable(rndNum); @@ -180,7 +179,7 @@ f32 Rand_ZeroOne_Variable(u32* rndNum) { #endif } -#if RAND_VERSION == RAND_GC +#if PLATFORM_GC /** * Generates the next pseudo-random floating-point number between -0.5f and 0.5f from the provided rndNum. * |
