First pass-through adding labels

Added items, equipment, and tracking/indicators
Added playername changes
Removed some defines
This commit is contained in:
cassidy
2021-12-01 23:06:28 -05:00
parent d47dea6123
commit e4d917c47c
48 changed files with 453 additions and 485 deletions

View File

@@ -2,14 +2,12 @@
; The Legend of Zelda, A Link to the Past - Randomizer General Development & Bugfixes ; The Legend of Zelda, A Link to the Past - Randomizer General Development & Bugfixes
;================================================================================ ;================================================================================
lorom lorom
;================================================================================ ;================================================================================
;org $00FFC0 ; <- 7FC0 - Bank00.asm : 9173 (db "THE LEGEND OF ZELDA " ; 21 bytes) ;org $00FFC0 ; <- 7FC0 - Bank00.asm : 9173 (db "THE LEGEND OF ZELDA " ; 21 bytes)
;db #$23, $4E ;db #$23, $4E
org $00FFD5 ; <- 7FD5 - Bank00.asm : 9175 (db $20 ; rom layout) org $00FFD5 ; <- 7FD5 - Bank00.asm : 9175 (db $20 ; rom layout)
;db #$35 ; set fast exhirom
db #$30 ; set fast lorom db #$30 ; set fast lorom
;org $00FFD6 ; <- 7FD6 - Bank00.asm : 9176 (db $02 ; cartridge type) ;org $00FFD6 ; <- 7FD6 - Bank00.asm : 9176 (db $02 ; cartridge type)
@@ -44,10 +42,6 @@ dw !ROM_VERSION_HIGH
!BGE = "BCS" !BGE = "BCS"
; Rando Specific SRAM assignments ; Rando Specific SRAM assignments
!SHOP_PURCHASE_COUNTS = "$7EF302" ;$7EF302 - $7EF33F (temporary home)
!INVENTORY_SWAP = "$7EF38C" ; [w]
!INVENTORY_SWAP_2 = "$7EF38E" ; [w]
!ITEM_LIMIT_COUNTS = "$7EF390" ; $7EF390 - ????
!NPC_FLAGS = "$7EF410" !NPC_FLAGS = "$7EF410"
!NPC_FLAGS_2 = "$7EF411" !NPC_FLAGS_2 = "$7EF411"
!MAP_OVERLAY = "$7EF414" ; [w] !MAP_OVERLAY = "$7EF414" ; [w]
@@ -58,16 +52,10 @@ dw !ROM_VERSION_HIGH
!SHAME_CHEST = "$7EF416" ; ---s ---- !SHAME_CHEST = "$7EF416" ; ---s ----
!HAS_GROVE_ITEM = "$7EF416" ; ---- ---g general flags, don't waste these !HAS_GROVE_ITEM = "$7EF416" ; ---- ---g general flags, don't waste these
!HIGHEST_SWORD_LEVEL = "$7EF417" ; --- -sss !HIGHEST_SWORD_LEVEL = "$7EF417" ; --- -sss
;$7EF41A[w] - Programmable Item #1
;$7EF41C[w] - Programmable Item #2
;$7EF41E[w] - Programmable Item #3
!SRAM_SINK = "$7EF41E" ; <- change this (conflicts with Programmable item 3)
;$7EF418 - Goal Item Counter ;$7EF418 - Goal Item Counter
;$7EF419 - Service Sequence ;$7EF419 - Service Sequence
;$7EF420 - $7EF46D - Stat Tracking Bank 1 (overlaps with RNG Item Flags) ;$7EF420 - $7EF46D - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF450 - $7EF45F - RNG Item (Single) Flags
;$7EF4A0 - $7EF4A7 - Service Request Block ;$7EF4A0 - $7EF4A7 - Service Request Block
!FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file
;$700500 - $70050F - Extended File Name ;$700500 - $70050F - Extended File Name
;$701000 - $70100F - Password (incorporate into log header) ;$701000 - $70100F - Password (incorporate into log header)
;$702000 - $702014 - Rom title copy (incorporate into log header) ;$702000 - $702014 - Rom title copy (incorporate into log header)
@@ -112,6 +100,7 @@ incsrc treekid.asm
incsrc spriteswap.asm incsrc spriteswap.asm
incsrc hashalphabethooks.asm incsrc hashalphabethooks.asm
incsrc sharedplayerpalettefix.asm incsrc sharedplayerpalettefix.asm
incsrc sram.asm
;org $208000 ; bank #$20 ;org $208000 ; bank #$20
org $A08000 ; bank #$A0 org $A08000 ; bank #$A0
@@ -349,6 +338,7 @@ warnpc $B08000
;$7F5000[0x800]: Rando's main free ram region ;$7F5000[0x800]: Rando's main free ram region
; See tables.asm for specific assignments ; See tables.asm for specific assignments
;$7F6000[0x500]: Free RAM (reclaimed from damage table) Not allocated yet ;$7F6000[0x500]: Free RAM (reclaimed from damage table) Not allocated yet
;$7F6000[0x500]: SRAM buffer save 2 0x500
;$7F6500[0xB00]: SRAM mirror for last 0xB00 bytes of SRAM (extended sram) ;$7F6500[0xB00]: SRAM mirror for last 0xB00 bytes of SRAM (extended sram)
;$7F7667[0x6719] - free ram ;$7F7667[0x6719] - free ram
;================================================================================ ;================================================================================

View File

@@ -54,7 +54,7 @@ GiveBonkItem:
CMP #$24 : BNE .notKey CMP #$24 : BNE .notKey
.key .key
PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key
LDA $7EF36F : INC A : STA $7EF36F LDA CurrentSmallKeys : INC A : STA CurrentSmallKeys
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
JSL CountBonkItem JSL CountBonkItem
RTL RTL
@@ -74,4 +74,4 @@ LoadBonkItem:
+ +
LDA.b #$24 ; default to small key LDA.b #$24 ; default to small key
++ ++
RTS RTS

View File

@@ -5,15 +5,15 @@
ModifyBoots: ModifyBoots:
PHA PHA
LDA !BOOTS_MODIFIER : CMP.b #$01 : BNE + LDA !BOOTS_MODIFIER : CMP.b #$01 : BNE +
PLA : AND $7EF379 : ORA.b #$04 : RTL ; yes boots PLA : AND AbilityFlags : ORA.b #$04 : RTL ; yes boots
+ : CMP.b #$02 : BNE + + : CMP.b #$02 : BNE +
PLA : AND $7EF379 : AND.b #$FB : RTL ; no boots PLA : AND AbilityFlags : AND.b #$FB : RTL ; no boots
+ : LDA FakeBoots : CMP.b #$01 : BNE + + : LDA FakeBoots : CMP.b #$01 : BNE +
LDA $5B : BEQ ++ : LDA $59 : BNE + ; hover check LDA $5B : BEQ ++ : LDA $59 : BNE + ; hover check
++ : PLA : AND $7EF379 : ORA.b #$04 : RTL ; yes boots, not hovering ++ : PLA : AND AbilityFlags : ORA.b #$04 : RTL ; yes boots, not hovering
+ +
PLA PLA
AND $7EF379 ; regular boots AND AbilityFlags ; regular boots
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
AddBonkTremors: AddBonkTremors:
@@ -22,7 +22,7 @@ AddBonkTremors:
JSL.l IncrementBonkCounter JSL.l IncrementBonkCounter
+ +
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ + LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots LDA BootsEquipment : BNE + ; Check for Boots
PLA : RTL PLA : RTL
+ +
PLA PLA
@@ -33,7 +33,7 @@ BonkBreakableWall:
PHX : PHP PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers SEP #$30 ; set 8-bit accumulator and index registers
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ + LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots LDA BootsEquipment : BNE + ; Check for Boots
PLP : PLX : LDA.w #$0000 : RTL PLP : PLX : LDA.w #$0000 : RTL
+ +
PLP : PLX PLP : PLX
@@ -42,7 +42,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
BonkRockPile: BonkRockPile:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ + LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots LDA BootsEquipment : BNE + ; Check for Boots
LDA.b #$00 : RTL LDA.b #$00 : RTL
+ +
LDA $02EF : AND.b #$70 ; things we wrote over LDA $02EF : AND.b #$70 ; things we wrote over
@@ -50,7 +50,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GravestoneHook: GravestoneHook:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ + LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BEQ .done ; Check for Boots LDA BootsEquipment : BEQ .done ; Check for Boots
+ +
LDA $0372 : BEQ .done ; things we wrote over LDA $0372 : BEQ .done ; things we wrote over
JML.l moveGravestone JML.l moveGravestone
@@ -59,7 +59,7 @@ GravestoneHook:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
JumpDownLedge: JumpDownLedge:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ + LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots LDA BootsEquipment : BNE + ; Check for Boots
; Disarm Waterwalk ; Disarm Waterwalk
LDA $5B : CMP.b #$01 : BNE + LDA $5B : CMP.b #$01 : BNE +
STZ $5B STZ $5B
@@ -70,7 +70,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
BonkRecoil: BonkRecoil:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ + LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots LDA BootsEquipment : BNE + ; Check for Boots
LDA.b #$16 : STA $29 : RTL LDA.b #$16 : STA $29 : RTL
+ +
LDA.b #$24 : STA $29 ; things we wrote over LDA.b #$24 : STA $29 ; things we wrote over

View File

@@ -2,8 +2,8 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
AssignKiki: AssignKiki:
LDA.b #$00 : STA $7EF3D3 ; defuse bomb LDA.b #$00 : STA FollowerDropped ; defuse bomb
LDA.b #$0A : STA $7EF3CC ; assign kiki as follower LDA.b #$0A : STA FollowerIndicator ; assign kiki as follower
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -13,7 +13,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!ITEM_BUSY = "$7F5091" !ITEM_BUSY = "$7F5091"
AllowSQ: AllowSQ:
LDA $7EF3C5 : BEQ .done ; thing we overwrote - check if link is in his bed LDA ProgressIndicator : BEQ .done ; thing we overwrote - check if link is in his bed
LDA !ITEM_BUSY : EOR #$01 LDA !ITEM_BUSY : EOR #$01
.done .done
RTL RTL
@@ -32,8 +32,8 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;0 = Become (Perma)bunny ;0 = Become (Perma)bunny
DecideIfBunny: DecideIfBunny:
LDA $7EF357 : BNE .done LDA MoonPearlEquipment : BNE .done
LDA $7EF3CA : AND.b #$40 LDA CurrentWorld : AND.b #$40
PHA : LDA.l InvertedMode : BNE .inverted PHA : LDA.l InvertedMode : BNE .inverted
.normal .normal
PLA : EOR #$40 PLA : EOR #$40
@@ -48,7 +48,7 @@ DecideIfBunnyByScreenIndex:
; If indoors we don't have a screen index. Return non-bunny to make mirror-based ; If indoors we don't have a screen index. Return non-bunny to make mirror-based
; superbunny work ; superbunny work
LDA $1B : BNE .done LDA $1B : BNE .done
LDA $7EF357 : BNE .done LDA MoonPearlEquipment : BNE .done
LDA $8A : AND.b #$40 : PHA LDA $8A : AND.b #$40 : PHA
LDA.l InvertedMode : BNE .inverted LDA.l InvertedMode : BNE .inverted
.normal .normal
@@ -63,7 +63,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;ReadInventoryPond: ;ReadInventoryPond:
; CPX.b #$1B : BNE + : LDA.b #$01 : RTL : + ; CPX.b #$1B : BNE + : LDA.b #$01 : RTL : +
; LDA $7EF340, X ; LDA SRAMEquipment, X
;RTL ;RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -112,15 +112,15 @@ RTS
; fix issue where cross world caves (in Entrance randomizer) don't cause ; fix issue where cross world caves (in Entrance randomizer) don't cause
; frog to become smith or vice versa. ; frog to become smith or vice versa.
FixFrogSmith: FixFrogSmith:
LDA.l $7EF3CA : BNE .darkWorld LDA.l CurrentWorld : BNE .darkWorld
LDA.l $7EF3CC : CMP.b #$07 : BNE .done LDA.l FollowerIndicator : CMP.b #$07 : BNE .done
LDA.b #$08 ; make frog into smith in light world LDA.b #$08 ; make frog into smith in light world
BRA .loadgfx BRA .loadgfx
.darkWorld .darkWorld
LDA.l $7EF3CC : CMP.b #$08 : BNE .done LDA.l FollowerIndicator : CMP.b #$08 : BNE .done
LDA.b #$07 ; make smith into frog in dark world LDA.b #$07 ; make smith into frog in dark world
.loadgfx .loadgfx
STA.l $7EF3CC STA.l FollowerIndicator
JSL Tagalong_LoadGfx JSL Tagalong_LoadGfx
.done .done
RTS RTS
@@ -158,8 +158,8 @@ WallmasterCameraFix:
; Fix losing glove colors ; Fix losing glove colors
LoadActualGearPalettesWithGloves: LoadActualGearPalettesWithGloves:
REP #$20 REP #$20
LDA $7EF359 : STA $0C LDA SwordEquipment : STA $0C
LDA $7EF35B : AND.w #$00FF LDA ArmorEquipment : AND.w #$00FF
JSL LoadGearPalettes_variable JSL LoadGearPalettes_variable
JSL SpriteSwap_Palette_ArmorAndGloves_part_two JSL SpriteSwap_Palette_ArmorAndGloves_part_two
RTL RTL

View File

@@ -1,43 +1,37 @@
;================================================================================ ;================================================================================
; Capacity Logic ; Capacity Logic
;================================================================================ ;================================================================================
!BOMB_UPGRADES = "$7EF370"
!BOMB_CURRENT = "$7EF343"
;--------------------------------------------------------------------------------
IncrementBombs: IncrementBombs:
LDA !BOMB_UPGRADES ; get bomb upgrades LDA BombCapacityUpgrades ; get bomb upgrades
!ADD.l StartingMaxBombs : BEQ + ; Skip if we can't have bombs !ADD.l StartingMaxBombs : BEQ + ; Skip if we can't have bombs
DEC DEC
CMP !BOMB_CURRENT CMP BombsEquipment
!BLT + !BLT +
LDA !BOMB_CURRENT LDA BombsEquipment
CMP.b #99 : !BGE + CMP.b #99 : !BGE +
INC : STA !BOMB_CURRENT INC : STA BombsEquipment
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!ARROW_UPGRADES = "$7EF371"
!ARROW_CURRENT = "$7EF377"
;--------------------------------------------------------------------------------
IncrementArrows: IncrementArrows:
LDA !ARROW_UPGRADES ; get arrow upgrades LDA ArrowCapacityUpgrades ; get arrow upgrades
!ADD.l StartingMaxArrows : DEC !ADD.l StartingMaxArrows : DEC
CMP !ARROW_CURRENT CMP CurrentArrows
!BLT + !BLT +
LDA !ARROW_CURRENT LDA CurrentArrows
CMP.b #99 : !BGE + CMP.b #99 : !BGE +
INC : STA !ARROW_CURRENT INC : STA CurrentArrows
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CompareBombsToMax: CompareBombsToMax:
LDA !BOMB_UPGRADES ; get bomb upgrades LDA BombCapacityUpgrades ; get bomb upgrades
!ADD.l StartingMaxBombs !ADD.l StartingMaxBombs
CMP !BOMB_CURRENT CMP BombsEquipment
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -23,7 +23,7 @@ DrawDungeonCompassCounts:
CPX.b #$1B : BCS .done ; Skip if not in a valid dungeon ID CPX.b #$1B : BCS .done ; Skip if not in a valid dungeon ID
CMP.w #$0002 : BEQ ++ ; if CompassMode==2, we don't check for the compass CMP.w #$0002 : BEQ ++ ; if CompassMode==2, we don't check for the compass
LDA $7EF364 : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks LDA CompassField : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks
BEQ .done ; skip if we don't have compass BEQ .done ; skip if we don't have compass
++ ++
@@ -143,4 +143,4 @@ CompassCount_Gt:
; $7EF439 - ttttssss - item locations checked ; $7EF439 - ttttssss - item locations checked
; t - turtle rock ; t - turtle rock
; s - swamp palace ; s - swamp palace
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -71,7 +71,7 @@
; ;
; PLX ; PLX
; ;
; LDA.b #$00 : STA $7EF3CC ; LDA.b #$00 : STA FollowerIndicator
; ;
; STZ $5E ; STZ $5E
; ;

View File

@@ -11,14 +11,14 @@ DoWorldFix:
JMP DoWorldFix_Inverted JMP DoWorldFix_Inverted
+ +
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA $7EF353 : BEQ .noMirror ; check if we have the mirror LDA MirrorEquipment : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point .skip_mirror_check ; alt entrance point
LDA $7EF3C5 : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive LDA ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.aga1Alive .aga1Alive
LDA #$00 LDA #$00
.noMirror .noMirror
STA $7EF3CA ; set flag to light world STA CurrentWorld ; set flag to light world
LDA $7EF3CC : CMP #$07 : BNE .done : INC : STA $7EF3CC ; convert frog to dwarf LDA FollowerIndicator : CMP #$07 : BNE .done : INC : STA FollowerIndicator ; convert frog to dwarf
.done .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -39,25 +39,25 @@ JMP DoWorldFix
JMP DoWorldFix_skip_mirror_check JMP DoWorldFix_skip_mirror_check
.pyramid .pyramid
LDA #$40 : STA $7EF3CA ; set flag to dark world LDA #$40 : STA CurrentWorld ; set flag to dark world
LDA $7EF3CC : CMP #$08 : BNE .done : DEC : STA $7EF3CC : + ; convert dwarf to frog LDA FollowerIndicator : CMP #$08 : BNE .done : DEC : STA FollowerIndicator : + ; convert dwarf to frog
.done .done
RTL RTL
;================================================================================ ;================================================================================
DoWorldFix_Inverted: DoWorldFix_Inverted:
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA $7EF353 : BEQ .noMirror ; check if we have the mirror LDA MirrorEquipment : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point .skip_mirror_check ; alt entrance point
LDA $7EF3C5 : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive LDA ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.noMirror .noMirror
.aga1Alive .aga1Alive
LDA #$40 : STA $7EF3CA ; set flag to dark world LDA #$40 : STA CurrentWorld ; set flag to dark world
LDA $7EF3CC LDA FollowerIndicator
CMP #$07 : BEQ .clear ; clear frog CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done BRA .done
.clear .clear
LDA.b #$00 : STA $7EF3CC ; clear follower LDA.b #$00 : STA FollowerIndicator ; clear follower
.done .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -75,8 +75,8 @@ JMP DoWorldFix
JMP DoWorldFix_Inverted_skip_mirror_check JMP DoWorldFix_Inverted_skip_mirror_check
.castle .castle
LDA #$00 : STA $7EF3CA ; set flag to dark world LDA #$00 : STA CurrentWorld ; set flag to dark world
LDA $7EF3CC : CMP #$07 : BNE + : LDA.b #$08 : STA $7EF3CC : + ; convert frog to dwarf LDA FollowerIndicator : CMP #$07 : BNE + : LDA.b #$08 : STA FollowerIndicator : + ; convert frog to dwarf
.done .done
RTL RTL
;================================================================================ ;================================================================================
@@ -85,19 +85,19 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FakeWorldFix: FakeWorldFix:
LDA FixFakeWorld : BEQ + LDA FixFakeWorld : BEQ +
LDA $8A : AND.b #$40 : STA $7EF3CA LDA $8A : AND.b #$40 : STA CurrentWorld
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MasterSwordFollowerClear: MasterSwordFollowerClear:
LDA $7EF3CC LDA FollowerIndicator
CMP #$0E : BNE .exit ; clear master sword follower CMP #$0E : BNE .exit ; clear master sword follower
LDA.b #$00 : STA $7EF3CC ; clear follower LDA.b #$00 : STA FollowerIndicator ; clear follower
.exit .exit
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FixAgahnimFollowers: FixAgahnimFollowers:
LDA.b #$00 : STA $7EF3CC ; clear follower LDA.b #$00 : STA FollowerIndicator ; clear follower
JML PrepDungeonExit ; thing we wrote over JML PrepDungeonExit ; thing we wrote over
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -107,24 +107,24 @@ macro SetMinimum(base,filler,compare)
?done: ?done:
endmacro endmacro
RefreshRainAmmo: RefreshRainAmmo:
LDA $7EF3C5 : CMP.b #$01 : BEQ .rain ; check if we're in rain state LDA ProgressIndicator : CMP.b #$01 : BEQ .rain ; check if we're in rain state
RTL RTL
.rain .rain
LDA $7EF3C8 LDA StartingEntrance
+ CMP.b #$03 : BNE + ; Uncle + CMP.b #$03 : BNE + ; Uncle
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Uncle) %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Uncle)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Uncle) %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Uncle)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Uncle) %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Uncle)
BRA .done BRA .done
+ CMP.b #$02 : BNE + ; Cell + CMP.b #$02 : BNE + ; Cell
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Cell) %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Cell)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Cell) %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Cell)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Cell) %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Cell)
BRA .done BRA .done
+ CMP.b #$04 : BNE + ; Mantle + CMP.b #$04 : BNE + ; Mantle
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Mantle) %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Mantle)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Mantle) %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Mantle)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Mantle) %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Mantle)
+ +
.done .done
RTL RTL
@@ -133,7 +133,7 @@ RTL
!INFINITE_BOMBS = "$7F50C9" !INFINITE_BOMBS = "$7F50C9"
!INFINITE_MAGIC = "$7F50CA" !INFINITE_MAGIC = "$7F50CA"
SetEscapeAssist: SetEscapeAssist:
LDA $7EF3C5 : CMP.b #$01 : BNE .no_train ; check if we're in rain state LDA ProgressIndicator : CMP.b #$01 : BNE .no_train ; check if we're in rain state
.rain .rain
LDA.l EscapeAssist LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : + BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : +
@@ -149,8 +149,8 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetSilverBowMode: SetSilverBowMode:
LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode
LDA $7EF340 : CMP.b #$3 : BCC + LDA BowEquipment : CMP.b #$3 : BCC +
SBC.b #$02 : STA $7EF340 SBC.b #$02 : STA BowEquipment
+ +
RTL RTL
;================================================================================ ;================================================================================

