From 7e5c2720b8f41ed49e06f3ad90a25ee0f4d82b8a Mon Sep 17 00:00:00 2001 From: Zur3l <90565581+Zur3l@users.noreply.github.com> Date: Sat, 11 Jul 2026 15:59:50 -0400 Subject: [PATCH] Decomp GetRngSeed --- asm/include/main_02001D68.inc | 1 - asm/main_02001D68.s | 9 --------- include/main_0200224C.h | 1 + src/main_0200224C.c | 5 +++++ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/asm/include/main_02001D68.inc b/asm/include/main_02001D68.inc index a8084565..ad0bc982 100644 --- a/asm/include/main_02001D68.inc +++ b/asm/include/main_02001D68.inc @@ -3,5 +3,4 @@ .public FixedPoint64IsZero .public NATURAL_LOG_VALUE_TABLE .public NegateFixedPoint64 -.public PRNG_SEQUENCE_NUM .public UFixedPoint64CmpLt diff --git a/asm/main_02001D68.s b/asm/main_02001D68.s index 54c192ba..ff0dd34f 100644 --- a/asm/main_02001D68.s +++ b/asm/main_02001D68.s @@ -359,12 +359,3 @@ _02002224: .word NATURAL_LOG_VALUE_TABLE sub_02002228: ; 0x02002228 bx lr arm_func_end sub_02002228 - - arm_func_start GetRngSeed -GetRngSeed: ; 0x0200222C - ldr r0, _02002238 ; =PRNG_SEQUENCE_NUM - ldrh r0, [r0] - bx lr - .align 2, 0 -_02002238: .word PRNG_SEQUENCE_NUM - arm_func_end GetRngSeed diff --git a/include/main_0200224C.h b/include/main_0200224C.h index 9ab5e9f5..929a9c09 100644 --- a/include/main_0200224C.h +++ b/include/main_0200224C.h @@ -1,6 +1,7 @@ #ifndef PMDSKY_MAIN_0200224C_H #define PMDSKY_MAIN_0200224C_H +u16 GetRngSeed(void); void SetRngSeed(u16 seed); u16 Rand16Bit(); u32 RandInt(u32 n); diff --git a/src/main_0200224C.c b/src/main_0200224C.c index a8aedf11..4f5312c7 100644 --- a/src/main_0200224C.c +++ b/src/main_0200224C.c @@ -2,6 +2,11 @@ extern u16 PRNG_SEQUENCE_NUM; +u16 GetRngSeed(void) +{ + return PRNG_SEQUENCE_NUM; +} + void SetRngSeed(u16 seed) { PRNG_SEQUENCE_NUM = seed;