Some more annotations

This commit is contained in:
cassidoxa
2022-11-25 01:08:07 -05:00
parent 8d0315e4c1
commit 69fd6015e6
18 changed files with 40 additions and 40 deletions

View File

@@ -311,7 +311,7 @@ DialogBombosTablet:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogSahasrahla: DialogSahasrahla:
LDA.l PendantsField : AND #$04 : BEQ + ;Check if player has green pendant LDA.l PendantsField : AND.b #$04 : BEQ + ;Check if player has green pendant
LDA.b #$2F LDA.b #$2F
LDY.b #$00 LDY.b #$00
JML Sprite_ShowMessageUnconditional JML Sprite_ShowMessageUnconditional
@@ -320,7 +320,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogBombShopGuy: DialogBombShopGuy:
LDY.b #$15 LDY.b #$15
LDA.l CrystalsField : AND #$05 : CMP #$05 : BNE + ;Check if player has crystals 5 & 6 LDA.l CrystalsField : AND.b #$05 : CMP.b #$05 : BNE + ;Check if player has crystals 5 & 6
INY ; from 15 to 16 INY ; from 15 to 16
+ +
TYA TYA

View File

@@ -690,7 +690,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
macro LayoutPriority(address) macro LayoutPriority(address)
LDX.w #$003C LDX.w #$003C
- : LDA.w <address>, X : ORA #$2000 : STA.w <address>, X - : LDA.w <address>, X : ORA.w #$2000 : STA.w <address>, X
DEX : DEX : BNE - DEX : DEX : BNE -
endmacro endmacro

View File