View File

@@ -267,7 +267,8 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogFairyThrow: DialogFairyThrow:
LDA.l Restrict_Ponds : BEQ .normal LDA.l Restrict_Ponds : BEQ .normal
LDA $7EF35C : ORA $7EF35D : ORA $7EF35E : ORA $7EF35F : BNE .normal LDA BottleContentsOne
ORA BottleContentsTwo : ORA BottleContentsThree : ORA BottleContentsFour : BNE .normal
.noInventory .noInventory
LDA $0D80, X : !ADD #$08 : STA $0D80, X LDA $0D80, X : !ADD #$08 : STA $0D80, X
@@ -294,7 +295,7 @@ RTL
; #$0193 - no silvers alternate ; #$0193 - no silvers alternate
; #$0194 - no silvers ; #$0194 - no silvers
; #$0195 - silvers ; #$0195 - silvers
; $7EF38E - bsp-- --- ; BowTracking - bsp-- ---
; b = bow ; b = bow
; s = silver arrow bow ; s = silver arrow bow
; p = 2nd progressive bow ; p = 2nd progressive bow
@@ -305,7 +306,7 @@ DialogGanon2:
BCS + BCS +
LDA.w #$018D : BRA ++ LDA.w #$018D : BRA ++
+ +
LDA.l $7EF38E LDA.l BowTracking
BIT.w #$0080 : BNE + ; branch if bow BIT.w #$0080 : BNE + ; branch if bow
LDA.w #$0192 : BRA ++ LDA.w #$0192 : BRA ++
@@ -334,9 +335,9 @@ DialogEtherTablet:
+ +
BIT $F4 : BVC - ; Show normal text if Y is not pressed BIT $F4 : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++ LDA.l AllowHammerTablets : BEQ ++
LDA $7EF34B : BEQ .yesText : BRA .noText LDA HammerEquipment : BEQ .yesText : BRA .noText
++ ++
LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : BCS .noText LDA SwordEquipment : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : BCS .noText
;++ ;++
.yesText .yesText
PLA PLA
@@ -356,9 +357,9 @@ DialogBombosTablet:
+ +
BIT $F4 : BVC - ; Show normal text if Y is not pressed BIT $F4 : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++ LDA.l AllowHammerTablets : BEQ ++
LDA $7EF34B : BEQ .yesText : BRA .noText LDA HammerEquipment : BEQ .yesText : BRA .noText
++ ++
LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText LDA SwordEquipment : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText
;++ ;++
.yesText .yesText
PLA PLA
@@ -371,7 +372,7 @@ DialogBombosTablet:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogSahasrahla: DialogSahasrahla:
LDA.l $7EF374 : AND #$04 : BEQ + ;Check if player has green pendant LDA.l PendantsField : AND #$04 : BEQ + ;Check if player has green pendant
LDA.b #$2F LDA.b #$2F
LDY.b #$00 LDY.b #$00
JML Sprite_ShowMessageUnconditional JML Sprite_ShowMessageUnconditional
@@ -380,7 +381,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogBombShopGuy: DialogBombShopGuy:
LDY.b #$15 LDY.b #$15
LDA.l $7EF37A : AND #$05 : CMP #$05 : BNE + ;Check if player has crystals 5 & 6 LDA.l CrystalsField : AND #$05 : CMP #$05 : BNE + ;Check if player has crystals 5 & 6
INY ; from 15 to 16 INY ; from 15 to 16
+ +
TYA TYA

View File

@@ -8,7 +8,7 @@ LockAgahnimDoors:
;#$0 = Never Locked ;#$0 = Never Locked
LDA.w #$0000 : RTL LDA.w #$0000 : RTL
+ : CMP.w #$0001 : BNE + + : CMP.w #$0001 : BNE +
LDA $7EF3C5 : AND.w #$000F : CMP.w #$0002 : !BGE .unlock ; if we rescued zelda, skip LDA ProgressIndicator : AND.w #$000F : CMP.w #$0002 : !BGE .unlock ; if we rescued zelda, skip
JSR.w LockAgahnimDoorsCore : RTL JSR.w LockAgahnimDoorsCore : RTL
+ : CMP.w #$0002 : BNE + + : CMP.w #$0002 : BNE +
JSR.w LockAgahnimDoorsCore : BEQ .unlock JSR.w LockAgahnimDoorsCore : BEQ .unlock
@@ -77,7 +77,7 @@ JML.l Overworld_Entrance_BRANCH_RHO
AllowStartFromSingleEntranceCave: AllowStartFromSingleEntranceCave:
; 16 Bit A, 16 bit XY ; 16 Bit A, 16 bit XY
; do not need to preserve A or X or Y ; do not need to preserve A or X or Y
LDA $7EF3C8 : AND.w #$00FF ; What we wrote over LDA StartingEntrance : AND.w #$00FF ; What we wrote over
PHA PHA
TAX TAX
@@ -138,7 +138,7 @@ AllowStartFromExit:
LDX $1CE8 LDX $1CE8
LDA.l ShouldStartatExit, X : BNE .doStart LDA.l ShouldStartatExit, X : BNE .doStart
LDA.l $7EF3C8 ; what we wrote over LDA.l StartingEntrance ; what we wrote over
JML.l AllowStartFromExitReturn JML.l AllowStartFromExitReturn
.doStart .doStart

View File

@@ -65,15 +65,15 @@ OnUncleItemGet:
PLA PLA
JSL Link_ReceiveItem JSL Link_ReceiveItem
LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA $7EF373 : + ; refill magic LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA MagicFiller : + ; refill magic
LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA $7EF375 : + ; refill bombs LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA BombsFiller : + ; refill bombs
LDA.l UncleRefill : BIT.b #$01 : BEQ + ; refill arrows LDA.l UncleRefill : BIT.b #$01 : BEQ + ; refill arrows
LDA.b #70 : STA $7EF376 LDA.b #70 : STA ArrowsFiller
LDA.l ArrowMode : BEQ + LDA.l ArrowMode : BEQ +
LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 ; enable bow toggle LDA BowTracking : ORA #$80 : STA BowTracking ; enable bow toggle
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA $7EF360 : !ADD.l FreeUncleItemAmount : STA $7EF360 ; rupee arrows, so also give the player some money to start LDA TargetRupees : !ADD.l FreeUncleItemAmount : STA TargetRupees ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
+ +
RTL RTL
@@ -95,9 +95,9 @@ OnFileLoad:
LDA.b #$07 : STA $210C ; Restore screen 3 to normal tile area LDA.b #$07 : STA $210C ; Restore screen 3 to normal tile area
LDA !FRESH_FILE_MARKER : BNE + LDA FileMarker : BNE +
JSL.l OnNewFile JSL.l OnNewFile
LDA.b #$FF : STA !FRESH_FILE_MARKER LDA.b #$FF : STA FileMarker
+ +
LDA.w $010A : BNE + ; don't adjust the worlds for "continue" or "save-continue" LDA.w $010A : BNE + ; don't adjust the worlds for "continue" or "save-continue"
LDA.l $7EC011 : BNE + ; don't adjust worlds if mosiac is enabled (Read: mirroring in dungeon) LDA.l $7EC011 : BNE + ; don't adjust worlds if mosiac is enabled (Read: mirroring in dungeon)
@@ -108,7 +108,7 @@ OnFileLoad:
LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in
LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
LDA.l GenericKeys : BEQ + LDA.l GenericKeys : BEQ +
LDA $7EF38B : STA $7EF36F ; copy generic keys to key counter LDA CurrentGenericKeys : STA CurrentSmallKeys ; copy generic keys to key counter
+ +
JSL.l SetSilverBowMode JSL.l SetSilverBowMode
@@ -125,17 +125,17 @@ RTL
OnNewFile: OnNewFile:
PHX : PHP PHX : PHP
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.l LinkStartingRupees : STA $7EF362 : STA $7EF360 LDA.l LinkStartingRupees : STA CurrentRupees : STA TargetRupees
LDA.l StartingTime : STA $7EF454 LDA.l StartingTime : STA $7EF454
LDA.l StartingTime+2 : STA $7EF454+2 LDA.l StartingTime+2 : STA $7EF454+2
LDX.w #$004E : - ; copy over starting equipment LDX.w #$004E : - ; copy over starting equipment
LDA StartingEquipment, X : STA $7EF340, X LDA StartingEquipment, X : STA SRAMEquipment, X
DEX : DEX DEX : DEX
BPL - BPL -
LDX #$000E : - LDX #$000E : -
LDA $7EF37C, X : STA $7EF4E0, X LDA SewerKeys, X : STA $7EF4E0, X
DEX : DEX DEX : DEX
BPL - BPL -
@@ -154,7 +154,7 @@ OnNewFile:
LDA.b #$20 : STA $7EF2C3 ; Ganons Tower already open LDA.b #$20 : STA $7EF2C3 ; Ganons Tower already open
+ +
LDA StartingSword : STA $7EF359 ; set starting sword type LDA StartingSword : STA SwordEquipment ; set starting sword type
; reset some values on new file that are otherwise only reset on hard reset ; reset some values on new file that are otherwise only reset on hard reset
STZ $03C4 ; ancilla slot index STZ $03C4 ; ancilla slot index

View File

@@ -2,20 +2,20 @@
; Fairy Changes & Fixes ; Fairy Changes & Fixes
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
RefillHealthPlusMagic: RefillHealthPlusMagic:
LDA BigFairyHealth : STA $7EF372 LDA BigFairyHealth : STA HeartsFiller
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
RefillHealthPlusMagic8bit: RefillHealthPlusMagic8bit:
LDA BigFairyHealth : STA $7EF372 LDA BigFairyHealth : STA HeartsFiller
LDA BigFairyMagic : STA $7EF373 LDA BigFairyMagic : STA MagicFiller
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckFullHealth: CheckFullHealth:
LDA BigFairyHealth : BEQ + LDA BigFairyHealth : BEQ +
LDA $7EF36D : CMP $7EF36C : BNE .player_hp_not_full_yet LDA CurrentHealth : CMP HealthCapacity : BNE .player_hp_not_full_yet
+ +
LDA BigFairyMagic : BEQ + LDA BigFairyMagic : BEQ +
LDA $7EF36E : CMP.b #$80 : BNE .player_mp_not_full_yet LDA CurrentMagic : CMP.b #$80 : BNE .player_mp_not_full_yet
+ +
LDA.b #$00 LDA.b #$00
RTL RTL
@@ -30,10 +30,10 @@ FairyPond_Init:
JML.l Sprite_ShowMessageFromPlayerContact JML.l Sprite_ShowMessageFromPlayerContact
+ +
PHY : JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC + PHY : JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC +
LDA $7EF35C : CMP.b #$02 : BNE ++ : LDA.b #$1C : PHA : BRA .emptyBottle : ++ LDA BottleContentsOne : CMP.b #$02 : BNE ++ : LDA.b #$1C : PHA : BRA .emptyBottle : ++
LDA $7EF35D : CMP.b #$02 : BNE ++ : LDA.b #$1D : PHA : BRA .emptyBottle : ++ LDA BottleContentsTwo : CMP.b #$02 : BNE ++ : LDA.b #$1D : PHA : BRA .emptyBottle : ++
LDA $7EF35E : CMP.b #$02 : BNE ++ : LDA.b #$1E : PHA : BRA .emptyBottle : ++ LDA BottleContentsThree : CMP.b #$02 : BNE ++ : LDA.b #$1E : PHA : BRA .emptyBottle : ++
LDA $7EF35F : CMP.b #$02 : BNE ++ : LDA.b #$1F : PHA : BRA .emptyBottle : ++ LDA BottleContentsFour : CMP.b #$02 : BNE ++ : LDA.b #$1F : PHA : BRA .emptyBottle : ++
.noInventory .noInventory
LDA.b #$0A : STA $0D80, X LDA.b #$0A : STA $0D80, X
LDA.b #$51 LDA.b #$51

View File

@@ -117,7 +117,7 @@ FastTextScroll:
RTL RTL
DumbFlagForMSU: DumbFlagForMSU:
STA.l $7EF3CA STA.l CurrentWorld
STZ.b $50 STZ.b $50
RTL RTL

View File

@@ -4,16 +4,16 @@
FlipperKill: FlipperKill:
PHP PHP
LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming
LDA $7EF356 : BNE .done ; skip if we have the flippers LDA FlippersEquipment : BNE .done ; skip if we have the flippers
LDA $7F5001 : BEQ .done ; skip if we're not marked in danger for softlock LDA $7F5001 : BEQ .done ; skip if we're not marked in danger for softlock
LDA $8A : CMP $7F5098 : BEQ .done ; skip if we're on the same screen we entered the water on LDA $8A : CMP $7F5098 : BEQ .done ; skip if we're on the same screen we entered the water on
;JSL.l KillFairies ; take away fairies ;JSL.l KillFairies ; take away fairies
LDA !IGNORE_FAIRIES : ORA.b #$04 : STA !IGNORE_FAIRIES LDA !IGNORE_FAIRIES : ORA.b #$04 : STA !IGNORE_FAIRIES
LDA.b #$00 : STA $7EF36D ; kill link LDA.b #$00 : STA CurrentHealth ; kill link
LDA.b #$00 : STA $7F5001 ; mark fake flipper softlock as impossible LDA.b #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
.done .done
PLP PLP
LDA $7EF36D ; thing we wrote over LDA CurrentHealth ; thing we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
IgnoreFairyCheck: IgnoreFairyCheck:
@@ -28,14 +28,14 @@ RTL
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;KillFairies: ;KillFairies:
; LDA $7EF35C : CMP #$06 : BNE + ; LDA BottleContentsOne : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35C ; LDA #$02 : STA BottleContentsOne
; + LDA $7EF35D : CMP #$06 : BNE + ; + LDA BottleContentsTwo : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35D ; LDA #$02 : STA BottleContentsTwo
; + LDA $7EF35E : CMP #$06 : BNE + ; + LDA BottleContentsThree : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35E ; LDA #$02 : STA BottleContentsThree
; + LDA $7EF35F : CMP #$06 : BNE + ; + LDA BottleContentsFour : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35F ; LDA #$02 : STA BottleContentsFour
; + ; +
;RTL ;RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -47,7 +47,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FlipperFlag: FlipperFlag:
LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming
LDA $7EF356 : BNE .safe ; skip if we have the flippers LDA FlippersEquipment : BNE .safe ; skip if we have the flippers
LDA #$01 : STA $7F5001 ; mark fake flipper softlock as possible LDA #$01 : STA $7F5001 ; mark fake flipper softlock as possible
BRA .done BRA .done
.safe .safe

View File

@@ -61,7 +61,7 @@ JML.l FluteBoy_Continue
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FreeDuckCheck: FreeDuckCheck:
LDA.l InvertedMode : BEQ .done LDA.l InvertedMode : BEQ .done
LDA $7EF34C : CMP.b #$03 : BEQ .done ; flute is already active LDA FluteEquipment : CMP.b #$03 : BEQ .done ; flute is already active
; check the area, is it #$18 = 30? ; check the area, is it #$18 = 30?
LDA $8A : CMP.b #$18 : BNE .done LDA $8A : CMP.b #$18 : BNE .done

View File

@@ -62,12 +62,12 @@ CheckGanonVulnerability:
; 02 = All dungeons ; 02 = All dungeons
.all_dungeons .all_dungeons
LDA.l $7EF3C5 : CMP.b #$03 : BCC .fail ; require post-aga world state LDA.l ProgressIndicator : CMP.b #$03 : BCC .fail ; require post-aga world state
; 09 = All dungeons except agahnim ; 09 = All dungeons except agahnim
.all_dungeons_no_agahnim .all_dungeons_no_agahnim
LDA.l $7EF374 : AND.b #$07 : CMP.b #$07 : BNE .fail ; require all pendants LDA.l PendantsField : AND.b #$07 : CMP.b #$07 : BNE .fail ; require all pendants
LDA.l $7EF37A : AND.b #$7F : CMP.b #$7F : BNE .fail ; require all crystals LDA.l CrystalsField : AND.b #$7F : CMP.b #$7F : BNE .fail ; require all crystals
LDA.l $7EF2DB : AND.b #$20 : BEQ .fail ; require aga2 defeated (pyramid hole open) LDA.l $7EF2DB : AND.b #$20 : BEQ .fail ; require aga2 defeated (pyramid hole open)
BRA .success BRA .success
@@ -125,12 +125,12 @@ GetRequiredCrystalsInX:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckEnoughCrystalsForGanon: CheckEnoughCrystalsForGanon:
LDA $7EF37A : JSL CountBits ; the comparison is against 1 less LDA CrystalsField : JSL CountBits ; the comparison is against 1 less
CMP.l NumberOfCrystalsRequiredForGanon CMP.l NumberOfCrystalsRequiredForGanon
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckEnoughCrystalsForTower: CheckEnoughCrystalsForTower:
LDA $7EF37A : JSL CountBits ; the comparison is against 1 less LDA CrystalsField : JSL CountBits ; the comparison is against 1 less
CMP.l NumberOfCrystalsRequiredForTower CMP.l NumberOfCrystalsRequiredForTower
RTL RTL
@@ -158,15 +158,15 @@ CheckAgaForPed:
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
KillGanon: KillGanon:
STA.l $7EF3C5 ; vanilla game state stuff we overwrote STA.l ProgressIndicator ; vanilla game state stuff we overwrote
LDA.l InvincibleGanon LDA.l InvincibleGanon
CMP.b #$06 : BNE .exit CMP.b #$06 : BNE .exit
.light_speed .light_speed
LDA.l $7EF2DB : ORA.b #$20 : STA.l $7EF2DB ; pyramid hole LDA.l $7EF2DB : ORA.b #$20 : STA.l $7EF2DB ; pyramid hole
LDA.b #$08 : STA.l $7EF001 ; kill ganon LDA.b #$08 : STA.l RoomData[$00].Low ; kill ganon
LDA.b #$02 : STA.l $7EF357 ; pearl but invisible in menu LDA.b #$02 : STA.l MoonPearlEquipment ; pearl but invisible in menu
.exit .exit
RTL RTL

