Make non-seeded rng a rom flag instead of compile flag
This commit is contained in:
21
rngfixes.asm
21
rngfixes.asm
@@ -110,18 +110,17 @@ RTL
|
|||||||
; Out: A = RNG Result
|
; Out: A = RNG Result
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
!RNG_POINTERS = "$7F5200"
|
!RNG_POINTERS = "$7F5200"
|
||||||
!static_rng ?= 1
|
|
||||||
GetStaticRNG:
|
GetStaticRNG:
|
||||||
if !static_rng
|
LDA.l SeededRNG : BNE .seeded
|
||||||
PHX : PHP
|
JML GetRandomInt
|
||||||
REP #$30 ; set 16-bit accumulator and index registers
|
RTL
|
||||||
AND.w #$000F
|
.seeded
|
||||||
ASL : TAX : LDA !RNG_POINTERS, X : INC : AND.w #$03FF : STA !RNG_POINTERS, X : TAX ; increment pointer and move value to X
|
PHX : PHP
|
||||||
LDA Static_RNG, X ; load RNG value
|
REP #$30 ; set 16-bit accumulator and index registers
|
||||||
PLP : PLX
|
AND.w #$000F
|
||||||
else
|
ASL : TAX : LDA !RNG_POINTERS, X : INC : AND.w #$03FF : STA !RNG_POINTERS, X : TAX ; increment pointer and move value to X
|
||||||
JML GetRandomInt
|
LDA Static_RNG, X ; load RNG value
|
||||||
endif
|
PLP : PLX
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
InitRNGPointerTable:
|
InitRNGPointerTable:
|
||||||
|
|||||||
@@ -413,7 +413,9 @@ org $30808E ; PC 0x18008E
|
|||||||
FakeBoots:
|
FakeBoots:
|
||||||
db $00 ; #$00 = Off (default) - #$01 = On
|
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
|
org $308090 ; PC 0x180090 - 0x180097
|
||||||
ProgressiveSwordLimit:
|
ProgressiveSwordLimit:
|
||||||
|
|||||||
Reference in New Issue
Block a user