Allow early detonation of bombs and add build flag to remove static RNG

This commit is contained in:
2021-10-12 20:24:56 -07:00
parent 825d4a1ead
commit aeec3fe6c6
4 changed files with 34 additions and 7 deletions

View File

@@ -110,13 +110,18 @@ RTL
; Out: A = RNG Result
;--------------------------------------------------------------------------------
!RNG_POINTERS = "$7F5200"
!static_rng ?= 1
GetStaticRNG:
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
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
RTL
;--------------------------------------------------------------------------------
InitRNGPointerTable: