Merge pull request #194 from spannerisms/decompressed

More v31.2.0 fixes
This commit is contained in:
Lexi Rose
2023-08-23 21:10:13 -05:00
committed by GitHub
18 changed files with 928 additions and 782 deletions

View File

@@ -371,7 +371,7 @@ RTL
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
AgahnimAsksAboutPed: AgahnimAsksAboutPed:
LDA.l InvincibleGanon LDA.l GanonVulnerableMode
CMP.b #$06 : BNE .vanilla CMP.b #$06 : BNE .vanilla
LDA.l OverworldEventDataWRAM+$80 ; check ped flag LDA.l OverworldEventDataWRAM+$80 ; check ped flag

View File

@@ -103,7 +103,6 @@ SetCutsceneFlag:
CLC CLC
RTL RTL
.dungeon_prize .dungeon_prize
JSR.w SetDungeonCompletion
LDA.w ItemReceiptID : TAX LDA.w ItemReceiptID : TAX
LDA.l InventoryTable_properties,X : BPL .no_cutscene LDA.l InventoryTable_properties,X : BPL .no_cutscene
PLX PLX
@@ -172,14 +171,6 @@ CheckSpawnPrize:
SEP #$21 SEP #$21
RTL RTL
SetDungeonCompletion:
LDX.w DungeonID : BMI +
REP #$20
LDA.l DungeonItemMasks, X : ORA.l DungeonsCompleted : STA.l DungeonsCompleted
SEP #$20
+
RTS
CheckDungeonCompletion: CheckDungeonCompletion:
LDX.w DungeonID LDX.w DungeonID
REP #$20 REP #$20

View File