View File

@@ -10,6 +10,6 @@ GetMagicBatItem:
JML.l Link_ReceiveItem JML.l Link_ReceiveItem
.normalLogic .normalLogic
LDA HalfMagic LDA HalfMagic
STA $7EF37B STA MagicConsumption
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -32,7 +32,7 @@ CalculateByrnaUsage:
LDA.l HardModeExclusionCaneOfByrnaUsage, X : STA $00 LDA.l HardModeExclusionCaneOfByrnaUsage, X : STA $00
PLX PLX
++ ++
LDA $7EF36E ; thing we wrote over LDA CurrentMagic ; thing we wrote over
JML IncrementMagicUseCounterByrna JML IncrementMagicUseCounterByrna
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CalculateCapeUsage: CalculateCapeUsage:

View File

@@ -15,7 +15,7 @@ HeartPieceGet:
STZ $02E9 ; 0 = Receiving item from an NPC or message STZ $02E9 ; 0 = Receiving item from an NPC or message
CPY.b #$26 : BNE .notHeart ; don't add a 1/4 heart if it's not a heart piece CPY.b #$26 : BNE .notHeart ; don't add a 1/4 heart if it's not a heart piece
LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .unfinished_heart ; add up heart quarters LDA HeartPieceQuarter : INC A : AND.b #$03 : STA HeartPieceQuarter : BNE .unfinished_heart ; add up heart quarters
BRA .giveItem BRA .giveItem
.notHeart .notHeart

View File

@@ -2483,7 +2483,7 @@ org $07A055 ; <- Bank07.asm:5205 (LDA $0B99 : BEQ BRANCH_DELTA)
JSL.l ArrowGame : NOP #14 JSL.l ArrowGame : NOP #14
org $07A06C ; <- Bank07.asm:5215 (LDA $7EF377 : BEQ BRANCH_EPSILON) org $07A06C ; <- Bank07.asm:5215 (LDA $7EF377 : BEQ BRANCH_EPSILON)
JSL.l DecrementArrows : SKIP 2 : NOP : LDA $7EF377 JSL.l DecrementArrows : SKIP 2 : NOP : LDA CurrentArrows
;================================================================================ ;================================================================================
;================================================================================ ;================================================================================

View File

@@ -131,7 +131,7 @@ db $02, $02, $02, $02, $02, $02, $02, $00, $00, $01, $01, $01, $02, $00, $08, $0
Electric_Barrier: Electric_Barrier:
LDA InvertedMode : BEQ .done LDA InvertedMode : BEQ .done
LDA $7EF280, X : ORA #$40 : STA $7EF280, X ;set barrier dead LDA OverworldData, X : ORA #$40 : STA $7EF280, X ;set barrier dead
.done .done
LDA $7EF280, X ; what we wrote over LDA $7EF280, X ; what we wrote over
RTL RTL

View File

@@ -1007,7 +1007,7 @@ LDA #$0108 : STA $3C38
;Warp Tile agah defeated ;Warp Tile agah defeated
LDA #$0034 : STA $3BBE ;Tile when no warp LDA #$0034 : STA $3BBE ;Tile when no warp
LDA $7EF3C5 : AND #$00FF : CMP #$0003 : BNE .agahnimAlive LDA ProgressIndicator : AND #$00FF : CMP #$0003 : BNE .agahnimAlive
LDA #$0212 : STA $3BBE ;warp LDA #$0212 : STA $3BBE ;warp
.agahnimAlive .agahnimAlive

View File

@@ -7,9 +7,9 @@ LampCheck:
LDA $7F50C4 : CMP.b #$01 : BNE + : RTL : + LDA $7F50C4 : CMP.b #$01 : BNE + : RTL : +
CMP.b #$FF : BNE + : INC : RTL : + CMP.b #$FF : BNE + : INC : RTL : +
LDA $7EF34A : BNE .done ; skip if we already have lantern LDA LampEquipment : BNE .done ; skip if we already have lantern
LDA $7EF3CA : BNE + LDA CurrentWorld : BNE +
.lightWorld .lightWorld
LDA $040C : BNE ++ ; check if we're in sewers LDA $040C : BNE ++ ; check if we're in sewers
LDA LampConeSewers : BRA .done LDA LampConeSewers : BRA .done
@@ -28,18 +28,18 @@ RTL
CheckForZelda: CheckForZelda:
;LDA.l OpenMode : BEQ + ; Skip if not open mode ;LDA.l OpenMode : BEQ + ; Skip if not open mode
;LDA $FFFFFF ;LDA $FFFFFF
LDA.l $7EF3C5 : CMP.b #$02 : !BLT + ; Skip if rain is falling LDA.l ProgressIndicator : CMP.b #$02 : !BLT + ; Skip if rain is falling
LDA.b #$01 ; pretend we have zelda anyway LDA.b #$01 ; pretend we have zelda anyway
RTL RTL
+ +
LDA $7EF3CC LDA FollowerIndicator
RTL RTL
;================================================================================ ;================================================================================
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetOverlayIfLamp: SetOverlayIfLamp:
;LDA $7EF34A ; check if lamp ;LDA LampEquipment ; check if lamp
JSL.l LampCheck JSL.l LampCheck
STA $1D ; write it directly to the overlay, this isn't a terrible idea at all STA $1D ; write it directly to the overlay, this isn't a terrible idea at all
RTL RTL
;================================================================================ ;================================================================================
;LDA $7EF3CA : EOR #$40 : LSR #6 : AND #$01 ; return the same result as having the lantern in the light world ;LDA CurrentWorld : EOR #$40 : LSR #6 : AND #$01 ; return the same result as having the lantern in the light world

View File

@@ -14,11 +14,11 @@ MaidenCrystalScript:
; Load the dungeon index. Is it the Dark Palace? ; Load the dungeon index. Is it the Dark Palace?
;LDA $040C : !SUB.b #$0A : TAY : CPY.b #$02 : BNE + ;LDA $040C : !SUB.b #$0A : TAY : CPY.b #$02 : BNE +
; LDA $7EF3C7 : CMP.b #$07 : BCS ++ : LDA.b #$07 : STA $7EF3C7 : ++ ; LDA MapIcons : CMP.b #$07 : BCS ++ : LDA.b #$07 : STA MapIcons : ++
;+ ;+
LDA $7EF37A : AND.b #$7F : CMP.b #$7F : BNE + ; check if we have all crystals LDA CrystalsField : AND.b #$7F : CMP.b #$7F : BNE + ; check if we have all crystals
LDA.b #$08 : STA $7EF3C7 ; Update the map icon to just be Ganon's Tower LDA.b #$08 : STA MapIcons ; Update the map icon to just be Ganon's Tower
+ +
JSL.l MaybeWriteSRAMTrace JSL.l MaybeWriteSRAMTrace

View File

@@ -2,11 +2,11 @@
; Mantle Object Changes ; Mantle Object Changes
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
Mantle_CorrectPosition: Mantle_CorrectPosition:
LDA $7EF3C6 : AND.b #$04 : BEQ + LDA ProgressFlags : AND.b #$04 : BEQ +
LDA.b #$0A : STA $0D10, X ; just spawn it off to the side where we know it should be LDA.b #$0A : STA $0D10, X ; just spawn it off to the side where we know it should be
LDA.b #$03 : STA $0D30, X LDA.b #$03 : STA $0D30, X
LDA.b #$90 : STA $0ED0, X LDA.b #$90 : STA $0ED0, X
+ +
LDA $0D00, X : !ADD.b #$03 ; thing we did originally LDA $0D00, X : !ADD.b #$03 ; thing we did originally
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

10
msu.asm
View File

@@ -257,13 +257,13 @@ CheckMusicLoadRequest:
-- : PLA : BRA .check_fallback-3 -- : PLA : BRA .check_fallback-3
.darkworld .darkworld
PHA PHA
LDA $7EF37A : CMP.b #$7F : BNE -- LDA CrystalsField : CMP.b #$7F : BNE --
- : PLA - : PLA
LDA.b #61 : BRA .check_fallback-3 LDA.b #61 : BRA .check_fallback-3
.darkwoods .darkwoods
PHA PHA
LDA $7EF37A : CMP.b #$7F : BEQ - LDA CrystalsField : CMP.b #$7F : BEQ -
LDA $7EF3CA : BEQ -- LDA CurrentWorld : BEQ --
LDA $8A : CMP #$40 : BNE -- LDA $8A : CMP #$40 : BNE --
PLA PLA
LDA.b #15 : BRA .check_fallback-3 LDA.b #15 : BRA .check_fallback-3
@@ -347,7 +347,7 @@ CheckMusicLoadRequest:
LDA $7EF2F0 : AND.b #$20 : BEQ .rain LDA $7EF2F0 : AND.b #$20 : BEQ .rain
+ +
LDA $7EF3C5 : CMP.b #$02 : BCS + LDA ProgressIndicator : CMP.b #$02 : BCS +
.rain .rain
LDX.b #$01 LDX.b #$01
+ +
@@ -385,7 +385,7 @@ SpiralStairsPreCheck:
LDA !REG_MSU_ID_45 : CMP !VAL_MSU_ID_45 : BNE .done LDA !REG_MSU_ID_45 : CMP !VAL_MSU_ID_45 : BNE .done
+ +
LDA $7EF366 : AND.w #$0004 : BEQ .done ; Check that we have the GT big key LDA BigKeyField : AND.w #$0004 : BEQ .done ; Check that we have the GT big key
LDA !REG_MSU_FALLBACK_TABLE+7 : AND.w #$0004 : BEQ .done ; Check that we have the extended track LDA !REG_MSU_FALLBACK_TABLE+7 : AND.w #$0004 : BEQ .done ; Check that we have the extended track
.fade .fade

View File

@@ -22,7 +22,7 @@ PreOverworld_LoadProperties_ChooseMusic:
LDX.b #$07 ; Default village theme LDX.b #$07 ; Default village theme
; Check what phase we're in ; Check what phase we're in
;LDA $7EF3C5 : CMP.b #$03 : !BLT + ;LDA ProgressIndicator : CMP.b #$03 : !BLT +
; LDX.b #$02 ; Default light world theme (phase >=3) ; LDX.b #$02 ; Default light world theme (phase >=3)
;+ ;+
@@ -45,14 +45,14 @@ PreOverworld_LoadProperties_ChooseMusic:
LDX.b #$02 LDX.b #$02
; Check phase ; In phase >= 2 ; Check phase ; In phase >= 2
LDA $7EF3C5 : CMP.b #$02 : !BGE + LDA ProgressIndicator : CMP.b #$02 : !BGE +
; If phase < 2, play the legend music ; If phase < 2, play the legend music
LDX.b #$03 LDX.b #$03
+ +
.endOfLightWorldChecks .endOfLightWorldChecks
; if we are in the light world go ahead and set chosen selection ; if we are in the light world go ahead and set chosen selection
LDA $7EF3CA : BEQ .checkInverted+4 LDA CurrentWorld : BEQ .checkInverted+4
LDX.b #$0F ; dark woods theme LDX.b #$0F ; dark woods theme
@@ -68,10 +68,10 @@ PreOverworld_LoadProperties_ChooseMusic:
; if not inverted and light world, or inverted and dark world, skip moon pearl check ; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted .checkInverted
LDA $7EF3CA : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck
; Does Link have a moon pearl? ; Does Link have a moon pearl?
LDA $7EF357 : BNE + LDA MoonPearlEquipment : BNE +
LDX.b #$04 ; bunny theme LDX.b #$04 ; bunny theme
+ +
@@ -117,8 +117,8 @@ Overworld_FinishMirrorWarp:
LDX.b #$04 ; bunny theme LDX.b #$04 ; bunny theme
; if not inverted and light world, or inverted and dark world, skip moon pearl check ; if not inverted and light world, or inverted and dark world, skip moon pearl check
LDA $7EF3CA : CLC : ROL #$03 : CMP InvertedMode : BEQ + LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ +
LDA $7EF357 : BEQ .endOfLightWorldChecks LDA MoonPearlEquipment : BEQ .endOfLightWorldChecks
+ +
LDX.b #$09 ; default dark world theme LDX.b #$09 ; default dark world theme
@@ -138,7 +138,7 @@ Overworld_FinishMirrorWarp:
CMP.b #$18 : BNE .endOfLightWorldChecks CMP.b #$18 : BNE .endOfLightWorldChecks
; Check what phase we're in ; Check what phase we're in
; LDA $7EF3C5 : CMP.b #$03 : !BGE .endOfLightWorldChecks ; LDA ProgressIndicator : CMP.b #$03 : !BGE .endOfLightWorldChecks
LDX.b #$07 ; Default village theme (phase <3) LDX.b #$07 ; Default village theme (phase <3)
.endOfLightWorldChecks .endOfLightWorldChecks
@@ -158,7 +158,7 @@ Overworld_FinishMirrorWarp:
LDX.b #$0D ; dark mountain theme LDX.b #$0D ; dark mountain theme
.bunny .bunny
LDA $7EF357 : ORA InvertedMode : BNE + LDA MoonPearlEquipment : ORA InvertedMode : BNE +
LDX #$04 ; bunny theme LDX #$04 ; bunny theme
+ +
@@ -185,7 +185,7 @@ BirdTravel_LoadTargetAreaMusic:
LDX.b #$07 ; Default village theme LDX.b #$07 ; Default village theme
; Check what phase we're in ; Check what phase we're in
;LDA $7EF3C5 : CMP.b #$03 : !BLT + ;LDA ProgressIndicator : CMP.b #$03 : !BLT +
; LDX.b #$02 ; Default light world theme (phase >=3) ; LDX.b #$02 ; Default light world theme (phase >=3)
;+ ;+
@@ -208,14 +208,14 @@ BirdTravel_LoadTargetAreaMusic:
LDX.b #$02 LDX.b #$02
; Check phase ; In phase >= 2 ; Check phase ; In phase >= 2
LDA $7EF3C5 : CMP.b #$02 : !BGE + LDA ProgressIndicator : CMP.b #$02 : !BGE +
; If phase < 2, play the legend music ; If phase < 2, play the legend music
LDX.b #$03 LDX.b #$03
+ +
.endOfLightWorldChecks .endOfLightWorldChecks
; if we are in the light world go ahead and set chosen selection ; if we are in the light world go ahead and set chosen selection
LDA $7EF3CA : BEQ .checkInverted+4 LDA CurrentWorld : BEQ .checkInverted+4
LDX.b #$09 ; dark overworld theme LDX.b #$09 ; dark overworld theme
@@ -236,16 +236,16 @@ BirdTravel_LoadTargetAreaMusic:
BRA .checkInverted BRA .checkInverted
.darkMountain .darkMountain
LDA $7EF37A : CMP.b #$7F : BEQ + LDA CrystalsField : CMP.b #$7F : BEQ +
LDX.b #$0D ; dark death mountain theme LDX.b #$0D ; dark death mountain theme
+ : LDA.b #$09 : STA $012D + : LDA.b #$09 : STA $012D
; if not inverted and light world, or inverted and dark world, skip moon pearl check ; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted .checkInverted
LDA $7EF3CA : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck
; Does Link have a moon pearl? ; Does Link have a moon pearl?
LDA $7EF357 : BNE + LDA MoonPearlEquipment : BNE +
LDX.b #$04 ; bunny theme LDX.b #$04 ; bunny theme
+ +
@@ -275,7 +275,7 @@ Overworld_MosaicDarkWorldChecks:
CMP.b #$51 : bne .doFade CMP.b #$51 : bne .doFade
.checkCrystals .checkCrystals
LDA $7EF37A : CMP.b #$7F : BEQ .done LDA CrystalsField : CMP.b #$7F : BEQ .done
.doFade .doFade
LDA.b #$F1 : STA $012C ; thing we wrote over, fade out music LDA.b #$F1 : STA $012C ; thing we wrote over, fade out music

View File

@@ -8,7 +8,7 @@ SEP #$30
LDA !INFINITE_BOMBS : BNE .infinite_bombs LDA !INFINITE_BOMBS : BNE .infinite_bombs
.finite_bombs .finite_bombs
LDA.l $7EF343 ; bombs LDA.l BombsEquipment ; bombs
JSR HudHexToDec2Digit ;requires 8 bit registers! JSR HudHexToDec2Digit ;requires 8 bit registers!
REP #$20 REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS ; Draw bombs 10 digit LDX.b $06 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS ; Draw bombs 10 digit
@@ -26,7 +26,7 @@ SEP #$30
!RUPEE_DRAW_ADDRESS = "$7EC750" !RUPEE_DRAW_ADDRESS = "$7EC750"
;================================================================================ ;================================================================================
LDA.l $7EF362 ; Drawing bombs (above) always ends with 16-bit A, so, no need to REP here LDA.l CurrentRupees ; Drawing bombs (above) always ends with 16-bit A, so, no need to REP here
JSR HudHexToDec4Digit JSR HudHexToDec4Digit
LDX.b $04 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS ; 1000s LDX.b $04 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS ; 1000s
LDX.b $05 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+2 ; 100s LDX.b $05 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+2 ; 100s
@@ -43,7 +43,7 @@ SEP #$30
LDA.l ArrowMode : BNE + LDA.l ArrowMode : BNE +
LDA !INFINITE_ARROWS : BNE .infinite_arrows LDA !INFINITE_ARROWS : BNE .infinite_arrows
.finite_arrows .finite_arrows
LDA.l $7EF377 ; arrows LDA.l CurrentArrows ; arrows
JSR HudHexToDec2Digit JSR HudHexToDec2Digit
REP #$20 REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS ; Draw arrows 10 digit LDX.b $06 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS ; Draw arrows 10 digit
@@ -104,12 +104,11 @@ SEP #$30
;================================================================================ ;================================================================================
; Draw key count ; Draw key count
!KEYS = "$7EF36F"
!KEY_DIGITS_ADDRESS = "$7EC764" !KEY_DIGITS_ADDRESS = "$7EC764"
!KEY_ICON_ADDRESS = "$7EC726" !KEY_ICON_ADDRESS = "$7EC726"
;================================================================================ ;================================================================================
SEP #$20 SEP #$20
LDA.l !KEYS : CMP.b #$FF : BEQ .not_in_dungeon LDA.l CurrentSmallKeys : CMP.b #$FF : BEQ .not_in_dungeon
.in_dungeon .in_dungeon
JSR HudHexToDec2Digit : REP #$20 JSR HudHexToDec2Digit : REP #$20
@@ -156,7 +155,7 @@ SEP #$30
REP #$20 REP #$20
BEQ .drawprize BEQ .drawprize
LDA.l $7EF368 LDA.l MapField
AND.l DungeonItemMasks,X AND.l DungeonItemMasks,X
BEQ .noprize BEQ .noprize
@@ -184,13 +183,13 @@ SEP #$30
!INFINITE_MAGIC = "$7F50CA" !INFINITE_MAGIC = "$7F50CA"
!DrawMagicMeter_mp_tilemap = "$0DFE0F" !DrawMagicMeter_mp_tilemap = "$0DFE0F"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LDA $7EF36E : AND #$00FF ; crap we wrote over when placing the hook for OnDrawHud LDA CurrentMagic : AND #$00FF ; crap we wrote over when placing the hook for OnDrawHud
!ADD #$0007 !ADD #$0007
AND #$FFF8 AND #$FFF8
TAX ; end of crap TAX ; end of crap
LDA !INFINITE_MAGIC : AND.w #$00FF : BNE + : JMP .green : + LDA !INFINITE_MAGIC : AND.w #$00FF : BNE + : JMP .green : +
SEP #$20 : LDA.b #$80 : STA $7EF36E : REP #$30 ; set magic to max SEP #$20 : LDA.b #$80 : STA CurrentMagic : REP #$30 ; set magic to max
LDX.w #$0080 ; load full magic meter graphics LDX.w #$0080 ; load full magic meter graphics
LDA $1A : AND.w #$000C : LSR #2 LDA $1A : AND.w #$000C : LSR #2
BEQ .red BEQ .red

