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

@@ -280,31 +280,31 @@ RTL
; s = silver arrow bow
; p = 2nd progressive bow
DialogGanon2:
JSL.l CheckGanonVulnerability
REP #$20
BCS +
JSL.l CheckGanonVulnerability
REP #$20
BCS +
LDA.w #$018D : BRA ++
+
LDA.l BowTracking
+
LDA.l BowTracking
BIT.w #$0080 : BNE + ; branch if bow
LDA.w #$0192 : BRA ++
+
+
BIT.w #$0040 : BEQ + ; branch if no silvers
LDA.w #$0195 : BRA ++
+
+
BIT.w #$0020 : BNE + ; branch if p bow
LDA.w #$0194 : BRA ++
+
+
BIT.w #$0080 : BEQ + ; branch if no bow
LDA.w #$0193 : BRA ++
+
+
LDA.w #$016E
++
STA.w TextID
SEP #$20
JSL.l Sprite_ShowMessageMinimal_Alt
++
STA.w TextID
SEP #$20
JSL.l Sprite_ShowMessageMinimal_Alt
RTL
;--------------------------------------------------------------------------------
DialogEtherTablet:
@@ -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,43 +171,73 @@ 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
LDA.l OverworldEventDataWRAM+$80 ; check ped flag
AND.b #$40
BEQ .force_blue_ball
SEP #$20
LDA.l OverworldEventDataWRAM+$80 ; check ped flag
AND.b #$40
BEQ .force_blue_ball
.vanilla ; run vanilla check for phase
LDA.w SpriteAux, X
CMP.b #$02
RTL
SEP #$20
LDA.w SpriteAux, X
CMP.b #$02
RTL
.force_blue_ball
LDA.b #$01 : STA.w SpriteAuxTable, Y
LDA.b #$20 : STA.w SpriteTimer, Y
CLC ; skip the RNG check
RTL
LDA.b #$01 : STA.w SpriteAuxTable, Y
LDA.b #$20 : STA.w SpriteTimer, Y
CLC ; skip the RNG check
RTL
;---------------------------------------------------------------------------------------------------
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