@@ -84,10 +84,10 @@ GetItemDamageValue:
LDA.l $0db8f1,x ;what we wrote over LDA.l $0db8f1,x ;what we wrote over
RTL RTL
.boomerang .boomerang
LDA.l StunItemAction : AND #$01 : BNE .normal LDA.l StunItemAction : AND.b #$01 : BNE .normal
BRA .noDamage BRA .noDamage
.hookshot .hookshot
LDA.l StunItemAction : AND #$02 : BNE .normal LDA.l StunItemAction : AND.b #$02 : BNE .normal
.noDamage .noDamage
LDA.b #$00 LDA.b #$00
RTL RTL
@@ -97,11 +97,11 @@ SearchAncilla:
{ {
STA.b Scrap05 STA.b Scrap05
PHX PHX
LDX #$00 LDX.b #$00
.loop .loop
LDA.w AncillaID, X LDA.w AncillaID, X
INX : CPX #$0A : BEQ .notFound INX : CPX #$0A : BEQ .notFound
CMP Scrap05 : BNE .loop CMP.b Scrap05 : BNE .loop
LDA.b #$01 LDA.b #$01
BRA .return BRA .return
.notFound .notFound

View File

@@ -271,7 +271,7 @@ db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 5 : db $05
; Remove code that tries to hide non-selected player files ; Remove code that tries to hide non-selected player files
org $0CD435 ; <- 65435 - Bank0C.asm : 2772 (LDX.b #$64) [LDX.b #$50] org $0CD435 ; <- 65435 - Bank0C.asm : 2772 (LDX.b #$64) [LDX.b #$50]
LDX.b #$44 LDX.b #$44
LDA $D324, X LDA.w $D324, X
org $0CD446 ; <- 65446 - Bank0C.asm : 2782 (LDX $C8 : CPX.b #$02 : BEQ BRANCH_11) org $0CD446 ; <- 65446 - Bank0C.asm : 2782 (LDX $C8 : CPX.b #$02 : BEQ BRANCH_11)
db $80 ; BRA db $80 ; BRA
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -4,7 +4,7 @@ ShouldOverrideFileLoad:
BNE .no BNE .no
LDA.w DungeonID ; Dungeon number LDA.w DungeonID ; Dungeon number
CMP #$12 ; Ice Palace CMP.b #$12 ; Ice Palace
BEQ .yes BEQ .yes
.no .no
CLC : RTS CLC : RTS

View File

@@ -20,7 +20,7 @@ Init_Primary:
INX INX
CPX.b #$FF : !BLT - CPX.b #$FF : !BLT -
LDX #$00 LDX.b #$00
- -
LDA.l RomNameSRAM, X : CMP.w $FFC0, X : BNE .clear LDA.l RomNameSRAM, X : CMP.w $FFC0, X : BNE .clear
INX INX

View File

@@ -55,7 +55,7 @@ RTL
LDA.l BoomerangEquipment : EOR.b #$03 : STA.l BoomerangEquipment ; swap blue & red boomerang LDA.l BoomerangEquipment : EOR.b #$03 : STA.l BoomerangEquipment ; swap blue & red boomerang
LDA.b #$20 : STA.w SFX3 ; menu select sound LDA.b #$20 : STA.w SFX3 ; menu select sound
JMP .captured JMP .captured
+ CMP #$01 : BNE + ; bow + CMP.b #$01 : BNE + ; bow
LDA.l BowTracking : AND.b #$C0 : CMP.b #$C0 : BNE .errorJump ; make sure we have both bows LDA.l BowTracking : AND.b #$C0 : CMP.b #$C0 : BNE .errorJump ; make sure we have both bows
PHX : LDX.b #$00 ; scan ancilla table for arrows PHX : LDX.b #$00 ; scan ancilla table for arrows
-- : CPX.b #$0A : !BGE ++ -- : CPX.b #$0A : !BGE ++
@@ -75,7 +75,7 @@ RTL
+ BRA + + BRA +
.errorJump .errorJump
BRA .errorJump2 BRA .errorJump2
+ CMP #$05 : BNE + ; powder + CMP.b #$05 : BNE + ; powder
LDA.l InventoryTracking : AND.b #$30 : CMP.b #$30 : BNE .errorJump ; make sure we have mushroom & magic powder LDA.l InventoryTracking : AND.b #$30 : CMP.b #$30 : BNE .errorJump ; make sure we have mushroom & magic powder
LDA.l PowderEquipment : EOR.b #$03 : STA.l PowderEquipment ; swap mushroom & magic powder LDA.l PowderEquipment : EOR.b #$03 : STA.l PowderEquipment ; swap mushroom & magic powder
LDA.b #$20 : STA.w SFX3 ; menu select sound LDA.b #$20 : STA.w SFX3 ; menu select sound
@@ -83,7 +83,7 @@ RTL
+ BRA + + BRA +
.errorJump2 .errorJump2
BRA .error BRA .error
+ CMP #$0D : BNE + ; flute + CMP.b #$0D : BNE + ; flute
LDA.w UseY2 : CMP.b #$01 : BEQ .midShovel ; inside a shovel animation, force the shovel & make error sound LDA.w UseY2 : CMP.b #$01 : BEQ .midShovel ; inside a shovel animation, force the shovel & make error sound
LDA.l InventoryTracking : BIT.b #$04 : BEQ .error ; make sure we have shovel LDA.l InventoryTracking : BIT.b #$04 : BEQ .error ; make sure we have shovel
AND.b #$03 : BEQ .error ; make sure we have one of the flutes AND.b #$03 : BEQ .error ; make sure we have one of the flutes

View File

@@ -208,22 +208,22 @@ MirrorBonk:
LDX.w #$0000 LDX.w #$0000
.loop .loop
LDA.l .bonkRectanglesTable, X ;Load X1 LDA.l .bonkRectanglesTable, X ;Load X1
CMP LinkPosX : !BGE ++ CMP.b LinkPosX : !BGE ++
;IF X > X1 ;IF X > X1
LDA.l .bonkRectanglesTable+2, X ; Load X2 LDA.l .bonkRectanglesTable+2, X ; Load X2
CMP LinkPosX : !BLT ++ CMP.b LinkPosX : !BLT ++
;IF X < X2 ;IF X < X2
LDA.l .bonkRectanglesTable+4, X ;Load Y1 LDA.l .bonkRectanglesTable+4, X ;Load Y1
CMP LinkPosY : !BGE ++ CMP.b LinkPosY : !BGE ++
;IF Y > Y1 ;IF Y > Y1
LDA.l .bonkRectanglesTable+6, X ; Load Y2 LDA.l .bonkRectanglesTable+6, X ; Load Y2
CMP LinkPosY : !BLT ++ CMP.b LinkPosY : !BLT ++
;IF Y < Y2 ;IF Y < Y2
;Bonk Here ;Bonk Here
PLB : PLP : PLX PLB : PLP : PLX
BRA .forceBonk BRA .forceBonk
++ ++
TXA : !ADD #$0008 : CMP #.tableEnd-.bonkRectanglesTable : BEQ .endLoop TXA : !ADD #$0008 : CMP.w #.tableEnd-.bonkRectanglesTable : BEQ .endLoop
TAX TAX
BRA .loop BRA .loop
.endbonkRectanglesTable .endbonkRectanglesTable

View File

@@ -332,7 +332,7 @@ STA.w $28D2
; CHECK IF AGAHNIM 2 IS DEAD AND WE HAVE ALREADY LANDED ; CHECK IF AGAHNIM 2 IS DEAD AND WE HAVE ALREADY LANDED
LDA.w $7EF2DB : AND #$0020 : BEQ .agahnim2Alive LDA.w OverworldEventDataWRAM+$2B : AND.w #$0020 : BEQ .agahnim2Alive
LDA.w #$046D : STA.w $243E LDA.w #$046D : STA.w $243E
LDA.w #$0E3A : STA.w $24BC LDA.w #$0E3A : STA.w $24BC
LDA.w #$0E3B : STA.w $24BE LDA.w #$0E3B : STA.w $24BE
@@ -1007,7 +1007,7 @@ LDA.w #$0108 : STA.w $3C38
;Warp Tile agah defeated ;Warp Tile agah defeated
LDA.w #$0034 : STA.w $3BBE ;Tile when no warp LDA.w #$0034 : STA.w $3BBE ;Tile when no warp
LDA.l ProgressIndicator : AND #$00FF : CMP.w #$0003 : BNE .agahnimAlive LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #$0003 : BNE .agahnimAlive
LDA.w #$0212 : STA.w $3BBE ;warp LDA.w #$0212 : STA.w $3BBE ;warp
.agahnimAlive .agahnimAlive

18
msu.asm
View File

@@ -114,15 +114,15 @@
; Check if A has an overworld track ; Check if A has an overworld track
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
IsOverworldTrack: IsOverworldTrack:
CMP #02 : BEQ .yes ; 2 - Hyrule Field CMP.b #02 : BEQ .yes ; 2 - Hyrule Field
CMP #03 : BEQ .yes ; 3 - Time of Falling Rain CMP.b #03 : BEQ .yes ; 3 - Time of Falling Rain
CMP #04 : BEQ .yes ; 4 - The Silly Pink Rabbit CMP.b #04 : BEQ .yes ; 4 - The Silly Pink Rabbit
CMP #05 : BEQ .yes ; 5 - Forest of Mystery CMP.b #05 : BEQ .yes ; 5 - Forest of Mystery
CMP #07 : BEQ .yes ; 7 - Kakariko Village CMP.b #07 : BEQ .yes ; 7 - Kakariko Village
CMP #09 : BEQ .yes ; 9 - Dark Golden Land CMP.b #09 : BEQ .yes ; 9 - Dark Golden Land
CMP #15 : BEQ .yes ; 15 - Dark Woods CMP.b #15 : BEQ .yes ; 15 - Dark Woods
CMP #60 : BEQ .yes ; 60 - Light World OW (after ped pull) CMP.b #60 : BEQ .yes ; 60 - Light World OW (after ped pull)
CMP #61 : BEQ .yes ; 61 - Dark World OW (with all crystals) CMP.b #61 : BEQ .yes ; 61 - Dark World OW (with all crystals)
.no .no
CLC : RTS CLC : RTS
.yes .yes

View File

@@ -263,6 +263,6 @@ Overworld_MosaicDarkWorldChecks:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Check if the boss in ToH has been defeated (16-bit accumulator) ; Check if the boss in ToH has been defeated (16-bit accumulator)
CheckHeraBossDefeated: CheckHeraBossDefeated:
LDA.l RoomDataWRAM[$07].l : AND #$FF00 LDA.l RoomDataWRAM[$07].l : AND.w #$FF00
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -85,7 +85,7 @@ NewDrawHud:
;================================================================================ ;================================================================================
; Draw Dungeon Compass Counts ; Draw Dungeon Compass Counts
;================================================================================ ;================================================================================
LDA.l CompassMode : AND #$00FF : BEQ + ; skip if CompassMode is 0. LDA.l CompassMode : AND.w #$00FF : BEQ + ; skip if CompassMode is 0.
JSL.l DrawDungeonCompassCounts ; compasses.asm JSL.l DrawDungeonCompassCounts ; compasses.asm
+ +
@@ -133,7 +133,7 @@ NewDrawHud:
CPX #$04 : !BLT .noprize CPX #$04 : !BLT .noprize
CPX #$08 : BEQ .noprize CPX #$08 : BEQ .noprize
LDA.b GameMode : CMP #$12 : BEQ .noprize LDA.b GameMode : CMP.b #$12 : BEQ .noprize
LDA.l MapMode LDA.l MapMode
REP #$20 REP #$20

View File

@@ -35,7 +35,7 @@ ItemCheck_MagicBat:
RTL RTL
ItemCheck_OldMan: ItemCheck_OldMan:
LDA.l NpcFlags : AND.b #$01 : CMP #$01 LDA.l NpcFlags : AND.b #$01 : CMP.b #$01
RTL RTL
ItemCheck_ZoraKing: ItemCheck_ZoraKing:

View File

@@ -72,7 +72,7 @@ OverworldMap_CheckObject:
LDA.l MapField : ORA.l MapOverlay : AND.b #$02 : BNE +++ LDA.l MapField : ORA.l MapOverlay : AND.b #$02 : BNE +++
PHX PHX
LDA.l .dw_map_offsets, X : TAX ; put map offset into X LDA.l .dw_map_offsets, X : TAX ; put map offset into X
LDA.l MapField, X : ORA MapOverlay, X LDA.l MapField, X : ORA.l MapOverlay, X
PLX PLX
AND.l .dw_map_masks, X : BNE +++ AND.l .dw_map_masks, X : BNE +++
JMP .fail JMP .fail

View File

@@ -71,7 +71,7 @@ ArrowGame:
.rupees .rupees
PHX PHX
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.l BowEquipment : DEC : AND #$0002 : TAX LDA.l BowEquipment : DEC : AND.w #$0002 : TAX
LDA.l CurrentRupees : !ADD.l ArrowModeWoodArrowCost, X : STA.l CurrentRupees LDA.l CurrentRupees : !ADD.l ArrowModeWoodArrowCost, X : STA.l CurrentRupees
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
PLX PLX

View File

@@ -112,7 +112,7 @@ SpritePrep_ShopKeeper:
- -
LDA.l ShopTable+1, X : CMP.b RoomIndex : BNE + LDA.l ShopTable+1, X : CMP.b RoomIndex : BNE +
LDA.l ShopTable+5, X : AND.w #$0040 : BNE ++ LDA.l ShopTable+5, X : AND.w #$0040 : BNE ++
LDA.l PreviousOverworldDoor : AND #$00FF : CMP.l ShopTable+3, X : BNE + LDA.l PreviousOverworldDoor : AND.w #$00FF : CMP.l ShopTable+3, X : BNE +
++ ++
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA.l ShopTable, X : STA.l ShopId LDA.l ShopTable, X : STA.l ShopId

View File

@@ -29,7 +29,7 @@ SaveDataWRAM = $7EF000
; Example: We can use RoomDataWRAM[$37].high to read or write the pot key in the first ; Example: We can use RoomDataWRAM[$37].high to read or write the pot key in the first
; floodable room in Swamp Palace (bit $04). To check if a boss has been killed we can ; floodable room in Swamp Palace (bit $04). To check if a boss has been killed we can
; take the room index for a boss room (e.g. $07 for Tower of Hera) and bitmask $FF00 ; take the room index for a boss room (e.g. $07 for Tower of Hera) and bitmask $FF00
; like this: RoomDataWRAM[$07].l : AND #$FF00 ; like this: RoomDataWRAM[$07].l : AND.w #$FF00
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; .high Byte: d d d d b k u t ; .high Byte: d d d d b k u t
; .low Byte: s e h c q q q q ; .low Byte: s e h c q q q q
@@ -658,7 +658,7 @@ endmacro
%assertSRAM(RoomPotData, $7F6018) %assertSRAM(RoomPotData, $7F6018)
%assertSRAM(SpritePotData, $7F6268) %assertSRAM(SpritePotData, $7F6268)
%assertSRAM(PurchaseCounts, $7F64B8) %assertSRAM(PurchaseCounts, $7F64B8)
%assertSRAM(PrivateBlock, $7F6518) %assertSRAM(PrivateBlockPersistent, $7F6518)
;================================================================================ ;================================================================================
; Direct SRAM Assertions ; Direct SRAM Assertions

View File

@@ -229,7 +229,7 @@ RenderCreditsStatCounter:
; == Determine stat type == ; == Determine stat type ==
LDA.w CreditsStats,y ; LLLL LLLL XXXX XTTL LDA.w CreditsStats,y ; LLLL LLLL XXXX XTTL
LSR LSR
AND #$0003 ; TT AND.w #$0003 ; TT
CMP.w #$0000 CMP.w #$0000
BEQ .normalStat BEQ .normalStat
JMP .timeStat JMP .timeStat
@@ -317,7 +317,7 @@ RenderCreditsStatCounter:
++ %StripeTile() ++ %StripeTile()
LDA.l $7F5005 LDA.l $7F5005
AND #$00FF AND.w #$00FF
CMP.b RemoveZero CMP.b RemoveZero
BNE + BNE +
LDA.w #BlankTile LDA.w #BlankTile