View File

@@ -144,7 +144,6 @@ endmacro
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!CHALLENGE_TIMER = "$7EF454" !CHALLENGE_TIMER = "$7EF454"
!GOAL_COUNTER = "$7EF418" !GOAL_COUNTER = "$7EF418"
!INVENTORY_SWAP_2 = "$7EF38E"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;carry clear if pass ;carry clear if pass
;carry set if caught ;carry set if caught
@@ -201,62 +200,62 @@ AddReceivedItemExpandedGetItem:
LDA $02D8 ; check inventory LDA $02D8 ; check inventory
JSL.l FreeDungeonItemNotice JSL.l FreeDungeonItemNotice
CMP.b #$0B : BNE + ; Bow CMP.b #$0B : BNE + ; Bow
LDA !INVENTORY_SWAP_2 : AND.b #$40 : BEQ ++ LDA BowTracking : AND.b #$40 : BEQ ++
LDA.l SilverArrowsUseRestriction : BNE ++ LDA.l SilverArrowsUseRestriction : BNE ++
LDA.b #03 : STA $7EF340 ; set bow to silver LDA.b #03 : STA BowEquipment ; set bow to silver
++ ++
JMP .done JMP .done
+ CMP.b #$3B : BNE + ; Silver Bow + CMP.b #$3B : BNE + ; Silver Bow
LDA.l SilverArrowsUseRestriction : BNE .noequip LDA.l SilverArrowsUseRestriction : BNE .noequip
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ .noequip LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ .noequip
LDA $7EF376 : BNE ++ ; check arrows LDA ArrowsFiller : BNE ++ ; check arrows
LDA.b #$03 : BRA +++ ; bow without arrow LDA.b #$03 : BRA +++ ; bow without arrow
++ ++
LDA.b #$04 ; bow with arrow LDA.b #$04 ; bow with arrow
+++ +++
STA $7EF340 STA BowEquipment
.noequip .noequip
LDA !INVENTORY_SWAP_2 : ORA #$40 : STA !INVENTORY_SWAP_2 ; mark silver bow on y-toggle LDA BowTracking : ORA #$40 : STA BowTracking ; mark silver bow on y-toggle
JMP .done JMP .done
+ CMP.b #$4C : BNE + ; 50 bombs + CMP.b #$4C : BNE + ; 50 bombs
;LDA.b #$07 : STA $7EF370 ; upgrade bombs ;LDA.b #$07 : STA BombCapacityUpgrades ; upgrade bombs
LDA.b #50 : !SUB.l StartingMaxBombs : STA $7EF370 ; upgrade bombs LDA.b #50 : !SUB.l StartingMaxBombs : STA BombCapacityUpgrades ; upgrade bombs
LDA.b #50 : STA $7EF375 ; fill bombs LDA.b #50 : STA BombsFiller ; fill bombs
JMP .done JMP .done
+ CMP.b #$4D : BNE + ; 70 arrows + CMP.b #$4D : BNE + ; 70 arrows
;LDA #$07 : STA $7EF371 ; upgrade arrows ;LDA #$07 : STA ArrowCapacityUpgrades ; upgrade arrows
LDA.b #70 : !SUB.l StartingMaxArrows : STA $7EF371 ; upgrade arrows LDA.b #70 : !SUB.l StartingMaxArrows : STA ArrowCapacityUpgrades ; upgrade arrows
LDA.b #70 : STA $7EF376 ; fill arrows LDA.b #70 : STA ArrowsFiller ; fill arrows
JMP .done JMP .done
+ CMP.b #$4E : BNE + ; 1/2 magic + CMP.b #$4E : BNE + ; 1/2 magic
LDA $7EF37B : CMP #$02 : !BGE ++ LDA MagicConsumption : CMP #$02 : !BGE ++
INC : STA $7EF37B ; upgrade magic INC : STA MagicConsumption ; upgrade magic
++ ++
LDA.b #$80 : STA $7EF373 ; fill magic LDA.b #$80 : STA MagicFiller ; fill magic
JMP .done JMP .done
+ CMP.b #$4F : BNE + ; 1/4 magic + CMP.b #$4F : BNE + ; 1/4 magic
LDA.b #$02 : STA $7EF37B ; upgrade magic LDA.b #$02 : STA MagicConsumption ; upgrade magic
LDA.b #$80 : STA $7EF373 ; fill magic LDA.b #$80 : STA MagicFiller ; fill magic
JMP .done JMP .done
+ CMP.b #$50 : BNE + ; Master Sword (Safe) + CMP.b #$50 : BNE + ; Master Sword (Safe)
LDA $7EF359 : CMP.b #$02 : !BGE + ; skip if we have a better sword LDA SwordEquipment : CMP.b #$02 : !BGE + ; skip if we have a better sword
LDA.b #$02 : STA $7EF359 ; set master sword LDA.b #$02 : STA SwordEquipment ; set master sword
JMP .done JMP .done
+ CMP.b #$51 : BNE + ; +5 Bombs + CMP.b #$51 : BNE + ; +5 Bombs
LDA $7EF370 : !ADD.b #$05 : STA $7EF370 ; upgrade bombs +5 LDA BombCapacityUpgrades : !ADD.b #$05 : STA BombCapacityUpgrades ; upgrade bombs +5
LDA.l Upgrade5BombsRefill : STA $7EF375 ; fill bombs LDA.l Upgrade5BombsRefill : STA BombsFiller ; fill bombs
JMP .done JMP .done
+ CMP.b #$52 : BNE + ; +10 Bombs + CMP.b #$52 : BNE + ; +10 Bombs
LDA $7EF370 : !ADD.b #$0A : STA $7EF370 ; upgrade bombs +10 LDA BombCapacityUpgrades : !ADD.b #$0A : STA BombCapacityUpgrades ; upgrade bombs +10
LDA.l Upgrade10BombsRefill : STA $7EF375 ; fill bombs LDA.l Upgrade10BombsRefill : STA BombsFiller ; fill bombs
JMP .done JMP .done
+ CMP.b #$53 : BNE + ; +5 Arrows + CMP.b #$53 : BNE + ; +5 Arrows
LDA $7EF371 : !ADD.b #$05 : STA $7EF371 ; upgrade arrows +5 LDA ArrowCapacityUpgrades : !ADD.b #$05 : STA ArrowCapacityUpgrades ; upgrade arrows +5
LDA.l Upgrade5ArrowsRefill : STA $7EF376 ; fill arrows LDA.l Upgrade5ArrowsRefill : STA ArrowsFiller ; fill arrows
JMP .done JMP .done
+ CMP.b #$54 : BNE + ; +10 Arrows + CMP.b #$54 : BNE + ; +10 Arrows
LDA $7EF371 : !ADD.b #$0A : STA $7EF371 ; upgrade arrows +10 LDA ArrowCapacityUpgrades : !ADD.b #$0A : STA ArrowCapacityUpgrades ; upgrade arrows +10
LDA.l Upgrade10ArrowsRefill : STA $7EF376 ; fill arrows LDA.l Upgrade10ArrowsRefill : STA ArrowsFiller ; fill arrows
JMP .done JMP .done
+ CMP.b #$55 : BNE + ; Programmable Object 1 + CMP.b #$55 : BNE + ; Programmable Object 1
%ProgrammableItemLogic(1) %ProgrammableItemLogic(1)
@@ -270,15 +269,15 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$58 : BNE + ; Upgrade-Only Sivler Arrows + CMP.b #$58 : BNE + ; Upgrade-Only Sivler Arrows
LDA.l SilverArrowsUseRestriction : BNE +++ LDA.l SilverArrowsUseRestriction : BNE +++
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ +++ LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ +++
LDA $7EF340 : BEQ ++ : CMP.b #$03 : !BGE ++ LDA BowEquipment : BEQ ++ : CMP.b #$03 : !BGE ++
!ADD.b #$02 : STA $7EF340 ; switch to silver bow !ADD.b #$02 : STA BowEquipment ; switch to silver bow
++ ++
+++ +++
LDA.l ArrowMode : BEQ ++ LDA.l ArrowMode : BEQ ++
LDA.b #$01 : STA $7EF376 LDA.b #$01 : STA ArrowsFiller
++ ++
+ CMP.b #$59 : BNE + ; 1 Rupoor + CMP.b #$59 : BNE + ; 1 Rupoor
REP #$20 : LDA $7EF360 : !SUB RupoorDeduction : STA $7EF360 : SEP #$20 ; Take 1 rupee REP #$20 : LDA TargetRupees : !SUB RupoorDeduction : STA TargetRupees : SEP #$20 ; Take 1 rupee
JMP .done JMP .done
+ CMP.b #$5A : BNE + ; Null Item + CMP.b #$5A : BNE + ; Null Item
JMP .done JMP .done
@@ -345,53 +344,53 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$70 : !BLT + : CMP.b #$80 : !BGE + ; Free Map + CMP.b #$70 : !BLT + : CMP.b #$80 : !BGE + ; Free Map
AND #$0F : CMP #$08 : !BGE ++ AND #$0F : CMP #$08 : !BGE ++
%ValueShift() %ValueShift()
ORA $7EF368 : STA $7EF368 ; Map 1 ORA MapField : STA MapField ; Map 1
JMP .done JMP .done
++ ++
!SUB #$08 !SUB #$08
%ValueShift() %ValueShift()
BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both
ORA $7EF369 : STA $7EF369 ; Map 2 ORA MapField+1 : STA MapField+1 ; Map 2
JMP .done JMP .done
+ CMP.b #$80 : !BLT + : CMP.b #$90 : !BGE + ; Free Compass + CMP.b #$80 : !BLT + : CMP.b #$90 : !BGE + ; Free Compass
AND #$0F : CMP #$08 : !BGE ++ AND #$0F : CMP #$08 : !BGE ++
%ValueShift() %ValueShift()
ORA $7EF364 : STA $7EF364 ; Compass 1 ORA CompassField : STA CompassField ; Compass 1
JMP .done JMP .done
++ ++
!SUB #$08 !SUB #$08
%ValueShift() %ValueShift()
BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both
ORA $7EF365 : STA $7EF365 ; Compass 2 ORA CompassField+1 : STA CompassField+1 ; Compass 2
JMP .done JMP .done
+ CMP.b #$90 : !BLT + : CMP.b #$A0 : !BGE + ; Free Big Key + CMP.b #$90 : !BLT + : CMP.b #$A0 : !BGE + ; Free Big Key
AND #$0F : CMP #$08 : !BGE ++ AND #$0F : CMP #$08 : !BGE ++
%ValueShift() %ValueShift()
ORA $7EF366 : STA $7EF366 ; Big Key 1 ORA BigKeyField : STA BigKeyField ; Big Key 1
JMP .done JMP .done
++ ++
!SUB #$08 !SUB #$08
%ValueShift() %ValueShift()
BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both
ORA $7EF367 : STA $7EF367 ; Big Key 2 ORA BigKeyField+1 : STA BigKeyField+1 ; Big Key 2
JMP .done JMP .done
+ CMP.b #$A0 : !BLT + : CMP.b #$B0 : !BGE + ; Free Small Key + CMP.b #$A0 : !BLT + : CMP.b #$B0 : !BGE + ; Free Small Key
AND #$0F : TAX AND #$0F : TAX
LDA $7EF37C, X : INC : STA $7EF37C, X ; Increment Key Count LDA SewerKeys, X : INC : STA SewerKeys, X ; Increment Key Count
CPX.b #$00 : BNE ++ CPX.b #$00 : BNE ++
STA $7EF37D ; copy HC to sewers STA HyruleCastleKeys ; copy HC to sewers
++ : CPX.b #$01 : BNE ++ ++ : CPX.b #$01 : BNE ++
STA $7EF37C ; copy sewers to HC STA SewerKeys ; copy sewers to HC
++ ++
LDA.l GenericKeys : BEQ + LDA.l GenericKeys : BEQ +
.generic .generic
LDA $7EF36F : INC : STA $7EF36F LDA CurrentSmallKeys : INC : STA CurrentSmallKeys
JMP .done JMP .done
.normal .normal
TXA : ASL : CMP $040C : BNE ++ TXA : ASL : CMP $040C : BNE ++
LDA $7EF36F : INC : STA $7EF36F LDA CurrentSmallKeys : INC : STA CurrentSmallKeys
++ ++
JMP .done JMP .done
+ +
@@ -404,7 +403,7 @@ RTL
; #$90 - Big Keys ; #$90 - Big Keys
; #$A0 - Small Keys ; #$A0 - Small Keys
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ---- !HIGHEST_ARMOR_SHIELD_SWORD = "$7EF416" ; ss-- ----
!RNG_ITEM = "$7EF450" !RNG_ITEM = "$7EF450"
!SCRATCH_AREA = "$7F5020" !SCRATCH_AREA = "$7F5020"
!SINGLE_INDEX_TEMP = "$7F5020" !SINGLE_INDEX_TEMP = "$7F5020"
@@ -458,11 +457,11 @@ AddReceivedItemExpanded:
LDA.l BottleLimitReplacement : STA $02D8 LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done +++ : JMP .done
++ : CMP.b #$4E : BNE ++ ; Progressive Magic ++ : CMP.b #$4E : BNE ++ ; Progressive Magic
LDA $7EF37B : BEQ +++ LDA MagicConsumption : BEQ +++
LDA.b #$4F : STA $02D8 LDA.b #$4F : STA $02D8
+++ : JMP .done +++ : JMP .done
++ : CMP.b #$5E : BNE ++ ; Progressive Sword ++ : CMP.b #$5E : BNE ++ ; Progressive Sword
LDA $7EF359 : CMP.l ProgressiveSwordLimit : !BLT + LDA SwordEquipment : CMP.l ProgressiveSwordLimit : !BLT +
LDA.l ProgressiveSwordReplacement : STA $02D8 : JMP .done LDA.l ProgressiveSwordReplacement : STA $02D8 : JMP .done
+ : CMP.b #$00 : BNE + ; No Sword + : CMP.b #$00 : BNE + ; No Sword
LDA.b #$49 : STA $02D8 : JMP .done LDA.b #$49 : STA $02D8 : JMP .done
@@ -473,39 +472,35 @@ AddReceivedItemExpanded:
+ ; Everything Else + ; Everything Else
LDA.b #$03 : STA $02D8 : JMP .done LDA.b #$03 : STA $02D8 : JMP .done
++ : CMP.b #$5F : BNE ++ ; Progressive Shield ++ : CMP.b #$5F : BNE ++ ; Progressive Shield
LDA !PROGRESSIVE_SHIELD : LSR #6 : CMP.l ProgressiveShieldLimit : !BLT + LDA ShieldEquipment : CMP.l ProgressiveShieldLimit : !BLT +
LDA.l ProgressiveShieldReplacement : STA $02D8 : JMP .done LDA.l ProgressiveShieldReplacement : STA $02D8 : JMP .done
+ + : CMP.b #$00 : BNE + ; No Shield
LDA !PROGRESSIVE_SHIELD : AND.b #$C0 : BNE + ; No Shield LDA.b #$04 : STA $02D8 : JMP .done
LDA.b #$04 : STA $02D8 + : CMP.b #$01 : BNE + ; Fighter Shield
LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : JMP .done LDA.b #$05 : STA $02D8 : JMP .done
+ : CMP.b #$40 : BNE + ; Fighter Shield
LDA.b #$05 : STA $02D8
LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : JMP .done
+ ; Everything Else + ; Everything Else
LDA.b #$06 : STA $02D8 LDA.b #$06 : STA $02D8 : JMP .done
LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : JMP .done
++ : CMP.b #$60 : BNE ++ ; Progressive Armor ++ : CMP.b #$60 : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT +
LDA.l ProgressiveArmorReplacement : STA $02D8 : JMP .done LDA.l ProgressiveArmorReplacement : STA $02D8 : JMP .done
+ : CMP.b #$00 : BNE + ; No Armor + : CMP.b #$00 : BNE + ; No Armor
LDA.b #$22 : STA $02D8 : JMP .done LDA.b #$22 : STA $02D8 : JMP .done
+ ; Everything Else + ; Everything Else
LDA.b #$23 : STA $02D8 : JMP .done LDA.b #$23 : STA $02D8 : JMP .done
++ : CMP.b #$61 : BNE ++ ; Progressive Lifting Glove ++ : CMP.b #$61 : BNE ++ ; Progressive Lifting Glove
LDA $7EF354 : BNE + ; No Lift LDA GloveEquipment : BNE + ; No Lift
LDA.b #$1B : STA $02D8 : BRA .done LDA.b #$1B : STA $02D8 : BRA .done
+ ; Everything Else + ; Everything Else
LDA.b #$1C : STA $02D8 : BRA .done LDA.b #$1C : STA $02D8 : BRA .done
++ : CMP.b #$64 : BNE ++ : -- ; Progressive Bow ++ : CMP.b #$64 : BNE ++ : -- ; Progressive Bow
LDA $7EF340 : INC : LSR : CMP.l ProgressiveBowLimit : !BLT + LDA BowEquipment : INC : LSR : CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement : STA $02D8 : JMP .done LDA.l ProgressiveBowReplacement : STA $02D8 : JMP .done
+ : CMP.b #$00 : BNE + ; No Bow + : CMP.b #$00 : BNE + ; No Bow
LDA.b #$3A : STA $02D8 : BRA .done LDA.b #$3A : STA $02D8 : BRA .done
+ ; Any Bow + ; Any Bow
LDA.b #$3B : STA $02D8 : BRA .done LDA.b #$3B : STA $02D8 : BRA .done
++ : CMP.b #$65 : BNE ++ ; Progressive Bow 2 ++ : CMP.b #$65 : BNE ++ ; Progressive Bow 2
LDA.l !INVENTORY_SWAP_2 : ORA #$20 : STA.l !INVENTORY_SWAP_2 LDA.l BowTracking : ORA #$20 : STA.l BowTracking
BRA -- BRA --
; ++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest) ; ++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest)
; JSL ChestItemServiceRequest ; JSL ChestItemServiceRequest
@@ -758,7 +753,7 @@ org $A08800
dw $F359 ; Master Sword (Safe) dw $F359 ; Master Sword (Safe)
dw $F375, $F375, $F376, $F376 ; +5/+10 Bomb Arrows dw $F375, $F375, $F376, $F376 ; +5/+10 Bomb Arrows
dw $F41A, $F41C, $F41E ; 3x Programmable Item dw $F41A, $F41C, $F41E ; 3x Programmable Item
dw $F340 ; Upgrade-Only Sivler Arrows dw $F340 ; Upgrade-Only Silver Arrows
dw $F360 ; 1 Rupoor dw $F360 ; 1 Rupoor
dw $F36A ; Null Item dw $F36A ; Null Item
dw $F454, $F454, $F454 ; Red, Blue & Green Clocks dw $F454, $F454, $F454 ; Red, Blue & Green Clocks
@@ -918,8 +913,8 @@ Link_ReceiveItemAlternatesExpanded:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;DrawHUDSilverArrows: ;DrawHUDSilverArrows:
; LDA $7EF340 : AND.w #$00FF : BNE + ; LDA BowEquipment : AND.w #$00FF : BNE +
; LDA !INVENTORY_SWAP_2 : AND.w #$0040 : BEQ + ; LDA BowTracking : AND.w #$0040 : BEQ +
; LDA.w #$2810 : STA $11C8 ; LDA.w #$2810 : STA $11C8
; LDA.w #$2811 : STA $11CA ; LDA.w #$2811 : STA $11CA
; LDA.w #$2820 : STA $1208 ; LDA.w #$2820 : STA $1208
@@ -928,19 +923,19 @@ RTL
; LDA.w #$11CE : STA $00 ; thing we wrote over ; LDA.w #$11CE : STA $00 ; thing we wrote over
;RTL ;RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;Return $7EF340 but also draw silver arrows if you have the upgrade even if you don't have the bow ;Return BowEquipment but also draw silver arrows if you have the upgrade even if you don't have the bow
CheckHUDSilverArrows: CheckHUDSilverArrows:
LDA.l ArrowMode : BEQ .normal LDA.l ArrowMode : BEQ .normal
.rupee_arrows .rupee_arrows
JSL.l DrawHUDArrows JSL.l DrawHUDArrows
LDA $7EF340 LDA BowEquipment
RTL RTL
.normal .normal
LDA $7EF340 : BNE + LDA BowEquipment : BNE +
LDA !INVENTORY_SWAP_2 : AND.b #$40 : BEQ ++ LDA BowTracking : AND.b #$40 : BEQ ++
JSL.l DrawHUDArrows JSL.l DrawHUDArrows
++ ++
LDA $7EF340 LDA BowEquipment
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -948,9 +943,9 @@ DrawHUDArrows:
LDA.l ArrowMode : BEQ .normal LDA.l ArrowMode : BEQ .normal
.rupee_arrows .rupee_arrows
LDA $7EF377 : BEQ .none ; assuming silvers will increment this. if we go with something else, reorder these checks LDA CurrentArrows : BEQ .none ; assuming silvers will increment this. if we go with something else, reorder these checks
LDA $7EF340 : BNE + LDA BowEquipment : BNE +
LDA !INVENTORY_SWAP_2 : AND.b #$40 : BNE .silver LDA BowTracking : AND.b #$40 : BNE .silver
BRA .wooden BRA .wooden
+ CMP.b #03 : !BGE .silver + CMP.b #03 : !BGE .silver
@@ -1070,7 +1065,7 @@ IncrementItemCounters:
.match .match
PHX PHX
TXA : LSR #2 : TAX TXA : LSR #2 : TAX
LDA !ITEM_LIMIT_COUNTS, X : INC : STA !ITEM_LIMIT_COUNTS, X LDA ItemLimitCounts, X : INC : STA ItemLimitCounts, X
PLX PLX
BEQ .exit BEQ .exit
.noMatch .noMatch
@@ -1090,7 +1085,7 @@ AttemptItemSubstitution:
.match .match
PHX PHX
TXA : LSR #2 : TAX TXA : LSR #2 : TAX
LDA !ITEM_LIMIT_COUNTS, X LDA ItemLimitCounts, X
PLX PLX
CMP.l ItemSubstitutionRules+1, X : !BLT + CMP.l ItemSubstitutionRules+1, X : !BLT +
LDA.l ItemSubstitutionRules+2, X : STA 1,s LDA.l ItemSubstitutionRules+2, X : STA 1,s
@@ -1106,10 +1101,10 @@ RTS
CountBottles: CountBottles:
PHX PHX
LDX.b #$00 LDX.b #$00
LDA $7EF35C : BEQ ++ : INX LDA BottleContentsOne : BEQ ++ : INX
++ : LDA $7EF35D : BEQ ++ : INX ++ : LDA BottleContentsTwo : BEQ ++ : INX
++ : LDA $7EF35E : BEQ ++ : INX ++ : LDA BottleContentsThree : BEQ ++ : INX
++ : LDA $7EF35F : BEQ ++ : INX ++ : LDA BottleContentsFour : BEQ ++ : INX
++ ++
TXA TXA
PLX PLX

