Added GanonAgahRNG to tables.asm to set agahnim & ganon behavior

#$00 = vanilla
#$01 = no blue balls / extra warps (default)
#$02 = use the random table
This commit is contained in:
Myramong
2017-05-31 20:03:55 -03:00
parent 6ccc435a25
commit 7186a36ea1
3 changed files with 79 additions and 5 deletions

View File

@@ -136,3 +136,64 @@ Sprite_ShowSolicitedMessageIfPlayerFacing_Alt:
RTL
}
;================================================================
RandomAgah:
{
LDA.l GanonAgahRNG : BNE +
JSL GetRandomInt
RTL
+
CMP #$01 : BEQ .noBlueBalls
CMP #$02 : BEQ .rigRng
.noBlueBalls
JSL GetRandomInt
ORA #$01 ;guarantee no blue ball
RTL
.rigRng
PHX
LDA $A0 : CMP #$20 : BEQ + ; branch if at agah 1 (they use a different part of the random table)
;g tower agahnim
LDX $0FA3
LDA.l $AF8100, X ; random table
INX
STX $0FA3
BRA .return
+
;light world agahnim
LDX $0FA2
LDA.l $AF8000, X ; random table
INX
STX $0FA2
.return
PLX
RTL
}
RandomGanon:
{
LDA.l GanonAgahRNG : BNE + ; branch if not using vanilla behavior
JSL GetRandomInt
RTL
+
CMP #$01 : BEQ .noTeleports
CMP #$02 : BEQ .rigRng
.noTeleports
JSL GetRandomInt
AND #$FE ; set least significant bit to 0 to prevent teleport
RTL
.rigRng
PHX
LDX $0FA4
LDA.l $AF8200, X ; random table
INX
STX $0FA4
PLX
RTL
}

View File

@@ -39,8 +39,8 @@ JSL.l PrepHashAlphabet
;================================================================================
; Agahnim 0bb
;--------------------------------------------------------------------------------
org $1ED6EF ; <- F56EF - sprite_agahnim.asm : 636 (JSL GetRandomInt : AND.b #$01 : BNE BRANCH_GAMMA)
NOP #18
;org $1ED6EF ; <- F56EF - sprite_agahnim.asm : 636 (JSL GetRandomInt : AND.b #$01 : BNE BRANCH_GAMMA)
;NOP #18
;--------------------------------------------------------------------------------
;================================================================================
@@ -734,6 +734,15 @@ JSL.l RigDigRNG
org $01EE94 ; <- EE94 - Bank01.asm : 14121
JSL.l RigChestRNG
;--------------------------------------------------------------------------------
org $1ED63E ; <- F563E - sprite_agahnim.asm
JSL RandomAgah
org $1ED6EF ; <- F56EF - sprite_agahnim.asm
JSL RandomAgah
org $1D9488 ; <- E9488 - sprite_ganon.asm
JSL RandomGanon
org $1D91E3 ; <- E91E3 - sprite_ganon.asm
JSL RandomGanon
;--------------------------------------------------------------------------------
;org $01EDB2 ; <- EDB2 - Bank01.asm : 14038
;INC $04C4
;--------------------------------------------------------------------------------
@@ -1334,10 +1343,10 @@ dw $05AC, $04FC, $0001, $0027, $00F0 ; Zelda in the water room
;================================================================================
; Ganon Fixes
;--------------------------------------------------------------------------------
org $1D91E3 ; <- E91E3 - sprite_ganon.asm : 778
;org $1D91E3 ; <- E91E3 - sprite_ganon.asm : 778
;JSL.l GanonWarpRNG
;NOP #2
LDA #$00 : NOP #4
;LDA #$00 : NOP #4
;--------------------------------------------------------------------------------
;================================================================================

View File

@@ -161,6 +161,10 @@ db #$A0 ; #$A0 - Full Refill (Default)
PotionMagicRefill:
db #$80 ; #$80 - Full Refill (Default)
;--------------------------------------------------------------------------------
org $308086 ; PC 0x180086
GanonAgahRNG:
db #$01 ; $00 = vanilla behavior, $01 = no extra blue balls/warps, $02 = use the random table
;--------------------------------------------------------------------------------
org $308040 ; PC 0x180040
UncleQuote:
db #$00 ; #$00 - #$1F