@@ -42,7 +42,7 @@ RTL
{ {
REP #$20 REP #$20
LDA.l GoalItemRequirement : BEQ .despawn LDA.l GoalItemRequirement : BEQ .despawn
LDA.l InvincibleGanon : AND.w #$00FF : CMP.w #$0005 : BEQ .despawn LDA.l GanonVulnerableMode : AND.w #$00FF : CMP.w #$0005 : BEQ .despawn
LDA.l TurnInGoalItems : AND.w #$00FF : BNE + LDA.l TurnInGoalItems : AND.w #$00FF : BNE +
.despawn .despawn
SEP #$20 SEP #$20

View File

@@ -14,7 +14,7 @@ LockAgahnimDoors:
JSR.w LockAgahnimDoorsCore : BEQ .unlock JSR.w LockAgahnimDoorsCore : BEQ .unlock
PHX : PHY PHX : PHY
SEP #$30 SEP #$30
JSL.l CheckEnoughCrystalsForTower JSL.l CheckTowerOpen
REP #$30 REP #$30
PLY : PLX PLY : PLX
!BGE .crystalOrUnlock !BGE .crystalOrUnlock

View File

@@ -27,6 +27,11 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnDungeonBossExit: OnDungeonBossExit:
JSL.l StatTransitionCounter JSL.l StatTransitionCounter
LDX.w DungeonID : BMI +
REP #$20
LDA.l DungeonItemMasks, X : ORA.l DungeonsCompleted : STA.l DungeonsCompleted
SEP #$20
+
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnPlayerDead: OnPlayerDead:

View File

@@ -15,7 +15,7 @@ RTL
;Carry set = ganon vulnerable ;Carry set = ganon vulnerable
CheckGanonVulnerability: CheckGanonVulnerability:
PHX PHX
LDA.l InvincibleGanon LDA.l GanonVulnerableMode
ASL ASL
TAX TAX
@@ -112,49 +112,70 @@ CheckGanonVulnerability:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetRequiredCrystalsForTower: GetRequiredCrystalsForTower:
BEQ + : JSL.l BreakTowerSeal_ExecuteSparkles : + ; thing we wrote over BEQ + : JSL.l BreakTowerSeal_ExecuteSparkles : + ; thing we wrote over
LDA.l NumberOfCrystalsRequiredForTower : CMP.b #$00 : BNE + : JML.l Ancilla_BreakTowerSeal_stop_spawning_sparkles : + LDA.l GanonsTowerOpenTarget : CMP.b #$00 : BNE + : JML.l Ancilla_BreakTowerSeal_stop_spawning_sparkles : +
LDA.l NumberOfCrystalsRequiredForTower : CMP.b #$01 : BNE + : JML.l Ancilla_BreakTowerSeal_draw_single_crystal : + LDA.l GanonsTowerOpenTarget : CMP.b #$01 : BNE + : JML.l Ancilla_BreakTowerSeal_draw_single_crystal : +
LDA.l NumberOfCrystalsRequiredForTower : DEC #2 : TAX LDA.l GanonsTowerOpenTarget : DEC #2 : TAX
JML.l GetRequiredCrystalsForTower_continue JML.l GetRequiredCrystalsForTower_continue
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetRequiredCrystalsInX: GetRequiredCrystalsInX:
LDA.l NumberOfCrystalsRequiredForTower : CMP.b #$00 : BNE + LDA.l GanonsTowerOpenTarget : CMP.b #$00 : BNE +
TAX TAX
RTL RTL
+ +
TXA TXA
- CMP.l NumberOfCrystalsRequiredForTower : BCC + - CMP.l GanonsTowerOpenTarget : BCC +
SBC.l NumberOfCrystalsRequiredForTower ; carry guaranteed set SBC.l GanonsTowerOpenTarget ; carry guaranteed set
BRA - BRA -
+ INC : CMP.l NumberOfCrystalsRequiredForTower : BNE + + INC : CMP.l GanonsTowerOpenTarget : BNE +
LDA.b #$08 LDA.b #$08
+ : DEC : TAX + : DEC : TAX
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckEnoughCrystalsForGanon: CheckEnoughCrystalsForGanon:
REP #$20
LDA.l CrystalCounter LDA.l CrystalCounter
CMP.l NumberOfCrystalsRequiredForGanon CMP.l GanonVulnerableTarget
SEP #$20
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckEnoughCrystalsForTower: CheckTowerOpen:
LDA.l CrystalCounter REP #$30
CMP.l NumberOfCrystalsRequiredForTower LDA.l GanonsTowerOpenMode : ASL : TAX
JSR.w (.tower_open_modes,X)
SEP #$30
RTL RTL
.tower_open_modes
dw .vanilla
dw .arbitrary_cmp
.vanilla
LDA.l CrystalsField
AND.w #$007F : CMP.w #$007F
RTS
.arbitrary_cmp
LDA.l GanonsTowerOpenAddress : TAX
LDA.l $7E0000,X
CMP.l GanonsTowerOpenTarget
RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
CheckAgaForPed: CheckAgaForPed:
LDA.l InvincibleGanon REP #$20
CMP.b #$06 : BNE .vanilla LDA.l GanonVulnerableMode
CMP.w #$0006 : BNE .vanilla
.light_speed .light_speed
SEP #$20
LDA.l OverworldEventDataWRAM+$80 ; check ped flag LDA.l OverworldEventDataWRAM+$80 ; check ped flag
AND.b #$40 AND.b #$40
BEQ .force_blue_ball BEQ .force_blue_ball
.vanilla ; run vanilla check for phase .vanilla ; run vanilla check for phase
SEP #$20
LDA.w SpriteAux, X LDA.w SpriteAux, X
CMP.b #$02 CMP.b #$02
RTL RTL
@@ -170,7 +191,7 @@ CheckAgaForPed:
KillGanon: KillGanon:
STA.l ProgressIndicator ; vanilla game state stuff we overwrote STA.l ProgressIndicator ; vanilla game state stuff we overwrote
LDA.l InvincibleGanon LDA.l GanonVulnerableMode
CMP.b #$06 : BNE .exit CMP.b #$06 : BNE .exit
.light_speed .light_speed
@@ -182,7 +203,6 @@ KillGanon:
RTL RTL
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
CheckForCrystalBossesDefeated: CheckForCrystalBossesDefeated:
PHB : PHX : PHY PHB : PHX : PHY
@@ -220,8 +240,34 @@ CheckForCrystalBossesDefeated:
SEP #$30 SEP #$30
PLY : PLX : PLB PLY : PLX : PLB
LDA.b Scrap00 : CMP.l NumberOfCrystalsRequiredForGanon LDA.b Scrap00 : CMP.l GanonVulnerableTarget
RTS RTS
;---------------------------------------------------------------------------------------------------
CheckPedestalPull:
; Out: c - Successful ped pull if set, do nothing if unset.
PHX
LDA.l PedCheckMode : ASL : TAX
JSR.w (.pedestal_modes,X)
PLX
RTL
.pedestal_modes
dw .vanilla
dw .arbitrary_cmp
.vanilla
LDA.l PendantsField
AND.b #$07 : CMP.b #$07 : BNE ..nopull
SEC
RTS
..nopull
CLC
RTS
.arbitrary_cmp
LDA.l PedPullAddress : TAX
LDA.l $7E000,X
CMP.l PedPullTarget
RTS

View File

@@ -42,10 +42,15 @@ DrawHeartPieceGFX:
LDA.l SpriteProperties_standing_width,X : BNE + LDA.l SpriteProperties_standing_width,X : BNE +
PLX PLX
LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X
BRA .draw PLA
JSL.l DrawDynamicTile
LDA.b Scrap00
CLC : ADC.b #$04
STA.b Scrap00
JSL.l Sprite_DrawShadowLong
BRA .done
+ +
PLX PLX
.draw
PLA PLA
JSL.l DrawDynamicTile JSL.l DrawDynamicTile
JSL.l Sprite_DrawShadowLong JSL.l Sprite_DrawShadowLong

View File

@@ -496,9 +496,8 @@ PreventEnterOnBonk_BRANCH_IX:
;================================================================================ ;================================================================================
; Crystals Mode ; Crystals Mode
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $899B7B ; <- ancilla_init.asm : 4136 (LDA $7EF37A : AND.b #$7F : CMP.b #$7F) org $899B7F ; <- ancilla_init.asm : 4136 (LDA $7EF37A : AND.b #$7F : CMP.b #$7F)
JSL CheckEnoughCrystalsForTower : NOP #4 JSL CheckTowerOpen : BCC $899B6D
db $90 ; BCC
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $88CE0C ; <- 44E0C - ancilla_break_tower_seal.asm : 168 (BEQ #$03 : JSR BreakTowerSeal_ExecuteSparkles : LDX.b #$06) org $88CE0C ; <- 44E0C - ancilla_break_tower_seal.asm : 168 (BEQ #$03 : JSR BreakTowerSeal_ExecuteSparkles : LDX.b #$06)
JML GetRequiredCrystalsForTower : NOP #3 JML GetRequiredCrystalsForTower : NOP #3
@@ -549,6 +548,8 @@ JSL GoalItemGanonCheck
org $86F2EA ; <- 372EA - Bank06.asm : 5791 (LDA $0E20, X : CMP.b #$D6 : BCS .no_collision) org $86F2EA ; <- 372EA - Bank06.asm : 5791 (LDA $0E20, X : CMP.b #$D6 : BCS .no_collision)
JSL CheckGanonHammerDamage : NOP JSL CheckGanonHammerDamage : NOP
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $858922
JSL.l CheckPedestalPull : BCC MasterSword_InPedestal_exit
;================================================================================ ;================================================================================
; Stat Hooks ; Stat Hooks

View File

@@ -10,10 +10,9 @@ ProcessMenuButtons:
BIT.b #$20 : BNE .sel_pressed ; check for P1 Select button BIT.b #$20 : BNE .sel_pressed ; check for P1 Select button
LDA.b Joy1A_All : BIT.b #$20 : BNE .sel_held LDA.b Joy1A_All : BIT.b #$20 : BNE .sel_held
.sel_unheld .sel_unheld
LDA.l HudFlag : AND.b #$20 : BEQ + LDA.l HudFlag : AND.b #$60 : BEQ +
LDA.l HudFlag : AND.b #$DF : STA.l HudFlag ; select is released, unset hud flag LDA.b #$00 : STA.l HudFlag
LDA.b IndoorsFlag : BEQ + ; skip if outdoors JSL.l MaybePlaySelectSFX
LDA.b #$20 : STA.w SFX3 ; menu select sound
+ +
JSL.l ResetEquipment JSL.l ResetEquipment
+ +
@@ -21,8 +20,14 @@ ProcessMenuButtons:
CLC ; no buttons CLC ; no buttons
RTL RTL
.sel_pressed .sel_pressed
LDA.l HudFlag : ORA.b #$20 : STA.l HudFlag ; set hud flag LDA.l HUDDungeonItems : BIT.b #$0C : BNE +
LDA.b #$20 : STA.w SFX3 ; menu select sound LDA.b #$40
BRA .store_flag
+
LDA.b #$60
.store_flag
STA.l HudFlag
JSL.l MaybePlaySelectSFX
JSL.l ResetEquipment JSL.l ResetEquipment
RTL RTL
.y_pressed ; Note: used as entry point by quickswap code. Must preserve X. .y_pressed ; Note: used as entry point by quickswap code. Must preserve X.
@@ -168,6 +173,7 @@ AddInventory:
RTL RTL
ShopCheck: ShopCheck:
; TODO: If we write all shops, we can use the ShopPurchase flag instead of this
LDA.b IndoorsFlag : BEQ .count LDA.b IndoorsFlag : BEQ .count
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .count LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .count
LDA.w InventoryTable_properties,Y : BIT.b #$02 : BNE .count LDA.w InventoryTable_properties,Y : BIT.b #$02 : BNE .count
@@ -264,8 +270,8 @@ IncrementByOne:
TYA : ASL : TAX TYA : ASL : TAX
LDA.w InventoryTable_stat,X : BEQ .skip LDA.w InventoryTable_stat,X : BEQ .skip
STA.b Scrap0B STA.b Scrap0B
SEP #$20 SEP #$21
LDA.b #$01 : ADC.b [Scrap0B] : STA.b [Scrap0B] LDA.b #$00 : ADC.b [Scrap0B] : STA.b [Scrap0B]
.skip .skip
SEP #$20 SEP #$20
RTS RTS
@@ -736,3 +742,14 @@ RTL
} }
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MaybePlaySelectSFX:
LDA.w DungeonID : BMI .not_dungeon
.play
LDA.b #$20 : STA.w SFX3 ; menu select sound
RTL
.not_dungeon
LDA.l HUDDungeonItems : BIT.b #$13 : BEQ .dont_play
BIT.b #$0C : BEQ .dont_play
BRA .play
.dont_play
RTL

View File

@@ -109,11 +109,11 @@ Overworld_LoadNewTiles:
!OWW_StripeRLEINC = $8002 !OWW_StripeRLEINC = $8002
dw .stripe_rle_inc ; 02 dw .stripe_rle_inc ; 02
; dw !OWW_ArbitraryRLE ; dw !OWW_ArbTileCopy
; dw <tile> ; dw <tile>
; dw <pos1>, <pos2>, ... <posN>|!OWW_STOP ; dw <pos1>, <pos2>, ... <posN>|!OWW_STOP
!OWW_ArbitraryRLE = $8003 !OWW_ArbTileCopy = $8003
dw .arbitrary_rle ; 03 dw .arbitrary_tile_copy ; 03
dw .nothing ; 04 dw .nothing ; 04
dw .nothing ; 05 dw .nothing ; 05
@@ -205,7 +205,6 @@ Overworld_LoadNewTiles:
.dont_change_inverted .dont_change_inverted
RTS RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.get_increment .get_increment
@@ -224,6 +223,7 @@ Overworld_LoadNewTiles:
.stripe .stripe
JSR .get_increment JSR .get_increment
LDX.w $0000,Y LDX.w $0000,Y
BRA ++ ; to increment at start of loop properly BRA ++ ; to increment at start of loop properly
@@ -276,7 +276,10 @@ Overworld_LoadNewTiles:
DEC.b OWWriteSize DEC.b OWWriteSize
BNE -- BNE --
INY #2
INY
INY
RTS RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
@@ -314,27 +317,28 @@ Overworld_LoadNewTiles:
DEC.b OWWriteSize DEC.b OWWriteSize
BNE -- BNE --
INY #2
INY
INY
RTS RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
; Don't use SKIP with this, since that's not really meaningful anyways...
.arbitrary_rle ;---------------------------------------------------------------------------------------------------
.arbitrary_tile_copy
LDA.w $0000,Y LDA.w $0000,Y
-- INY -- INY
INY INY
LDX.w $0000,Y LDX.w $0000,Y
BMI .last_arb_rle_maybe BMI .last_arb
STA.l $7E0000,X STA.l $7E0000,X
BRA -- BRA --
.last_arb_rle_maybe .last_arb
CPX.w #!OWW_SKIP
BEQ --
PHA PHA
TXA TXA
@@ -491,6 +495,7 @@ dw $0000 ; 7F
.map03 .map03
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
; singles ; singles
dw $0034, $2BE0 dw $0034, $2BE0
@@ -498,7 +503,7 @@ dw $0000 ; 7F
dw $29B6 ; address dw $29B6 ; address
dw $021A, $01F3, $00A0, $0104|!OWW_STOP dw $021A, $01F3, $00A0, $0104|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $00C6 ; tile dw $00C6 ; tile
dw $2A34, $2A38, $2A3A|!OWW_STOP dw $2A34, $2A38, $2A3A|!OWW_STOP
@@ -508,7 +513,9 @@ dw $0000 ; 7F
.map05 .map05
dw $0101, $2E18 ; OWG sign dw $0101, $2E18 ; OWG sign
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
; singles ; singles
dw $0034, $21F2 dw $0034, $21F2
dw $0034, $3D4A dw $0034, $3D4A
@@ -552,19 +559,19 @@ dw $0000 ; 7F
dw $2970 ; address dw $2970 ; address
dw $0139, $014B|!OWW_STOP dw $0139, $014B|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0130 ; tile dw $0130 ; tile
dw $21E2, $21F0, $22E2, $22F0|!OWW_STOP dw $21E2, $21F0, $22E2, $22F0|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0135 ; tile dw $0135 ; tile
dw $2262, $2270, $2362, $2370|!OWW_STOP dw $2262, $2270, $2362, $2370|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0136 ; tile dw $0136 ; tile
dw $2264, $2266, $226C, $226E|!OWW_STOP dw $2264, $2266, $226C, $226E|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0137 ; tile dw $0137 ; tile
dw $2268, $226A|!OWW_STOP dw $2268, $226A|!OWW_STOP
@@ -584,7 +591,7 @@ dw $0000 ; 7F
dw $0134, $26A4 dw $0134, $26A4
dw $0034, $2826 dw $0034, $2826
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $021B ; tile dw $021B ; tile
dw $259E, $25A2, $25A4, $261C dw $259E, $25A2, $25A4, $261C
dw $2626, $269A, $26A8, $271A dw $2626, $269A, $26A8, $271A
@@ -632,158 +639,121 @@ dw $0000 ; 7F
.map1B .map1B
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
; TODO clean up and optimize ; singles
dw $0485, $2424
dw $0485, $2426
dw $0454, $24A4
dw $0454, $24A6
dw $0476, $2522 dw $0476, $2522
dw $0460, $2524
dw $0460, $2526
dw $04D7, $2528 dw $04D7, $2528
dw $04DD, $2624
dw $04DE, $2626 dw !OWW_Stripe|!OWW_Vertical
dw $04E0, $26A4 dw $2424 ; address
dw $04E1, $26A6 dw $0485, $0454, $0460, !OWW_SKIP
dw $04E4, $2724 dw $04DD, $04E0, $04E4, $0034|!OWW_STOP
dw $04E5, $2726
dw $0034, $27A4 dw !OWW_Stripe|!OWW_Vertical
dw $0034, $27A6 dw $2426 ; address
dw $0485, $0454, $0460, !OWW_SKIP
dw $04DE, $04E1, $04E5, $0034|!OWW_STOP
; Eye removed ; Eye removed
dw $046D, $243E dw !OWW_ArbTileCopy
dw $046D, $24BC dw $046D ; tile
dw $046D, $24BE dw $243E, $24BC, $24BE, $253E
dw $046D, $253E dw $2440, $24C0, $24C2, $2540|!OWW_STOP
dw $046D, $2440
dw $046D, $24C0
dw $046D, $24C2
dw $046D, $2540
; new trees ; new trees
dw !OWW_Stripe|!OWW_Horizontal
dw $2D2C ; address
dw $00B0, $0014, $0015, $00A8
dw $04BB, $0034|!OWW_STOP
dw !OWW_Stripe|!OWW_Horizontal
dw $2DAC ; address
dw $0089, $001C, $001D, $0076
dw $04BA, $0034|!OWW_STOP
dw !OWW_Stripe|!OWW_Horizontal
dw $2E2C ; address
dw $00F1, $004E, $004F, $00D9
dw $04BB|!OWW_STOP
dw !OWW_ArbTileCopy
dw $0034 ; tile
dw $28AC, $28AE
dw $28B0, $28CE, $28D0, $28D2
dw $2C2C, $2C2E, $2CB6, $2EB6
dw $2F30, $2F36, $2FAA, $2FB0
dw $2FB4, $2FB6, $3028, $302C|!OWW_STOP
; TODO still need to optimize this last section ugh
dw $0035, $2C28 dw $0035, $2C28
dw $0035, $2FAE dw $0035, $2FAE
dw $0034, $2C2C dw $0035, $302A
dw $0034, $2C2E dw $0035, $3032
dw $0034, $2CB6
dw $0034, $2D36
dw $0034, $2DB6
dw $0034, $2EB6
dw $0034, $2F30
dw $0034, $2F36
dw $0034, $2FAA
dw $0034, $2FB0
dw $0034, $2FB4
dw $0034, $2FB6
dw $00E2, $2C36
dw $00E2, $2FA8
dw $00AE, $2CAC
dw $00AF, $2CAE
dw $007E, $2CB0 dw $007E, $2CB0
dw $007F, $2CB2 dw $007F, $2CB2
dw $04BA, $2CB4 dw $0095, $2EB2
dw $04BA, $2DB4
dw $04BA, $2EB4
dw $00B0, $2D2C
dw $0014, $2D2E
dw $0015, $2D30
dw $00A8, $2D32
dw $04BB, $2D34
dw $04BB, $2E34
dw $04BB, $2F34
dw $0089, $2DAC
dw $001C, $2DAE
dw $001D, $2DB0
dw $0076, $2DB2
dw $00F1, $2E2C
dw $004E, $2E2E
dw $004F, $2E30
dw $00D9, $2E32
dw $009A, $2EAC dw $009A, $2EAC
dw $009B, $2EAE dw $009B, $2EAE
dw $009C, $2EB0 dw $009C, $2EB0
dw $0095, $2EB2 dw $00AE, $2CAC
dw $00AF, $2CAE
dw $0034, $3028
dw $0034, $302C
dw $0035, $302A
dw $0035, $3032
dw $00DA, $302E dw $00DA, $302E
dw $00E2, $2C36
dw $00E2, $2FA8
dw $00E2, $3030 dw $00E2, $3030
dw $0451, $282E
dw $0485, $2424
dw $0485, $2426
dw $0454, $24A4
dw $0454, $24A6
dw $0476, $2522
dw $0460, $2524
dw $0460, $2526
dw $04D7, $2528
dw $04DD, $2624
dw $04DE, $2626
dw $04E0, $26A4
dw $04E1, $26A6
dw $04E4, $2724
dw $04E5, $2726
dw $0034, $27A4
dw $0034, $27A6
dw $0486, $26B0
dw $0487, $26B2
dw $0454, $272C
dw $0454, $272E
dw $048E, $2730
dw $048F, $2732
dw $04CA, $27AC
dw $045E, $27AE
dw $0494, $27B0
dw $0495, $27B2
dw $049E, $27B4
dw $0499, $282C
dw $0451, $2830 dw $0451, $2830
dw $0034, $28AC
dw $0034, $28AE
dw $0034, $28B0
dw $0454, $274E
dw $0454, $2750
dw $0608, $2752
dw $0459, $27CE
dw $0459, $27D0
dw $045E, $27D2
dw $0451, $284E dw $0451, $284E
dw $0451, $2850 dw $0451, $2850
dw $0451, $2852 dw $0451, $2852
dw $0451, $282E dw $0454, $272C
dw $0034, $28CE dw $0454, $272E
dw $0034, $28D0 dw $0454, $274E
dw $0034, $28D2 dw $0454, $2750
dw $0459, $27CE
dw $0459, $27D0
dw $045E, $27AE
dw $045E, $27D2
dw $0476, $2522
dw $0486, $26B0
dw $0487, $26B2
dw $048E, $2730
dw $048F, $2732
dw $0494, $27B0
dw $0495, $27B2
dw $0499, $282C
dw $049E, $27B4
dw $04BA, $2CB4
dw $04BA, $2EB4
dw $04BB, $2F34
dw $04CA, $27AC
dw $04D7, $2528
dw $0608, $2752
dw !OWW_CustomCommand, .map1B_check_aga dw !OWW_CustomCommand, .map1B_check_aga
dw $046D, $243E dw $046D, $243E
dw $0E39, $2440 dw $0E39, $2440
dw $0E3A, $24BC
dw $0E3B, $24BE dw !OWW_StripeRLEINC|!OWW_Horizontal|OWW_RLESize(4)
dw $0E3C, $24C0 dw $0E3A, $24BC ; tile, start
dw $0E3D, $24C2
dw $0E3E, $253C dw !OWW_StripeRLEINC|!OWW_Horizontal|OWW_RLESize(4)
dw $0E3F, $253E dw $0E3E, $253C ; tile, start
dw $0E40, $2540
dw $0E41, $2542
dw $0490, $25BE dw $0490, $25BE
dw $0491, $25C0 dw $0491, $25C0
.map1B_no_hole .map1B_no_hole
; add sign for Tower Entry ; add sign for tower entry
dw $0101, $222C dw $0101, $222C
dw $0101, $2252 dw $0101, $2252
dw !OWW_END dw !OWW_END
.map1B_check_aga .map1B_check_aga
LDA.w OverworldEventDataWRAM+$2B LDA.l OverworldEventDataWRAM+$5B
AND.w #$0020 AND.w #$0020
BNE ++ BNE ++
@@ -799,7 +769,7 @@ dw $0000 ; 7F
; singles ; singles
dw $0036, $2386 dw $0036, $2386
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0034 ; tile dw $0034 ; tile
dw $2288, $2308, $2388, $2408 dw $2288, $2308, $2388, $2408
dw $2488, $248A|!OWW_STOP dw $2488, $248A|!OWW_STOP
@@ -829,7 +799,7 @@ dw $0000 ; 7F
dw $00CF, $27DA dw $00CF, $27DA
dw $0034, $3D94 dw $0034, $3D94
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $017E dw $017E
dw $2050, $20CE|!OWW_STOP dw $2050, $20CE|!OWW_STOP
@@ -839,11 +809,11 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(6) dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(6)
dw $00D1, $21E6 dw $00D1, $21E6
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $00D2 dw $00D2
dw $2060, $20E2, $2164|!OWW_STOP dw $2060, $20E2, $2164|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0183 dw $0183
dw $20D0, $214E|!OWW_STOP dw $20D0, $214E|!OWW_STOP
@@ -857,22 +827,22 @@ dw $0000 ; 7F
dw $00C9, $2266 dw $00C9, $2266
dw $00C9, $22CC dw $00C9, $22CC
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $00D0 dw $00D0
dw $20E0, $2162, $21E4|!OWW_STOP dw $20E0, $2162, $21E4|!OWW_STOP
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(3) dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(3)
dw $0153, $2150 dw $0153, $2150
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0153 dw $0153
dw $21CE, $22CE|!OWW_STOP dw $21CE, $22CE|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $00C8 dw $00C8
dw $2160, $21E2, $2264, $28DA, $295C|!OWW_STOP dw $2160, $21E2, $2264, $28DA, $295C|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $00CA dw $00CA
dw $21E0, $2262, $285A, $28DC|!OWW_STOP dw $21E0, $2262, $285A, $28DC|!OWW_STOP
@@ -883,7 +853,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(2) dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(2)
dw $00E3, $2252 dw $00E3, $2252
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0186 dw $0186
dw $22D0, $234E|!OWW_STOP dw $22D0, $234E|!OWW_STOP
@@ -899,7 +869,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(2) dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(2)
dw $0034, $2350 dw $0034, $2350
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0034 dw $0034
dw $2458, $2656|!OWW_STOP dw $2458, $2656|!OWW_STOP
@@ -922,46 +892,46 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(4) dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(4)
dw $06AB, $2366 dw $06AB, $2366
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $06AB dw $06AB
dw $24E4, $2760|!OWW_STOP dw $24E4, $2760|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0384 dw $0384
dw $236A, $236E, $23EC, $246A|!OWW_STOP dw $236A, $236E, $23EC, $246A|!OWW_STOP
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4) dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4)
dw $0384, $24E8 dw $0384, $24E8
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0759 dw $0759
dw $23C8, $244A, $24CC, $254E, $26D0, $2752, $27D4|!OWW_STOP dw $23C8, $244A, $24CC, $254E, $26D0, $2752, $27D4|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0757 dw $0757
dw $23CA, $244C, $24CE, $2550, $26D2, $2754|!OWW_STOP dw $23CA, $244C, $24CE, $2550, $26D2, $2754|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $01FF dw $01FF
dw $23CC, $244E, $24D0, $2652, $26D4, $2756|!OWW_STOP dw $23CC, $244E, $24D0, $2652, $26D4, $2756|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $017C dw $017C
dw $23CE, $2450, $24D2, $2654, $26D6|!OWW_STOP dw $23CE, $2450, $24D2, $2654, $26D6|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0100 dw $0100
dw $245A, $24D8|!OWW_STOP dw $245A, $24D8|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0104 dw $0104
dw $24DA, $2558|!OWW_STOP dw $24DA, $2558|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0106 dw $0106
dw $2462, $24E0, $255C|!OWW_STOP dw $2462, $24E0, $255C|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0107 dw $0107
dw $2464, $24E2|!OWW_STOP dw $2464, $24E2|!OWW_STOP
@@ -996,7 +966,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(2) dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(2)
dw $02FD, $27D8 dw $02FD, $27D8
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $06E7 dw $06E7
dw $28D8, $295A, $29DC|!OWW_STOP dw $28D8, $295A, $29DC|!OWW_STOP
@@ -1071,24 +1041,24 @@ dw $0000 ; 7F
.map3C .map3C
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $02E5 dw $02E5
dw $27AE, $282C, $282E, $2832 dw $27AE, $282C, $282E, $2832
dw $28AC, $28AE, $2928, $292C dw $28AC, $28AE, $2928, $292C
dw $29A8, $29B0, $2A28, $2A30 dw $29A8, $29B0, $2A28, $2A30
dw $2AAC, $2AB2|!OWW_STOP dw $2AAC, $2AB2|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $078A dw $078A
dw $28AA, $28B0, $2AAA, $2B2A dw $28AA, $28B0, $2AAA, $2B2A
dw $2B30, $2BAE|!OWW_STOP dw $2B30, $2BAE|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $02EB dw $02EB
dw $28B4, $2930, $29AE, $2A2C dw $28B4, $2930, $29AE, $2A2C
dw $2A32, $2AAE|!OWW_STOP dw $2A32, $2AAE|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $02EC dw $02EC
dw $2934, $2B28, $2B2C, $2B2E dw $2934, $2B28, $2B2C, $2B2E
dw $2B32|!OWW_STOP dw $2B32|!OWW_STOP
@@ -1118,7 +1088,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(5) dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(5)
dw $021C, $260A dw $021C, $260A
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0034 dw $0034
dw $270E, $278E, $2790, $2918, $291A, $2998, $299A, $291C, $291E, $2920|!OWW_STOP dw $270E, $278E, $2790, $2918, $291A, $2998, $299A, $291C, $291E, $2920|!OWW_STOP
@@ -1132,7 +1102,6 @@ dw $0000 ; 7F
dw $288C dw $288C
dw $01FA, $0034, $00DA|!OWW_STOP dw $01FA, $0034, $00DA|!OWW_STOP
dw !OWW_Stripe|!OWW_Horizontal dw !OWW_Stripe|!OWW_Horizontal
dw $290C dw $290C
dw $0186 dw $0186
@@ -1158,112 +1127,81 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(13) dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(13)
dw $0034, $2A06 dw $0034, $2A06
; leave these after the above
dw $0071, $2A0E
dw $0071, $2A1A
; a couple of these will be over written in a second
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(13) dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(13)
dw $0034, $2A84 dw $0034, $2A84
; leave these after the above ; leave these after the above
dw $0071, $2A0E
dw $0071, $2A1A
dw $0035, $2A8C dw $0035, $2A8C
; TODO clean up and optimize dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(5)
dw $015C, $2A20 dw $0034, $2B84
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(6)
dw $0034, $2C86
dw !OWW_ArbTileCopy
dw $0034 ; tile
dw $2B06, $2B0A, $2B0E, $2B12
dw $2B1A, $2B92, $2B94
dw $2B98, $2B9A, $2C04, $2C08
dw $2C0A, $2C0E, $2C12, $2C14
dw $2C18, $2C98
dw $2D0A, $2D0C, $2D10, $2D14
dw $2D16, $2D8A, $2D8C, $2D8E
dw $2D94|!OWW_STOP
dw !OWW_ArbTileCopy
dw $0035 ; tile
dw $2B08, $2C06, $2D0E, $2D90|!OWW_STOP
dw $0104, $2A22 dw $0104, $2A22
dw $01D4, $2A24 dw $01D4, $2A24
dw $016A, $2A82
dw $015C, $2A9E
dw $0162, $2AA0
dw $016A, $2B02
dw $00E2, $2B04
dw $0034, $2B06
dw $0035, $2B08
dw $0034, $2B0A
dw $00E2, $2B0C
dw $0034, $2B0E
dw $00E2, $2B10
dw $0034, $2B12
dw $00DA, $2B14
dw $00DA, $2B16
dw $00DA, $2B18
dw $0034, $2B1A
dw $015C, $2B1C
dw $0162, $2B1E
dw $016A, $2B82
dw $0034, $2B84
dw $0034, $2B86
dw $0034, $2B88
dw $0034, $2B8A
dw $00E2, $2B8C
dw $0034, $2B8E
dw $00E2, $2B90
dw $0034, $2B92
dw $0034, $2B94
dw $00DA, $2B96
dw $0034, $2B98
dw $0034, $2B9A
dw $0162, $2B9C
dw $016A, $2C02
dw $0034, $2C04
dw $0035, $2C06
dw $0034, $2C08
dw $0034, $2C0A
dw $00E2, $2C0C
dw $0034, $2C0E
dw $00E2, $2C10
dw $0034, $2C12
dw $0034, $2C14
dw $00DA, $2C16
dw $0034, $2C18
dw $00F8, $2C1A dw $00F8, $2C1A
dw $00CE, $2C1C dw $00CE, $2C1C
dw $016A, $2C82
dw $0160, $2C84
dw $0034, $2C86
dw $0034, $2C88
dw $0034, $2C8A
dw $0071, $2C8C dw $0071, $2C8C
dw $00E2, $2C8E
dw $0034, $2C90
dw $0034, $2C92
dw $0034, $2C94
dw $00DA, $2C96
dw $0034, $2C98
dw $015C, $2C9A
dw $00CE, $2C9C dw $00CE, $2C9C
dw $0167, $2D04 dw $0167, $2D04
dw $0160, $2D06
dw $00DA, $2D08
dw $0034, $2D0A
dw $0034, $2D0C
dw $0035, $2D0E
dw $0034, $2D10
dw $0036, $2D12 dw $0036, $2D12
dw $0034, $2D14
dw $0034, $2D16
dw $015C, $2D18
dw $0162, $2D1A
dw $0167, $2D86 dw $0167, $2D86
dw $0160, $2D88
dw $0034, $2D8A
dw $0034, $2D8C
dw $0034, $2D8E
dw $0035, $2D90
dw $00DA, $2D92
dw $0034, $2D94
dw $015C, $2D96
dw $0162, $2D98
dw $0172, $2E08 dw $0172, $2E08
dw $015E, $2E0A
dw $015E, $2E0C
dw $015E, $2E0E
dw $015E, $2E10
dw $015E, $2E12
dw $015E, $2E14
dw $0174, $2E16 dw $0174, $2E16
dw !OWW_ArbTileCopy
dw $00DA ; tile
dw $2B14, $2B16, $2B18, $2B96
dw $2C16, $2C96, $2D08, $2D92|!OWW_STOP
dw !OWW_ArbTileCopy
dw $00E2 ; tile
dw $2B04, $2B0C, $2B10, $2B8C, $2B90
dw $2C0C, $2C10, $2C8E|!OWW_STOP
dw !OWW_ArbTileCopy
dw $015C ; tile
dw $2A20, $2A9E, $2B1C, $2C9A, $2D18
dw $2D96|!OWW_STOP
dw !OWW_ArbTileCopy
dw $015E ; tile
dw $2E0A, $2E0C, $2E0E, $2E10
dw $2E12, $2E14|!OWW_STOP
dw !OWW_ArbTileCopy
dw $0160 ; tile
dw $2C84, $2D06, $2D88|!OWW_STOP
dw !OWW_ArbTileCopy
dw $0162 ; tile
dw $2AA0, $2B1E, $2B9C, $2D1A
dw $2D98|!OWW_STOP
dw !OWW_ArbTileCopy
dw $016A ; tile
dw $2A82, $2B02, $2B82, $2C02
dw $2C82|!OWW_STOP
dw !OWW_END dw !OWW_END
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
@@ -1272,6 +1210,7 @@ dw $0000 ; 7F
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
dw $0034, $22A8 dw $0034, $22A8
dw !OWW_END dw !OWW_END
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
@@ -1379,9 +1318,11 @@ dw $0000 ; 7F
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map45 .map45
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
dw $0239, $3D4A dw $0239, $3D4A
dw !OWW_END dw !OWW_END
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map47 .map47
@@ -1463,14 +1404,14 @@ dw $0000 ; 7F
dw $03A2, $0232, $0235, $046A dw $03A2, $0232, $0235, $046A
dw $0333, $0333, $0333|!OWW_STOP dw $0333, $0333, $0333|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0034 ; tile dw $0034 ; tile
dw $3BB6, $3BBA, $3BBC, $3C3A dw $3BB6, $3BBA, $3BBC, $3C3A
dw $3C3C, $3C3E|!OWW_STOP dw $3C3C, $3C3E|!OWW_STOP
; pegs ; pegs
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0034 ; tile dw $0034 ; tile
dw $321C, $329C, $32A0|!OWW_STOP dw $321C, $329C, $32A0|!OWW_STOP
@@ -1487,7 +1428,7 @@ dw $0000 ; 7F
dw $00F2, $3BB8 dw $00F2, $3BB8
dw $0108, $3C38 dw $0108, $3C38
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $021B ; tile dw $021B ; tile
dw $3218, $3222, $3298, $32A2 dw $3218, $3222, $3298, $32A2
dw $331A, $331C, $331E, $3320|!OWW_STOP dw $331A, $331C, $331E, $3320|!OWW_STOP
@@ -1533,16 +1474,16 @@ dw $0000 ; 7F
dw !OWW_END dw !OWW_END
.map5B_pick_warp_tile .map5B_pick_warp_tile
LDX.w #$0034
LDA.l ProgressIndicator LDA.l ProgressIndicator
AND.w #$00FF AND.w #$00FF
CMP.w #$0003 CMP.w #$0003
BNE ++
LDX.w #$0212 LDA.w #$0034
BCC ++
++ STX.w $3BBE LDA.w #$0212
++ STA.l $7E3BBE
RTS RTS
@@ -1556,12 +1497,14 @@ dw $0000 ; 7F
dw !OWW_END dw !OWW_END
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map70 .map70
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
dw $0239, $3D94 dw $0239, $3D94
dw !OWW_END dw !OWW_END
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map73 .map73
@@ -1599,7 +1542,7 @@ dw $0000 ; 7F
dw $30DA ; start dw $30DA ; start
dw $0BAA, $0BC8, $0BCD|!OWW_STOP dw $0BAA, $0BC8, $0BCD|!OWW_STOP
dw !OWW_ArbitraryRLE dw !OWW_ArbTileCopy
dw $0BA3 ; tile dw $0BA3 ; tile
dw $2F52, $2FCE, $2FD0|!OWW_STOP dw $2F52, $2FCE, $2FD0|!OWW_STOP

View File

@@ -1,3 +1,118 @@
;------------------------------------------------------------------------------
; Item Data Tables
;------------------------------------------------------------------------------
; This module contains several statically mapped tables related to items, item
; receipts, and item graphics. There are 256 item receipt indexes and the tables are
; written column-major, meaning each "column" property of every table entry is
; written adjacent to each other (e.g., ItemReceipts_offset_y is one byte per item.
; All 256 bytes for each item are written in receipt ID order, then 256 bytes are
; written for ItemReceipts_offset_x, etc.) The addresses and description of each
; table and column are described immediately below. The tables themselves are below
; the documentation.
;
; The tables and documentation here should provide the knowledge and capability
; to add an item into an unclaimed receipt ID or replace some existing items, although
; you should prefer to use unclaimed space or reuse randomizer item slots as some
; vanilla behavior is still hard-coded.
;
; Some of the entries in these tables are word-length vectors, or pointers to
; code the randomizer ROM runs on item pickup or resolution (e.g., resolving a
; progressive sword that's a standing item.) We provide all our own routines plus
; some for "skipping" these steps when not necessary. If you want an item to potentially
; resolve to a different one, or to run some custom code on pickup, you will have to use
; ItemSubstitutionRules in tables.asm or claim some free space in this bank to put your
; own code with vectors to it in the appropriate tables.
;
; Currently our "skip" vectors are located at (SNES address, little-endian):
; ItemReceipts_behavior: $CDBB
; ItemReceipts_resolution: $D33F
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; ItemReceiptGraphicsROM - $A28000 (0x110000 PC)
;------------------------------------------------------------------------------
; Where the custom uncompressed 4bpp item graphics are stored. See customitems.4bpp
; and customitems.png for reference. Offsets into this label should written to
; ItemReceiptGraphicsOffsets & StandingItemGraphicsOffsets without the high byte
; (0x8000) set.
;
; We can understand this buffer as being divided into an 8x8 grid with most sprites
; occupying a 16x16 space and narrow sprites occupying an 8x16 space. The first 16x16
; item tile is a blank one-color sprite, the second 16x16 is the triforce piece,
; and the third is the fighter sword sprite.
;
; Every 8x8 4bpp tile from left to right is offset by 0x20. From top to bottom
; the offset is 0x200. This means that each "row" of 8x8 tiles should be written
; contiguously, but to write the next tile(s) below the base upper-left address
; should be incremented by 0x200.
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; ItemReceipts
;------------------------------------------------------------------------------
; .offset_y [0x01] - $A2B000 (0x113000 PC)
; • Sprite Y offset from default position
; .offset_x [0x01] - $A2B100 (0x113100 PC)
; • Sprite X offset from default position
; .graphics [0x01] - $A2B200 (0x113200 PC)
; • Sprite index for compressed graphics
; .target [0x02] - $A2B300 (0x113300 PC)
; • Target address in save buffer in bank $7E
; .value [0x01] - $A2B500 (0x113500 PC)
; • Value written to target address
; .behavior [0x02] - $A2B600 (0x113600 PC)
; • Vector to code in this bank that runs on item pickup
; .resolution [0x02] - $A2B600 (0x113600 PC)
; • Vector to code in this bank that can resolve to new item (e.g. for progressive items)
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; SpriteProperties
;------------------------------------------------------------------------------
; For the most part item sprites are identical in all contexts, but some
; sprites have two graphics, chest/npc graphics and standing item graphics.
;------------------------------------------------------------------------------
; .chest_width [0x01] - $A2BA00 (0x11CA00 PC)
; .standing_width [0x01] - $A2BB00 (0x11CB00 PC)
; • $00 = 8x16 sprite | $02 = 16x16 sprite
; .chest_palette [0x01] - $A2BC00 (0x11CC00 PC)
; .standing_palette [0x01] - $A2BD00 (0x11CD00 PC)
; • l - - - - c c c
; c = palette index | l = load palette from .palette_addr
; .palette_addr [0x02] - $A2BE00 (0x11CE00 PC)
; • Pointer to 8-color palette in bank $9B (see custompalettes.asm)
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; InventoryTable
;------------------------------------------------------------------------------
; .properties [0x01] - $A2C000 (0x114000 PC)
; • p k w o a y s t
; t = Count for total item counter | s = Count for total in shops
; y = Y item | a = A item
; o = Bomb item | w = Bow item
; k = Chest Key | p = Crystal prize behavior (sparkle, etc) if set
; .stat [0x02] - $A2C100 (0x114100 PC)
; • Pointer to address in bank $7E. Increments byte by one if stats not locked.
; .stamp [0x02] - $A2C300 (0x114300 PC)
; • Pointer to address in bank $7E. Stamps 32-bit frame time if stats not locked.
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; ItemReceiptGraphicsOffsets & StandingItemGraphicsOffsets
;------------------------------------------------------------------------------
; Each receipt ID has one word-length entry. Decompressed vanilla item graphics
; are located starting at BigDecompressionBuffer. The graphics routines use the
; fact that the high bit is set for these in this table to know to load from the
; buffer. Custom graphics are offset from ItemReceiptGraphicsRom, allocated in
; LTTP_RND_GeneralBugfixes.asm and written to with decompressed customitems.4bpp
; (see customitems.png for reference.)
;
; ItemReceiptGraphicsOffsets is used for chest items and items link holds up while
; in an item receipt post. StandingItemGraphicsOffsets is for standing items in
; heart piece, heart container, and shop locations.
;------------------------------------------------------------------------------
ItemReceipts: ItemReceipts:
.offset_y : fillbyte $00 : fill 256 .offset_y : fillbyte $00 : fill 256
.offset_x : fillbyte $00 : fill 256 .offset_x : fillbyte $00 : fill 256
@@ -894,7 +1009,7 @@ ItemReceiptGraphicsOffsets:
dw BigDecompressionBuffer+$0080 ; 38 - Blue pendant dw BigDecompressionBuffer+$0080 ; 38 - Blue pendant
dw BigDecompressionBuffer+$0080 ; 39 - Red pendant dw BigDecompressionBuffer+$0080 ; 39 - Red pendant
dw BigDecompressionBuffer+$0920 ; 3A - Tossed bow dw BigDecompressionBuffer+$0920 ; 3A - Tossed bow
dw BigDecompressionBuffer+$08E0 ; 3B - Silvers dw BigDecompressionBuffer+$08E0 ; 3B - Silver bow
dw BigDecompressionBuffer+$09A0 ; 3C - Full bottle (bee) dw BigDecompressionBuffer+$09A0 ; 3C - Full bottle (bee)
dw BigDecompressionBuffer+$0960 ; 3D - Full bottle (fairy) dw BigDecompressionBuffer+$0960 ; 3D - Full bottle (fairy)
dw BigDecompressionBuffer+$18C0 ; 3E - Boss heart dw BigDecompressionBuffer+$18C0 ; 3E - Boss heart
@@ -945,7 +1060,7 @@ ItemReceiptGraphicsOffsets:
dw $0 ; 69 - dw $0 ; 69 -
dw $0060 ; 6A - Triforce dw $0060 ; 6A - Triforce
dw $11E0 ; 6B - Power star dw $11E0 ; 6B - Power star
dw $0 ; 6C - dw $0060 ; 6C - Triforce Piece
dw $0 ; 6D - Server request item dw $0 ; 6D - Server request item
dw $0 ; 6E - Server request item (dungeon drop) dw $0 ; 6E - Server request item (dungeon drop)
dw $0 ; 6F - dw $0 ; 6F -
@@ -1215,7 +1330,7 @@ StandingItemGraphicsOffsets:
dw $0 ; 69 - dw $0 ; 69 -
dw $0060 ; 6A - Triforce dw $0060 ; 6A - Triforce
dw $11E0 ; 6B - Power star dw $11E0 ; 6B - Power star
dw $0 ; 6C - dw $0060 ; 6C - Triforce Piece
dw $0 ; 6D - Server request item dw $0 ; 6D - Server request item
dw $0 ; 6E - Server request item (dungeon drop) dw $0 ; 6E - Server request item (dungeon drop)
dw $0 ; 6F - dw $0 ; 6F -

View File

@@ -395,7 +395,7 @@ UpdateHearts:
PHX PHX
PLB PLB
LDA.w $7EF36C LDA.w MaximumHealth
LSR LSR
LSR LSR
LSR LSR
@@ -414,7 +414,11 @@ UpdateHearts:
CPX.b #$01 CPX.b #$01
BMI .done_hearts BMI .done_hearts
JSR.w CheckHeartPalette PHX
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
PLX
ORA.w #$20A0
CPY.b #$01 CPY.b #$01
BPL .add_heart BPL .add_heart
@@ -450,18 +454,22 @@ UpdateHearts:
BRA .next_filled_heart BRA .next_filled_heart
.done_hearts .done_hearts
LDA.w $7EF36D LDA.w CurrentHealth
AND.w #$0007 AND.w #$0007
BEQ .skip_partial BEQ .skip_partial
CMP.w #$0005 CMP.w #$0005
JSR.w CheckHeartPalette
BCS .more_than_half BCS .more_than_half
INC LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
ORA.w #$20A1
STA.b ($09)
BRA .skip_partial
.more_than_half .more_than_half
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
ORA.w #$20A0
STA.b ($09) STA.b ($09)
.skip_partial .skip_partial
@@ -486,9 +494,11 @@ CheckHeartPalette:
RTS RTS
ColorAnimatedHearts: ColorAnimatedHearts:
PHX
REP #$20 REP #$20
LDA.l HUDHeartColors_index : ASL : TAX LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X LDA.l HUDHeartColors_masks_game_hud,X
PLX
ORA.l HeartFramesBaseTiles,X ORA.l HeartFramesBaseTiles,X
STA.b [Scrap00],Y STA.b [Scrap00],Y
SEP #$20 SEP #$20

View File

@@ -280,7 +280,9 @@ ItemBehavior:
RTS RTS
.silversbow .silversbow
LDA.l BowTracking : ORA.b #$80 : STA.l BowTracking
LDA.l SilverArrowsUseRestriction : BNE + LDA.l SilverArrowsUseRestriction : BNE +
LDA.l BowTracking : ORA.b #$40 : STA.l BowTracking
LDA.b #03 : STA.l BowEquipment ; set bow to silver LDA.b #03 : STA.l BowEquipment ; set bow to silver
+ +
LDA.b #$01 : STA.l BowEquipment LDA.b #$01 : STA.l BowEquipment
@@ -322,17 +324,31 @@ ItemBehavior:
JMP.w .increment_map JMP.w .increment_map
.bow_and_arrows .bow_and_arrows
LDA.l BowTracking : BIT.b #$40 : BEQ + LDA.b #$80 : ORA.l BowTracking : STA.l BowTracking
LDA.l SilverArrowsUseRestriction : BNE + LDA.l BowTracking : BIT.b #$40 : BEQ .no_silvers
LDA.b #03 : STA.l BowEquipment ; set bow to silver LDA.l SilverArrowsUseRestriction : BNE .no_silvers
LDA.l CurrentArrows : BEQ +
LDA.b #04 : STA.l BowEquipment
BRA .store_bow
+ +
LDA.b #$03
BRA .store_bow
.no_silvers
LDA.l CurrentArrows : BEQ +
LDA.b #02
BRA .store_bow
+
LDA.b #$01
.store_bow
STA.l BowEquipment
RTS RTS
.silver_bow .silver_bow
LDA.b #$40 : ORA.l BowTracking : STA.l BowTracking LDA.b #$80 : ORA.l BowTracking : STA.l BowTracking
LDA.l SilverArrowsUseRestriction : BNE .noequip LDA.l SilverArrowsUseRestriction : BNE .noequip
LDA.b #$40 : ORA.l BowTracking : STA.l BowTracking
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ .noequip LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ .noequip
LDA.l ArrowsFiller : BNE + ; check arrows LDA.l CurrentArrows : 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
@@ -405,8 +421,8 @@ ItemBehavior:
RTS RTS
.silver_arrows .silver_arrows
LDA.l BowTracking : ORA.b #$40 : STA.l BowTracking
LDA.l SilverArrowsUseRestriction : BNE ++ LDA.l SilverArrowsUseRestriction : BNE ++
LDA.l BowTracking : ORA.b #$40 : STA.l BowTracking
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ ++ LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ ++
LDA.l BowEquipment : BEQ ++ : CMP.b #$03 : !BGE + LDA.l BowEquipment : BEQ ++ : CMP.b #$03 : !BGE +
!ADD.b #$02 : STA.l BowEquipment ; switch to silver bow !ADD.b #$02 : STA.l BowEquipment ; switch to silver bow
@@ -531,18 +547,23 @@ ItemBehavior:
LSR LSR
AND.w #$000F : TAX AND.w #$000F : TAX
ASL : CMP.w DungeonID : BEQ .same_dungeon ASL : CMP.w DungeonID : BEQ .same_dungeon
LSR : TAX
LDA.l DungeonKeys,X : INC : STA.l DungeonKeys,X LDA.l DungeonKeys,X : INC : STA.l DungeonKeys,X
RTS RTS
.same_dungeon .same_dungeon
SEP #$20 SEP #$20
LDA.l CurrentSmallKeys : INC : STA.l CurrentSmallKeys LDA.l CurrentSmallKeys : INC : STA.l CurrentSmallKeys
LSR : TAX LDA.l DungeonKeys,X : INC : STA.l DungeonKeys,X
LDA.l DungeonKeys,X : INC : STA.l DungeonKeys,X ; Update menu key count too RTS
.same_dungeon_hc
SEP #$20
LDA.l CurrentSmallKeys : INC : STA.l CurrentSmallKeys
LDA.l SewerKeys : INC
STA.l SewerKeys : STA.l HyruleCastleKeys
RTS RTS
.hc_smallkey .hc_smallkey
LDA.w DungeonID : CMP.b #$03 : BCC .same_dungeon LDA.w DungeonID : CMP.b #$03 : BCC .same_dungeon_hc
LDA.l HyruleCastleKeys : INC : STA.l HyruleCastleKeys LDA.l HyruleCastleKeys : INC : STA.l HyruleCastleKeys
LDA.l SewerKeys : INC : STA.l SewerKeys LDA.l SewerKeys : INC : STA.l SewerKeys
RTS RTS
@@ -814,10 +835,10 @@ HandleBowTracking:
CMP.b #$65 : BEQ .prog_two CMP.b #$65 : BEQ .prog_two
RTS RTS
.prog_one .prog_one
LDA.b #$80 LDA.b #$90
BRA .done BRA .done
.prog_two .prog_two
LDA.b #$20 LDA.b #$A0
.done .done
ORA.l BowTracking : STA.l BowTracking ORA.l BowTracking : STA.l BowTracking
LDA.w ItemReceiptID LDA.w ItemReceiptID

View File

@@ -115,11 +115,15 @@ CheckCloseItemMenu:
RTL RTL
;================================================================================ ;================================================================================
ShowDungeonItems: ShowDungeonItems:
REP #$30 LDA.w DungeonID-1 : BMI .no_dungeon
LDA.w DungeonID : AND.w #$00FF : CMP.w #$00FF : BNE + : RTL : + ; return normal result if outdoors or in a cave LDA.l HudFlag : AND.w #$0040 : BEQ +
LDA.l HudFlag : AND.w #$0020 ; check hud flag .no_dungeon
BEQ + : LDA.w #$0000 : RTL : + ; if set, send the zero onwards LDA.w #$0000
LDA.w DungeonID : AND.w #$00FF : CMP.w #$00FF ; original logic RTL
+
LDA.w DungeonID
REP #$02
.done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
UpdateKeys: UpdateKeys:
@@ -254,27 +258,18 @@ DrawHUDDungeonItems:
dw $0D*2 ; ; Ganon's Tower dw $0D*2 ; ; Ganon's Tower
.continue .continue
PHP PHP : PHB
PHK : PLB
PHB
PHK
PLB
REP #$30 REP #$30
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
; dungeon names ; dungeon names
LDA.w #$2D50 LDA.w #$2D50
LDY.w #00 LDY.w #00
.next_dungeon_name .next_dungeon_name
LDX.w .dungeon_positions,Y LDX.w .dungeon_positions,Y
STA.w GFXStripes+$0646,X STA.w GFXStripes+$0646,X
INC INC
INY : INY INY : INY
CPY.w #26 : BCC .next_dungeon_name CPY.w #26 : BCC .next_dungeon_name
@@ -286,25 +281,20 @@ DrawHUDDungeonItems:
STA.w GFXStripes+$06C6,X STA.w GFXStripes+$06C6,X
STA.w GFXStripes+$0706,X STA.w GFXStripes+$0706,X
DEX : DEX : BPL -- DEX : DEX
BPL --
LDA.l HudFlag : AND.w #$0020 : BEQ + LDA.l HudFlag : AND.w #$0020 : BEQ +
JMP .maps_and_compasses JMP .maps_and_compasses
+
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
+
LDA.l HUDDungeonItems : AND.w #$0001 : BEQ .skip_small_keys LDA.l HUDDungeonItems : AND.w #$0001 : BNE +
LDA.w #$24F5 : STA.w GFXStripes+$0684 ; blank tile
BRA .skip_small_keys
+
.draw_small_keys .draw_small_keys
LDA.w #$2810 : STA.w GFXStripes+$0684 ; small keys icon LDA.w #$2810 : STA.w GFXStripes+$0684 ; small keys icon
LDY.w #0 LDY.w #0
; Clear the carry only once
; it will be cleared by looping condition afterwards
CLC CLC
.next_small_key .next_small_key
@@ -322,17 +312,13 @@ DrawHUDDungeonItems:
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
.skip_small_keys .skip_small_keys
; Big Keys ; Big Keys
LDA.l HUDDungeonItems : AND.w #$0002 : BEQ .skip_big_keys LDA.l HUDDungeonItems : AND.w #$0002 : BNE +
LDA.w #$24F5 : STA.w GFXStripes+$06C4 ; blank tile
BRA .skip_big_keys
+
LDA.w #$2811 : STA.w GFXStripes+$06C4 ; big key icon LDA.w #$2811 : STA.w GFXStripes+$06C4 ; big key icon
; use X so we can BIT
LDX.w #0 LDX.w #0
; load once and test multiple times
LDA.l BigKeyField LDA.l BigKeyField
.next_big_key .next_big_key
@@ -342,8 +328,6 @@ DrawHUDDungeonItems:
LDY.w .dungeon_positions,X LDY.w .dungeon_positions,X
LDA.w #$2826 LDA.w #$2826
STA.w GFXStripes+$06C6,Y STA.w GFXStripes+$06C6,Y
; reload
LDA.l BigKeyField LDA.l BigKeyField
..skip_key ..skip_key
@@ -353,8 +337,10 @@ DrawHUDDungeonItems:
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
.skip_big_keys .skip_big_keys
LDA.l HUDDungeonItems : AND.w #$0010 : BNE +
LDA.l HUDDungeonItems : AND.w #$0010 : BEQ .skip_boss_kills LDA.w #$24F5 : STA.w GFXStripes+$0704 ; blank tile
BRA .skip_boss_kills
+
LDA.w #$280F : STA.w GFXStripes+$0704 ; skull icon LDA.w #$280F : STA.w GFXStripes+$0704 ; skull icon
LDY.w #0 LDY.w #0
@@ -363,33 +349,27 @@ DrawHUDDungeonItems:
LDA.l RoomDataWRAM.l,X LDA.l RoomDataWRAM.l,X
AND.w #$0800 AND.w #$0800
BEQ ..skip_boss_kill BEQ ..skip_boss_kill
LDA.w #$2826 LDA.w #$2826
LDX.w .dungeon_positions,Y LDX.w .dungeon_positions,Y
STA.w GFXStripes+$0706,X STA.w GFXStripes+$0706,X
..skip_boss_kill ..skip_boss_kill
INY : INY INY : INY
CPY.w #26 : BCC .next_boss_kill CPY.w #26 : BCC .next_boss_kill
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
.skip_boss_kills .skip_boss_kills
LDA.l HUDDungeonItems : BIT.w #$00F3 : BEQ .maps_and_compasses
JMP .exit JMP .exit
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
; This should only display if select is pressed in hud
.maps_and_compasses .maps_and_compasses
LDA.w #$24F5 : STA.w GFXStripes+$0704 ; blank tile boss icon
; Maps ; Maps
LDA.l HUDDungeonItems : AND.w #$0004 : BEQ .skip_maps LDA.l HUDDungeonItems : AND.w #$0004 : BNE +
LDA.w #$24F5 : STA.w GFXStripes+$0684 ; map icon
BRA .skip_maps
+
LDA.w #$2821 : STA.w GFXStripes+$0684 ; map icon LDA.w #$2821 : STA.w GFXStripes+$0684 ; map icon
; use X so we can BIT
LDX.w #0 LDX.w #0
; load once and test multiple times
LDA.l MapField LDA.l MapField
.next_map .next_map
@@ -399,26 +379,19 @@ DrawHUDDungeonItems:
LDY.w .dungeon_positions,X LDY.w .dungeon_positions,X
LDA.w #$2826 LDA.w #$2826
STA.w GFXStripes+$0686,Y STA.w GFXStripes+$0686,Y
; reload
LDA.l MapField LDA.l MapField
..skip_map ..skip_map
INX : INX INX : INX
CPX.w #26 : BCC .next_map CPX.w #26 : BCC .next_map
;-------------------------------------------------------------------------------
.skip_maps .skip_maps
LDA.l HUDDungeonItems : AND.w #$0008 : BNE +
; Compasses LDA.w #$24F5 : STA.w GFXStripes+$06C4 ; blank tile
LDA.l HUDDungeonItems : AND.w #$0008 : BEQ .skip_compasses BRA .skip_compasses
+
LDA.w #$2C20 : STA.w GFXStripes+$06C4 ; compass icon LDA.w #$2C20 : STA.w GFXStripes+$06C4 ; compass icon
; use X so we can BIT
LDX.w #0 LDX.w #0
; load once and test multiple times
LDA.l CompassField LDA.l CompassField
.next_compass .next_compass
@@ -428,8 +401,6 @@ DrawHUDDungeonItems:
LDY.w .dungeon_positions,X LDY.w .dungeon_positions,X
LDA.w #$2826 LDA.w #$2826
STA.w GFXStripes+$06C6,Y STA.w GFXStripes+$06C6,Y
; reload
LDA.l CompassField LDA.l CompassField
..skip_compass ..skip_compass
@@ -439,7 +410,6 @@ DrawHUDDungeonItems:
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
.skip_compasses .skip_compasses
.exit .exit
PLB PLB
PLP PLP
@@ -598,15 +568,19 @@ HandleEmptyMenu:
LDA.b Joy1A_New : BIT.b #$DF : BNE .close_menu ; Not select, close menu LDA.b Joy1A_New : BIT.b #$DF : BNE .close_menu ; Not select, close menu
BIT.b #$20 : BNE .sel_pressed BIT.b #$20 : BNE .sel_pressed
LDA.b Joy1A_All : BIT.b #$20 : BNE .wait_for_change LDA.b Joy1A_All : BIT.b #$20 : BNE .wait_for_change
LDA.l HudFlag : AND.b #$20 : BEQ .wait_for_change ; HUD flag off, skip drawing work LDA.l HudFlag : AND.b #$60 : BEQ .wait_for_change
LDA.l HudFlag : AND.b #$DF : STA.l HudFlag ; Unset without select LDA.l HudFlag : AND.b #$9F : STA.l HudFlag ; Unset without select
LDA.b IndoorsFlag : BEQ ++ ; skip if outdoors JSL.l MaybePlaySelectSFX
LDA.b #$20 : STA.w SFX3
++
LDA.b #$0C : BRA .done LDA.b #$0C : BRA .done
.sel_pressed .sel_pressed
LDA.l HudFlag : ORA.b #$20 : STA.l HudFlag LDA.l HUDDungeonItems : BIT.b #$0C : BNE +
LDA.b #$20 : STA.w SFX3 LDA.b #$40
BRA .store_flag
+
LDA.b #$60
.store_flag
STA.l HudFlag
JSL.l MaybePlaySelectSFX
LDA.b #$0C : BRA .done LDA.b #$0C : BRA .done
.wait_for_change .wait_for_change
LDA.b #$03 : BRA .done LDA.b #$03 : BRA .done
@@ -665,3 +639,4 @@ dw $2084, $6084, $2085, $6085 ; 0 heart pieces
dw $20AD, $6084, $2085, $6085 ; 1 heart piece dw $20AD, $6084, $2085, $6085 ; 1 heart piece
dw $20AD, $6084, $20AE, $6085 ; 2 heart pieces dw $20AD, $6084, $20AE, $6085 ; 2 heart pieces
dw $20AD, $60AD, $20AE, $6085 ; 3 heart pieces dw $20AD, $60AD, $20AE, $6085 ; 3 heart pieces
;-------------------------------------------------------------------------------

View File

@@ -177,8 +177,9 @@ InventoryTracking: skip 2 ; - - - - - - o q b r m p n s k f (bitfield)
; p = Magic Powder | n = Mushroom Past | s = Shovel ; p = Magic Powder | n = Mushroom Past | s = Shovel
; k = Inactive Flute | f = Active Flute | o = Any bomb acquired ; k = Inactive Flute | f = Active Flute | o = Any bomb acquired
; q = Quickswap locked ; q = Quickswap locked
BowTracking: skip 2 ; b s p - - - - - - - - - - - - - (bitfield) BowTracking: skip 2 ; b s p f - - - - - - - - - - - - (bitfield)
; b = Bow | s = Silver Arrows Upgrade | p = Second Progressive Bow ; b = Any Bow | s = Silver Arrows Upgrade | p = Second Progressive Bow
; f = First progressive bow
; 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
@@ -254,7 +255,8 @@ MapOverlay: skip 2 ; Used to reveal dungeon prizes on the map in mo
; | m = Misery Mire | d = Palace of Darkness | s = Swamp Palace ; | m = Misery Mire | d = Palace of Darkness | s = Swamp Palace
; | a = Aga Tower | t = Desert Palace | e = Eastern Palace ; | a = Aga Tower | t = Desert Palace | e = Eastern Palace
; / h = Hyrule Castle | s = Sewer Passage ; / h = Hyrule Castle | s = Sewer Passage
HudFlag: ; HudFlag: ; - h c - - - - -
; c = show maps and compasses | h = show heart pieces
IgnoreFaeries: ; IgnoreFaeries: ;
HasGroveItem: ; HasGroveItem: ;
GeneralFlags: skip 1 ; - - h - - i - g (bitfield) GeneralFlags: skip 1 ; - - h - - i - g (bitfield)
@@ -314,11 +316,12 @@ MagicCounter: skip 2 ; Magic used by player (16-bit integer)
HighestMail: skip 1 ; Highest mail level HighestMail: skip 1 ; Highest mail level
SmallKeyCounter: skip 1 ; Total Number of small keys collected (integer) SmallKeyCounter: skip 1 ; Total Number of small keys collected (integer)
HeartPieceCounter: skip 1 ; Total Number of heartpieces collected (integer) HeartPieceCounter: skip 1 ; Total Number of heartpieces collected (integer)
CrystalCounter: skip 1 ; Total Number of crystals collected (integer) skip 1 ; Unused
DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize has been collected. DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize has been collected.
; This has the same shape as the dungeon item bitfields. ; This has the same shape as the dungeon item bitfields.
MapCountDisplay: skip 2 ; MapCountDisplay: skip 2 ;
skip 42 ; Unused CrystalCounter: skip 2 ; Total Number of crystals collected (integer)
skip 40 ; Unused
ServiceSequence: ; See servicerequest.asm ServiceSequence: ; See servicerequest.asm
ServiceSequenceRx: skip 8 ; Service sequence receive ServiceSequenceRx: skip 8 ; Service sequence receive
ServiceSequenceTx: skip 8 ; Service sequence transmit ServiceSequenceTx: skip 8 ; Service sequence transmit
@@ -594,9 +597,9 @@ endmacro
%assertSRAM(HighestMail, $7EF46E) %assertSRAM(HighestMail, $7EF46E)
%assertSRAM(SmallKeyCounter, $7EF46F) %assertSRAM(SmallKeyCounter, $7EF46F)
%assertSRAM(HeartPieceCounter, $7EF470) %assertSRAM(HeartPieceCounter, $7EF470)
%assertSRAM(CrystalCounter, $7EF471)
%assertSRAM(DungeonsCompleted, $7EF472) %assertSRAM(DungeonsCompleted, $7EF472)
%assertSRAM(MapCountDisplay, $7EF474) %assertSRAM(MapCountDisplay, $7EF474)
%assertSRAM(CrystalCounter, $7EF476)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
%assertSRAM(ServiceSequence, $7EF4A0) %assertSRAM(ServiceSequence, $7EF4A0)
%assertSRAM(ServiceSequenceRx, $7EF4A0) %assertSRAM(ServiceSequenceRx, $7EF4A0)

View File

@@ -132,21 +132,7 @@ org $B0803D ; PC 0x18003D
PersistentFloodgate: PersistentFloodgate:
db $00 ; #$00 = Off (default) - #$01 = On db $00 ; #$00 = Off (default) - #$01 = On
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B0803E ; PC 0x18003E org $B0803E ; PC 0x18003E (unused)
InvincibleGanon:
db $00
; #$00 = Off (default)
; #$01 = On
; #$02 = Require All Dungeons
; #$03 = Require "NumberOfCrystalsRequiredForGanon" Crystals and Aga2
; #$04 = Require "NumberOfCrystalsRequiredForGanon" Crystals
; #$05 = Require "GoalItemRequirement" Goal Items
; #$06 = Light Speed
; #$07 = Require All Crystals and Crystal Bosses
; #$08 = Require All Crystal Bosses only
; #$09 = Require All Dungeons No Agahnim
; #$0A = Require 100% Item Collection
; #$0B = Require 100% Item Collection and All Dungeons
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B0803F ; PC 0x18003F org $B0803F ; PC 0x18003F
HammerableGanon: HammerableGanon:
@@ -247,12 +233,7 @@ CrystalPendantFlags_2:
;Aga1: $01 ;Aga1: $01
;Aga2: $02 ;Aga2: $02
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B0805E ; PC 0x18005E - Number of crystals required to enter GT org $B0805E ; PC 0x18005E - 0x18005F (Unused)
NumberOfCrystalsRequiredForTower:
db $07 ; #$07 = 7 Crystals
org $B0805F ; PC 0x18005F - Number of crystals required to kill Ganon
NumberOfCrystalsRequiredForGanon:
db $07 ; #$07 = 7 Crystals
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B08060 ; PC 0x180060 - 0x18007E org $B08060 ; PC 0x180060 - 0x18007E
ProgrammableItemLogicJump_1: ProgrammableItemLogicJump_1:
@@ -940,10 +921,38 @@ org $B08196 ; PC 0x180196-0x180197
TotalItemCount: ; Total item count for HUD. Only counts items that use "item get" animation. TotalItemCount: ; Total item count for HUD. Only counts items that use "item get" animation.
dw $00D8 ; 216 dw $00D8 ; 216
org $B08198 ; PC 0x180198-0x180199 org $B08198 ; PC 0x180198-0x1801A9
GanonsTowerOpenAddress: ; Target address for GT open check GanonsTowerOpenAddress: ; 0x180198-0x180199
dw CrystalCounter ; Target address for GT open check
GanonsTowerOpenTarget: ; 0x18019A-0x18019B
dw $0007 ; Target amount for GT open modes to compare
GanonsTowerOpenMode: ; 0x18019C-0x18019D
dw $0001 ; $00 = Vanilla | $01 = Compare target with address
PedPullAddress: ; 0x18019E-0x18019F
dw PendantCounter ; Target address for ped pull check
PedPullTarget: ; 0x1801A0-0x1801A1
dw $0003 ; Target amount for ped pull modes to check
PedCheckMode: ; 0x1801A2-0x1801A3
dw $0000 ; $00 = vanilla | $01 = Compare address to target value
GanonVulnerableAddress: ; 0x1801A4-0x1801A5
dw CrystalCounter ; Target address for ped pull check
GanonVulnerableTarget: ; 0x1801A6-0x1801A7
dw $0007 ; Target amount for Ganon vulnerability modes to compare
GanonVulnerableMode: ; 0x1801A8-0x1801A9
dw $0000 ; #$00 = Off (default)
; #$01 = On
; #$02 = Require All Dungeons
; #$03 = Require "GanonVulnerableTarget" Crystals and Aga2
; #$04 = Require "GanonVulnerableTarget" Crystals
; #$05 = Require "GoalItemRequirement" Goal Items
; #$06 = Light Speed
; #$07 = Require All Crystals and Crystal Bosses
; #$08 = Require All Crystal Bosses only
; #$09 = Require All Dungeons No Agahnim
; #$0A = Require 100% Item Collection
; #$0B = Require 100% Item Collection and All Dungeons
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x180196 - 0x1801FF (unused) ; 0x18019A - 0x1801FF (unused)
;================================================================================ ;================================================================================
org $B08200 ; PC 0x180200 - 0x18020B org $B08200 ; PC 0x180200 - 0x18020B
RedClockAmount: RedClockAmount:

View File

@@ -69,10 +69,6 @@ RTL
;-------------------------------------------------------------------------------- 20/847B ;-------------------------------------------------------------------------------- 20/847B
LoadDynamicTileOAMTable: LoadDynamicTileOAMTable:
PHP PHP
REP #$20
LDA.w #$0000 : STA.l SpriteOAM : STA.l SpriteOAM+2
LDA.w #$0200 : STA.l SpriteOAM+6
SEP #$20
LDA.b #$24 : STA.l SpriteOAM+4 LDA.b #$24 : STA.l SpriteOAM+4
LDA.w SpriteID,X LDA.w SpriteID,X
@@ -80,11 +76,18 @@ LoadDynamicTileOAMTable:
STA.l SpriteOAM+5 : STA.l SpriteOAM+13 STA.l SpriteOAM+5 : STA.l SpriteOAM+13
PHX PHX
LDA.l SpriteProperties_standing_width,X : BEQ .narrow LDA.l SpriteProperties_standing_width,X : BEQ .narrow
REP #$20
LDA.w #$0000 : STA.l SpriteOAM : STA.l SpriteOAM+2
LDA.w #$0200 : STA.l SpriteOAM+6
BRA .done BRA .done
.narrow .narrow
REP #$20 REP #$20
LDA.w #$0000 : STA.l SpriteOAM+7 : STA.l SpriteOAM+14 LDA.w #$0004 : STA.l SpriteOAM
LDA.w #$0000 : STA.l SpriteOAM+2
LDA.w #$0200 : STA.l SpriteOAM+6
LDA.w #$0400 : STA.l SpriteOAM+7 : STA.l SpriteOAM+14
LDA.w #$0800 : STA.l SpriteOAM+9 LDA.w #$0800 : STA.l SpriteOAM+9
LDA.w #$3400 : STA.l SpriteOAM+11 LDA.w #$3400 : STA.l SpriteOAM+11

View File

@@ -39,6 +39,8 @@ Dungeon_SaveRoomQuadrantData = $82B861
LoadGearPalettes_bunny = $82FD8A LoadGearPalettes_bunny = $82FD8A
LoadGearPalettes_variable = $82FD95 LoadGearPalettes_variable = $82FD95
Filter_Majorly_Whiten_Color = $82FEAB Filter_Majorly_Whiten_Color = $82FEAB
MasterSword_InPedestal = $858908
MasterSword_InPedestal_exit = $85894C
Ancilla_SpawnFallingPrize = $85A51D Ancilla_SpawnFallingPrize = $85A51D
Sprite_DrawMultiple = $85DF6C Sprite_DrawMultiple = $85DF6C
Sprite_DrawMultiple_quantity_preset = $85DF70 Sprite_DrawMultiple_quantity_preset = $85DF70