View File

@@ -49,11 +49,11 @@ ItemCheck_SickKid:
RTL RTL
ItemCheck_TreeKid: ItemCheck_TreeKid:
LDA !NPC_FLAGS : AND.b #$08 ; FluteBoy_Chillin - 73: LDA $7EF34C LDA !NPC_FLAGS : AND.b #$08 ; FluteBoy_Chillin - 73: LDA FluteEquipment
RTL RTL
ItemCheck_TreeKid2: ItemCheck_TreeKid2:
LDA !NPC_FLAGS : AND.b #$08 : LSR #$02 ; FluteAardvark_InitialStateFromFluteState - 225: LDA $7EF34C : AND.b #$03 LDA !NPC_FLAGS : AND.b #$08 : LSR #$02 ; FluteAardvark_InitialStateFromFluteState - 225: LDA FluteEquipment : AND.b #$03
RTL RTL
ItemCheck_TreeKid3: ItemCheck_TreeKid3:
@@ -92,7 +92,7 @@ ItemCheck_Catfish:
;LDA CatfishGoodItem : BEQ .junk ;LDA CatfishGoodItem : BEQ .junk
;PHX ;PHX
; LDA CatfishGoodItem+1 : TAX ; LDA CatfishGoodItem+1 : TAX
; LDA $7EF340-1, X ; LDA BowEquipment-1, X
;PLX ;PLX
;-- ;--
;CMP CatfishGoodItem : !BLT .oursNewer ;CMP CatfishGoodItem : !BLT .oursNewer

View File

@@ -6,15 +6,15 @@
!INFINITE_MAGIC = "$7F50CA" !INFINITE_MAGIC = "$7F50CA"
SetUncleRainState: SetUncleRainState:
LDA.l OpenMode : BEQ + : RTL : + ; we're done if open mode is on LDA.l OpenMode : BEQ + : RTL : + ; we're done if open mode is on
LDA.b #$01 : STA $7EF3C5 LDA.b #$01 : STA ProgressIndicator
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
InitOpenMode: InitOpenMode:
LDA.l OpenMode : BEQ + ; Skip if not open mode LDA.l OpenMode : BEQ + ; Skip if not open mode
LDA $7EF3C5 : CMP #$02 : !BGE + ; Skip if already past escape LDA ProgressIndicator : CMP #$02 : !BGE + ; Skip if already past escape
LDA.b #$02 : STA $7EF3C5 ; Go to post-escape phase (pre aga1) LDA.b #$02 : STA ProgressIndicator ; Go to post-escape phase (pre aga1)
LDA $7EF3C6 : ORA #$14 : STA $7EF3C6 ; remove uncle LDA ProgressFlags : ORA #$14 : STA ProgressFlags ; remove uncle
LDA $7EF3C8 : CMP #$05 : BEQ ++ : LDA.b #$01 : ++ : STA $7EF3C8 ; set spawn points to house+sanc unless already house+sanc+mountain LDA StartingEntrance : CMP #$05 : BEQ ++ : LDA.b #$01 : ++ : STA StartingEntrance ; set spawn points to house+sanc unless already house+sanc+mountain
LDA $7EF29B : ORA.b #$20 : STA $7EF29B ; open castle gate LDA $7EF29B : ORA.b #$20 : STA $7EF29B ; open castle gate
JSL MaybeSetPostAgaWorldState JSL MaybeSetPostAgaWorldState
+ +
@@ -22,8 +22,8 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MaybeSetPostAgaWorldState: MaybeSetPostAgaWorldState:
LDA.l InstantPostAgaWorldState : BEQ + ; Skip if not enabled LDA.l InstantPostAgaWorldState : BEQ + ; Skip if not enabled
LDA.b #$03 : STA $7EF3C5 ; Go to post-aga phase LDA.b #$03 : STA ProgressIndicator ; Go to post-aga phase
LDA $7EF282 : ORA.b #$20 : STA $7EF282 ; make lumberjack tree accessible LDA $7EF282 : ORA.b #$20 : STA $7EF282 ; make lumberjack tree accessible
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -8,13 +8,13 @@
FlipLWDWFlag: FlipLWDWFlag:
PHP PHP
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA $7EF3CA : EOR.b #$40 : STA $7EF3CA LDA CurrentWorld : EOR.b #$40 : STA CurrentWorld
BEQ + BEQ +
LDA.b #07 : BRA ++ ; dark world - crystals LDA.b #07 : BRA ++ ; dark world - crystals
+ +
LDA.b #03 ; light world - pendants LDA.b #03 ; light world - pendants
++ ++
STA $7EF3C7 STA MapIcons
PLP PLP
RTL RTL
;================================================================================ ;================================================================================
@@ -23,7 +23,7 @@ HUDRebuildIndoorHole:
LDA.l GenericKeys : BEQ .normal LDA.l GenericKeys : BEQ .normal
.generic .generic
PLA PLA
LDA $7EF38B ; generic key count LDA CurrentGenericKeys ; generic key count
JSL.l HUD_RebuildIndoor_Palace JSL.l HUD_RebuildIndoor_Palace
RTL RTL
.normal .normal
@@ -35,7 +35,7 @@ HUDRebuildIndoor:
LDA.l GenericKeys : BEQ .normal LDA.l GenericKeys : BEQ .normal
.generic .generic
LDA.b #$00 : STA $7EC017 LDA.b #$00 : STA $7EC017
LDA $7EF38B ; generic key count LDA CurrentGenericKeys ; generic key count
RTL RTL
.normal .normal
LDA.b #$00 : STA $7EC017 LDA.b #$00 : STA $7EC017
@@ -45,25 +45,24 @@ RTL
GetCrystalNumber: GetCrystalNumber:
PHX PHX
TXA : ASL : TAX TXA : ASL : TAX
LDA $7EF3CA : EOR.b #$40 : BNE + LDA CurrentWorld : EOR.b #$40 : BNE +
INX INX
+ +
LDA.l CrystalNumberTable-16, X LDA.l CrystalNumberTable-16, X
PLX PLX
RTL RTL
;================================================================================ ;================================================================================
!INVENTORY_MAP = "$7EF368"
!MAP_OVERLAY = "$7EF414" ; [2] !MAP_OVERLAY = "$7EF414" ; [2]
OverworldMap_CheckObject: OverworldMap_CheckObject:
PHX PHX
;CPX.b #$01 : BNE + : JMP ++ : + : JMP .fail ;CPX.b #$01 : BNE + : JMP ++ : + : JMP .fail
LDA $7EF3CA : AND.b #$40 : BNE + LDA CurrentWorld : AND.b #$40 : BNE +
;LW Map ;LW Map
LDA.l MapMode : BEQ +++ LDA.l MapMode : BEQ +++
LDA !INVENTORY_MAP : ORA !MAP_OVERLAY : AND.b #$01 : BNE +++ LDA MapField : ORA !MAP_OVERLAY : AND.b #$01 : BNE +++
PHX PHX
LDA.l .lw_map_offsets, X : TAX ; put map offset into X LDA.l .lw_map_offsets, X : TAX ; put map offset into X
LDA !INVENTORY_MAP, X : ORA !MAP_OVERLAY, X LDA MapField, X : ORA !MAP_OVERLAY, X
PLX PLX
AND.l .lw_map_masks, X : BNE +++ AND.l .lw_map_masks, X : BNE +++
JMP .fail JMP .fail
@@ -74,10 +73,10 @@ OverworldMap_CheckObject:
+ +
;DW Map ;DW Map
LDA.l MapMode : BEQ +++ LDA.l MapMode : BEQ +++
LDA !INVENTORY_MAP : ORA !MAP_OVERLAY : AND.b #$02 : BNE +++ LDA MapField : ORA !MAP_OVERLAY : AND.b #$02 : BNE +++
PHX PHX
LDA.l .dw_map_offsets, X : TAX ; put map offset into X LDA.l .dw_map_offsets, X : TAX ; put map offset into X
LDA.l !INVENTORY_MAP, X : ORA !MAP_OVERLAY, X LDA.l MapField, X : ORA !MAP_OVERLAY, X
PLX PLX
AND.l .dw_map_masks, X : BNE +++ AND.l .dw_map_masks, X : BNE +++
JMP .fail JMP .fail
@@ -92,11 +91,11 @@ RTL
AND.b #$40 : BNE .checkCrystal AND.b #$40 : BNE .checkCrystal
.checkPendant .checkPendant
LDA $7EF374 : AND.l CrystalPendantFlags, X : BNE .fail LDA PendantsField : AND.l CrystalPendantFlags, X : BNE .fail
CLC : BRA .done CLC : BRA .done
.checkCrystal .checkCrystal
LDA $7EF37A : AND.l CrystalPendantFlags, X : BNE .fail LDA CrystalsField : AND.l CrystalPendantFlags, X : BNE .fail
CLC : BRA .done CLC : BRA .done
.fail .fail
@@ -121,18 +120,18 @@ db $02, $80, $08, $10, $01, $40, $04
SetLWDWMap: SetLWDWMap:
PHP PHP
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA $7EF3CA : EOR.b #$40 LDA CurrentWorld : EOR.b #$40
BNE + BNE +
LDA.b #07 : BRA ++ ; dark world - crystals LDA.b #07 : BRA ++ ; dark world - crystals
+ +
LDA.b #03 ; light world - pendants LDA.b #03 ; light world - pendants
++ ++
STA $7EF3C7 STA MapIcons
PLP PLP
RTL RTL
;================================================================================ ;================================================================================
GetMapMode: GetMapMode:
LDA $7EF3CA : AND.b #$40 : BEQ + LDA CurrentWorld : AND.b #$40 : BEQ +
LDA.b #07 ; dark world - crystals LDA.b #07 ; dark world - crystals
RTL RTL
+ +
@@ -205,13 +204,13 @@ UpdateKeys:
LSR : TAX ; get dungeon index and store to X LSR : TAX ; get dungeon index and store to X
LDA $7EF36F ; load current key count LDA CurrentSmallKeys ; load current key count
STA $7EF37C, X ; save to main counts STA SewerKeys, X ; save to main counts
CPX.b #$00 : BNE + CPX.b #$00 : BNE +
STA $7EF37D ; copy HC to sewers STA HyruleCastleKeys ; copy HC to sewers
+ : CPX.b #$01 : BNE + + : CPX.b #$01 : BNE +
STA $7EF37C ; copy sewers to HC STA SewerKeys ; copy sewers to HC
+ +
.skip .skip
JSL.l PostItemGet JSL.l PostItemGet
@@ -285,19 +284,19 @@ DrawHUDDungeonItems:
dw 30 ; Ganon's Tower dw 30 ; Ganon's Tower
.small_key_x_offset .small_key_x_offset
dw $7EF37D-$7EF37D ; Hyrule Castle dw HyruleCastleKeys-DungeonKeys ; Hyrule Castle
dw $7EF37E-$7EF37D ; Eastern dw EasternKeys-DungeonKeys ; Eastern
dw $7EF37F-$7EF37D ; Desert dw DesertKeys-DungeonKeys ; Desert
dw $7EF386-$7EF37D ; Hera dw HeraKeys-DungeonKeys ; Hera
dw $7EF380-$7EF37D ; Agahnims Tower dw CastleTowerKeys-DungeonKeys ; Agahnims Tower
dw $7EF382-$7EF37D ; PoD dw PalaceOfDarknessKeys-DungeonKeys ; PoD
dw $7EF381-$7EF37D ; Swamp dw SwampKeys-DungeonKeys ; Swamp
dw $7EF384-$7EF37D ; Skull Woods dw SkullWoodsKeys-DungeonKeys ; Skull Woods
dw $7EF387-$7EF37D ; Thieves Town dw ThievesTownKeys-DungeonKeys ; Thieves Town
dw $7EF385-$7EF37D ; Ice dw IcePalaceKeys-DungeonKeys ; Ice
dw $7EF383-$7EF37D ; Mire dw MireKeys-DungeonKeys ; Mire
dw $7EF388-$7EF37D ; Turtle Rock dw TurtleRockKeys-DungeonKeys ; Turtle Rock
dw $7EF389-$7EF37D ; Ganon's Tower dw GanonsTowerKeys-DungeonKeys ; Ganon's Tower
.dungeon_bitmasks .dungeon_bitmasks
@@ -386,7 +385,7 @@ DrawHUDDungeonItems:
.next_small_key .next_small_key
LDX.w .small_key_x_offset,Y LDX.w .small_key_x_offset,Y
LDA.l $7EF37D,X LDA.l DungeonKeys,X
AND.w #$00FF AND.w #$00FF
LDX.w .dungeon_positions,Y LDX.w .dungeon_positions,Y
@@ -410,7 +409,7 @@ DrawHUDDungeonItems:
LDX.w #0 LDX.w #0
; load once and test multiple times ; load once and test multiple times
LDA.l $7EF366 LDA.l BigKeyField
.next_big_key .next_big_key
BIT.w .dungeon_bitmasks,X BIT.w .dungeon_bitmasks,X
@@ -421,7 +420,7 @@ DrawHUDDungeonItems:
STA.w $16C6,Y STA.w $16C6,Y
; reload ; reload
LDA.l $7EF366 LDA.l BigKeyField
..skip_key ..skip_key
INX : INX INX : INX
@@ -469,7 +468,7 @@ DrawHUDDungeonItems:
LDX.w #0 LDX.w #0
; load once and test multiple times ; load once and test multiple times
LDA.l $7EF368 LDA.l MapField
.next_map .next_map
BIT.w .dungeon_bitmasks,X BIT.w .dungeon_bitmasks,X
@@ -480,7 +479,7 @@ DrawHUDDungeonItems:
STA.w $1686,Y STA.w $1686,Y
; reload ; reload
LDA.l $7EF368 LDA.l MapField
..skip_map ..skip_map
INX : INX INX : INX
@@ -498,7 +497,7 @@ DrawHUDDungeonItems:
LDX.w #0 LDX.w #0
; load once and test multiple times ; load once and test multiple times
LDA.l $7EF364 LDA.l CompassField
.next_compass .next_compass
BIT.w .dungeon_bitmasks,X BIT.w .dungeon_bitmasks,X
@@ -509,7 +508,7 @@ DrawHUDDungeonItems:
STA.w $16C6,Y STA.w $16C6,Y
; reload ; reload
LDA.l $7EF364 LDA.l CompassField
..skip_compass ..skip_compass
INX : INX INX : INX
@@ -542,7 +541,7 @@ DrawPendantCrystalDiagram:
INX #2 : CPX.w #$0014 : BCC - INX #2 : CPX.w #$0014 : BCC -
; pendants ; pendants
LDA $7EF374 LDA PendantsField
LSR : BCC + ; pendant of wisdom (red) LSR : BCC + ; pendant of wisdom (red)
LDX.w #$252B LDX.w #$252B
@@ -569,7 +568,7 @@ DrawPendantCrystalDiagram:
; crystals ; crystals
LDA $7EF37A LDA CrystalsField
LDX.w #$2D44 LDX.w #$2D44
LDY.w #$2D45 LDY.w #$2D45
@@ -675,4 +674,4 @@ dw $A8FB, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $E8FB
;0x1A - Ganon's Tower ;0x1A - Ganon's Tower
;0x1C - ??? possibly unused. (Were they planning two extra dungeons perhaps?) ;0x1C - ??? possibly unused. (Were they planning two extra dungeons perhaps?)
;0x1E - ??? possibly unused. ;0x1E - ??? possibly unused.
;================================================================================ ;================================================================================

