Merge pull request #194 from spannerisms/decompressed

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

View File

@@ -280,31 +280,31 @@ RTL
; s = silver arrow bow ; s = silver arrow bow
; p = 2nd progressive bow ; p = 2nd progressive bow
DialogGanon2: DialogGanon2:
JSL.l CheckGanonVulnerability JSL.l CheckGanonVulnerability
REP #$20 REP #$20
BCS + BCS +
LDA.w #$018D : BRA ++ LDA.w #$018D : BRA ++
+ +
LDA.l BowTracking LDA.l BowTracking
BIT.w #$0080 : BNE + ; branch if bow BIT.w #$0080 : BNE + ; branch if bow
LDA.w #$0192 : BRA ++ LDA.w #$0192 : BRA ++
+ +
BIT.w #$0040 : BEQ + ; branch if no silvers BIT.w #$0040 : BEQ + ; branch if no silvers
LDA.w #$0195 : BRA ++ LDA.w #$0195 : BRA ++
+ +
BIT.w #$0020 : BNE + ; branch if p bow BIT.w #$0020 : BNE + ; branch if p bow
LDA.w #$0194 : BRA ++ LDA.w #$0194 : BRA ++
+ +
BIT.w #$0080 : BEQ + ; branch if no bow BIT.w #$0080 : BEQ + ; branch if no bow
LDA.w #$0193 : BRA ++ LDA.w #$0193 : BRA ++
+ +
LDA.w #$016E LDA.w #$016E
++ ++
STA.w TextID STA.w TextID
SEP #$20 SEP #$20
JSL.l Sprite_ShowMessageMinimal_Alt JSL.l Sprite_ShowMessageMinimal_Alt
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogEtherTablet: DialogEtherTablet:
@@ -371,7 +371,7 @@ RTL
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
AgahnimAsksAboutPed: AgahnimAsksAboutPed:
LDA.l InvincibleGanon LDA.l GanonVulnerableMode
CMP.b #$06 : BNE .vanilla CMP.b #$06 : BNE .vanilla
LDA.l OverworldEventDataWRAM+$80 ; check ped flag LDA.l OverworldEventDataWRAM+$80 ; check ped flag

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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: ItemReceipts:
.offset_y : fillbyte $00 : fill 256 .offset_y : fillbyte $00 : fill 256
.offset_x : fillbyte $00 : fill 256 .offset_x : fillbyte $00 : fill 256
@@ -894,7 +1009,7 @@ ItemReceiptGraphicsOffsets:
dw BigDecompressionBuffer+$0080 ; 38 - Blue pendant dw BigDecompressionBuffer+$0080 ; 38 - Blue pendant
dw BigDecompressionBuffer+$0080 ; 39 - Red pendant dw BigDecompressionBuffer+$0080 ; 39 - Red pendant
dw BigDecompressionBuffer+$0920 ; 3A - Tossed bow dw BigDecompressionBuffer+$0920 ; 3A - Tossed bow
dw BigDecompressionBuffer+$08E0 ; 3B - Silvers dw BigDecompressionBuffer+$08E0 ; 3B - Silver bow
dw BigDecompressionBuffer+$09A0 ; 3C - Full bottle (bee) dw BigDecompressionBuffer+$09A0 ; 3C - Full bottle (bee)
dw BigDecompressionBuffer+$0960 ; 3D - Full bottle (fairy) dw BigDecompressionBuffer+$0960 ; 3D - Full bottle (fairy)
dw BigDecompressionBuffer+$18C0 ; 3E - Boss heart dw BigDecompressionBuffer+$18C0 ; 3E - Boss heart
@@ -945,7 +1060,7 @@ ItemReceiptGraphicsOffsets:
dw $0 ; 69 - dw $0 ; 69 -
dw $0060 ; 6A - Triforce dw $0060 ; 6A - Triforce
dw $11E0 ; 6B - Power star dw $11E0 ; 6B - Power star
dw $0 ; 6C - dw $0060 ; 6C - Triforce Piece
dw $0 ; 6D - Server request item dw $0 ; 6D - Server request item
dw $0 ; 6E - Server request item (dungeon drop) dw $0 ; 6E - Server request item (dungeon drop)
dw $0 ; 6F - dw $0 ; 6F -
@@ -1215,7 +1330,7 @@ StandingItemGraphicsOffsets:
dw $0 ; 69 - dw $0 ; 69 -
dw $0060 ; 6A - Triforce dw $0060 ; 6A - Triforce
dw $11E0 ; 6B - Power star dw $11E0 ; 6B - Power star
dw $0 ; 6C - dw $0060 ; 6C - Triforce Piece
dw $0 ; 6D - Server request item dw $0 ; 6D - Server request item
dw $0 ; 6E - Server request item (dungeon drop) dw $0 ; 6E - Server request item (dungeon drop)
dw $0 ; 6F - dw $0 ; 6F -

