Files
wii-ipl/include/math/iplMathRandom.h
Devin AI 24a977d898 scene3: SELECT TU decl-only gates + score-filler audit cleanup
- sdChannelSelect TU: decl-only gates for Base methods, VEC2/VEC3 ops,
  get_u16, setTriggerTarget, initCalcNormal/calcCommonAfter (kills ~20
  extra weak emits; symtab UNDEF set now matches orig)
- remove s_unkTbl score-filler decl (owner rule 3 audit)
- iplFaderSceneBase/SceneBase/GUIManager per-TU decl-variant cleanup
- verified: base .o symtabs are extraction-rebuilt from symbols.txt;
  dedup'd weak emits (vtables/dtors) appear as anonymous zero regions
  (iplSDButton precedent). select .data 0x960 hole = anonymous 0x20
  zeros confirmed in DOL (no relocs baked) - unsourceable under
  no-filler rule; documented

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 21:55:19 +00:00

39 lines
849 B
C++

#ifndef IPL_MATH_RANDOM_H
#define IPL_MATH_RANDOM_H
#include <revolution/types.h>
#ifdef __cplusplus
namespace ipl {
namespace math {
class Random {
// Based on https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use
// Numerical Recipes
#define NEXT (next = next * 1664525 + 1013904223)
public:
Random(u32 myNext) : next(myNext) {}
u8 get_u8() { return (u8)NEXT; }
#ifdef IPL_SD_CHANNEL_SELECT_CPP
u16 get_u16();
#else
u16 get_u16() NO_INLINE { return NEXT >> 16; }
#endif
u32 get_u32() { return (u32)NEXT; }
f32 get_f01() { return (f32)NEXT / 0xFFFFFFFF; }
private:
u32 next;
#undef NEXT
};
} // namespace math
} // namespace ipl
#endif // __cplusplus
#endif // IPL_MATH_RANDOM_H