View File

@@ -1,30 +1,35 @@
; Note shortly before this we have a blank-the-sram slot code that we might want to hook ; Note shortly before this we have a blank-the-sram slot code that we might want to hook
WriteBlanksToPlayerName: WriteBlanksToPlayerName:
STA.l !ExtendedPlayerName STA.l ExtendedFileNameSRAM
STA.l !ExtendedPlayerName+2 STA.l ExtendedFileNameSRAM+2
STA.l !ExtendedPlayerName+4 STA.l ExtendedFileNameSRAM+4
STA.l !ExtendedPlayerName+6 STA.l ExtendedFileNameSRAM+6
STA.l !ExtendedPlayerName+8 STA.l ExtendedFileNameSRAM+8
STA.l !ExtendedPlayerName+10 STA.l ExtendedFileNameSRAM+10
STA.l !ExtendedPlayerName+12 STA.l ExtendedFileNameSRAM+12
STA.l !ExtendedPlayerName+14 STA.l ExtendedFileNameSRAM+14
STA.l $7003D9, X ;What we wrote over (clear first byte of vanilla name slot) STA.l ExtendedFileNameSRAM+16
STA.l ExtendedFileNameSRAM+18
STA.l ExtendedFileNameSRAM+20
STA.l ExtendedFileNameSRAM+22
STA.l $7003D9, X ;What we wrote over (clear first byte of vanilla name slot)
RTL RTL
WriteCharacterToPlayerName: WriteCharacterToPlayerName:
CPX.w #$0008 : !BLT .orig STA ExtendedFileNameSRAM, X
STA !ExtendedPlayerName-8, X CPX.w #$0008 : !BGE +
.orig STA $7003D9, X ;what we wrote over
STA $7003D9, X ;what we wrote over +
RTL RTL
ReadCharacterFromPlayerName: ;Only for use on Name Screen ReadCharacterFromPlayerName: ;Only for use on Name Screen
CPX.w #$0008 : !BLT .orig LDA ExtendedFileNameSRAM, X
LDA !ExtendedPlayerName-8, X CPX.w #$0008 : !BGE +
.orig LDA $7003D9, X ;what we wrote over
LDA $7003D9, X ;what we wrote over +
RTL RTL
GetCharacterPosition: GetCharacterPosition:

View File

@@ -15,19 +15,19 @@ RefillHealth:
LDA.l PotionHealthRefill : CMP.b #$A0 : !BGE .done LDA.l PotionHealthRefill : CMP.b #$A0 : !BGE .done
LDA !BUSY_HEALTH : BNE ++ LDA !BUSY_HEALTH : BNE ++
LDA.l PotionHealthRefill ; load refill amount LDA.l PotionHealthRefill ; load refill amount
!ADD $7EF36D ; add to current health !ADD CurrentHealth ; add to current health
CMP $7EF36C : !BLT +++ : LDA $7EF36C : +++ CMP HealthCapacity : !BLT +++ : LDA HealthCapacity : +++
STA !BUSY_HEALTH STA !BUSY_HEALTH
++ ++
LDA $7EF36D : CMP.l !BUSY_HEALTH : !BLT ++ LDA CurrentHealth : CMP.l !BUSY_HEALTH : !BLT ++
LDA.b #$00 : STA $7EF372 LDA.b #$00 : STA HeartsFiller
LDA $020A : BNE .notDone LDA $020A : BNE .notDone
LDA.b #$00 : STA !BUSY_HEALTH LDA.b #$00 : STA !BUSY_HEALTH
SEC SEC
RTL RTL
++ ++
LDA.b #$08 : STA $7EF372 ; refill some health LDA.b #$08 : STA HeartsFiller ; refill some health
.notDone .notDone
CLC CLC
RTL RTL
@@ -35,16 +35,16 @@ RefillHealth:
; Check goal health versus actual health. ; Check goal health versus actual health.
; if(actual < goal) then branch. ; if(actual < goal) then branch.
LDA $7EF36D : CMP $7EF36C : BCC .refillAllHealth LDA CurrentHealth : CMP HealthCapacity : BCC .refillAllHealth
LDA $7EF36C : STA $7EF36D LDA HealthCapacity : STA CurrentHealth
LDA.b #$00 : STA $7EF372 LDA.b #$00 : STA HeartsFiller
; ??? not sure what purpose this branch serves. ; ??? not sure what purpose this branch serves.
LDA $020A : BNE .beta LDA $020A : BNE .beta
SEC SEC
RTL RTL
.refillAllHealth .refillAllHealth
; Fill up ze health. ; Fill up ze health.
LDA.b #$A0 : STA $7EF372 LDA.b #$A0 : STA HeartsFiller
.beta .beta
CLC CLC
RTL RTL
@@ -62,27 +62,27 @@ RefillMagic:
LDA.l PotionMagicRefill : CMP.b #$80 : !BGE .done LDA.l PotionMagicRefill : CMP.b #$80 : !BGE .done
LDA !BUSY_MAGIC : BNE ++ LDA !BUSY_MAGIC : BNE ++
LDA.l PotionMagicRefill ; load refill amount LDA.l PotionMagicRefill ; load refill amount
!ADD $7EF36E ; add to current magic !ADD CurrentMagic ; add to current magic
CMP.b #$80 : !BLT +++ : LDA.b #$80 : +++ CMP.b #$80 : !BLT +++ : LDA.b #$80 : +++
STA !BUSY_MAGIC STA !BUSY_MAGIC
++ ++
LDA $7EF36E : CMP.l !BUSY_MAGIC : !BLT ++ LDA CurrentMagic : CMP.l !BUSY_MAGIC : !BLT ++
LDA.b #$00 : STA !BUSY_MAGIC LDA.b #$00 : STA !BUSY_MAGIC
SEC SEC
RTL RTL
++ ++
LDA.b #$01 : STA $7EF373 ; refill some magic LDA.b #$01 : STA MagicFiller ; refill some magic
CLC CLC
RTL RTL
.done .done
SEP #$30 SEP #$30
; Check if Link's magic meter is full ; Check if Link's magic meter is full
LDA $7EF36E : CMP.b #$80 LDA CurrentMagic : CMP.b #$80
BCS .itsFull BCS .itsFull
; Tell the magic meter to fill up until it's full. ; Tell the magic meter to fill up until it's full.
LDA.b #$80 : STA $7EF373 LDA.b #$80 : STA MagicFiller
SEP #$30 SEP #$30
RTL RTL
.itsFull .itsFull

View File

@@ -28,7 +28,7 @@ QuickSwap:
BRA .store BRA .store
.special_swap .special_swap
LDA !INVENTORY_SWAP_2 : ORA #$01 : STA !INVENTORY_SWAP_2 LDA BowTracking : ORA #$01 : STA BowTracking
CPX.b #$02 : BEQ + ; boomerang CPX.b #$02 : BEQ + ; boomerang
CPX.b #$01 : BEQ + ; bow CPX.b #$01 : BEQ + ; bow
CPX.b #$05 : BEQ + ; powder CPX.b #$05 : BEQ + ; powder
@@ -50,10 +50,10 @@ RTL
RCode: RCode:
LDX.w $0202 LDX.w $0202
LDA.b $F2 : BIT #$20 : BNE ++ ; Still holding L from a previous frame LDA.b $F2 : BIT #$20 : BNE ++ ; Still holding L from a previous frame
LDA !INVENTORY_SWAP_2 : AND #$FE : STA !INVENTORY_SWAP_2 LDA BowTracking : AND #$FE : STA BowTracking
BRA + BRA +
++ ++
LDA !INVENTORY_SWAP_2 : BIT #$01 : BEQ + LDA BowTracking : BIT #$01 : BEQ +
RTS RTS
- -
+ CPX.b #$14 : BNE + : LDX.b #$00 ;will wrap around to 1 + CPX.b #$14 : BNE + : LDX.b #$00 ;will wrap around to 1
@@ -65,10 +65,10 @@ RTS
LCode: LCode:
LDX.w $0202 LDX.w $0202
LDA.b $F2 : BIT #$10 : BNE ++ ; Still holding R from a previous frame LDA.b $F2 : BIT #$10 : BNE ++ ; Still holding R from a previous frame
LDA !INVENTORY_SWAP_2 : AND #$FE : STA !INVENTORY_SWAP_2 LDA BowTracking : AND #$FE : STA BowTracking
BRA + BRA +
++ ++
LDA !INVENTORY_SWAP_2 : BIT #$01 : BEQ + LDA BowTracking : BIT #$01 : BEQ +
RTS RTS
- -
+ CPX.b #$01 : BNE + : LDX.b #$15 ; will wrap around to $14 + CPX.b #$01 : BNE + : LDX.b #$15 ; will wrap around to $14

View File

@@ -10,13 +10,13 @@ RTL
LoadBombCount: LoadBombCount:
LDA !INFINITE_BOMBS : BNE .infinite LDA !INFINITE_BOMBS : BNE .infinite
.finite .finite
LDA $7EF343 LDA BombsEquipment
.infinite .infinite
RTL RTL
LoadBombCount16: LoadBombCount16:
LDA !INFINITE_BOMBS : AND.w #$00FF : BNE .infinite LDA !INFINITE_BOMBS : AND.w #$00FF : BNE .infinite
.finite .finite
LDA $7EF343 LDA BombsEquipment
.infinite .infinite
RTL RTL
StoreBombCount: StoreBombCount:
@@ -24,13 +24,13 @@ StoreBombCount:
.infinite .infinite
PLA : LDA.b #$01 : RTL PLA : LDA.b #$01 : RTL
.finite .finite
PLA : STA $7EF343 PLA : STA BombsEquipment
RTL RTL
SearchForEquippedItem: SearchForEquippedItem:
LDA !INFINITE_BOMBS : BEQ + LDA !INFINITE_BOMBS : BEQ +
LDA.b #$01 : LDX.b #$00 : RTL LDA.b #$01 : LDX.b #$00 : RTL
+ +
LDA $7EF340 ; thing we wrote over LDA BowEquipment ; thing we wrote over
RTL RTL
!INFINITE_ARROWS = "$7F50C8" !INFINITE_ARROWS = "$7F50C8"
@@ -40,8 +40,8 @@ DecrementArrows:
.infinite .infinite
LDA.b #$01 : RTL LDA.b #$01 : RTL
.normal .normal
LDA $7EF377 : BEQ .done LDA CurrentArrows : BEQ .done
DEC : STA $7EF377 : INC DEC : STA CurrentArrows : INC
BRA .done BRA .done
.rupees .rupees
REP #$20 REP #$20
@@ -51,17 +51,17 @@ DecrementArrows:
LDA.b #$00 : BRA .done LDA.b #$00 : BRA .done
.not_archery_game .not_archery_game
LDA.l $7EF377 : BNE .shoot_arrow ; check if we have arrows LDA.l CurrentArrows : BNE .shoot_arrow ; check if we have arrows
BRA .done BRA .done
.shoot_arrow .shoot_arrow
PHX PHX
REP #$20 REP #$20
LDA $7EF360 : BEQ + LDA TargetRupees : BEQ +
PHA : LDA $7EF340 : DEC : AND #$0002 : TAX : PLA PHA : LDA BowEquipment : DEC : AND #$0002 : TAX : PLA
!SUB.l ArrowModeWoodArrowCost, X ; CMP.w #$0000 !SUB.l ArrowModeWoodArrowCost, X ; CMP.w #$0000
BMI .not_enough_money BMI .not_enough_money
STA $7EF360 : LDA.w #$0001 : BRA + STA TargetRupees : LDA.w #$0001 : BRA +
.not_enough_money .not_enough_money
LDA.w #$0000 LDA.w #$0000
+ +
@@ -76,13 +76,13 @@ ArrowGame:
DEC $0B99 ; reduce minigame arrow count DEC $0B99 ; reduce minigame arrow count
LDA.l ArrowMode : BNE .rupees LDA.l ArrowMode : BNE .rupees
.normal .normal
LDA $7EF377 : INC #2 : STA $7EF377 ; increment arrow count (by 2 for some reason) LDA CurrentArrows : INC #2 : STA CurrentArrows ; increment arrow count (by 2 for some reason)
RTL RTL
.rupees .rupees
PHX PHX
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA $7EF340 : DEC : AND #$0002 : TAX LDA BowEquipment : DEC : AND #$0002 : TAX
LDA $7EF360 : !ADD.l ArrowModeWoodArrowCost, X : STA $7EF360 LDA TargetRupees : !ADD.l ArrowModeWoodArrowCost, X : STA TargetRupees
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
PLX PLX
+ +

View File

@@ -97,7 +97,7 @@ RNG_Ganon_Extra_Warp:
PLA PLA
RTL RTL
RNG_Enemy_Drops: RNG_Enemy_Drops:
LDA.l $7EF3C5 : CMP #$01 : BEQ + ; drops are static after uncle pickup & before rescuing zelda LDA.l ProgressIndicator : CMP #$01 : BEQ + ; drops are static after uncle pickup & before rescuing zelda
JML GetRandomInt JML GetRandomInt
+ +
LDA.b #$0F LDA.b #$0F

View File

@@ -84,7 +84,7 @@ IcePalaceBombosNE:
RTL RTL
CastleEastEntrance: CastleEastEntrance:
LDA $7EF3C5 : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1) LDA ProgressIndicator : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1)
LDA.l BlockCastleDoorsInRain : BNE + : RTL : + LDA.l BlockCastleDoorsInRain : BNE + : RTL : +
REP #$20 ; 16 A REP #$20 ; 16 A
@@ -115,7 +115,7 @@ CastleEastEntrance:
RTL RTL
CastleWestEntrance: CastleWestEntrance:
LDA $7EF3C5 : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1) LDA ProgressIndicator : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1)
LDA.l BlockCastleDoorsInRain : BNE + : RTL : + LDA.l BlockCastleDoorsInRain : BNE + : RTL : +
REP #$20 ; 16 A REP #$20 ; 16 A

View File

@@ -11,7 +11,7 @@ Draw4DigitRupees:
BRA .print BRA .print
.outdoors .outdoors
.normal .normal
LDA $7EF362 LDA CurrentRupees
.print .print
JSL.l HexToDec JSL.l HexToDec
LDA $7F5004 : AND.w #$00FF : ORA.w #$2400 : STA $7EC750 LDA $7F5004 : AND.w #$00FF : ORA.w #$2400 : STA $7EC750
@@ -19,4 +19,4 @@ Draw4DigitRupees:
LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC754 LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC754
LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC756 LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC756
RTL RTL
;================================================================================ ;================================================================================

View File

@@ -168,7 +168,7 @@ SpritePrep_ShopKeeper:
PHY PHY
PHX PHX
LDA.b #$00 : XBA : TYA : LSR #2 : !ADD !SHOP_SRAM_INDEX : TAX LDA.b #$00 : XBA : TYA : LSR #2 : !ADD !SHOP_SRAM_INDEX : TAX
LDA !SHOP_PURCHASE_COUNTS, X : TYX : STA.l !SHOP_INVENTORY+3, X : TAY LDA PurchaseCounts, X : TYX : STA.l !SHOP_INVENTORY+3, X : TAY
PLX PLX
LDA.l ShopContentsTable+4, X : BEQ ++ LDA.l ShopContentsTable+4, X : BEQ ++
@@ -214,7 +214,7 @@ SpritePrep_ShopKeeper:
.takeAll .takeAll
LDA.b #$00 : XBA : LDA !SHOP_SRAM_INDEX : TAX LDA.b #$00 : XBA : LDA !SHOP_SRAM_INDEX : TAX
LDA.l !SHOP_PURCHASE_COUNTS, X LDA.l PurchaseCounts, X
BRA ++ BRA ++
.notTakeAll .notTakeAll
LDA.b #$00 LDA.b #$00
@@ -266,7 +266,7 @@ RTS
;!SHOP_INVENTORY, X ;!SHOP_INVENTORY, X
;[id][$lo][$hi][purchase_counter] ;[id][$lo][$hi][purchase_counter]
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;!SHOP_PURCHASE_COUNTS = "$7EF302" ;PurchaseCounts = "$7EF51A"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
Shopkeeper_UploadVRAMTilesLong: Shopkeeper_UploadVRAMTilesLong:
JSR.w Shopkeeper_UploadVRAMTiles JSR.w Shopkeeper_UploadVRAMTiles
@@ -390,13 +390,13 @@ Sprite_ShopKeeper:
BIT.b #$20 : BNE + ; Not A Take-All BIT.b #$20 : BNE + ; Not A Take-All
PHX PHX
LDA !SHOP_SRAM_INDEX : TAX LDA !SHOP_SRAM_INDEX : TAX
LDA !SHOP_PURCHASE_COUNTS, X : BEQ ++ : PLX : BRA .done : ++ LDA PurchaseCounts, X : BEQ ++ : PLX : BRA .done : ++
PLX PLX
BRA .normal BRA .normal
+ ; Take-All + ; Take-All
;PHX ;PHX
; LDA !SHOP_SRAM_INDEX : TAX ; LDA !SHOP_SRAM_INDEX : TAX
; LDA.w !SHOP_PURCHASE_COUNTS, X : STA.l !SHOP_STATE ; LDA.w PurchaseCounts, X : STA.l !SHOP_STATE
;PLX ;PLX
.normal .normal
@@ -539,7 +539,7 @@ Shopkeeper_BuyItem:
+ +
LDA !SHOP_TYPE : AND.b #$80 : BNE .buy ; don't charge if this is a take-any LDA !SHOP_TYPE : AND.b #$80 : BNE .buy ; don't charge if this is a take-any
REP #$20 : LDA $7EF360 : CMP.l !SHOP_INVENTORY+1, X : SEP #$20 : !BGE .buy REP #$20 : LDA TargetRupees : CMP.l !SHOP_INVENTORY+1, X : SEP #$20 : !BGE .buy
.cant_afford .cant_afford
LDA.b #$7A LDA.b #$7A
@@ -555,7 +555,7 @@ Shopkeeper_BuyItem:
JMP .done JMP .done
.buy .buy
LDA !SHOP_TYPE : AND.b #$80 : BNE ++ ; don't charge if this is a take-any LDA !SHOP_TYPE : AND.b #$80 : BNE ++ ; don't charge if this is a take-any
REP #$20 : LDA $7EF360 : !SUB !SHOP_INVENTORY+1, X : STA $7EF360 : SEP #$20 ; Take price away REP #$20 : LDA TargetRupees : !SUB !SHOP_INVENTORY+1, X : STA TargetRupees : SEP #$20 ; Take price away
++ ++
LDA.l !SHOP_INVENTORY, X : TAY : JSL.l Link_ReceiveItem LDA.l !SHOP_INVENTORY, X : TAY : JSL.l Link_ReceiveItem
LDA.l !SHOP_INVENTORY+3, X : INC : STA.l !SHOP_INVENTORY+3, X LDA.l !SHOP_INVENTORY+3, X : INC : STA.l !SHOP_INVENTORY+3, X
@@ -565,7 +565,7 @@ Shopkeeper_BuyItem:
LDA.l !SHOP_STATE : ORA.w Shopkeeper_ItemMasks, X : STA.l !SHOP_STATE LDA.l !SHOP_STATE : ORA.w Shopkeeper_ItemMasks, X : STA.l !SHOP_STATE
PHX PHX
TXA : !ADD !SHOP_SRAM_INDEX : TAX TXA : !ADD !SHOP_SRAM_INDEX : TAX
LDA !SHOP_PURCHASE_COUNTS, X : INC : BEQ +++ : STA !SHOP_PURCHASE_COUNTS, X : +++ LDA PurchaseCounts, X : INC : BEQ +++ : STA PurchaseCounts, X : +++
PLX PLX
BRA ++ BRA ++
+ ; Take-any + ; Take-any
@@ -573,11 +573,11 @@ Shopkeeper_BuyItem:
BIT.b #$20 : BNE .takeAll BIT.b #$20 : BNE .takeAll
.takeAny .takeAny
LDA.l !SHOP_STATE : ORA.b #$07 : STA.l !SHOP_STATE LDA.l !SHOP_STATE : ORA.b #$07 : STA.l !SHOP_STATE
PHX : LDA.l !SHOP_SRAM_INDEX : TAX : LDA.b #$01 : STA.l !SHOP_PURCHASE_COUNTS, X : PLX PHX : LDA.l !SHOP_SRAM_INDEX : TAX : LDA.b #$01 : STA.l PurchaseCounts, X : PLX
BRA ++ BRA ++
.takeAll .takeAll
LDA.l !SHOP_STATE : ORA.w Shopkeeper_ItemMasks, X : STA.l !SHOP_STATE LDA.l !SHOP_STATE : ORA.w Shopkeeper_ItemMasks, X : STA.l !SHOP_STATE
PHX : LDA.l !SHOP_SRAM_INDEX : TAX : LDA.l !SHOP_STATE : STA.l !SHOP_PURCHASE_COUNTS, X : PLX PHX : LDA.l !SHOP_SRAM_INDEX : TAX : LDA.l !SHOP_STATE : STA.l PurchaseCounts, X : PLX
++ ++
.done .done
PLY : PLX PLY : PLX
@@ -587,7 +587,7 @@ db #$01, #$02, #$04
;-------------------- ;--------------------
;!SHOP_ID = "$7F5050" ;!SHOP_ID = "$7F5050"
;!SHOP_SRAM_INDEX = "$7F5062" ;!SHOP_SRAM_INDEX = "$7F5062"
;!SHOP_PURCHASE_COUNTS = "$7EF302" ;PurchaseCounts = "$7EF51A"
;-------------------- ;--------------------
Setup_ShopItemCollisionHitbox: Setup_ShopItemCollisionHitbox:
;The complications with XBA are to handle the fact that nintendo likes to store ;The complications with XBA are to handle the fact that nintendo likes to store