View File

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

View File

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

View File

@@ -115,11 +115,15 @@ CheckCloseItemMenu:
RTL RTL
;================================================================================ ;================================================================================
ShowDungeonItems: ShowDungeonItems:
REP #$30 LDA.w DungeonID-1 : BMI .no_dungeon
LDA.w DungeonID : AND.w #$00FF : CMP.w #$00FF : BNE + : RTL : + ; return normal result if outdoors or in a cave LDA.l HudFlag : AND.w #$0040 : BEQ +
LDA.l HudFlag : AND.w #$0020 ; check hud flag .no_dungeon
BEQ + : LDA.w #$0000 : RTL : + ; if set, send the zero onwards LDA.w #$0000
LDA.w DungeonID : AND.w #$00FF : CMP.w #$00FF ; original logic RTL
+
LDA.w DungeonID
REP #$02
.done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
UpdateKeys: UpdateKeys:
@@ -190,7 +194,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawHUDDungeonItems: DrawHUDDungeonItems:
LDA.l HUDDungeonItems : BNE .continue LDA.l HUDDungeonItems : BNE .continue
RTL RTL
.dungeon_positions .dungeon_positions
dw 0 ; Hyrule Castle dw 0 ; Hyrule Castle
@@ -253,28 +257,19 @@ DrawHUDDungeonItems:
dw $A4*2 ; ; Turtle Rock dw $A4*2 ; ; Turtle Rock
dw $0D*2 ; ; Ganon's Tower dw $0D*2 ; ; Ganon's Tower
.continue .continue
PHP PHP : PHB
PHK : PLB
PHB REP #$30
PHK
PLB
REP #$30
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
; dungeon names ; dungeon names
LDA.w #$2D50 LDA.w #$2D50
LDY.w #00 LDY.w #00
.next_dungeon_name
.next_dungeon_name
LDX.w .dungeon_positions,Y LDX.w .dungeon_positions,Y
STA.w GFXStripes+$0646,X STA.w GFXStripes+$0646,X
INC INC
INY : INY INY : INY
CPY.w #26 : BCC .next_dungeon_name CPY.w #26 : BCC .next_dungeon_name
@@ -286,163 +281,138 @@ DrawHUDDungeonItems:
STA.w GFXStripes+$06C6,X STA.w GFXStripes+$06C6,X
STA.w GFXStripes+$0706,X STA.w GFXStripes+$0706,X
DEX : DEX : BPL -- DEX : DEX
BPL --
LDA.l HudFlag : AND.w #$0020 : BEQ + LDA.l HudFlag : AND.w #$0020 : BEQ +
JMP .maps_and_compasses
JMP .maps_and_compasses
+
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
+
LDA.l HUDDungeonItems : AND.w #$0001 : 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 LDX.w .dungeon_positions,Y
LDA.w #$2810 : STA.w GFXStripes+$0684 ; small keys icon ADC.w #$2816
STA.w GFXStripes+$0686,X
LDY.w #0 INY : INY
CPY.w #26 : BCC .next_small_key
; 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
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
.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 .next_big_key
LDA.l HUDDungeonItems : AND.w #$0002 : BEQ .skip_big_keys 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 ..skip_key
INX : INX
; use X so we can BIT CPX.w #26 : BCC .next_big_key
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_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 .next_boss_kill
LDA.w #$280F : STA.w GFXStripes+$0704 ; skull icon LDX.w .boss_room_ids,Y
LDY.w #0 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 .skip_boss_kills
LDA.l RoomDataWRAM.l,X LDA.l HUDDungeonItems : BIT.w #$00F3 : BEQ .maps_and_compasses
AND.w #$0800 JMP .exit
BEQ ..skip_boss_kill ;-------------------------------------------------------------------------------
.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 .next_map
LDX.w .dungeon_positions,Y BIT.w .dungeon_bitmasks,X
STA.w GFXStripes+$0706,X BEQ ..skip_map
..skip_boss_kill LDY.w .dungeon_positions,X
INY : INY LDA.w #$2826
CPY.w #26 : BCC .next_boss_kill 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 .skip_compasses
JMP .exit .exit
PLB
;------------------------------------------------------------------------------- PLP
; 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
BEQ ..skip_map
LDY.w .dungeon_positions,X
LDA.w #$2826
STA.w GFXStripes+$0686,Y
; reload
LDA.l MapField
..skip_map
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
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
@@ -598,15 +568,19 @@ HandleEmptyMenu:
LDA.b Joy1A_New : BIT.b #$DF : BNE .close_menu ; Not select, close menu LDA.b Joy1A_New : BIT.b #$DF : BNE .close_menu ; Not select, close menu
BIT.b #$20 : BNE .sel_pressed BIT.b #$20 : BNE .sel_pressed
LDA.b Joy1A_All : BIT.b #$20 : BNE .wait_for_change LDA.b Joy1A_All : BIT.b #$20 : BNE .wait_for_change
LDA.l HudFlag : AND.b #$20 : BEQ .wait_for_change ; HUD flag off, skip drawing work LDA.l HudFlag : AND.b #$60 : BEQ .wait_for_change
LDA.l HudFlag : AND.b #$DF : STA.l HudFlag ; Unset without select LDA.l HudFlag : AND.b #$9F : STA.l HudFlag ; Unset without select
LDA.b IndoorsFlag : BEQ ++ ; skip if outdoors JSL.l MaybePlaySelectSFX
LDA.b #$20 : STA.w SFX3 LDA.b #$0C : BRA .done
++
LDA.b #$0C : BRA .done
.sel_pressed .sel_pressed
LDA.l HudFlag : ORA.b #$20 : STA.l HudFlag LDA.l HUDDungeonItems : BIT.b #$0C : BNE +
LDA.b #$20 : STA.w SFX3 LDA.b #$40
BRA .store_flag
+
LDA.b #$60
.store_flag
STA.l HudFlag
JSL.l MaybePlaySelectSFX
LDA.b #$0C : BRA .done LDA.b #$0C : BRA .done
.wait_for_change .wait_for_change
LDA.b #$03 : BRA .done LDA.b #$03 : BRA .done
@@ -665,3 +639,4 @@ dw $2084, $6084, $2085, $6085 ; 0 heart pieces
dw $20AD, $6084, $2085, $6085 ; 1 heart piece dw $20AD, $6084, $2085, $6085 ; 1 heart piece
dw $20AD, $6084, $20AE, $6085 ; 2 heart pieces dw $20AD, $6084, $20AE, $6085 ; 2 heart pieces
dw $20AD, $60AD, $20AE, $6085 ; 3 heart pieces dw $20AD, $60AD, $20AE, $6085 ; 3 heart pieces
;-------------------------------------------------------------------------------

View File

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

View File

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

View File

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

View File

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