From 5fd285c767166b07b16a9a5e5f8b317f70374e8d Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Mon, 24 Jan 2022 13:53:03 -0800 Subject: [PATCH] Make non-seeded rng a rom flag instead of compile flag --- rngfixes.asm | 21 ++++++++++----------- tables.asm | 4 +++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/rngfixes.asm b/rngfixes.asm index 4cb4015..e7cb49f 100644 --- a/rngfixes.asm +++ b/rngfixes.asm @@ -109,18 +109,17 @@ RTL ; Out: A = RNG Result ;-------------------------------------------------------------------------------- !RNG_POINTERS = "$7F5200" -!static_rng ?= 1 GetStaticRNG: - if !static_rng - PHX : PHP - REP #$30 ; set 16-bit accumulator and index registers - AND.w #$000F - ASL : TAX : LDA !RNG_POINTERS, X : INC : AND.w #$03FF : STA !RNG_POINTERS, X : TAX ; increment pointer and move value to X - LDA Static_RNG, X ; load RNG value - PLP : PLX - else - JML GetRandomInt - endif + LDA.l SeededRNG : BNE .seeded + JML GetRandomInt + RTL +.seeded + PHX : PHP + REP #$30 ; set 16-bit accumulator and index registers + AND.w #$000F + ASL : TAX : LDA !RNG_POINTERS, X : INC : AND.w #$03FF : STA !RNG_POINTERS, X : TAX ; increment pointer and move value to X + LDA Static_RNG, X ; load RNG value + PLP : PLX RTL ;-------------------------------------------------------------------------------- InitRNGPointerTable: diff --git a/tables.asm b/tables.asm index c52b1cc..2a21422 100644 --- a/tables.asm +++ b/tables.asm @@ -409,7 +409,9 @@ org $30808E ; PC 0x18008E FakeBoots: db $00 ; #$00 = Off (default) - #$01 = On ;-------------------------------------------------------------------------------- -; 0x18008F (unused) +org $30808F ; PC 0x18008F +SeededRNG: +db $01 ; #$00 = Off - #$01 = Seeded RNG (default for rando) ;-------------------------------------------------------------------------------- org $308090 ; PC 0x180090 - 0x180097 ProgressiveSwordLimit: