Merge remote-tracking branch 'baserom/master' into MergeDecompression

# Conflicts:
#	goalitem.asm
#	inventory.asm
#	invertedmaps.asm
#	newhud.asm
#	pendantcrystalhud.asm

Also some bugfixes here and there
This commit is contained in:
aerinon
2023-08-24 16:16:31 -06:00
22 changed files with 955 additions and 809 deletions

View File

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

View File

@@ -169,8 +169,8 @@ jsl CutoffEntranceRug : bra .nextTile : nop
org $8799de ; <- Bank07.asm : 4088 (LDA.b #$15 : STA $5D)
JSL StoreTempBunnyState
;
org $88c450 ; <- ancilla_receive_item.asm : 146-148 (STY $5D : STZ $02D8)
JSL RetrieveBunnyState : NOP
org $88C450 ; <- ancilla_receive_item.asm : 146-148 (STY $5D : STZ $02D8)
JSL RetrieveBunnyState : JMP.w $88C458 : NOP
org $82d9ce ; <- Bank02.asm : Dungeon_LoadEntrance 10829 (STA $A0 : STA $048E)
JSL CheckDarkWorldSpawn : NOP

View File

@@ -91,7 +91,7 @@ RetrieveBunnyState:
STY $5D : STZ $02D8 ; what we wrote over
LDA $5F : BEQ +
STA $5D
+ RTL
+ JML MaybeKeepLootID
; A should be how much dmg to do to Aga when leaving this function
StandardAgaDmg:

View File

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

View File

@@ -42,7 +42,7 @@ RTL
{
REP #$20
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 +
.despawn
SEP #$20

View File

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

View File

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

View File

@@ -15,7 +15,7 @@ RTL
;Carry set = ganon vulnerable
CheckGanonVulnerability:
PHX
LDA.l InvincibleGanon
LDA.l GanonVulnerableMode
ASL
TAX
@@ -122,7 +122,7 @@ db %10111111 ; 7 crystals
;--------------------------------------------------------------------------------
GTCutscene_ConditionalAnimateCrystals:
PHX : PHX
LDA.l NumberOfCrystalsRequiredForTower : TAX : LDA.l GTCutscene_CrystalMasks,X
JSR GTCutscene_NumberOfCrystals : TAX : LDA.l GTCutscene_CrystalMasks,X
PLX
- LSR : DEX : BPL -
PLX : BCC .skip_crystal
@@ -136,7 +136,7 @@ GTCutscene_ConditionalAnimateCrystals:
;--------------------------------------------------------------------------------
GTCutscene_ConditionalDrawSingleCrystal:
LDA.w $06FA : BEQ .draw_crystal : STZ.w $06FA
LDA.l NumberOfCrystalsRequiredForTower : TAX
JSR GTCutscene_NumberOfCrystals : TAX
LDA.l GTCutscene_CrystalMasks,X : AND.b #$80 : BEQ .skip_crystal
.draw_crystal
LDX.w $0FA0 : PHY ; what we wrote over
@@ -146,7 +146,7 @@ GTCutscene_ConditionalDrawSingleCrystal:
;--------------------------------------------------------------------------------
GTCutscene_AnimateCrystals_Prep:
BEQ + : JSL.l GTCutscene_SparkleALot : + ; thing we wrote over
LDA.l NumberOfCrystalsRequiredForTower : BNE +
JSR GTCutscene_NumberOfCrystals : BNE +
JML.l GTCutscene_DrawSingleCrystal_SkipSparkle
+ CMP.b #$01 : BNE +
JML.l GTCutscene_DrawSingleCrystal
@@ -154,15 +154,16 @@ GTCutscene_AnimateCrystals_Prep:
JML.l GTCutscene_AnimateCrystals_NextCrystal-2
;--------------------------------------------------------------------------------
GTCutscene_ActivateSparkle_SelectCrystal:
LDA.l NumberOfCrystalsRequiredForTower : BNE +
JSR GTCutscene_NumberOfCrystals : BNE +
TAX : RTL
+ TXA
+ STA.b Scrap00
TXA
- CMP.l NumberOfCrystalsRequiredForTower : BCC +
SBC.l NumberOfCrystalsRequiredForTower : BRA - ; carry guaranteed set
- CMP.l Scrap00 : BCC +
SBC.l Scrap00 : BRA - ; carry guaranteed set
+ PHY : TAY
LDA.l NumberOfCrystalsRequiredForTower : TAX : LDA.l GTCutscene_CrystalMasks,X
LDA.b Scrap00 : TAX : LDA.l GTCutscene_CrystalMasks,X
LDX.b #$FF
- LSR : INX : BCC +
DEY
@@ -170,27 +171,57 @@ GTCutscene_ActivateSparkle_SelectCrystal:
PLY
RTL
;--------------------------------------------------------------------------------
GTCutscene_NumberOfCrystals:
REP #$20
LDA.l GanonsTowerOpenAddress : CMP.w #CrystalCounter : BEQ +
LDA.w #$0001 : BRA .done
+ LDA.l GanonsTowerOpenTarget
.done
SEP #$20
RTS
;--------------------------------------------------------------------------------
CheckEnoughCrystalsForGanon:
REP #$20
LDA.l CrystalCounter
CMP.l NumberOfCrystalsRequiredForGanon
CMP.l GanonVulnerableTarget
SEP #$20
RTL
;--------------------------------------------------------------------------------
CheckEnoughCrystalsForTower:
LDA.l CrystalCounter
CMP.l NumberOfCrystalsRequiredForTower
CheckTowerOpen:
REP #$30
LDA.l GanonsTowerOpenMode : ASL : TAX
JSR.w (.tower_open_modes,X)
SEP #$30
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:
LDA.l InvincibleGanon
CMP.b #$06 : BNE .vanilla
REP #$20
LDA.l GanonVulnerableMode
CMP.w #$0006 : BNE .vanilla
.light_speed
SEP #$20
LDA.l OverworldEventDataWRAM+$80 ; check ped flag
AND.b #$40
BEQ .force_blue_ball
.vanilla ; run vanilla check for phase
SEP #$20
LDA.w SpriteAux, X
CMP.b #$02
RTL
@@ -206,7 +237,7 @@ CheckAgaForPed:
KillGanon:
STA.l ProgressIndicator ; vanilla game state stuff we overwrote
LDA.l InvincibleGanon
LDA.l GanonVulnerableMode
CMP.b #$06 : BNE .exit
.light_speed
@@ -218,7 +249,6 @@ KillGanon:
RTL
;---------------------------------------------------------------------------------------------------
CheckForCrystalBossesDefeated:
PHB : PHX : PHY
@@ -256,8 +286,34 @@ CheckForCrystalBossesDefeated:
SEP #$30
PLY : PLX : PLB
LDA.b Scrap00 : CMP.l NumberOfCrystalsRequiredForGanon
LDA.b Scrap00 : CMP.l GanonVulnerableTarget
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

@@ -44,10 +44,15 @@ DrawHeartPieceGFX:
LDA.l SpriteProperties_standing_width,X : BNE +
PLX
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
.draw
PLA
JSL.l DrawDynamicTile
JSL.l Sprite_DrawShadowLong

View File

@@ -506,9 +506,8 @@ PreventEnterOnBonk_BRANCH_IX:
;================================================================================
; Crystals Mode
;--------------------------------------------------------------------------------
org $899B7B ; <- ancilla_init.asm : 4136 (LDA $7EF37A : AND.b #$7F : CMP.b #$7F)
JSL CheckEnoughCrystalsForTower : NOP #4
db $90 ; BCC
org $899B7F ; <- ancilla_init.asm : 4136 (LDA $7EF37A : AND.b #$7F : CMP.b #$7F)
JSL CheckTowerOpen : BCC $899B6D
;--------------------------------------------------------------------------------
org $88CE0C ; <- 44E0C - ancilla_break_tower_seal.asm : 168 (BEQ #$03 : JSR GTCutscene_SparkleALot : LDX.b #$06)
JML.l GTCutscene_AnimateCrystals_Prep : NOP
@@ -565,6 +564,8 @@ JSL GoalItemGanonCheck
org $86F2EA ; <- 372EA - Bank06.asm : 5791 (LDA $0E20, X : CMP.b #$D6 : BCS .no_collision)
JSL CheckGanonHammerDamage : NOP
;--------------------------------------------------------------------------------
org $858922
JSL.l CheckPedestalPull : BCC MasterSword_InPedestal_exit
;================================================================================
; Stat Hooks
@@ -1032,7 +1033,7 @@ org $81C742 : JSL.l SpawnDungeonPrize
org $8799EA : JML.l SetItemPose
org $88C415 : JSL.l PendantMusicCheck
BCS Ancilla22_ItemReceipt_is_pendant : BRA Ancilla22_ItemReceipt_wait_for_music
org $88C452 : JSL.l MaybeKeepLootID : NOP #2
;org $88C452 : JSL.l MaybeKeepLootID : NOP #2 DR overwrote hook see RetrieveBunnyState
org $88C61D : JSL.l AnimatePrizeCutscene : NOP
org $88C622 : BCC ItemReceipt_Animate_continue
org $88C6BA : JSL.l CheckPoseItemCoordinates
@@ -1688,15 +1689,6 @@ JSL FlipLWDWFlag : NOP #2
;org $8AC5D8 ; < 545D8 - Bank0A.asm:1885 - (LDA $7EF3C7 : CMP.b #$07 : BNE OverworldMap_CheckPendant_fail)
;JSL OverworldMap_CheckObject : RTS
;================================================================================
;Clear level to open doors - todo: unsure if needed
org $81C50D ; 0xC50D - Bank01.asm:10032 - (LDA $7EF3CA : BNE .inDarkWorld)
LDA CrystalPendantFlags_2, X
;================================================================================
;Kill enemy to clear level
org $81C715 ; <- C715 - Bank01.asm:10358 - (LDA $7EF3CA : BNE .inDarkWorld)
LDA CrystalPendantFlags_2, X
;JSL.l GetPendantCrystalWorld
;================================================================================
org $8AC53E ; <- 5453E - Bank0A.asm:1771 - (LDA $0AC50D, X : STA $0D)
LDA.l CrystalNumberTable-1,X
;================================================================================

View File

@@ -10,10 +10,9 @@ ProcessMenuButtons:
BIT.b #$20 : BNE .sel_pressed ; check for P1 Select button
LDA.b Joy1A_All : BIT.b #$20 : BNE .sel_held
.sel_unheld
LDA.l HudFlag : AND.b #$20 : BEQ +
LDA.l HudFlag : AND.b #$DF : STA.l HudFlag ; select is released, unset hud flag
LDA.b IndoorsFlag : BEQ + ; skip if outdoors
LDA.b #$20 : STA.w SFX3 ; menu select sound
LDA.l HudFlag : AND.b #$60 : BEQ +
LDA.b #$00 : STA.l HudFlag
JSL.l MaybePlaySelectSFX
+
JSL.l ResetEquipment
+
@@ -21,8 +20,14 @@ ProcessMenuButtons:
CLC ; no buttons
RTL
.sel_pressed
LDA.l HudFlag : ORA.b #$20 : STA.l HudFlag ; set hud flag
LDA.b #$20 : STA.w SFX3 ; menu select sound
LDA.l HUDDungeonItems : BIT.b #$0C : BNE +
LDA.b #$40
BRA .store_flag
+
LDA.b #$60
.store_flag
STA.l HudFlag
JSL.l MaybePlaySelectSFX
JSL.l ResetEquipment
RTL
.y_pressed ; Note: used as entry point by quickswap code. Must preserve X.
@@ -173,6 +178,7 @@ AddInventory:
RTL
ShopCheck:
; TODO: If we write all shops, we can use the ShopPurchase flag instead of this
LDA.b IndoorsFlag : BEQ .count
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .count
LDA.w InventoryTable_properties,Y : BIT.b #$02 : BNE .count
@@ -274,8 +280,8 @@ IncrementByOne:
TYA : ASL : TAX
LDA.w InventoryTable_stat,X : BEQ .skip
STA.b Scrap0B
SEP #$20
LDA.b #$01 : ADC.b [Scrap0B] : STA.b [Scrap0B]
SEP #$21
LDA.b #$00 : ADC.b [Scrap0B] : STA.b [Scrap0B]
.skip
SEP #$20
RTS
@@ -761,6 +767,18 @@ 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
;--------------------------------------------------------------------------------
; A = item id being collected
ItemGetAlternateSFX:
PEA.w $C567 ; SNES to RTS to in bank 08

View File

@@ -109,11 +109,11 @@ Overworld_LoadNewTiles:
!OWW_StripeRLEINC = $8002
dw .stripe_rle_inc ; 02
; dw !OWW_ArbitraryRLE
; dw !OWW_ArbTileCopy
; dw <tile>
; dw <pos1>, <pos2>, ... <posN>|!OWW_STOP
!OWW_ArbitraryRLE = $8003
dw .arbitrary_rle ; 03
!OWW_ArbTileCopy = $8003
dw .arbitrary_tile_copy ; 03
dw .nothing ; 04
dw .nothing ; 05
@@ -205,7 +205,6 @@ Overworld_LoadNewTiles:
.dont_change_inverted
RTS
;---------------------------------------------------------------------------------------------------
.get_increment
@@ -224,6 +223,7 @@ Overworld_LoadNewTiles:
.stripe
JSR .get_increment
LDX.w $0000,Y
BRA ++ ; to increment at start of loop properly
@@ -276,7 +276,10 @@ Overworld_LoadNewTiles:
DEC.b OWWriteSize
BNE --
INY #2
INY
INY
RTS
;---------------------------------------------------------------------------------------------------
@@ -314,27 +317,28 @@ Overworld_LoadNewTiles:
DEC.b OWWriteSize
BNE --
INY #2
INY
INY
RTS
;---------------------------------------------------------------------------------------------------
.arbitrary_rle
; Don't use SKIP with this, since that's not really meaningful anyways...
;---------------------------------------------------------------------------------------------------
.arbitrary_tile_copy
LDA.w $0000,Y
-- INY
INY
LDX.w $0000,Y
BMI .last_arb_rle_maybe
BMI .last_arb
STA.l $7E0000,X
BRA --
.last_arb_rle_maybe
CPX.w #!OWW_SKIP
BEQ --
.last_arb
PHA
TXA
@@ -491,6 +495,7 @@ dw $0000 ; 7F
.map03
dw !OWW_InvertedOnly
; singles
dw $0034, $2BE0
@@ -498,7 +503,7 @@ dw $0000 ; 7F
dw $29B6 ; address
dw $021A, $01F3, $00A0, $0104|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $00C6 ; tile
dw $2A34, $2A38, $2A3A|!OWW_STOP
@@ -508,7 +513,9 @@ dw $0000 ; 7F
.map05
dw $0101, $2E18 ; OWG sign
dw !OWW_InvertedOnly
; singles
dw $0034, $21F2
dw $0034, $3D4A
@@ -552,19 +559,19 @@ dw $0000 ; 7F
dw $2970 ; address
dw $0139, $014B|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0130 ; tile
dw $21E2, $21F0, $22E2, $22F0|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0135 ; tile
dw $2262, $2270, $2362, $2370|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0136 ; tile
dw $2264, $2266, $226C, $226E|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0137 ; tile
dw $2268, $226A|!OWW_STOP
@@ -584,7 +591,7 @@ dw $0000 ; 7F
dw $0134, $26A4
dw $0034, $2826
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $021B ; tile
dw $259E, $25A2, $25A4, $261C
dw $2626, $269A, $26A8, $271A
@@ -632,158 +639,121 @@ dw $0000 ; 7F
.map1B
dw !OWW_InvertedOnly
; TODO clean up and optimize
dw $0485, $2424
dw $0485, $2426
dw $0454, $24A4
dw $0454, $24A6
; singles
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 !OWW_Stripe|!OWW_Vertical
dw $2424 ; address
dw $0485, $0454, $0460, !OWW_SKIP
dw $04DD, $04E0, $04E4, $0034|!OWW_STOP
dw !OWW_Stripe|!OWW_Vertical
dw $2426 ; address
dw $0485, $0454, $0460, !OWW_SKIP
dw $04DE, $04E1, $04E5, $0034|!OWW_STOP
; Eye removed
dw $046D, $243E
dw $046D, $24BC
dw $046D, $24BE
dw $046D, $253E
dw $046D, $2440
dw $046D, $24C0
dw $046D, $24C2
dw $046D, $2540
dw !OWW_ArbTileCopy
dw $046D ; tile
dw $243E, $24BC, $24BE, $253E
dw $2440, $24C0, $24C2, $2540|!OWW_STOP
; 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, $2FAE
dw $0034, $2C2C
dw $0034, $2C2E
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 $0035, $302A
dw $0035, $3032
dw $007E, $2CB0
dw $007F, $2CB2
dw $04BA, $2CB4
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 $0095, $2EB2
dw $009A, $2EAC
dw $009B, $2EAE
dw $009C, $2EB0
dw $0095, $2EB2
dw $0034, $3028
dw $0034, $302C
dw $0035, $302A
dw $0035, $3032
dw $00AE, $2CAC
dw $00AF, $2CAE
dw $00DA, $302E
dw $00E2, $2C36
dw $00E2, $2FA8
dw $00E2, $3030
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, $282E
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, $2850
dw $0451, $2852
dw $0451, $282E
dw $0034, $28CE
dw $0034, $28D0
dw $0034, $28D2
dw $0454, $272C
dw $0454, $272E
dw $0454, $274E
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 $046D, $243E
dw $0E39, $2440
dw $0E3A, $24BC
dw $0E3B, $24BE
dw $0E3C, $24C0
dw $0E3D, $24C2
dw $0E3E, $253C
dw $0E3F, $253E
dw $0E40, $2540
dw $0E41, $2542
dw !OWW_StripeRLEINC|!OWW_Horizontal|OWW_RLESize(4)
dw $0E3A, $24BC ; tile, start
dw !OWW_StripeRLEINC|!OWW_Horizontal|OWW_RLESize(4)
dw $0E3E, $253C ; tile, start
dw $0490, $25BE
dw $0491, $25C0
.map1B_no_hole
; add sign for Tower Entry
; add sign for tower entry
dw $0101, $222C
dw $0101, $2252
dw !OWW_END
.map1B_check_aga
LDA.w OverworldEventDataWRAM+$2B
LDA.l OverworldEventDataWRAM+$5B
AND.w #$0020
BNE ++
@@ -799,7 +769,7 @@ dw $0000 ; 7F
; singles
dw $0036, $2386
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0034 ; tile
dw $2288, $2308, $2388, $2408
dw $2488, $248A|!OWW_STOP
@@ -829,7 +799,7 @@ dw $0000 ; 7F
dw $00CF, $27DA
dw $0034, $3D94
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $017E
dw $2050, $20CE|!OWW_STOP
@@ -839,11 +809,11 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(6)
dw $00D1, $21E6
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $00D2
dw $2060, $20E2, $2164|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0183
dw $20D0, $214E|!OWW_STOP
@@ -857,22 +827,22 @@ dw $0000 ; 7F
dw $00C9, $2266
dw $00C9, $22CC
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $00D0
dw $20E0, $2162, $21E4|!OWW_STOP
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(3)
dw $0153, $2150
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0153
dw $21CE, $22CE|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $00C8
dw $2160, $21E2, $2264, $28DA, $295C|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $00CA
dw $21E0, $2262, $285A, $28DC|!OWW_STOP
@@ -883,7 +853,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(2)
dw $00E3, $2252
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0186
dw $22D0, $234E|!OWW_STOP
@@ -899,7 +869,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(2)
dw $0034, $2350
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0034
dw $2458, $2656|!OWW_STOP
@@ -922,46 +892,46 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(4)
dw $06AB, $2366
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $06AB
dw $24E4, $2760|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0384
dw $236A, $236E, $23EC, $246A|!OWW_STOP
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4)
dw $0384, $24E8
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0759
dw $23C8, $244A, $24CC, $254E, $26D0, $2752, $27D4|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0757
dw $23CA, $244C, $24CE, $2550, $26D2, $2754|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $01FF
dw $23CC, $244E, $24D0, $2652, $26D4, $2756|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $017C
dw $23CE, $2450, $24D2, $2654, $26D6|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0100
dw $245A, $24D8|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0104
dw $24DA, $2558|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0106
dw $2462, $24E0, $255C|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0107
dw $2464, $24E2|!OWW_STOP
@@ -996,7 +966,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(2)
dw $02FD, $27D8
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $06E7
dw $28D8, $295A, $29DC|!OWW_STOP
@@ -1071,24 +1041,24 @@ dw $0000 ; 7F
.map3C
dw !OWW_InvertedOnly
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $02E5
dw $27AE, $282C, $282E, $2832
dw $28AC, $28AE, $2928, $292C
dw $29A8, $29B0, $2A28, $2A30
dw $2AAC, $2AB2|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $078A
dw $28AA, $28B0, $2AAA, $2B2A
dw $2B30, $2BAE|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $02EB
dw $28B4, $2930, $29AE, $2A2C
dw $2A32, $2AAE|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $02EC
dw $2934, $2B28, $2B2C, $2B2E
dw $2B32|!OWW_STOP
@@ -1118,7 +1088,7 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(5)
dw $021C, $260A
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0034
dw $270E, $278E, $2790, $2918, $291A, $2998, $299A, $291C, $291E, $2920|!OWW_STOP
@@ -1132,7 +1102,6 @@ dw $0000 ; 7F
dw $288C
dw $01FA, $0034, $00DA|!OWW_STOP
dw !OWW_Stripe|!OWW_Horizontal
dw $290C
dw $0186
@@ -1158,112 +1127,81 @@ dw $0000 ; 7F
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(13)
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 $0034, $2A84
; leave these after the above
dw $0071, $2A0E
dw $0071, $2A1A
dw $0035, $2A8C
; TODO clean up and optimize
dw $015C, $2A20
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(5)
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 $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 $00CE, $2C1C
dw $016A, $2C82
dw $0160, $2C84
dw $0034, $2C86
dw $0034, $2C88
dw $0034, $2C8A
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 $0167, $2D04
dw $0160, $2D06
dw $00DA, $2D08
dw $0034, $2D0A
dw $0034, $2D0C
dw $0035, $2D0E
dw $0034, $2D10
dw $0036, $2D12
dw $0034, $2D14
dw $0034, $2D16
dw $015C, $2D18
dw $0162, $2D1A
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 $015E, $2E0A
dw $015E, $2E0C
dw $015E, $2E0E
dw $015E, $2E10
dw $015E, $2E12
dw $015E, $2E14
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
;---------------------------------------------------------------------------------------------------
@@ -1272,6 +1210,7 @@ dw $0000 ; 7F
dw !OWW_InvertedOnly
dw $0034, $22A8
dw !OWW_END
;---------------------------------------------------------------------------------------------------
@@ -1379,9 +1318,11 @@ dw $0000 ; 7F
;---------------------------------------------------------------------------------------------------
.map45
dw !OWW_InvertedOnly
dw $0239, $3D4A
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map47
@@ -1463,14 +1404,14 @@ dw $0000 ; 7F
dw $03A2, $0232, $0235, $046A
dw $0333, $0333, $0333|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0034 ; tile
dw $3BB6, $3BBA, $3BBC, $3C3A
dw $3C3C, $3C3E|!OWW_STOP
; pegs
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0034 ; tile
dw $321C, $329C, $32A0|!OWW_STOP
@@ -1487,7 +1428,7 @@ dw $0000 ; 7F
dw $00F2, $3BB8
dw $0108, $3C38
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $021B ; tile
dw $3218, $3222, $3298, $32A2
dw $331A, $331C, $331E, $3320|!OWW_STOP
@@ -1533,16 +1474,16 @@ dw $0000 ; 7F
dw !OWW_END
.map5B_pick_warp_tile
LDX.w #$0034
LDA.l ProgressIndicator
AND.w #$00FF
CMP.w #$0003
BNE ++
LDX.w #$0212
LDA.w #$0034
BCC ++
++ STX.w $3BBE
LDA.w #$0212
++ STA.l $7E3BBE
RTS
@@ -1556,12 +1497,14 @@ dw $0000 ; 7F
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map70
dw !OWW_InvertedOnly
dw $0239, $3D94
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map73
@@ -1599,7 +1542,7 @@ dw $0000 ; 7F
dw $30DA ; start
dw $0BAA, $0BC8, $0BCD|!OWW_STOP
dw !OWW_ArbitraryRLE
dw !OWW_ArbTileCopy
dw $0BA3 ; tile
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:
.offset_y : fillbyte $00 : fill 256
.offset_x : fillbyte $00 : fill 256
@@ -894,7 +1009,7 @@ ItemReceiptGraphicsOffsets:
dw BigDecompressionBuffer+$0080 ; 38 - Blue pendant
dw BigDecompressionBuffer+$0080 ; 39 - Red pendant
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+$0960 ; 3D - Full bottle (fairy)
dw BigDecompressionBuffer+$18C0 ; 3E - Boss heart
@@ -945,7 +1060,7 @@ ItemReceiptGraphicsOffsets:
dw $0 ; 69 -
dw $0060 ; 6A - Triforce
dw $11E0 ; 6B - Power star
dw $0 ; 6C -
dw $0060 ; 6C - Triforce Piece
dw $0 ; 6D - Server request item
dw $0 ; 6E - Server request item (dungeon drop)
dw $0 ; 6F -
@@ -1215,7 +1330,7 @@ StandingItemGraphicsOffsets:
dw $0 ; 69 -
dw $0060 ; 6A - Triforce
dw $11E0 ; 6B - Power star
dw $0 ; 6C -
dw $0060 ; 6C - Triforce Piece
dw $0 ; 6D - Server request item
dw $0 ; 6E - Server request item (dungeon drop)
dw $0 ; 6F -

View File

@@ -605,9 +605,9 @@ SpriteKeyPrep:
LDA.w SpawnedItemMWPlayer : STA SprItemMWPlayer, X : STA.w !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w SpawnedItemFlag : STA SprItemFlags, X : BEQ +
LDA.l SpawnedItemID : STA $0E80, X
PHA
JSL.l GetSpritePalette : STA $0F50, X ; setup the palette
PLA
PHA : PHY : PHX
JSL.l GetSpritePalette : PLX : STA $0F50, X ; setup the palette
PLY : PLA
CMP #$24 : BNE ++ ;
LDA $A0 : CMP.b #$80 : BNE +
LDA SpawnedItemFlag : BNE +

View File

@@ -401,7 +401,7 @@ UpdateHearts:
PHX
PLB
LDA.w $7EF36C
LDA.w MaximumHealth
LSR
LSR
LSR
@@ -420,7 +420,11 @@ UpdateHearts:
CPX.b #$01
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
BPL .add_heart
@@ -456,18 +460,22 @@ UpdateHearts:
BRA .next_filled_heart
.done_hearts
LDA.w $7EF36D
LDA.w CurrentHealth
AND.w #$0007
BEQ .skip_partial
CMP.w #$0005
JSR.w CheckHeartPalette
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
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
ORA.w #$20A0
STA.b ($09)
.skip_partial
@@ -492,9 +500,11 @@ CheckHeartPalette:
RTS
ColorAnimatedHearts:
PHX
REP #$20
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
PLX
ORA.l HeartFramesBaseTiles,X
STA.b [Scrap00],Y
SEP #$20

View File

@@ -296,7 +296,9 @@ ItemBehavior:
RTS
.silversbow
LDA.l BowTracking : ORA.b #$80 : STA.l BowTracking
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 #$01 : STA.l BowEquipment
@@ -338,17 +340,31 @@ ItemBehavior:
JMP.w .increment_map
.bow_and_arrows
LDA.l BowTracking : BIT.b #$40 : BEQ +
LDA.l SilverArrowsUseRestriction : BNE +
LDA.b #03 : STA.l BowEquipment ; set bow to silver
LDA.b #$80 : ORA.l BowTracking : STA.l BowTracking
LDA.l BowTracking : BIT.b #$40 : BEQ .no_silvers
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
.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.b #$40 : ORA.l BowTracking : STA.l BowTracking
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 #$04 ; bow with arrow
@@ -421,8 +437,8 @@ ItemBehavior:
RTS
.silver_arrows
LDA.l BowTracking : ORA.b #$40 : STA.l BowTracking
LDA.l SilverArrowsUseRestriction : BNE ++
LDA.l BowTracking : ORA.b #$40 : STA.l BowTracking
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ ++
LDA.l BowEquipment : BEQ ++ : CMP.b #$03 : !BGE +
!ADD.b #$02 : STA.l BowEquipment ; switch to silver bow
@@ -547,18 +563,23 @@ ItemBehavior:
LSR
AND.w #$000F : TAX
ASL : CMP.w DungeonID : BEQ .same_dungeon
LSR : TAX
LDA.l DungeonKeys,X : INC : STA.l DungeonKeys,X
RTS
.same_dungeon
SEP #$20
LDA.l CurrentSmallKeys : INC : STA.l CurrentSmallKeys
LSR : TAX
LDA.l DungeonKeys,X : INC : STA.l DungeonKeys,X ; Update menu key count too
LDA.l DungeonKeys,X : INC : STA.l DungeonKeys,X
RTS
.same_dungeon_hc
SEP #$20
LDA.l CurrentSmallKeys : INC : STA.l CurrentSmallKeys
LDA.l SewerKeys : INC
STA.l SewerKeys : STA.l HyruleCastleKeys
RTS
.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 SewerKeys : INC : STA.l SewerKeys
RTS
@@ -839,10 +860,10 @@ HandleBowTracking:
CMP.b #$65 : BEQ .prog_two
RTS
.prog_one
LDA.b #$80
LDA.b #$90
BRA .done
.prog_two
LDA.b #$20
LDA.b #$A0
.done
ORA.l BowTracking : STA.l BowTracking
LDA.w ItemReceiptID

View File

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

View File

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

View File

@@ -18,7 +18,7 @@ db 2, 55
db $5F, $6B, $68, $68, $61, $5F, $70, $65, $6B, $6A, $9F, $6E, $5D, $70, $61 ; "Collection Rate"
db $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F ; " " 8 spaces
print "Collection Rate High Start: ", pc
db $9F, $A2 ; " /"
db $9F, $DB ; " /"
db $55, $54, $59 ; 216
CollectionRateLo:
@@ -26,7 +26,7 @@ db 2, 55
db $85, $91, $8E, $8E, $87, $85, $96, $8B, $91, $90, $9F, $94, $83, $96, $87 ; "Collection Rate"
db $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F ; " " 8 spaces
print "Collection Rate Low Start: ", pc
db $9F, $C2 ; " /"
db $9F, $EE ; " /"
db $7B, $7A, $7F ; 216
;===================================================================================================

View File

@@ -134,21 +134,7 @@ org $B0803D ; PC 0x18003D
PersistentFloodgate:
db $00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
org $B0803E ; PC 0x18003E
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 $B0803E ; PC 0x18003E (unused)
;--------------------------------------------------------------------------------
org $B0803F ; PC 0x18003F
HammerableGanon:
@@ -250,12 +236,7 @@ CrystalPendantFlags_2:
;Aga2: $02
;HC special check $04
;--------------------------------------------------------------------------------
org $B0805E ; PC 0x18005E - Number of crystals required to enter GT
NumberOfCrystalsRequiredForTower:
db $07 ; #$07 = 7 Crystals
org $B0805F ; PC 0x18005F - Number of crystals required to kill Ganon
NumberOfCrystalsRequiredForGanon:
db $07 ; #$07 = 7 Crystals
org $B0805E ; PC 0x18005E - 0x18005F (Unused)
;--------------------------------------------------------------------------------
org $B08060 ; PC 0x180060 - 0x18007E
ProgrammableItemLogicJump_1:
@@ -665,17 +646,17 @@ org $81C6FC ; PC 0xC6FC - Bank01.asm:10344 - (db $00, $00, $01, $02, $00, $06, $
DungeonPrizeReceiptID:
db $00 ; Sewers
db $00 ; Hyrule Castle
db $01 ; Eastern Palace
db $02 ; Desert Palace
db $37 ; Eastern Palace
db $38 ; Desert Palace
db $00 ; Agahnim's Tower
db $06 ; Swamp Palace
db $06 ; Palace of Darkness
db $20 ; Swamp Palace
db $20 ; Palace of Darkness
db $20 ; Misery Mire
db $20 ; Skull Woods
db $06 ; Ice Palace
db $03 ; Tower of Hera
db $06 ; Thieves' Town
db $06 ; Turtle Rock
db $20 ; Ice Palace
db $39 ; Tower of Hera
db $20 ; Thieves' Town
db $20 ; Turtle Rock
;Ether/Nothing: $00
;Green Pendant: $01
;Blue Pendant: $02
@@ -943,10 +924,38 @@ org $B08196 ; PC 0x180196-0x180197
TotalItemCount: ; Total item count for HUD. Only counts items that use "item get" animation.
dw $00D8 ; 216
org $B08198 ; PC 0x180198-0x180199
GanonsTowerOpenAddress: ; Target address for GT open check
org $B08198 ; PC 0x180198-0x1801A9
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
RedClockAmount:

View File

@@ -81,10 +81,6 @@ RTL
;-------------------------------------------------------------------------------- 20/847B
LoadDynamicTileOAMTable:
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.w SpriteID,X
@@ -92,11 +88,18 @@ LoadDynamicTileOAMTable:
STA.l SpriteOAM+5 : STA.l SpriteOAM+13
PHX
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
.narrow
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 #$3400 : STA.l SpriteOAM+11

View File

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