File diff suppressed because it is too large Load Diff

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,22 +340,36 @@ 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.l SilverArrowsAutoEquip : AND.b #$01 : BEQ .noequip
LDA.l ArrowsFiller : BNE + ; check arrows
LDA.b #$03 : BRA ++ ; bow without arrow
+
LDA.b #$04 ; bow with arrow
++
STA.l BowEquipment
LDA.b #$40 : ORA.l BowTracking : STA.l BowTracking
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ .noequip
LDA.l CurrentArrows : BNE + ; check arrows
LDA.b #$03 : BRA ++ ; bow without arrow
+
LDA.b #$04 ; bow with arrow
++
STA.l BowEquipment
.noequip
RTS
@@ -421,13 +437,13 @@ ItemBehavior:
RTS
.silver_arrows
LDA.l BowTracking : ORA.b #$40 : STA.l BowTracking
LDA.l SilverArrowsUseRestriction : BNE ++
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
+
++
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
+
++
LDA.l ArrowMode : BEQ +
LDA.b #$01 : STA.l ArrowsFiller
+
@@ -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:
@@ -190,7 +194,7 @@ RTL
;--------------------------------------------------------------------------------
DrawHUDDungeonItems:
LDA.l HUDDungeonItems : BNE .continue
RTL
RTL
.dungeon_positions
dw 0 ; Hyrule Castle
@@ -253,28 +257,19 @@ DrawHUDDungeonItems:
dw $A4*2 ; ; Turtle Rock
dw $0D*2 ; ; Ganon's Tower
.continue
PHP
PHB
PHK
PLB
REP #$30
.continue
PHP : PHB
PHK : PLB
REP #$30
;-------------------------------------------------------------------------------
; dungeon names
LDA.w #$2D50
LDY.w #00
.next_dungeon_name
.next_dungeon_name
LDX.w .dungeon_positions,Y
STA.w GFXStripes+$0646,X
INC
INY : INY
CPY.w #26 : BCC .next_dungeon_name
@@ -286,165 +281,138 @@ 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
+
JMP .maps_and_compasses
;-------------------------------------------------------------------------------
+
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
CLC
LDA.l HUDDungeonItems : AND.w #$0001 : BEQ .skip_small_keys
.next_small_key
LDX.w .small_key_x_offset,Y
LDA.l DungeonKeys,X
AND.w #$00FF
.draw_small_keys
LDA.w #$2810 : STA.w GFXStripes+$0684 ; small keys icon
LDX.w .dungeon_positions,Y
ADC.w #$2816
STA.w GFXStripes+$0686,X
LDY.w #0
; Clear the carry only once
; it will be cleared by looping condition afterwards
CLC
.next_small_key
LDX.w .small_key_x_offset,Y
LDA.l DungeonKeys,X
AND.w #$00FF
LDX.w .dungeon_positions,Y
ADC.w #$2816
STA.w GFXStripes+$0686,X
INY : INY
CPY.w #26 : BCC .next_small_key
INY : INY
CPY.w #26 : BCC .next_small_key
;-------------------------------------------------------------------------------
.skip_small_keys
.skip_small_keys
; 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
LDX.w #0
LDA.l BigKeyField
; Big Keys
LDA.l HUDDungeonItems : AND.w #$0002 : BEQ .skip_big_keys
.next_big_key
BIT.w .dungeon_bitmasks,X
BEQ ..skip_key
LDY.w .dungeon_positions,X
LDA.w #$2826
STA.w GFXStripes+$06C6,Y
LDA.l BigKeyField
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
BIT.w .dungeon_bitmasks,X
BEQ ..skip_key
LDY.w .dungeon_positions,X
LDA.w #$2826
STA.w GFXStripes+$06C6,Y
; reload
LDA.l BigKeyField
..skip_key
INX : INX
CPX.w #26 : BCC .next_big_key
..skip_key
INX : INX
CPX.w #26 : BCC .next_big_key
;-------------------------------------------------------------------------------
.skip_big_keys
.skip_big_keys
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
LDA.l HUDDungeonItems : AND.w #$0010 : BEQ .skip_boss_kills
LDA.w #$280F : STA.w GFXStripes+$0704 ; skull icon
LDY.w #0
.next_boss_kill
LDX.w .boss_room_ids,Y
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
.next_boss_kill
LDX.w .boss_room_ids,Y
LDA.l RoomDataWRAM.l,X
AND.w #$0800
BEQ ..skip_boss_kill
;-------------------------------------------------------------------------------
.skip_boss_kills
LDA.l HUDDungeonItems : BIT.w #$00F3 : BEQ .maps_and_compasses
JMP .exit
;-------------------------------------------------------------------------------
.maps_and_compasses
LDA.w #$24F5 : STA.w GFXStripes+$0704 ; blank tile boss icon
; 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
LDX.w #0
LDA.l MapField
LDA.w #$2826
LDX.w .dungeon_positions,Y
STA.w GFXStripes+$0706,X
.next_map
BIT.w .dungeon_bitmasks,X
BEQ ..skip_map
..skip_boss_kill
INY : INY
CPY.w #26 : BCC .next_boss_kill
LDY.w .dungeon_positions,X
LDA.w #$2826
STA.w GFXStripes+$0686,Y
LDA.l MapField
..skip_map
INX : INX
CPX.w #26 : BCC .next_map
.skip_maps
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
LDX.w #0
LDA.l CompassField
.next_compass
BIT.w .dungeon_bitmasks,X
BEQ ..skip_compass
LDY.w .dungeon_positions,X
LDA.w #$2826
STA.w GFXStripes+$06C6,Y
LDA.l CompassField
..skip_compass
INX : INX
CPX.w #26 : BCC .next_compass
;-------------------------------------------------------------------------------
.skip_boss_kills
JMP .exit
;-------------------------------------------------------------------------------
; This should only display if select is pressed in hud
.maps_and_compasses
; Maps
LDA.l HUDDungeonItems : AND.w #$0004 : BEQ .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
..draw_map
LDY.w .dungeon_positions,X
JSL MapIndicatorLong
STA.w GFXStripes+$0686,Y
..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.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
BIT.w .dungeon_bitmasks,X
BEQ ..skip_compass
LDY.w .dungeon_positions,X
LDA.w #$2826
STA.w GFXStripes+$06C6,Y
; reload
LDA.l CompassField
..skip_compass
INX : INX
CPX.w #26 : BCC .next_compass
;-------------------------------------------------------------------------------
.skip_compasses
.exit
PLB
PLP
.skip_compasses
.exit
PLB
PLP
RTL
;--------------------------------------------------------------------------------
;================================================================================
@@ -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.b #$0C : BRA .done
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
@@ -939,14 +920,42 @@ org $B08195 ; PC 0x180195
ByrnaCaveSpikeDamage:
db $08 ; #$08 = 1 Heart (default) - #$02 = 1/4 Heart
;--------------------------------------------------------------------------------
org $B08196 ; PC 0x180196-0x180197
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