View File

@@ -39,7 +39,7 @@ SpriteSwap_Palette_ArmorAndGloves:
SEP #$30 SEP #$30
LDA !SPRITE_SWAP : BNE .continue LDA !SPRITE_SWAP : BNE .continue
REP #$30 REP #$30
LDA $7EF354 LDA GloveEquipment
JSL $1BEE21 ; Read Original Palette Code JSL $1BEE21 ; Read Original Palette Code
RTL RTL

View File

@@ -98,48 +98,51 @@ skip 1 ; Not used
SwordEquipment: skip 1 ; $01 = Fighter | $02 = Master | $03 = Tempered | $04 = Gold SwordEquipment: skip 1 ; $01 = Fighter | $02 = Master | $03 = Tempered | $04 = Gold
ShieldEquipment: skip 1 ; $01 = Fighter | $02 = Red | $03 = Mirror ShieldEquipment: skip 1 ; $01 = Fighter | $02 = Red | $03 = Mirror
ArmorEquipment: skip 1 ; $00 = Green | $01 = Blue | $02 = Red ArmorEquipment: skip 1 ; $00 = Green | $01 = Blue | $02 = Red
BottleContentsOne: skip 1 ; \ Bottle Contents BottleContents: ; \ Bottle Contents
BottleContentsOne: skip 1 ; |
BottleContentsTwo: skip 1 ; | $00 = No Bottle | $01 = Mushroom | $02 = Empty Bottle BottleContentsTwo: skip 1 ; | $00 = No Bottle | $01 = Mushroom | $02 = Empty Bottle
BottleContentsThree: skip 1 ; | $03 = Red Potion | $04 = Green Potion | $05 = Blue Potion BottleContentsThree: skip 1 ; | $03 = Red Potion | $04 = Green Potion | $05 = Blue Potion
BottleContentsFour: skip 1 ; / $06 = Fairy | $07 = Bee | $08 = Good Bee BottleContentsFour: skip 1 ; / $06 = Fairy | $07 = Bee | $08 = Good Bee
TargetRupees: skip 2 ; \ CurrentRupees will always increment or decrement to match TargetRupees: skip 2 ; \ CurrentRupees will always increment or decrement to match
CurrentRupees: skip 2 ; / TargetRupees if not equal (16-bit integer) CurrentRupees: skip 2 ; / TargetRupees if not equal (16-bit integer)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Dungeon item bitfields CompassField: skip 2 ; Dungeon item bitfields
CompassFieldOne: skip 2 ; \ - - g r t h i s BigKeyField: skip 2 ; Low byte: - - g r t h i s
BigKeyFieldOne: skip 2 ; | g = Ganon's Tower | r = Turtle Rock | t = Thieves' Town MapField: skip 2 ; g = Ganon's Tower | r = Turtle Rock | t = Thieves' Town
MapFieldOne: skip -3 ; / h = Tower of Hera | i = Ice Palace | s = Skull Woods ; h = Tower of Hera | i = Ice Palace | s = Skull Woods
CompassFieldTwo: skip 2 ; \ m d s a t e h p ;------------------------------------------------
BigKeyFieldTwo: skip 2 ; | m = Misery Mire | d = Palace of Darkness | s = Swamp Palace ; High Byte: m d s a t e h p
MapFieldTwo: skip 1 ; | a = Aga Tower | t = Desert Palace | e = Eastern Palace ; m = Misery Mire | d = Palace of Darkness | s = Swamp Palace
; / h = Hyrule Castle | s = Sewer Passage ; a = Aga Tower | t = Desert Palace | e = Eastern Palace
; h = Hyrule Castle | s = Sewer Passage
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; HUD & other equipment ; HUD & other equipment
skip 1 ; Wishing Pond Rupee (Unused) skip 1 ; Wishing Pond Rupee (Unused)
HeartPieceFraction: skip 1 ; Heart pieces of four for upgrade. Wraps around to $00 after $03. HeartPieceQuarter: skip 1 ; Heart pieces of four for health upgrade. Wraps around to $00 after $03.
HealthCapacity: skip 1 ; \ Health Capacity & Current Health HealthCapacity: skip 1 ; \ Health Capacity & Current Health
CurrentHealth: skip 1 ; / Max value is $A0 | $04 = half heart | $08 = heart CurrentHealth: skip 1 ; / Max value is $A0 | $04 = half heart | $08 = heart
CurrentMagic: skip 1 ; Current magic | Max value is $80 CurrentMagic: skip 1 ; Current magic | Max value is $80
CurrentSmallKeys: skip 1 ; Number of small keys held for current dungeon (integer) CurrentSmallKeys: skip 1 ; Number of small keys held for current dungeon (integer)
BombCapacityUpgrades: skip 1 ; \ Bomb & Arrow Capacity Upgrades BombCapacityUpgrades: skip 1 ; \ Bomb & Arrow Capacity Upgrades
ArrowCapacityUpgrades: skip 1 ; / Indicates flatly how many can be held above vanilla max (integers) ArrowCapacityUpgrades: skip 1 ; / Indicates flatly how many can be held above vanilla max (integers)
HeartFiller: skip 1 ; Hearts collected yet to be filled. Write in multiples of $08 HeartsFiller: skip 1 ; Hearts collected yet to be filled. Write in multiples of $08
MagicFiller: skip 1 ; Magic collected yet to be filled MagicFiller: skip 1 ; Magic collected yet to be filled
PendantsField: skip 1 ; - - - - - g b r (bitfield) PendantsField: skip 1 ; - - - - - g b r (bitfield)
; g = Green (Courage) | b = Blue (Power) | r = Red (Wisdom) ; g = Green (Courage) | b = Blue (Power) | r = Red (Wisdom)
BombFiller: skip 1 ; Bombs collected yet to be filled (integer) BombsFiller: skip 1 ; Bombs collected yet to be filled (integer)
ArrowFiller: skip 1 ; Arrows collected yet to be filled (integer) ArrowsFiller: skip 1 ; Arrows collected yet to be filled (integer)
CurrentArrows: skip 1 ; Current arrows (integer) CurrentArrows: skip 1 ; Current arrows (integer)
skip 1 ; Unknown skip 1 ; Unknown
AbilityFlags: skip 1 ; - r t - p d s - (bitfield) AbilityFlags: skip 1 ; - r t - p d s - (bitfield)
; r = Read | t = Talk | p = Pull | d = Dash ; r = Read | t = Talk | p = Pull | d = Dash
; s = Swim ; s = Swim
CurrentCrystals: skip 1 ; - 3 4 2 7 5 1 6 (bitfield) CrystalsField: skip 1 ; - 3 4 2 7 5 1 6 (bitfield)
MagicConsumption: skip 1 ; $00 = Normal | $01 = Half Magic | $02 = Quarter Magic MagicConsumption: skip 1 ; $00 = Normal | $01 = Half Magic | $02 = Quarter Magic
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Small keys earned per dungeon (integers) ; Small keys earned per dungeon (integers)
SewerKeys: skip 1 ; \ Hyrule Castle and Sewer keys typically increment SewerKeys: skip 1 ; \ Hyrule Castle and Sewer keys typically increment
HyruleCastleKeys: skip 1 ; / and decrement together DungeonKeys: ; | and decrement together
HyruleCastleKeys: skip 1 ; /
EasternKeys: skip 1 ; Eastern Palace small keys EasternKeys: skip 1 ; Eastern Palace small keys
DesertKeys: skip 1 ; Desert Palace small keys DesertKeys: skip 1 ; Desert Palace small keys
CastleTowerKeys: skip 1 ; Agahnim's Tower small keys CastleTowerKeys: skip 1 ; Agahnim's Tower small keys
@@ -152,7 +155,8 @@ HeraKeys: skip 1 ; Tower of Hera small keys
ThievesTownKeys: skip 1 ; Thieves' Town small keys ThievesTownKeys: skip 1 ; Thieves' Town small keys
TurtleRockKeys: skip 1 ; Turtle Rock small keys TurtleRockKeys: skip 1 ; Turtle Rock small keys
GanonsTowerKeys: skip 1 ; Ganon's Tower small keys GanonsTowerKeys: skip 1 ; Ganon's Tower small keys
skip 2 ; Unused skip 1 ; Unused
CurrentGenericKeys: skip 1 ; Generic small keys
;================================================================================ ;================================================================================
; Tracking & Indicators ($7EF38C - $7EF3F0) ; Tracking & Indicators ($7EF38C - $7EF3F0)
@@ -166,9 +170,9 @@ BowTracking: skip 2 ; b s p - - - - - (bitfield)
; The front end writes two distinct progressive bow items. p ; The front end writes two distinct progressive bow items. p
; indicates whether the "second" has been found independent of ; indicates whether the "second" has been found independent of
; the first ; the first
ItemLimitCounts: skip 3 ; Keeps track of limited non-progressive items such as lamp. ItemLimitCounts: skip 10 ; Keeps track of limited non-progressive items such as lamp.
; See: ItemSubstitutionRules in tables.asm ; See: ItemSubstitutionRules in tables.asm
skip 50 ; skip 43 ;
ProgressIndicator: skip 1 ; $00 = Pre-Uncle | $01 = Post-Uncle item | $02 = Zelda Rescued ProgressIndicator: skip 1 ; $00 = Pre-Uncle | $01 = Post-Uncle item | $02 = Zelda Rescued
; $03 = Agahnim 1 defeated ; $03 = Agahnim 1 defeated
; $04 and above don't do anything. $00-$02 used in standard mode ; $04 and above don't do anything. $00-$02 used in standard mode
@@ -382,28 +386,25 @@ assert BottleContentsFour = $7EF35F, "BottleContentsFour labeled at incorrec
assert TargetRupees = $7EF360, "TargetRupees labeled at incorrect address" assert TargetRupees = $7EF360, "TargetRupees labeled at incorrect address"
assert CurrentRupees = $7EF362, "CurrentRupees labeled at incorrect address" assert CurrentRupees = $7EF362, "CurrentRupees labeled at incorrect address"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
assert CompassFieldOne = $7EF364, "Compass bitfield labeled at incorrect address" assert CompassField = $7EF364, "Compass bitfield labeled at incorrect address"
assert CompassFieldTwo = $7EF365, "Compass bitfield labeled at incorrect address" assert BigKeyField = $7EF366, "Big Key item bitfield labeled at incorrect address"
assert BigKeyFieldOne = $7EF366, "Big Key item bitfield labeled at incorrect address" assert MapField = $7EF368, "Map item bitfield labeled at incorrect address"
assert BigKeyFieldTwo = $7EF367, "Big Key item bitfield labeled at incorrect address"
assert MapFieldOne = $7EF368, "Map item bitfield labeled at incorrect address"
assert MapFieldTwo = $7EF369, "Map item bitfield labeled at incorrect address"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
assert HeartPieceFraction = $7EF36B, "HeartPieceFraction labeled at incorrect address" assert HeartPieceQuarter = $7EF36B, "HeartPieceQuarter labeled at incorrect address"
assert HealthCapacity = $7EF36C, "HealthCapacity labeled at incorrect address" assert HealthCapacity = $7EF36C, "HealthCapacity labeled at incorrect address"
assert CurrentHealth = $7EF36D, "CurrentHealth labeled at incorrect address" assert CurrentHealth = $7EF36D, "CurrentHealth labeled at incorrect address"
assert CurrentMagic = $7EF36E, "CurrentMagic labeled at incorrect address" assert CurrentMagic = $7EF36E, "CurrentMagic labeled at incorrect address"
assert CurrentSmallKeys = $7EF36F, "CurrentSmallKeys labeled at incorrect address" assert CurrentSmallKeys = $7EF36F, "CurrentSmallKeys labeled at incorrect address"
assert BombCapacityUpgrades = $7EF370, "BombCapacityUpgrades labeled at incorrect address" assert BombCapacityUpgrades = $7EF370, "BombCapacityUpgrades labeled at incorrect address"
assert ArrowCapacityUpgrades = $7EF371, "ArrowCapacityUpgrades labeled at incorrect address" assert ArrowCapacityUpgrades = $7EF371, "ArrowCapacityUpgrades labeled at incorrect address"
assert HeartFiller = $7EF372, "HeartFiller labeled at incorrect address" assert HeartsFiller = $7EF372, "HeartsFiller labeled at incorrect address"
assert MagicFiller = $7EF373, "MagicFiller labeled at incorrect address" assert MagicFiller = $7EF373, "MagicFiller labeled at incorrect address"
assert PendantsField = $7EF374, "PendantsField labeled at incorrect address" assert PendantsField = $7EF374, "PendantsField labeled at incorrect address"
assert BombFiller = $7EF375, "BombFiller labeled at incorrect address" assert BombsFiller = $7EF375, "BombsFiller labeled at incorrect address"
assert ArrowFiller = $7EF376, "ArrowFiller labeled at incorrect address" assert ArrowsFiller = $7EF376, "ArrowsFiller labeled at incorrect address"
assert CurrentArrows = $7EF377, "CurrentArrows labeled at incorrect address" assert CurrentArrows = $7EF377, "CurrentArrows labeled at incorrect address"
assert AbilityFlags = $7EF379, "AbilityFlags labeled at incorrect address" assert AbilityFlags = $7EF379, "AbilityFlags labeled at incorrect address"
assert CurrentCrystals = $7EF37A, "CurrentCrystals labeled at incorrect address" assert CrystalsField = $7EF37A, "CrystalsField labeled at incorrect address"
assert MagicConsumption = $7EF37B, "MagicConsumption labeled at incorrect address" assert MagicConsumption = $7EF37B, "MagicConsumption labeled at incorrect address"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
assert SewerKeys = $7EF37C, "SewerKeys labeled at incorrect address" assert SewerKeys = $7EF37C, "SewerKeys labeled at incorrect address"
@@ -420,6 +421,7 @@ assert HeraKeys = $7EF386, "HeraKeys labeled at incorrect address"
assert ThievesTownKeys = $7EF387, "ThievesTownKeys labeled at incorrect address" assert ThievesTownKeys = $7EF387, "ThievesTownKeys labeled at incorrect address"
assert TurtleRockKeys = $7EF388, "TurtleRockKeys labeled at incorrect address" assert TurtleRockKeys = $7EF388, "TurtleRockKeys labeled at incorrect address"
assert GanonsTowerKeys = $7EF389, "GanonsTowerKeys labeled at incorrect address" assert GanonsTowerKeys = $7EF389, "GanonsTowerKeys labeled at incorrect address"
assert CurrentGenericKeys = $7EF38B, "CurrentGenericKeys labeled at incorrect address"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
assert ProgressIndicator = $7EF3C5, "ProgressIndicator labeled at incorrect address" assert ProgressIndicator = $7EF3C5, "ProgressIndicator labeled at incorrect address"
assert ProgressFlags = $7EF3C6, "ProgressFlags labeled at incorrect address" assert ProgressFlags = $7EF3C6, "ProgressFlags labeled at incorrect address"

View File

@@ -107,9 +107,9 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; $7EF44B - flute counter ; $7EF44B - flute counter
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; $7EF44Cl[3] - RTA-Timestamp (Start) ; $7EF44Cl[3] - Unused
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; $7EF44Fl[3] - RTA-Timestamp (End) ; $7EF44Fl[3] - Unused
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; $7EF452 - sssscccc ; $7EF452 - sssscccc
; s - swordless bosses ; s - swordless bosses
@@ -182,10 +182,10 @@ DungeonHoleEntranceTransition:
LDA.l SilverArrowsAutoEquip : AND.b #$02 : BEQ + LDA.l SilverArrowsAutoEquip : AND.b #$02 : BEQ +
LDA $010E : CMP.b #$7B : BNE + ; skip unless falling to ganon's room LDA $010E : CMP.b #$7B : BNE + ; skip unless falling to ganon's room
LDA !INVENTORY_SWAP_2 : AND.b #$40 : BEQ + ; skip if we don't have silvers LDA BowTracking : AND.b #$40 : BEQ + ; skip if we don't have silvers
LDA $7EF340 : BEQ + ; skip if we have no bow LDA BowEquipment : BEQ + ; skip if we have no bow
CMP.b #$03 : !BGE + ; skip if the bow is already silver CMP.b #$03 : !BGE + ; skip if the bow is already silver
!ADD #$02 : STA $7EF340 ; increase bow to silver !ADD #$02 : STA BowEquipment ; increase bow to silver
+ +
BRA StatTransitionCounter BRA StatTransitionCounter
@@ -218,7 +218,7 @@ IncrementFlute:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
IncrementSmallKeys: IncrementSmallKeys:
STA $7EF36F ; thing we wrote over, write small key count STA CurrentSmallKeys ; thing we wrote over, write small key count
PHX PHX
LDA !LOCK_STATS : BNE + LDA !LOCK_STATS : BNE +
JSL AddInventory_incrementKeyLong JSL AddInventory_incrementKeyLong
@@ -230,7 +230,7 @@ IncrementSmallKeys:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
IncrementSmallKeysNoPrimary: IncrementSmallKeysNoPrimary:
STA $7EF36F ; thing we wrote over, write small key count STA CurrentSmallKeys ; thing we wrote over, write small key count
PHX PHX
LDA !LOCK_STATS : BNE + LDA !LOCK_STATS : BNE +
JSL AddInventory_incrementKeyLong JSL AddInventory_incrementKeyLong
@@ -249,7 +249,7 @@ IncrementSmallKeysNoPrimary:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DecrementSmallKeys: DecrementSmallKeys:
STA $7EF36F ; thing we wrote over, write small key count STA CurrentSmallKeys ; thing we wrote over, write small key count
JSL.l UpdateKeys JSL.l UpdateKeys
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -302,7 +302,7 @@ RTL
IncrementDeathCounter: IncrementDeathCounter:
PHA PHA
LDA !LOCK_STATS : BNE + LDA !LOCK_STATS : BNE +
LDA $7EF36D : BNE + ; link is still alive, skip LDA CurrentHealth : BNE + ; link is still alive, skip
LDA !DEATH_COUNTER : INC : STA !DEATH_COUNTER LDA !DEATH_COUNTER : INC : STA !DEATH_COUNTER
;JSL.l DecrementSaveCounter ;JSL.l DecrementSaveCounter
+ +
@@ -311,7 +311,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!FAIRY_COUNTER = "$7EF453" !FAIRY_COUNTER = "$7EF453"
IncrementFairyRevivalCounter: IncrementFairyRevivalCounter:
STA $7EF35C, X ; thing we wrote over STA BottleContents, X ; thing we wrote over
PHA PHA
LDA !LOCK_STATS : BNE + LDA !LOCK_STATS : BNE +
LDA !FAIRY_COUNTER : INC : STA !FAIRY_COUNTER LDA !FAIRY_COUNTER : INC : STA !FAIRY_COUNTER
@@ -368,7 +368,7 @@ RTL
!DAMAGE_COUNTER = $7EF46A !DAMAGE_COUNTER = $7EF46A
!MAGIC_COUNTER = $7EF46C !MAGIC_COUNTER = $7EF46C
IncrementDamageTakenCounter_Eight: IncrementDamageTakenCounter_Eight:
STA.l $7EF36D STA.l CurrentHealth
PHA : PHP PHA : PHP
LDA !LOCK_STATS : BNE + LDA !LOCK_STATS : BNE +
REP #$21 REP #$21
@@ -393,11 +393,11 @@ IncrementDamageTakenCounter_Arb:
++ STA.l !DAMAGE_COUNTER ++ STA.l !DAMAGE_COUNTER
+ PLP + PLP
LDA.l $7EF36D LDA.l CurrentHealth
RTL RTL
IncrementMagicUseCounter: IncrementMagicUseCounter:
STA.l $7EF36E STA.l CurrentMagic
IncrementMagicUseCounterByrna: IncrementMagicUseCounterByrna:
PHA : PHP PHA : PHP
@@ -421,7 +421,7 @@ IncrementMagicUseCounterOne:
BEQ ++ BEQ ++
STA.l !MAGIC_COUNTER STA.l !MAGIC_COUNTER
++ SEP #$20 ++ SEP #$20
+ LDA.l $7EF36E + LDA.l CurrentMagic
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -429,7 +429,7 @@ IncrementMagicUseCounterOne:
IncrementOWMirror: IncrementOWMirror:
PHA PHA
LDA !LOCK_STATS : BNE + LDA !LOCK_STATS : BNE +
LDA $7EF3CA : BEQ + ; only do this for DW->LW LDA CurrentWorld : BEQ + ; only do this for DW->LW
LDA !OW_MIRROR_COUNTER : INC : STA !OW_MIRROR_COUNTER LDA !OW_MIRROR_COUNTER : INC : STA !OW_MIRROR_COUNTER
+ +
PLA PLA
@@ -451,7 +451,7 @@ RTL
!SPENT_RUPEES = "$7EF42B" !SPENT_RUPEES = "$7EF42B"
IncrementSpentRupees: IncrementSpentRupees:
DEC A : BPL .subtractRupees DEC A : BPL .subtractRupees
LDA.w #$0000 : STA $7EF360 LDA.w #$0000 : STA $7EF
RTL RTL
.subtractRupees .subtractRupees
PHA : PHP PHA : PHP
@@ -490,7 +490,6 @@ JMP StatTransitionCounter
!RUPEES_COLLECTED = "$7F503C" !RUPEES_COLLECTED = "$7F503C"
!ITEM_TOTAL = "$7EF423" !ITEM_TOTAL = "$7EF423"
!RTA_END = "$7EF44F"
StatsFinalPrep: StatsFinalPrep:
PHA : PHX : PHP PHA : PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers SEP #$30 ; set 8-bit accumulator and index registers
@@ -517,27 +516,11 @@ StatsFinalPrep:
LDA !NMI_COUNTER+2 : SBC !LOOP_COUNTER+2 : STA !LAG_TIME+2 LDA !NMI_COUNTER+2 : SBC !LOOP_COUNTER+2 : STA !LAG_TIME+2
LDA !NMI_COUNTER+3 : SBC !LOOP_COUNTER+3 : STA !LAG_TIME+3 LDA !NMI_COUNTER+3 : SBC !LOOP_COUNTER+3 : STA !LAG_TIME+3
LDA !SPENT_RUPEES : !ADD $7EF362 : STA !RUPEES_COLLECTED LDA !SPENT_RUPEES : !ADD CurrentRupees : STA !RUPEES_COLLECTED
LDA !SPENT_RUPEES+1 : ADC $7EF363 : STA !RUPEES_COLLECTED+1 LDA !SPENT_RUPEES+1 : ADC $7EF363 : STA !RUPEES_COLLECTED+1
LDA !ITEM_TOTAL : !SUB !CHEST_COUNTER : STA !NONCHEST_COUNTER LDA !ITEM_TOTAL : !SUB !CHEST_COUNTER : STA !NONCHEST_COUNTER
;LDA $FFFFFF
;JSL.l Clock_IsSupported
;BRA +
; REP #$20 ; set 16-bit accumulator
;
; LDA $00 : PHA
; LDA $02 : PHA
;
; JSL.l Clock_QuickStamp
; LDA $00 : STA !RTA_END
; LDA $02 : STA !RTA_END+2
;
; PLA : STA $02
; PLA : STA $00
;+
.done .done
PLP : PLX : PLA PLP : PLX : PLA
LDA.b #$19 : STA $10 ; thing we wrote over, load triforce room LDA.b #$19 : STA $10 ; thing we wrote over, load triforce room

View File

@@ -20,7 +20,7 @@
;JML.l Smithy_DoesntHaveSword ;JML.l Smithy_DoesntHaveSword
;================================================================================ ;================================================================================
;LoadSwordForDamage: ;LoadSwordForDamage:
; LDA $7EF359 : CMP #$04 : BNE .done ; skip if not gold sword ; LDA SwordEquipment : CMP #$04 : BNE .done ; skip if not gold sword
; LDA $1B : BEQ + ; skip if outdoors ; LDA $1B : BEQ + ; skip if outdoors
; LDA $A0 : CMP #41 : BNE + ; decimal 41 ; skip if not in the mothula room ; LDA $A0 : CMP #41 : BNE + ; decimal 41 ; skip if not in the mothula room
; LDA #$03 ; pretend we're using tempered ; LDA #$03 ; pretend we're using tempered
@@ -62,20 +62,20 @@ RTL
; $7F50C0 - Sword Modifier ; $7F50C0 - Sword Modifier
LoadModifiedSwordLevel: ; returns short LoadModifiedSwordLevel: ; returns short
LDA $7F50C0 : BEQ + LDA $7F50C0 : BEQ +
!ADD $7EF359 ; add normal sword value to modifier !ADD SwordEquipment ; add normal sword value to modifier
BNE ++ : LDA.b #$01 : RTS : ++ BNE ++ : LDA.b #$01 : RTS : ++
CMP.b #$05 : !BLT ++ : LDA.b #$04 : RTS : ++ CMP.b #$05 : !BLT ++ : LDA.b #$04 : RTS : ++
RTS RTS
+ +
LDA $7EF359 ; load normal sword value LDA SwordEquipment ; load normal sword value
RTS RTS
;================================================================================ ;================================================================================
; $7EF35B - Armor Inventory ; ArmorEquipment - Armor Inventory
; $7F50C2 - Armor Modifier ; $7F50C2 - Armor Modifier
; $7F5020 - Scratch Space (Caller Preserved) ; $7F5020 - Scratch Space (Caller Preserved)
LoadModifiedArmorLevel: LoadModifiedArmorLevel:
PHA PHA
LDA $7EF35B : !ADD $7F50C2 LDA ArmorEquipment : !ADD $7F50C2
CMP.b #$FF : BNE + : LDA.b #$00 : + CMP.b #$FF : BNE + : LDA.b #$00 : +
CMP.b #$03 : !BLT + : LDA.b #$02 : + CMP.b #$03 : !BLT + : LDA.b #$02 : +
STA $7F5020 STA $7F5020
@@ -83,16 +83,16 @@ LoadModifiedArmorLevel:
!ADD $7F5020 !ADD $7F5020
RTL RTL
;================================================================================ ;================================================================================
; $7EF37B - Magic Inventory ; MagicConsumption - Magic Inventory
; $7F50C3 - Magic Modifier ; $7F50C3 - Magic Modifier
LoadModifiedMagicLevel: LoadModifiedMagicLevel:
LDA $7F50C3 : BEQ + LDA $7F50C3 : BEQ +
!ADD $7EF37B ; add normal magic value to modifier !ADD MagicConsumption ; add normal magic value to modifier
CMP.b #$FF : BNE ++ : LDA.b #$00 : RTL : ++ CMP.b #$FF : BNE ++ : LDA.b #$00 : RTL : ++
CMP.b #$03 : !BLT ++ : LDA.b #$02 : ++ CMP.b #$03 : !BLT ++ : LDA.b #$02 : ++
RTL RTL
+ +
LDA $7EF37B ; load normal magic value LDA MagicConsumption ; load normal magic value
RTL RTL
;================================================================================ ;================================================================================
; $7E0348 - Ice Value ; $7E0348 - Ice Value
@@ -116,17 +116,17 @@ RTL
;================================================================================ ;================================================================================
CheckTabletSword: CheckTabletSword:
LDA.l AllowHammerTablets : BEQ + LDA.l AllowHammerTablets : BEQ +
LDA $7EF34B : BEQ + ; check for hammer LDA HammerEquipment : BEQ + ; check for hammer
LDA.b #$02 : RTL LDA.b #$02 : RTL
+ +
LDA $7EF359 ; get actual sword value LDA SwordEquipment ; get actual sword value
RTL RTL
;================================================================================ ;================================================================================
GetSwordLevelForEvilBarrier: GetSwordLevelForEvilBarrier:
LDA.l AllowHammerEvilBarrierWithFighterSword : BEQ + LDA.l AllowHammerEvilBarrierWithFighterSword : BEQ +
LDA #$FF : RTL LDA #$FF : RTL
+ +
LDA $7EF359 LDA SwordEquipment
RTL RTL
;================================================================================ ;================================================================================
CheckGanonHammerDamage: CheckGanonHammerDamage:
@@ -143,7 +143,7 @@ GetSmithSword:
JML.l Smithy_DoesntHaveSword ; Classic Smithy JML.l Smithy_DoesntHaveSword ; Classic Smithy
+ +
REP #$20 : LDA $7EF360 : CMP #$000A : SEP #$20 : !BGE .buy REP #$20 : LDA TargetRupees : CMP #$000A : SEP #$20 : !BGE .buy
.cant_afford .cant_afford
REP #$10 REP #$10
LDA.b #$7A LDA.b #$7A
@@ -158,7 +158,7 @@ GetSmithSword:
STZ $02E9 ; Item from NPC STZ $02E9 ; Item from NPC
PHX : JSL Link_ReceiveItem : PLX PHX : JSL Link_ReceiveItem : PLX
REP #$20 : LDA $7EF360 : !SUB.w #$000A : STA $7EF360 : SEP #$20 ; Take 10 rupees REP #$20 : LDA TargetRupees : !SUB.w #$000A : STA TargetRupees : SEP #$20 ; Take 10 rupees
JSL ItemSet_SmithSword JSL ItemSet_SmithSword
.done .done
@@ -170,7 +170,7 @@ CheckMedallionSword:
LDA.b #$02 ; Pretend we have master sword LDA.b #$02 ; Pretend we have master sword
RTL RTL
.check_sword .check_sword
LDA $7EF359 LDA SwordEquipment
RTL RTL
.check_pad .check_pad
PHB : PHX : PHY PHB : PHX : PHY
@@ -220,7 +220,7 @@ CheckMedallionSword:
+ +
.done .done
PLY : PLX : PLB PLY : PLX : PLB
LDA $7EF359 LDA SwordEquipment
RTL RTL
.permit .permit
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator

View File

@@ -182,8 +182,8 @@ OHKOTimer:
LDA.l TimeoutBehavior : CMP #$02 : BNE + LDA.l TimeoutBehavior : CMP #$02 : BNE +
LDA !Status : AND.b #$02 : BEQ + LDA !Status : AND.b #$02 : BEQ +
.kill .kill
LDA.b #$00 : STA $7EF36D ; kill link LDA.b #$00 : STA CurrentHealth ; kill link
+ +
LDA $7EF36D LDA CurrentHealth
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -1,9 +1,9 @@
;================================================================================ ;================================================================================
; Tree Kid Fix ; Tree Kid Fix
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $06B12B ; <- 3312B - tree status set - 418 - LDA $7EF3C9 : ORA.b #$08 : STA $7EF3C9 org $06B12B ; <- 3312B - tree status set - 418 - LDA NpcFlagsVanilla : ORA.b #$08 : STA NpcFlagsVanilla
LDA $7EF3C9 : AND.b #$F7 : STA $7EF3C9 ; unset arboration instead of setting it LDA NpcFlagsVanilla : AND.b #$F7 : STA NpcFlagsVanilla ; unset arboration instead of setting it
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $06B072 ; <- 33072 - FluteAardvark_InitialStateFromFluteState - 418 : dw FluteAardvark_AlreadyArborated org $06B072 ; <- 33072 - FluteAardvark_InitialStateFromFluteState - 418 : dw FluteAardvark_AlreadyArborated
db #$8B db #$8B
;================================================================================ ;================================================================================

View File

@@ -45,7 +45,7 @@ GetSpriteID:
RTL RTL
.specialHandling .specialHandling
CMP.b #$F9 : BNE ++ ; Progressive Magic CMP.b #$F9 : BNE ++ ; Progressive Magic
LDA.l $7EF37B : BNE +++ LDA.l MagicConsumption : BNE +++
LDA.b #$3B : RTL ; Half Magic LDA.b #$3B : RTL ; Half Magic
+++ +++
LDA.b #$3C : RTL ; Quarter Magic LDA.b #$3C : RTL ; Quarter Magic
@@ -54,13 +54,13 @@ RTL
++ CMP.b #$FB : BNE ++ ; RNG Item (Multi) ++ CMP.b #$FB : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti : JMP GetSpriteID JSL.l GetRNGItemMulti : JMP GetSpriteID
++ CMP.b #$FD : BNE ++ ; Progressive Armor ++ CMP.b #$FD : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JMP GetSpriteID JMP GetSpriteID
+ +
LDA.b #$04 : RTL LDA.b #$04 : RTL
++ CMP.b #$FE : BNE ++ ; Progressive Sword ++ CMP.b #$FE : BNE ++ ; Progressive Sword
LDA $7EF359 LDA SwordEquipment
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JMP GetSpriteID JMP GetSpriteID
@@ -85,7 +85,7 @@ RTL
+ ; Everything Else + ; Everything Else
LDA.b #$2E : RTL LDA.b #$2E : RTL
++ : CMP.b #$F8 : BNE ++ ; Progressive Bow ++ : CMP.b #$F8 : BNE ++ ; Progressive Bow
LDA $7EF340 : INC : LSR LDA BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT + CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement LDA.l ProgressiveBowReplacement
JMP GetSpriteID JMP GetSpriteID
@@ -183,7 +183,7 @@ GetSpritePalette:
RTL RTL
.specialHandling .specialHandling
CMP.b #$FD : BNE ++ ; Progressive Sword CMP.b #$FD : BNE ++ ; Progressive Sword
LDA $7EF359 LDA SwordEquipment
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JMP GetSpritePalette JMP GetSpritePalette
@@ -207,7 +207,7 @@ RTL
+ ; Everything Else + ; Everything Else
LDA.b #$08 : RTL LDA.b #$08 : RTL
++ : CMP.b #$FF : BNE ++ ; Progressive Armor ++ : CMP.b #$FF : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JMP GetSpritePalette JMP GetSpritePalette
+ : CMP.b #$00 : BNE + ; Green Tunic + : CMP.b #$00 : BNE + ; Green Tunic
@@ -215,12 +215,12 @@ RTL
+ ; Everything Else + ; Everything Else
LDA.b #$02 : RTL LDA.b #$02 : RTL
++ : CMP.b #$FC : BNE ++ ; Progressive Gloves ++ : CMP.b #$FC : BNE ++ ; Progressive Gloves
LDA $7EF354 : BNE + ; No Gloves LDA GloveEquipment : BNE + ; No Gloves
LDA.b #$02 : RTL LDA.b #$02 : RTL
+ ; Everything Else + ; Everything Else
LDA.b #$08 : RTL LDA.b #$08 : RTL
++ : CMP.b #$F8 : BNE ++ ; Progressive Bow ++ : CMP.b #$F8 : BNE ++ ; Progressive Bow
LDA $7EF340 : INC : LSR LDA BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT + CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement LDA.l ProgressiveBowReplacement
JMP GetSpritePalette JMP GetSpritePalette
@@ -307,7 +307,7 @@ IsNarrowSprite:
+ : JMP .continue + : JMP .continue
.notBottle .notBottle
CMP.b #$5E : BNE ++ ; Progressive Sword CMP.b #$5E : BNE ++ ; Progressive Sword
LDA $7EF359 : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit LDA SwordEquipment : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite
JMP .done JMP .done
@@ -319,7 +319,7 @@ IsNarrowSprite:
JSL.l IsNarrowSprite JSL.l IsNarrowSprite
JMP .done JMP .done
++ CMP.b #$60 : BNE ++ ; Progressive Armor ++ CMP.b #$60 : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT .continue LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT .continue
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite
JMP .done JMP .done
@@ -330,7 +330,7 @@ IsNarrowSprite:
JSL.l GetRNGItemMulti JSL.l GetRNGItemMulti
++ CMP.b #$64 : BEQ + ; Progressive Bow ++ CMP.b #$64 : BEQ + ; Progressive Bow
CMP.b #$65 : BNE .continue ; Progressive Bow (alt) CMP.b #$65 : BNE .continue ; Progressive Bow (alt)
+ : LDA $7EF340 : INC : LSR + : LDA BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT + CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement LDA.l ProgressiveBowReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite

View File

@@ -2,16 +2,16 @@
; Spawn Zelda (or not) ; Spawn Zelda (or not)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SpawnZelda: SpawnZelda:
LDA.l $7EF3CC : CMP #$08 : BEQ + ; don't spawn if dwarf is present LDA.l FollowerIndicator : CMP #$08 : BEQ + ; don't spawn if dwarf is present
CMP #$07 : BEQ + ; don't spawn if frog is present CMP #$07 : BEQ + ; don't spawn if frog is present
CMP #$0C : BEQ + ; don't spawn if purple chest is present CMP #$0C : BEQ + ; don't spawn if purple chest is present
CLC CLC
+ RTL + RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
EndRainState: EndRainState:
LDA $7EF3C5 : CMP.b #$02 : !BGE + ; skip if past escape already LDA ProgressIndicator : CMP.b #$02 : !BGE + ; skip if past escape already
LDA.b #$00 : STA !INFINITE_ARROWS : STA !INFINITE_BOMBS : STA !INFINITE_MAGIC LDA.b #$00 : STA !INFINITE_ARROWS : STA !INFINITE_BOMBS : STA !INFINITE_MAGIC
LDA.b #$02 : STA $7EF3C5 ; end rain state LDA.b #$02 : STA ProgressIndicator ; end rain state
JSL MaybeSetPostAgaWorldState JSL MaybeSetPostAgaWorldState
+ +
RTL RTL