More merge labeling

This commit is contained in:
codemann8
2024-04-07 05:09:32 -05:00
parent 9cfeb18fef
commit 27685ac77d
70 changed files with 1386 additions and 1410 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -54,27 +54,26 @@ GiveBonkItem:
LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
LDA.w SprItemReceipt, X LDA.w SprItemReceipt, X
JSR AbsorbKeyCheck : BCC .notKey JSR AbsorbKeyCheck : BCC .notKey
.key PHY : LDY.b #$24 : JSL AddInventory : PLY ; do inventory processing for a small key
PHY : LDY.b #$24 : JSL AddInventory : PLY ; do inventory processing for a small key LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys
LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys LDA.b #$2F : JSL Sound_SetSfx3PanLong
LDA.b #$2F : JSL Sound_SetSfx3PanLong INC.w UpdateHUDFlag
INC.w UpdateHUDFlag RTL
RTL .notKey
.notKey
PHY : TAY : JSL Link_ReceiveItem : PLY PHY : TAY : JSL Link_ReceiveItem : PLY
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadBonkItem: LoadBonkItem:
LDA.b RoomIndex ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte LDA.b RoomIndex ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
CMP.b #$73 : BNE + ; Desert Bonk Key CMP.b #$73 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert LDA.l BonkKey_Desert
BRA ++ BRA ++
+ : CMP.b #$8C : BNE + ; GTower Bonk Key + : CMP.b #$8C : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower LDA.l BonkKey_GTower
BRA ++ BRA ++
+ +
LDA.b #$24 ; default to small key LDA.b #$24 ; default to small key
++ ++
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadBonkItem_Player: LoadBonkItem_Player:
@@ -86,8 +85,8 @@ LoadBonkItem_Player:
LDA.l BonkKey_GTower_Player LDA.l BonkKey_GTower_Player
BRA ++ BRA ++
+ +
LDA.b #$00 LDA.b #$00
++ ++
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
AbsorbKeyCheck: AbsorbKeyCheck:

View File

@@ -193,7 +193,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Fix losing VRAM gfx when using quake ; Fix losing VRAM gfx when using quake
PostNMIUpdateBGCharHalf: PostNMIUpdateBGCharHalf:
STA.w MDMAEN : SEP #$10 ; what we wrote over STA.w DMAENABLE : SEP #$10 ; what we wrote over
LDA.w VRAMTileMapIndex : CMP.b #$46 : BNE .return ; checks to see if this is the last VRAM write LDA.w VRAMTileMapIndex : CMP.b #$46 : BNE .return ; checks to see if this is the last VRAM write
LDA.b LinkState : CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion LDA.b LinkState : CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
RTL RTL
@@ -259,7 +259,7 @@ ParadoxCaveGfxFix:
CPX.w #$1E00 : BEQ .uploadLine CPX.w #$1E00 : BEQ .uploadLine
.uploadLine .uploadLine
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
.skipLine .skipLine
RTL RTL
@@ -270,7 +270,7 @@ ParadoxCaveGfxFix:
BRA .uploadLine BRA .uploadLine
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetItemRiseTimer: SetItemRiseTimer:
LDA.w ItemReceiptMethod : CMP #$01 : BNE .not_from_chest LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest
LDA.b #$38 : STA.w AncillaTimer, X LDA.b #$38 : STA.w AncillaTimer, X
RTL RTL
.not_from_chest .not_from_chest

View File

@@ -41,7 +41,7 @@ SetDeathWorldChecked:
LDA.w DungeonID : CMP.b #$FF : BNE .dungeon LDA.w DungeonID : CMP.b #$FF : BNE .dungeon
LDA.b RoomIndex : ORA.b RoomIndex+1 : BNE ++ LDA.b RoomIndex : ORA.b RoomIndex+1 : BNE ++
LDA.l GanonPyramidRespawn : BNE .pyramid ; if flag is set, force respawn at pyramid on death to ganon LDA.l GanonPyramidRespawn : BNE .pyramid ; if flag is set, force respawn at pyramid on death to ganon
++ ++
.outdoors .outdoors
JMP DoWorldFix JMP DoWorldFix

View File

@@ -142,13 +142,13 @@ TransferItemToVRAM:
STA.w $2116 STA.w $2116
LDX.b #$01 LDX.b #$01
STX.w $420B STX.w DMAENABLE
ADC.w #$0100 ADC.w #$0100
STA.w $2116 STA.w $2116
INX INX
STX.w $420B STX.w DMAENABLE
STZ.w ItemGFXPtr STZ.w ItemGFXPtr
STZ.w ItemGFXTarget STZ.w ItemGFXTarget

View File

@@ -24,10 +24,10 @@ RetrieveValueFromEncryptedTable:
LDY.b Scrap0A : PHY : LDY.b Scrap0C : PHY : LDY.b Scrap0E : PHY LDY.b Scrap0A : PHY : LDY.b Scrap0C : PHY : LDY.b Scrap0E : PHY
AND.w #$FFF8 : TAY AND.w #$FFF8 : TAY
LDA.b [$00], Y : STA.l CryptoBuffer : INY #2 LDA.b [Scrap00], Y : STA.l CryptoBuffer : INY #2
LDA.b [$00], Y : STA.l CryptoBuffer+2 : INY #2 LDA.b [Scrap00], Y : STA.l CryptoBuffer+2 : INY #2
LDA.b [$00], Y : STA.l CryptoBuffer+4 : INY #2 LDA.b [Scrap00], Y : STA.l CryptoBuffer+4 : INY #2
LDA.b [$00], Y : STA.l CryptoBuffer+6 LDA.b [Scrap00], Y : STA.l CryptoBuffer+6
LDA.w #$0002 : STA.b Scrap04 ;set block size LDA.w #$0002 : STA.b Scrap04 ;set block size

View File

@@ -21,7 +21,7 @@ macro LoadDialogAddress(address)
PHB : PHK : PLB PHB : PHK : PLB
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
REP #$10 ; set 16-bit index registers REP #$10 ; set 16-bit index registers
PEI.b ($00) PEI.b (Scrap00)
LDA.b Scrap02 : PHA LDA.b Scrap02 : PHA
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
LDA.b #$01 : STA.l AltTextFlag ; set flag LDA.b #$01 : STA.l AltTextFlag ; set flag
@@ -44,7 +44,7 @@ endmacro
macro CopyDialogIndirect() macro CopyDialogIndirect()
REP #$20 : LDA.l DialogOffsetPointer : TAX : LDY.w #$0000 : SEP #$20 ; copy 2-byte offset pointer to X and set Y to 0 REP #$20 : LDA.l DialogOffsetPointer : TAX : LDY.w #$0000 : SEP #$20 ; copy 2-byte offset pointer to X and set Y to 0
?loop: ?loop:
LDA.b [$00], Y ; load the next character from the pointer LDA.b [Scrap00], Y ; load the next character from the pointer
STA.l DialogBuffer, X ; write to the buffer STA.l DialogBuffer, X ; write to the buffer
INX : INY INX : INY
CMP.b #$7F : BNE ?loop CMP.b #$7F : BNE ?loop
@@ -149,7 +149,7 @@ FreeDungeonItemNotice:
.self_notice .self_notice
SEP #$20 SEP #$20
%CopyDialog(Notice_Self) %CopyDialog(Notice_Self)
JMP.w .done JMP .done
+ +
SEP #$20 SEP #$20
LDA.w ScratchBufferNV+1 LDA.w ScratchBufferNV+1
@@ -251,7 +251,7 @@ DialogFairyThrow:
ORA.l BottleContentsTwo : ORA.l BottleContentsThree : ORA.l BottleContentsFour : BNE .normal ORA.l BottleContentsTwo : ORA.l BottleContentsThree : ORA.l BottleContentsFour : BNE .normal
.noInventory .noInventory
LDA.w SpriteActivity, X : !ADD #$08 : STA.w SpriteActivity, X LDA.w SpriteActivity, X : !ADD.b #$08 : STA.w SpriteActivity, X
LDA.b #$51 LDA.b #$51
LDY.b #$01 LDY.b #$01
RTL RTL

View File

@@ -1,9 +1,3 @@
!add = "clc : adc"
!addl = "clc : adc.l"
!sub = "sec : sbc"
!bge = "bcs"
!blt = "bcc"
; Free RAM notes ; Free RAM notes
; Normal doors use $AB-AC for scrolling indicator ; Normal doors use $AB-AC for scrolling indicator
; Normal doors use $FE to store the trap door indicator ; Normal doors use $FE to store the trap door indicator

View File

@@ -188,7 +188,7 @@ Main_ShowTextMessage:
; Conditionally disable UW music changes in Door Rando ; Conditionally disable UW music changes in Door Rando
org $828ADB ; <- Bank02.asm:2088-2095 (LDX.b #$14 : LDA $A0 ...) org $828ADB ; <- Bank02.asm:2088-2095 (LDX.b #$14 : LDA $A0 ...)
JSL Underworld_DoorDown_Entry : CPX #$FF JSL Underworld_DoorDown_Entry : CPX.b #$FF
BEQ + : db $80, $1C ; BRA $028B04 BEQ + : db $80, $1C ; BRA $028B04
NOP #6 : + NOP #6 : +

View File

@@ -5,8 +5,8 @@ HorzEdge:
cpy.b #$ff : beq + cpy.b #$ff : beq +
jsr DetectWestEdge : ldy.b #$02 : bra ++ jsr DetectWestEdge : ldy.b #$02 : bra ++
+ jsr DetectEastEdge + jsr DetectEastEdge
++ cmp #$ff : beq + ++ cmp.b #$ff : beq +
sta.b Scrap00 : asl : !add.b Scrap00 : tax sta.b Scrap00 : asl : !ADD.b Scrap00 : tax
cpy.b #$ff : beq ++ cpy.b #$ff : beq ++
jsr LoadWestData : bra .main jsr LoadWestData : bra .main
++ jsr LoadEastData ++ jsr LoadEastData
@@ -20,7 +20,7 @@ VertEdge:
jsr DetectNorthEdge : bra ++ jsr DetectNorthEdge : bra ++
+ jsr DetectSouthEdge + jsr DetectSouthEdge
++ cmp.b #$ff : beq + ++ cmp.b #$ff : beq +
sta.b Scrap00 : asl : !add.b Scrap00 : tax sta.b Scrap00 : asl : !ADD.b Scrap00 : tax
cpy.b #$ff : beq ++ cpy.b #$ff : beq ++
jsr LoadNorthData : bra .main jsr LoadNorthData : bra .main
++ jsr LoadSouthData ++ jsr LoadSouthData
@@ -32,8 +32,8 @@ VertEdge:
LoadEdgeRoomHorz: LoadEdgeRoomHorz:
lda.b Scrap03 : sta.b RoomIndex lda.b Scrap03 : sta.b RoomIndex
sty.b Scrap06 sty.b Scrap06
and.b #$0f : asl a : !sub.b LinkPosX+1 : !add.b Scrap06 : sta.b Scrap02 and.b #$0f : asl a : !SUB.b LinkPosX+1 : !ADD.b Scrap06 : sta.b Scrap02
ldy #$00 : jsr ShiftVariablesMainDir ldy.b #$00 : jsr ShiftVariablesMainDir
lda.b Scrap04 : and.b #$80 : bne .edge lda.b Scrap04 : and.b #$80 : bne .edge
lda.b Scrap04 : sta.b Scrap01 ; load up flags in $01 lda.b Scrap04 : sta.b Scrap01 ; load up flags in $01
@@ -54,7 +54,7 @@ LoadEdgeRoomHorz:
LoadEdgeRoomVert: LoadEdgeRoomVert:
lda.b Scrap03 : sta.b RoomIndex lda.b Scrap03 : sta.b RoomIndex
sty.b Scrap06 sty.b Scrap06
and.b #$f0 : lsr #3 : !sub.b LinkPosY+1 : !add.b Scrap06 : sta.b Scrap02 and.b #$f0 : lsr #3 : !SUB.b LinkPosY+1 : !ADD.b Scrap06 : sta.b Scrap02
lda.b Scrap04 : and.b #$80 : bne .edge lda.b Scrap04 : and.b #$80 : bne .edge
lda.b Scrap04 : sta.b Scrap01 ; load up flags in $01 lda.b Scrap04 : sta.b Scrap01 ; load up flags in $01
@@ -99,7 +99,7 @@ MathStart:
rts rts
MathMid: MathMid:
and.w #$01ff : !sub.b Scrap00 : and.w #$00ff : sta.b Scrap00 and.w #$01ff : !SUB.b Scrap00 : and.w #$00ff : sta.b Scrap00
; nothing should be bigger than $a0 at this point ; nothing should be bigger than $a0 at this point
lda.b Scrap05 : and.w #$00f0 : lsr #4 : tax lda.b Scrap05 : and.w #$00f0 : lsr #4 : tax
@@ -118,7 +118,7 @@ MathMid:
MathEnd: MathEnd:
beq + beq +
lda.w #$0100 lda.w #$0100
+ !add.b Scrap02 : !add.b Scrap00 + !ADD.b Scrap02 : !ADD.b Scrap00
sta.b Scrap04 sta.b Scrap04
sep #$30 sep #$30
rts rts
@@ -137,7 +137,7 @@ LoadNorthData:
rts rts
LoadSouthMidpoint: LoadSouthMidpoint:
and.b #$0f : sta.b Scrap00 : asl : !add.b Scrap00 : tax and.b #$0f : sta.b Scrap00 : asl : !ADD.b Scrap00 : tax
lda.w SouthEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition lda.w SouthEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition
rts rts
@@ -153,7 +153,7 @@ LoadSouthData:
rts rts
LoadNorthMidpoint: LoadNorthMidpoint:
and.b #$0f : sta.b Scrap00 : asl : !add.b Scrap00 : tax and.b #$0f : sta.b Scrap00 : asl : !ADD.b Scrap00 : tax
lda.w NorthEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition lda.w NorthEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition
rts rts
@@ -169,7 +169,7 @@ LoadWestData:
rts rts
LoadEastMidpoint: LoadEastMidpoint:
and.b #$0f : sta.b Scrap00 : asl : !add.b Scrap00 : tax and.b #$0f : sta.b Scrap00 : asl : !ADD.b Scrap00 : tax
lda.w EastEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition lda.w EastEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition
rts rts
@@ -185,7 +185,7 @@ LoadEastData:
LoadWestMidpoint: LoadWestMidpoint:
and.b #$0f : sta.b Scrap00 : asl : !add.b Scrap00 : tax and.b #$0f : sta.b Scrap00 : asl : !ADD.b Scrap00 : tax
lda.w WestEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition lda.w WestEdgeInfo, x : sta.b Scrap0A ; needed now, and for nrml transition
rts rts
@@ -289,7 +289,7 @@ DetectEastEdge:
ldx.b #$04 : bra .end ldx.b #$04 : bra .end
++ ldx.b #$03 : bra .end ++ ldx.b #$03 : bra .end
+ cmp.b #$84 : bne + + cmp.b #$84 : bne +
ldx #$05 : bra .end ldx.b #$05 : bra .end
+ cmp.b #$cb : bne + + cmp.b #$cb : bne +
lda.b LinkQuadrantV : beq ++ lda.b LinkQuadrantV : beq ++
ldx.b #$06 : bra .end ldx.b #$06 : bra .end

View File

@@ -46,7 +46,7 @@ pullpc
;=================================================================================================== ;===================================================================================================
StoreDoorInfo: StoreDoorInfo:
STA.w $1980,X STA.w $1980,X
LDA.b $00 : STA.w $19F0,X LDA.b Scrap00 : STA.w $19F0,X
TXA TXA
RTL RTL

View File

@@ -86,7 +86,7 @@ CgramAuxToMain: ; ripped this from bank02 because it ended with rts
OverridePaletteHeader: OverridePaletteHeader:
lda.l DRMode : cmp.b #$02 : bne + lda.l DRMode : cmp.b #$02 : bne +
lda.l DRFlags : and.b #$20 : bne + lda.l DRFlags : and.b #$20 : bne +
cpx.w #$01c2 : !bge + cpx.w #$01c2 : !BGE +
rep #$20 rep #$20
txa : lsr : tax txa : lsr : tax
lda.l PaletteTable, x lda.l PaletteTable, x

View File

@@ -124,7 +124,7 @@ DrHudDungeonItemsAdditions:
sta.w $1644 : sta.w $164a : sta.w $1652 : sta.w $1662 : sta.w $1684 : sta.w $16c4 sta.w $1644 : sta.w $164a : sta.w $1652 : sta.w $1662 : sta.w $1684 : sta.w $16c4
ldx.w #$0000 ldx.w #$0000
- sta.w $1704, x : sta.w $170e, x : sta.w $1718, x - sta.w $1704, x : sta.w $170e, x : sta.w $1718, x
inx #2 : cpx.w #$0008 : !blt - inx #2 : cpx.w #$0008 : !BLT -
lda.l HudFlag : and.w #$0020 : beq + : JMP ++ : + lda.l HudFlag : and.w #$0020 : beq + : JMP ++ : +
lda.l HUDDungeonItems : and.w #$0007 : bne + : JMP ++ : + lda.l HUDDungeonItems : and.w #$0007 : bne + : JMP ++ : +
@@ -136,7 +136,7 @@ DrHudDungeonItemsAdditions:
lda.w #$24f5 : sta.w $1724 lda.w #$24f5 : sta.w $1724
ldx.w #$0002 ldx.w #$0002
- lda.w #$0000 : !addl RowOffsets,x : !addl ColumnOffsets, x : tay - lda.w #$0000 : !ADD.l RowOffsets,x : !ADD.l ColumnOffsets, x : tay
lda.l DungeonReminderTable, x : sta.w $1644, y : iny #2 lda.l DungeonReminderTable, x : sta.w $1644, y : iny #2
lda.w #$24f5 : sta.w $1644, y lda.w #$24f5 : sta.w $1644, y
lda.l MapField : and.l DungeonMask, x : beq + ; must have map lda.l MapField : and.l DungeonMask, x : beq + ; must have map
@@ -146,7 +146,7 @@ DrHudDungeonItemsAdditions:
.smallKey .smallKey
+ iny #2 + iny #2
cpx.w #$001a : bne + cpx.w #$001a : bne +
tya : !add.w #$003c : tay tya : !ADD.w #$003c : tay
+ stx.b Scrap00 + stx.b Scrap00
txa : lsr : tax txa : lsr : tax
lda.w #$24f5 : sta.w $1644, y lda.w #$24f5 : sta.w $1644, y
@@ -158,7 +158,7 @@ DrHudDungeonItemsAdditions:
lda.l MapField : and.l DungeonMask, x : beq + ; must have map lda.l MapField : and.l DungeonMask, x : beq + ; must have map
plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02
lda.l GenericKeys : bne +++ lda.l GenericKeys : bne +++
lda.b Scrap02 : !sub.l DungeonCollectedKeys, x : sta.b Scrap02 lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02
+++ lda.b Scrap02 +++ lda.b Scrap02
rep #$30 rep #$30
jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals
@@ -180,7 +180,7 @@ DrHudDungeonItemsAdditions:
sta.w $160a : sta.w $1614 : sta.w $161e ; blank out sm key indicators sta.w $160a : sta.w $1614 : sta.w $161e ; blank out sm key indicators
ldx.w #$0002 ldx.w #$0002
- lda.w #$0000 ; start of hud area - lda.w #$0000 ; start of hud area
!addl RowOffsets, x : !addl ColumnOffsets, x : tay !ADD.l RowOffsets, x : !ADD.l ColumnOffsets, x : tay
lda.l DungeonReminderTable, x : sta.w $1644, y lda.l DungeonReminderTable, x : sta.w $1644, y
iny #2 iny #2
lda.w #$24f5 : sta.w $1644, y ; blank out map spot lda.w #$24f5 : sta.w $1644, y ; blank out map spot
@@ -188,10 +188,10 @@ DrHudDungeonItemsAdditions:
JSR MapIndicatorShort : STA.w $1644, Y JSR MapIndicatorShort : STA.w $1644, Y
+ iny #2 + iny #2
cpx.w #$001a : bne + cpx.w #$001a : bne +
tya : !add.w #$003c : tay tya : !ADD.w #$003c : tay
+ lda.l CompassField : and.l DungeonMask, x : beq + ; must have compass + lda.l CompassField : and.l DungeonMask, x : beq + ; must have compass
phx ; total chest counts phx ; total chest counts
LDA.l CompassTotalsWRAM, x : !sub.l DungeonLocationsChecked, x LDA.l CompassTotalsWRAM, x : !SUB.l DungeonLocationsChecked, x
SEP #$30 : JSR HudHexToDec2DigitCopy : REP #$30 SEP #$30 : JSR HudHexToDec2DigitCopy : REP #$30
lda.b Scrap06 : jsr ConvertToDisplay2 : sta.w $1644, y : iny #2 lda.b Scrap06 : jsr ConvertToDisplay2 : sta.w $1644, y : iny #2
lda.b Scrap07 : jsr ConvertToDisplay2 : sta.w $1644, y lda.b Scrap07 : jsr ConvertToDisplay2 : sta.w $1644, y
@@ -201,7 +201,7 @@ DrHudDungeonItemsAdditions:
.skipBlanks iny #2 .skipBlanks iny #2
cpx.w #$001a : beq + cpx.w #$001a : beq +
lda.w #$24f5 : sta.w $1644, y ; blank out spot lda.w #$24f5 : sta.w $1644, y ; blank out spot
+ inx #2 : cpx.w #$001b : !bge ++ : JMP - + inx #2 : cpx.w #$001b : !BGE ++ : JMP -
++ ++
plp : ply : plx : rtl plp : ply : plx : rtl
} }
@@ -244,15 +244,15 @@ BkStatus:
+++ lda.w #$2826 : rts ; check mark +++ lda.w #$2826 : rts ; check mark
ConvertToDisplay: ConvertToDisplay:
and.w #$00ff : cmp.w #$000a : !blt + and.w #$00ff : cmp.w #$000a : !BLT +
!add.w #$2553 : rts !ADD.w #$2553 : rts
+ !add.w #$2490 : rts + !ADD.w #$2490 : rts
ConvertToDisplay2: ConvertToDisplay2:
and.w #$00ff : beq ++ and.w #$00ff : beq ++
cmp.w #$000a : !blt + cmp.w #$000a : !BLT +
!add.w #$2553 : rts ; 2580 with 258A as "A" for non transparent digits !ADD.w #$2553 : rts ; 2580 with 258A as "A" for non transparent digits
+ !add.w #$2816 : rts + !ADD.w #$2816 : rts
++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483
CountAbsorbedKeys: CountAbsorbedKeys:

View File

@@ -23,11 +23,11 @@ CheckIfDoorsOpen: {
.nextDoor .nextDoor
lda.b RoomIndex : asl : tax lda.b RoomIndex : asl : tax
lda.w KeyDoorOffset, x : beq .skipDoor lda.w KeyDoorOffset, x : beq .skipDoor
asl : sty.b Scrap05 : !add.b Scrap05 : tax asl : sty.b Scrap05 : !ADD.b Scrap05 : tax
lda.w PairedDoorTable, x : beq .skipDoor lda.w PairedDoorTable, x : beq .skipDoor
sta.b Scrap02 : and.w #$00ff : asl a : tax sta.b Scrap02 : and.w #$00ff : asl a : tax
lda.b Scrap02 : and.w #$ff00 : sta.b Scrap03 lda.b Scrap02 : and.w #$ff00 : sta.b Scrap03
lda RoomDataWRAM.l, X : and.w #$f000 : and.b Scrap03 : beq .skipDoor lda.l RoomDataWRAM.l, X : and.w #$f000 : and.b Scrap03 : beq .skipDoor
tyx : lda.w $068c : ora.l DungeonMask,x : sta.w $068c tyx : lda.w $068c : ora.l DungeonMask,x : sta.w $068c
.skipDoor .skipDoor
iny #2 : cpy.b Scrap00 : bne .nextDoor iny #2 : cpy.b Scrap00 : bne .nextDoor

View File

@@ -31,18 +31,18 @@ lda.b Scrap00 : bra .loop
.done rts .done rts
MultiBy3: MultiBy3:
sta.b Scrap00 : asl : !add.b Scrap00 sta.b Scrap00 : asl : !ADD.b Scrap00
rts rts
MultiBy5: MultiBy5:
sta.b Scrap00 : asl #2 : !add.b Scrap00 sta.b Scrap00 : asl #2 : !ADD.b Scrap00
rts rts
;width of divison in x: rounds toward X/2 ;width of divison in x: rounds toward X/2
DivideBy2: DivideBy2:
sta.b Scrap00 sta.b Scrap00
lsr : bcc .done lsr : bcc .done
sta.b Scrap02 : txa : lsr : cmp.b Scrap00 : !blt + sta.b Scrap02 : txa : lsr : cmp.b Scrap00 : !BLT +
lda.b Scrap02 : inc : bra .done lda.b Scrap02 : inc : bra .done
+ lda.b Scrap02 + lda.b Scrap02
.done rts .done rts
@@ -51,8 +51,8 @@ DivideBy3:
sta.b Scrap00 sta.b Scrap00
ldx.w #$0000 ldx.w #$0000
lda.w #$0002 lda.w #$0002
.loop cmp.b Scrap00 : !bge .store .loop cmp.b Scrap00 : !BGE .store
inx : !add.w #$0003 : bra .loop inx : !ADD.w #$0003 : bra .loop
.store txa .store txa
rts rts
@@ -60,7 +60,7 @@ DivideBy5:
sta.b Scrap00 sta.b Scrap00
ldx.w #$0000 ldx.w #$0000
lda.w #$0003 lda.w #$0003
.loop cmp.b Scrap00 : !bge .store .loop cmp.b Scrap00 : !BGE .store
inx : !add.w #$0005 : bra .loop inx : !ADD.w #$0005 : bra .loop
.store txa .store txa
rts rts

View File

@@ -3,7 +3,7 @@ WarpLeft:
JSR CheckIfCave : BCS .end JSR CheckIfCave : BCS .end
lda.b LinkPosY : ldx.b LinkQuadrantV lda.b LinkPosY : ldx.b LinkQuadrantV
jsr CalcIndex jsr CalcIndex
!add.b #$06 : ldy.b #$01 ; offsets in A, Y !ADD.b #$06 : ldy.b #$01 ; offsets in A, Y
jsr LoadRoomHorz jsr LoadRoomHorz
.end .end
jsr Cleanup jsr Cleanup
@@ -14,7 +14,7 @@ WarpRight:
JSR CheckIfCave : BCS .end JSR CheckIfCave : BCS .end
lda.b LinkPosY : ldx.b LinkQuadrantV lda.b LinkPosY : ldx.b LinkQuadrantV
jsr CalcIndex jsr CalcIndex
!add.b #$12 : ldy.b #$ff ; offsets in A, Y !ADD.b #$12 : ldy.b #$ff ; offsets in A, Y
jsr LoadRoomHorz jsr LoadRoomHorz
.end .end
jsr Cleanup jsr Cleanup
@@ -43,7 +43,7 @@ WarpDown:
JSR CheckIfCave : BCS .end JSR CheckIfCave : BCS .end
lda.b LinkPosX : ldx.b LinkQuadrantH lda.b LinkPosX : ldx.b LinkQuadrantH
jsr CalcIndex jsr CalcIndex
!add.b #$0c : ldy.b #$ff ; offsets in A, Y !ADD.b #$0c : ldy.b #$ff ; offsets in A, Y
jsr LoadRoomVert jsr LoadRoomVert
%StonewallCheck($43) %StonewallCheck($43)
.end .end
@@ -65,9 +65,9 @@ CheckLinkDoorL:
+ clc : rtl + clc : rtl
TrapDoorFixer: TrapDoorFixer:
lda.b $fe : and #$0038 : beq .end lda.b $fe : and.w #$0038 : beq .end
xba : asl #2 : sta.b Scrap00 xba : asl #2 : sta.b Scrap00
stz.w $0468 : lda.w $068c : ora.b Scrap00 : sta.w $068c stz.w TrapDoorFlag : lda.w $068c : ora.b Scrap00 : sta.w $068c
.end .end
stz.b $fe ; clear our fe here because we don't need it anymore stz.b $fe ; clear our fe here because we don't need it anymore
rts rts
@@ -113,7 +113,7 @@ LoadRoomHorz:
.gtg ;Good to Go! .gtg ;Good to Go!
pla ; Throw away normal room (don't fill up the stack) pla ; Throw away normal room (don't fill up the stack)
lda.b RoomIndex : and.b #$0F : asl a : !sub.b LinkPosX+1 : !add.b Scrap06 : sta.b Scrap02 lda.b RoomIndex : and.b #$0F : asl a : !SUB.b LinkPosX+1 : !ADD.b Scrap06 : sta.b Scrap02
ldy.b #$00 : jsr ShiftVariablesMainDir ldy.b #$00 : jsr ShiftVariablesMainDir
lda.b Scrap01 : and.b #$80 : beq .normal lda.b Scrap01 : and.b #$80 : beq .normal
@@ -146,7 +146,7 @@ LoadRoomVert:
sta.b RoomIndex : bra .end ; Restore normal room, abort (straight staircases and open edges can get in this routine) sta.b RoomIndex : bra .end ; Restore normal room, abort (straight staircases and open edges can get in this routine)
.gtg ;Good to Go! .gtg ;Good to Go!
pla ; Throw away normal room (don't fill up the stack) pla ; Throw away normal room (don't fill up the stack)
lda.b RoomIndex : and.b #$F0 : lsr #3 : !sub.b LinkPosY+1 : !add.b Scrap06 : sta.b Scrap02 lda.b RoomIndex : and.b #$F0 : lsr #3 : !SUB.b LinkPosY+1 : !ADD.b Scrap06 : sta.b Scrap02
lda.b Scrap01 : and.b #$80 : beq .notEdge lda.b Scrap01 : and.b #$80 : beq .notEdge
ldy.b #$01 : jsr ShiftVariablesMainDir ldy.b #$01 : jsr ShiftVariablesMainDir
@@ -173,12 +173,12 @@ LoadRoomVert:
LookupNewRoom: ; expects data offset to be in A LookupNewRoom: ; expects data offset to be in A
{ {
rep #$30 : and #$00FF ;sanitize A reg (who knows what is in the high byte) rep #$30 : and.w #$00FF ;sanitize A reg (who knows what is in the high byte)
sta.b Scrap00 ; offset in 00 sta.b Scrap00 ; offset in 00
lda.b PreviousRoom : tax ; probably okay loading $a3 in the high byte lda.b PreviousRoom : tax ; probably okay loading $a3 in the high byte
lda.w DoorOffset,x : and.w #$00FF ;we only want the low byte lda.w DoorOffset,x : and.w #$00FF ;we only want the low byte
asl #3 : sta.b Scrap02 : !add.b Scrap02 : !add.b Scrap02 ;multiply by 24 (data size) asl #3 : sta.b Scrap02 : !ADD.b Scrap02 : !ADD.b Scrap02 ;multiply by 24 (data size)
!add.b Scrap00 ; should now have the offset of the address I want to load !ADD.b Scrap00 ; should now have the offset of the address I want to load
tax : lda.w DoorTable,x : sta.b Scrap00 tax : lda.w DoorTable,x : sta.b Scrap00
and.w #$00FF : sta.b RoomIndex ; assign new room and.w #$00FF : sta.b RoomIndex ; assign new room
sep #$30 sep #$30
@@ -190,14 +190,14 @@ LookupNewRoom: ; expects data offset to be in A
ShiftVariablesMainDir: ShiftVariablesMainDir:
{ {
lda.w CoordIndex,y : tax lda.w CoordIndex,y : tax
lda.b LinkPosY+1,x : !add.b Scrap02 : sta.b LinkPosY+1,x ; coordinate update lda.b LinkPosY+1,x : !ADD.b Scrap02 : sta.b LinkPosY+1,x ; coordinate update
lda.w CameraIndex,y : tax lda.w CameraIndex,y : tax
lda.b $e3,x : !add.b Scrap02 : sta.b $e3,x ; scroll register high byte lda.b $e3,x : !ADD.b Scrap02 : sta.b $e3,x ; scroll register high byte
lda.w CamQuadIndex,y : tax lda.w CamQuadIndex,y : tax
lda.w $0605,x : !add.b Scrap02 : sta.w $0605,x ; high bytes of these guys lda.w $0605,x : !ADD.b Scrap02 : sta.w $0605,x ; high bytes of these guys
lda.w $0607,x : !add.b Scrap02 : sta.w $0607,x lda.w $0607,x : !ADD.b Scrap02 : sta.w $0607,x
lda.w $0601,x : !add.b Scrap02 : sta.w $0601,x lda.w $0601,x : !ADD.b Scrap02 : sta.w $0601,x
lda.w $0603,x : !add.b Scrap02 : sta.w $0603,x lda.w $0603,x : !ADD.b Scrap02 : sta.w $0603,x
rts rts
} }
@@ -232,10 +232,10 @@ PrepScrollToInroomStairs:
inc.w $0603 : inc.w $0607 inc.w $0603 : inc.w $0607
dec.w CameraScrollN+1 : dec.w CameraScrollS+1 dec.w CameraScrollN+1 : dec.w CameraScrollS+1
+ +
lda.w InroomStairsY,y : !add.b #$20 : sta.b LinkPosY lda.w InroomStairsY,y : !ADD.b #$20 : sta.b LinkPosY
!sub.b #$38 : sta.w $045e !SUB.b #$38 : sta.w $045e
lda.b Scrap01 : and.b #$40 : beq + lda.b Scrap01 : and.b #$40 : beq +
lda.b LinkPosY : !add.b #$20 : sta.b LinkPosY lda.b LinkPosY : !ADD.b #$20 : sta.b LinkPosY
stz.w $045f stz.w $045f
+ +
dec.b LinkPosY+1 dec.b LinkPosY+1
@@ -251,10 +251,10 @@ PrepScrollToInroomStairs:
dec.w $0603 : dec.w $0607 dec.w $0603 : dec.w $0607
inc.w CameraScrollN+1 : inc.w CameraScrollS+1 inc.w CameraScrollN+1 : inc.w CameraScrollS+1
+ +
lda.w InroomStairsY,y : !sub.b #$20 : sta.b LinkPosY lda.w InroomStairsY,y : !SUB.b #$20 : sta.b LinkPosY
!add.b #$38 : sta.w $045e !ADD.b #$38 : sta.w $045e
lda.b Scrap01 : and.b #$40 : beq + lda.b Scrap01 : and.b #$40 : beq +
lda.b LinkPosY : !sub.b #$20 : sta.b LinkPosY lda.b LinkPosY : !SUB.b #$20 : sta.b LinkPosY
stz.w $045f stz.w $045f
+ +
inc.b LinkPosY+1 inc.b LinkPosY+1
@@ -287,7 +287,7 @@ PrepScrollToNormal:
stz.w $0476 stz.w $0476
+ stz.b Scrap05 : lda.b #$78 : sta.b Scrap04 + stz.b Scrap05 : lda.b #$78 : sta.b Scrap04
lda.b Scrap01 : and.b #$03 : beq .end lda.b Scrap01 : and.b #$03 : beq .end
cmp.b #$02 : !bge + cmp.b #$02 : !BGE +
lda.b #$f8 : sta.b Scrap04 : bra .end lda.b #$f8 : sta.b Scrap04 : bra .end
+ inc.b Scrap05 + inc.b Scrap05
.end rts .end rts
@@ -306,11 +306,11 @@ StraightStairsAdj:
jsr GetTileAttribute : tax jsr GetTileAttribute : tax
lda.b GameSubMode : cmp.b #$12 : beq .goingNorth lda.b GameSubMode : cmp.b #$12 : beq .goingNorth
lda.b PreviousRoom : cmp.b #$51 : bne ++ lda.b PreviousRoom : cmp.b #$51 : bne ++
rep #$20 : lda.w #$0018 : !add.b LinkPosY : sta.b LinkPosY : sep #$20 ; special fix for throne room rep #$20 : lda.w #$0018 : !ADD.b LinkPosY : sta.b LinkPosY : sep #$20 ; special fix for throne room
jsr GetTileAttribute : tax jsr GetTileAttribute : tax
++ lda.l StepAdjustmentDown, X : bra .end ++ lda.l StepAdjustmentDown, X : bra .end
; lda.b LinkLayer : beq .end ; lda.b LinkLayer : beq .end
; rep #$20 : lda.w #$ffe0 : !add.b LinkPosY : sta.b LinkPosY : sep #$20 ; rep #$20 : lda.w #$ffe0 : !ADD.b LinkPosY : sta.b LinkPosY : sep #$20
.goingNorth .goingNorth
cpx.b #$00 : bne ++ cpx.b #$00 : bne ++
lda.b RoomIndex : cmp.b #$51 : bne ++ lda.b RoomIndex : cmp.b #$51 : bne ++
@@ -320,8 +320,8 @@ StraightStairsAdj:
++ lda.l StepAdjustmentUp, X ++ lda.l StepAdjustmentUp, X
.end .end
pha : lda.w $0462 : and.b #$04 : bne ++ pha : lda.w $0462 : and.b #$04 : bne ++
pla : !add.b #$f6 : pha pla : !ADD.b #$f6 : pha
++ pla : !add.w $0464 : sta.w $0464 ++ pla : !ADD.w $0464 : sta.w $0464
+ rtl + rtl
.toInroom .toInroom
lda.b #$32 : sta.w $0464 : stz.w $045e lda.b #$32 : sta.w $0464 : stz.w $045e
@@ -352,7 +352,7 @@ StraightStairsFix:
{ {
pha pha
lda.l DRMode : bne + lda.l DRMode : bne +
pla : !add.b LinkPosY : sta.b LinkPosY : rtl ;what we wrote over pla : !ADD.b LinkPosY : sta.b LinkPosY : rtl ;what we wrote over
+ pla : rtl + pla : rtl
} }
@@ -405,13 +405,13 @@ StraightStairsTrapDoor:
pea.w $82802c pea.w $82802c
jml ResetThenCacheRoomEntryProperties ; $10D71 .reset label of Bank02 jml ResetThenCacheRoomEntryProperties ; $10D71 .reset label of Bank02
.jslrtsreturn .jslrtsreturn
lda.w $0468 : bne ++ lda.w TrapDoorFlag : bne ++
lda.b RoomIndex : cmp.b #$ac : bne .animateTraps lda.b RoomIndex : cmp.b #$ac : bne .animateTraps
lda.w $0403 : and.b #$20 : bne .animateTraps lda.w $0403 : and.b #$20 : bne .animateTraps
lda.w $0403 : and.b #$10 : beq ++ lda.w $0403 : and.b #$10 : beq ++
.animateTraps .animateTraps
lda.b #$05 : sta.b GameSubMode lda.b #$05 : sta.b GameSubMode
inc.w $0468 : stz.w $068e : stz.w $0690 inc.w TrapDoorFlag : stz.w TileMapDoorPos : stz.w DoorTimer
++ JML Underworld_SetBossOrSancMusicUponEntry_long ++ JML Underworld_SetBossOrSancMusicUponEntry_long
+ JML Dungeon_ApproachFixedColor ; what we wrote over + JML Dungeon_ApproachFixedColor ; what we wrote over
} }
@@ -443,5 +443,6 @@ HandleSpecialDoorLanding: {
PLA PLA
CMP.b #$34 : BNE + ; inroom stairs CMP.b #$34 : BNE + ; inroom stairs
PHA : LDA.b #$26 : STA.w $045E : PLA PHA : LDA.b #$26 : STA.w $045E : PLA
+ RTL +
RTL
} }

View File

@@ -36,7 +36,7 @@ BlockEraseFix:
+ rtl + rtl
FixShopCode: FixShopCode:
cpx.w #$0300 : !bge + cpx.w #$0300 : !BGE +
sta.l RoomDataWRAM[$00].l, x sta.l RoomDataWRAM[$00].l, x
+ rtl + rtl
@@ -46,8 +46,8 @@ VitreousKeyReset:
+ JML SpritePrep_LoadProperties ; what we wrote over + JML SpritePrep_LoadProperties ; what we wrote over
GuruguruFix: GuruguruFix:
lda.b RoomIndex : cmp.b #$df : !bge + lda.b RoomIndex : cmp.b #$df : !BGE +
and.b #$0f : cmp.b #$0e : !blt + and.b #$0f : cmp.b #$0e : !BLT +
iny #2 iny #2
+ rtl + rtl

View File

@@ -12,7 +12,7 @@ AdjustTransition:
.add jsr AdjustCamAdd : ply : bra .reset .add jsr AdjustCamAdd : ply : bra .reset
+ lda.b $ab : and.w #$0200 : xba : tax + lda.b $ab : and.w #$0200 : xba : tax
lda.l OffsetTable,x : jsr AdjustCamAdd lda.l OffsetTable,x : jsr AdjustCamAdd
lda.b $ab : !sub.w #$0008 : sta.b $ab lda.b $ab : !SUB.w #$0008 : sta.b $ab
ply : bra .done ply : bra .done
.reset ; clear the $ab variable so to not disturb intra-tile doors .reset ; clear the $ab variable so to not disturb intra-tile doors
stz.b $ab stz.b $ab
@@ -22,11 +22,11 @@ AdjustTransition:
} }
AdjustCamAdd: AdjustCamAdd:
!add.w $00E2,y : pha !ADD.w $00E2,y : pha
and.w #$01ff : cmp.w #$0111 : !blt + and.w #$01ff : cmp.w #$0111 : !BLT +
cmp.w #$01f8 : !bge ++ cmp.w #$01f8 : !BGE ++
pla : and.w #$ff10 : pha : bra + pla : and.w #$ff10 : pha : bra +
++ pla : and.w #$ff00 : !add.w #$0100 : pha ++ pla : and.w #$ff00 : !ADD.w #$0100 : pha
+ pla : sta.w $00E2,y : sta.w $00E0,y : rts + pla : sta.w $00E2,y : sta.w $00E0,y : rts
; expects target quad in $05 (either 0 or 1) and target pixel in $04, target room should be in $a0 ; expects target quad in $05 (either 0 or 1) and target pixel in $04, target room should be in $a0
@@ -45,22 +45,22 @@ ScrollY: ;change the Y offset variables
rep #$30 rep #$30
lda.b Scrap00 : pha lda.b Scrap00 : pha
lda.b BG2V : and #$01ff : sta.b Scrap02 lda.b BG2V : and.w #$01ff : sta.b Scrap02
lda.b Scrap04 : jsr LimitYCamera : sta.b Scrap00 lda.b Scrap04 : jsr LimitYCamera : sta.b Scrap00
jsr CheckRoomLayoutY : bcc + jsr CheckRoomLayoutY : bcc +
lda.b Scrap00 : cmp.w #$0080 : !bge ++ lda.b Scrap00 : cmp.w #$0080 : !BGE ++
cmp.w #$0010 : !blt .cmpSrll cmp.w #$0010 : !BLT .cmpSrll
lda.w #$0010 : bra .cmpSrll lda.w #$0010 : bra .cmpSrll
++ cmp.w #$0100 : !bge .cmpSrll ++ cmp.w #$0100 : !BGE .cmpSrll
lda.w #$0100 lda.w #$0100
.cmpSrll sta.b Scrap00 .cmpSrll sta.b Scrap00
; figures out scroll amt ; figures out scroll amt
+ lda.b Scrap00 : cmp.b Scrap02 : bne + + lda.b Scrap00 : cmp.b Scrap02 : bne +
lda.w #$0000 : bra .next lda.w #$0000 : bra .next
+ !blt + + !BLT +
!sub.b Scrap02 : inc.b Scrap0E : bra .next !SUB.b Scrap02 : inc.b Scrap0E : bra .next
+ lda.b Scrap02 : !sub.b Scrap00 + lda.b Scrap02 : !SUB.b Scrap00
.next .next
sta.b $ab sta.b $ab
@@ -76,11 +76,11 @@ ScrollY: ;change the Y offset variables
rts rts
LimitYCamera: LimitYCamera:
cmp.w #$006c : !bge + cmp.w #$006c : !BGE +
lda.w #$0000 : bra .end lda.w #$0000 : bra .end
+ cmp.w #$017d : !blt + + cmp.w #$017d : !BLT +
lda.w #$0110 : bra .end lda.w #$0110 : bra .end
+ !sub.w #$006c + !SUB.w #$006c
.end rts .end rts
CheckRoomLayoutY: CheckRoomLayoutY:
@@ -88,7 +88,7 @@ CheckRoomLayoutY:
cmp.b #$00 : beq .lock cmp.b #$00 : beq .lock
cmp.b #$07 : beq .free cmp.b #$07 : beq .free
cmp.b #$01 : beq .free cmp.b #$01 : beq .free
cmp.b #$04 : !bge .lock cmp.b #$04 : !BGE .lock
cmp.b #$02 : bne + cmp.b #$02 : bne +
lda.b Scrap06 : cmp.b #$ff : beq .lock lda.b Scrap06 : cmp.b #$ff : beq .lock
+ cmp.b #$03 : bne .free + cmp.b #$03 : bne .free
@@ -100,26 +100,26 @@ AdjustCameraBoundsY:
jsr CheckRoomLayoutY : bcc .free jsr CheckRoomLayoutY : bcc .free
; layouts that are camera locked (quads only) ; layouts that are camera locked (quads only)
lda.b Scrap04 : and.w #$00ff : cmp.w #$007d : !blt + lda.b Scrap04 : and.w #$00ff : cmp.w #$007d : !BLT +
lda.w #$0088 : bra ++ lda.w #$0088 : bra ++
+ cmp.w #$006d : !bge + + cmp.w #$006d : !BGE +
lda.w #$0078 : bra ++ lda.w #$0078 : bra ++
+ !add.w #$000b + !ADD.w #$000b
; I think we no longer need the $02 variable ; I think we no longer need the $02 variable
++ sta.b Scrap02 : lda.b Scrap04 : and.w #$0100 : !add.b Scrap02 : bra .setBounds ++ sta.b Scrap02 : lda.b Scrap04 : and.w #$0100 : !ADD.b Scrap02 : bra .setBounds
; layouts where the camera is free ; layouts where the camera is free
.free lda.b Scrap04 : cmp.w #$006c : !bge + .free lda.b Scrap04 : cmp.w #$006c : !BGE +
lda.w #$0077 : bra .setBounds lda.w #$0077 : bra .setBounds
+ cmp.w #$017c : !blt + + cmp.w #$017c : !BLT +
lda.w #$0187 : bra .setBounds lda.w #$0187 : bra .setBounds
+ !add.w #$000b + !ADD.w #$000b
.setBounds sta.w $0618 : inc #2 : sta.w $061a .setBounds sta.w $0618 : inc #2 : sta.w $061a
rts rts
LoadRoomLayout: LoadRoomLayout:
lda.b RoomIndex : asl : !add.b RoomIndex : tax lda.b RoomIndex : asl : !ADD.b RoomIndex : tax
lda.l RoomData_ObjectDataPointers+1, x : sta.b $b8 lda.l RoomData_ObjectDataPointers+1, x : sta.b $b8
lda.l RoomData_ObjectDataPointers, x : sta.b $b7 lda.l RoomData_ObjectDataPointers, x : sta.b $b7
sep #$30 sep #$30
@@ -144,7 +144,7 @@ ScrollX: ;change the X offset variables
lda.b BG2H : and.w #$01ff : sta.b Scrap02 lda.b BG2H : and.w #$01ff : sta.b Scrap02
lda.b Scrap04 : jsr LimitXCamera : sta.b Scrap00 lda.b Scrap04 : jsr LimitXCamera : sta.b Scrap00
jsr CheckRoomLayoutX : bcc + jsr CheckRoomLayoutX : bcc +
lda.b Scrap00 : cmp.w #$0080 : !bge ++ lda.b Scrap00 : cmp.w #$0080 : !BGE ++
lda.w #$0000 : bra .cmpSrll lda.w #$0000 : bra .cmpSrll
++ lda.w #$0100 ++ lda.w #$0100
.cmpSrll sta.b Scrap00 .cmpSrll sta.b Scrap00
@@ -152,18 +152,18 @@ ScrollX: ;change the X offset variables
;figures out scroll amt ;figures out scroll amt
+ lda.b Scrap00 : cmp.b Scrap02 : bne + + lda.b Scrap00 : cmp.b Scrap02 : bne +
lda.w #$0000 : bra .next lda.w #$0000 : bra .next
+ !blt + + !BLT +
!sub.b Scrap02 : inc.b Scrap0E : bra .next !SUB.b Scrap02 : inc.b Scrap0E : bra .next
+ lda.b Scrap02 : !sub.b Scrap00 + lda.b Scrap02 : !SUB.b Scrap00
.next .next
sta.b $ab : lda.b Scrap04 sta.b $ab : lda.b Scrap04
cmp.w #$0078 : !bge + cmp.w #$0078 : !BGE +
lda.w #$007f : bra ++ lda.w #$007f : bra ++
+ cmp.w #$0178 : !blt + + cmp.w #$0178 : !BLT +
lda.w #$017f : bra ++ lda.w #$017f : bra ++
+ !add.w #$0007 + !ADD.w #$0007
++ sta.w $061c : inc #2 : sta.w $061e ++ sta.w $061c : inc #2 : sta.w $061e
pla : sta.b Scrap00 pla : sta.b Scrap00
@@ -181,19 +181,19 @@ ScrollX: ;change the X offset variables
rts rts
LimitXCamera: LimitXCamera:
cmp.w #$0079 : !bge + cmp.w #$0079 : !BGE +
lda.w #$0000 : bra .end lda.w #$0000 : bra .end
+ cmp.w #$0178 : !blt + + cmp.w #$0178 : !BLT +
lda.w #$0178 lda.w #$0178
+ !sub.w #$0078 + !SUB.w #$0078
.end rts .end rts
CheckRoomLayoutX: CheckRoomLayoutX:
jsr LoadRoomLayout ;switches to 8-bit jsr LoadRoomLayout ;switches to 8-bit
cmp.b #$04 : !blt .lock cmp.b #$04 : !BLT .lock
cmp.b #$05 : bne + cmp.b #$05 : bne +
lda.b Scrap06 : cmp.b #$ff : beq .lock lda.b Scrap06 : cmp.b #$ff : beq .lock
+ cmp #$06 : bne .free + cmp.b #$06 : bne .free
lda.b Scrap06 : cmp.b #$ff : bne .lock lda.b Scrap06 : cmp.b #$ff : bne .lock
.free rep #$30 : clc : rts .free rep #$30 : clc : rts
.lock rep #$30 : sec : rts .lock rep #$30 : sec : rts
@@ -202,8 +202,8 @@ ApplyScroll:
rep #$30 rep #$30
lda.b $ab : and.w #$01ff : sta.b Scrap00 lda.b $ab : and.w #$01ff : sta.b Scrap00
lda.b $ab : and.w #$0200 : beq + lda.b $ab : and.w #$0200 : beq +
lda.w $00e2, y : !add.b Scrap00 : bra .end lda.w $00e2, y : !ADD.b Scrap00 : bra .end
+ lda.w $00e2, y : !sub.b Scrap00 + lda.w $00e2, y : !SUB.b Scrap00
.end .end
sta.w $00e2, y sta.w $00e2, y
sta.w $00e0, y sta.w $00e0, y

View File

@@ -2,7 +2,7 @@ RecordStairType: {
pha pha
lda.l DRMode : beq .norm lda.l DRMode : beq .norm
REP #$30 : LDA.b PreviousRoom : CMP.w #$00E1 : BCS .norm REP #$30 : LDA.b PreviousRoom : CMP.w #$00E1 : BCS .norm
CMP #$00DF : BEQ .norm CMP.w #$00DF : BEQ .norm
SEP #$30 SEP #$30
lda.b Scrap0E lda.b Scrap0E
cmp.b #$25 : bcc ++ ; don't record straight staircases cmp.b #$25 : bcc ++ ; don't record straight staircases
@@ -38,42 +38,42 @@ SpiralWarp: {
lda.b Scrap00 : sta.b RoomIndex lda.b Scrap00 : sta.b RoomIndex
; shift quadrant if necessary ; shift quadrant if necessary
stz.b Scrap07 ; this is a x quad adjuster for those blasted staircase on the edges stz.b Scrap07 ; this is a x quad adjuster for those blasted staircase on the edges
lda.b Scrap01 : and.b #$01 : !sub.b LinkQuadrantH lda.b Scrap01 : and.b #$01 : !SUB.b LinkQuadrantH
bne .xQuad bne .xQuad
lda.w $0462 : and.b #$04 : bne .xqCont lda.w $0462 : and.b #$04 : bne .xqCont
inc.b Scrap07 inc.b Scrap07
.xqCont lda.b LinkPosX : bne .skipXQuad ; this is an edge case .xqCont lda.b LinkPosX : bne .skipXQuad ; this is an edge case
dec.b LinkPosX+1 : bra .skipXQuad ; need to -1 if $22 is 0 dec.b LinkPosX+1 : bra .skipXQuad ; need to -1 if $22 is 0
.xQuad sta.b Scrap06 : !add.b LinkQuadrantH : sta.b LinkQuadrantH .xQuad sta.b Scrap06 : !ADD.b LinkQuadrantH : sta.b LinkQuadrantH
lda.w $0462 : and.b #$04 : bne .xCont lda.w $0462 : and.b #$04 : bne .xCont
inc.b Scrap07 ; up stairs are going to -1 the quad anyway during transition, need to add this back inc.b Scrap07 ; up stairs are going to -1 the quad anyway during transition, need to add this back
.xCont ldy.b #$00 : jsr ShiftQuadSimple .xCont ldy.b #$00 : jsr ShiftQuadSimple
.skipXQuad .skipXQuad
lda.b LinkQuadrantV : lsr : sta.b Scrap06 : lda.b Scrap01 : and.b #$02 : lsr : !sub.b Scrap06 lda.b LinkQuadrantV : lsr : sta.b Scrap06 : lda.b Scrap01 : and.b #$02 : lsr : !SUB.b Scrap06
beq .skipYQuad beq .skipYQuad
sta.b Scrap06 : asl : !add.b LinkQuadrantV : sta.b LinkQuadrantV sta.b Scrap06 : asl : !ADD.b LinkQuadrantV : sta.b LinkQuadrantV
ldy.b #$01 : jsr ShiftQuadSimple ldy.b #$01 : jsr ShiftQuadSimple
.skipYQuad .skipYQuad
lda.b Scrap01 : and.b #$04 : lsr : sta.w $048a ;fix layer calc 0->0 2->1 lda.b Scrap01 : and.b #$04 : lsr : sta.w $048a ;fix layer calc 0->0 2->1
lda.b Scrap01 : and.b #$08 : lsr #2 : sta.w $0492 ;fix from layer calc 0->0 2->1 lda.b Scrap01 : and.b #$08 : lsr #2 : sta.w $0492 ;fix from layer calc 0->0 2->1
; shift lower coordinates ; shift lower coordinates
lda.b Scrap02 : sta.b LinkPosX : bne .adjY : lda.b LinkPosX+1 : !add.b Scrap07 : sta.b LinkPosX+1 lda.b Scrap02 : sta.b LinkPosX : bne .adjY : lda.b LinkPosX+1 : !ADD.b Scrap07 : sta.b LinkPosX+1
.adjY lda.b Scrap03 : sta.b LinkPosY : bne .upDownAdj : inc.b LinkPosY+1 .adjY lda.b Scrap03 : sta.b LinkPosY : bne .upDownAdj : inc.b LinkPosY+1
.upDownAdj ldx.b #$08 .upDownAdj ldx.b #$08
lda.w $0462 : and.b #$04 : beq .upStairs lda.w $0462 : and.b #$04 : beq .upStairs
ldx.b #$fd ldx.b #$fd
lda.b Scrap01 : and.b #$80 : bne .set53 lda.b Scrap01 : and.b #$80 : bne .set53
; if target is also down adjust by (6,-15) ; if target is also down adjust by (6,-15)
lda.b #$06 : !add.b LinkPosY : sta.b LinkPosY : lda.b #$eb : !add.b LinkPosX : sta.b LinkPosX : bra .set53 lda.b #$06 : !ADD.b LinkPosY : sta.b LinkPosY : lda.b #$eb : !ADD.b LinkPosX : sta.b LinkPosX : bra .set53
.upStairs .upStairs
lda.b Scrap01 : and.b #$80 : beq .set53 lda.b Scrap01 : and.b #$80 : beq .set53
; if target is also up adjust by (-6, 14) ; if target is also up adjust by (-6, 14)
lda.b #$fa : !add.b LinkPosY : sta.b LinkPosY : lda.b #$14 : !add.b LinkPosX : sta.b LinkPosX lda.b #$fa : !ADD.b LinkPosY : sta.b LinkPosY : lda.b #$14 : !ADD.b LinkPosX : sta.b LinkPosX
bne .set53 : inc.b LinkPosX+1 bne .set53 : inc.b LinkPosX+1
.set53 .set53
txa : !add.b LinkPosX : sta.b $53 txa : !ADD.b LinkPosX : sta.b $53
lda.b Scrap01 : and.b #$10 : sta.b Scrap07 ; zeroHzCam check lda.b Scrap01 : and.b #$10 : sta.b Scrap07 ; zeroHzCam check
ldy.b #$00 : jsr SetCamera ldy.b #$00 : jsr SetCamera
@@ -90,7 +90,7 @@ StairCleanup: {
stz.w $045e ; clear the staircase flag stz.w $045e ; clear the staircase flag
; animated tiles fix ; animated tiles fix
lda.l DRMode : cmp #$02 : bne + ; only do this in crossed mode lda.l DRMode : cmp.b #$02 : bne + ; only do this in crossed mode
ldx.b RoomIndex : lda.l TilesetTable, x ldx.b RoomIndex : lda.l TilesetTable, x
cmp.w $0aa1 : beq + ; already eq no need to decomp cmp.w $0aa1 : beq + ; already eq no need to decomp
sta.w $0aa1 sta.w $0aa1
@@ -154,7 +154,7 @@ LookupSpiralOffset: {
.done .done
lda.b PreviousRoom : tax : lda.w SpiralOffset,x lda.b PreviousRoom : tax : lda.w SpiralOffset,x
!add.b Scrap01 ;add a thing (0 in easy case) !ADD.b Scrap01 ;add a thing (0 in easy case)
rts rts
} }
@@ -202,7 +202,7 @@ InroomStairsWarp: {
lda.w InroomStairsX,y : sta.b LinkPosX lda.w InroomStairsX,y : sta.b LinkPosX
lda.w InroomStairsY,y lda.w InroomStairsY,y
ldy.b Scrap07 : beq + ldy.b Scrap07 : beq +
!add #$07 !ADD.b #$07
+ +
sta.b LinkPosY sta.b LinkPosY
inc.b Scrap07 inc.b Scrap07
@@ -228,7 +228,7 @@ InroomStairsWarp: {
++ sta.b LinkPosY ++ sta.b LinkPosY
inc.b Scrap07 : stz.b Scrap02 : lda.b #$78 : sta.b LinkPosX inc.b Scrap07 : stz.b Scrap02 : lda.b #$78 : sta.b LinkPosX
lda.b Scrap01 : and.b #$03 : beq ++ lda.b Scrap01 : and.b #$03 : beq ++
cmp.b #$02 : !bge + cmp.b #$02 : !BGE +
lda.b #$f8 : sta.b LinkPosX : stz.b Scrap07 : bra ++ lda.b #$f8 : sta.b LinkPosX : stz.b Scrap07 : bra ++
+ inc.b Scrap02 + inc.b Scrap02
++ ++
@@ -240,14 +240,14 @@ InroomStairsWarp: {
stz.w $0476 stz.w $0476
+ +
lda.b Scrap02 : !sub.b LinkQuadrantH lda.b Scrap02 : !SUB.b LinkQuadrantH
beq .skipXQuad beq .skipXQuad
sta.b Scrap06 : !add.b LinkQuadrantH : sta.b LinkQuadrantH sta.b Scrap06 : !ADD.b LinkQuadrantH : sta.b LinkQuadrantH
ldy.b #$00 : jsr ShiftQuadSimple ldy.b #$00 : jsr ShiftQuadSimple
.skipXQuad .skipXQuad
lda.b LinkQuadrantV : lsr : sta.b Scrap06 : lda.b Scrap03 : !sub.b Scrap06 lda.b LinkQuadrantV : lsr : sta.b Scrap06 : lda.b Scrap03 : !SUB.b Scrap06
beq .skipYQuad beq .skipYQuad
sta.b Scrap06 : asl : !add.b LinkQuadrantV : sta.b LinkQuadrantV sta.b Scrap06 : asl : !ADD.b LinkQuadrantV : sta.b LinkQuadrantV
ldy.b #$01 : jsr ShiftQuadSimple ldy.b #$01 : jsr ShiftQuadSimple
.skipYQuad .skipYQuad
@@ -268,11 +268,11 @@ InroomStairsWarp: {
ShiftQuadSimple: { ShiftQuadSimple: {
lda.w CoordIndex,y : tax lda.w CoordIndex,y : tax
lda.b LinkPosY,x : beq .skip lda.b LinkPosY,x : beq .skip
lda.b LinkPosY+1,x : !add.b Scrap06 : sta.b LinkPosY+1,x ; coordinate update lda.b LinkPosY+1,x : !ADD.b Scrap06 : sta.b LinkPosY+1,x ; coordinate update
.skip .skip
lda.w CamQuadIndex,y : tax lda.w CamQuadIndex,y : tax
lda.w $0601,x : !add.b Scrap06 : sta.w $0601,x lda.w $0601,x : !ADD.b Scrap06 : sta.w $0601,x
lda.w $0605,x : !add.b Scrap06 : sta.w $0605,x ; high bytes of these guys lda.w $0605,x : !ADD.b Scrap06 : sta.w $0605,x ; high bytes of these guys
rts rts
} }
@@ -288,8 +288,8 @@ SetCamera: {
lda.w CoordIndex,y : tax lda.w CoordIndex,y : tax
lda.b LinkPosY,x : beq .oddQuad lda.b LinkPosY,x : beq .oddQuad
cmp.b #$79 : bcc .adj0 cmp.b #$79 : bcc .adj0
!sub.b #$78 : sta.b Scrap04 !SUB.b #$78 : sta.b Scrap04
tya : asl : !add.b #$04 : tax : jsr AdjCamBounds : bra .done tya : asl : !ADD.b #$04 : tax : jsr AdjCamBounds : bra .done
.oddQuad .oddQuad
lda.b #$80 : sta.b Scrap04 : bra .adj1 ; this is such a weird case - quad cross boundary lda.b #$80 : sta.b Scrap04 : bra .adj1 ; this is such a weird case - quad cross boundary
.adj0 .adj0
@@ -299,16 +299,16 @@ SetCamera: {
lda.b Scrap07 : bne .setQuad lda.b Scrap07 : bne .setQuad
lda.w CoordIndex,y : tax lda.w CoordIndex,y : tax
lda.b LinkPosY,x : cmp.b #$78 : bcs .setQuad lda.b LinkPosY,x : cmp.b #$78 : bcs .setQuad
!add.b #$78 : sta.b Scrap04 !ADD.b #$78 : sta.b Scrap04
lda.w CamQuadIndex,y : tax : lda.w $0603, x : pha lda.w CamQuadIndex,y : tax : lda.w $0603, x : pha
lda.w CameraIndex,y : tax : pla : sta.b BG2H+1, x lda.w CameraIndex,y : tax : pla : sta.b BG2H+1, x
.adj1 .adj1
tya : asl : !add.b #$08 : tax : jsr AdjCamBounds : bra .done tya : asl : !ADD.b #$08 : tax : jsr AdjCamBounds : bra .done
.setQuad .setQuad
lda.w CamQuadIndex,y : tax : lda.w $0607, x : pha lda.w CamQuadIndex,y : tax : lda.w $0607, x : pha
lda.w CameraIndex,y : tax : pla : sta.b BG2H+1, x lda.w CameraIndex,y : tax : pla : sta.b BG2H+1, x
tya : asl : !add.b #$0c : tax : jsr AdjCamBounds : bra .done tya : asl : !ADD.b #$0c : tax : jsr AdjCamBounds : bra .done
.done .done
lda.w CameraIndex,y : tax lda.w CameraIndex,y : tax
@@ -322,7 +322,7 @@ AdjCamBounds: {
rep #$20 : lda.w CamBoundBaseLine, x : sta.b Scrap05 rep #$20 : lda.w CamBoundBaseLine, x : sta.b Scrap05
lda.b Scrap04 : and.w #$00ff : beq .common lda.b Scrap04 : and.w #$00ff : beq .common
lda.w CoordIndex,y : tax lda.w CoordIndex,y : tax
lda.b LinkPosY, x : and.w #$00ff : !add.b Scrap05 : sta.b Scrap05 lda.b LinkPosY, x : and.w #$00ff : !ADD.b Scrap05 : sta.b Scrap05
.common .common
lda.w OppCamBoundIndex,y : tax lda.w OppCamBoundIndex,y : tax
lda.b Scrap05 : sta.w CameraScrollN, x lda.b Scrap05 : sta.w CameraScrollN, x

View File

@@ -103,7 +103,7 @@ SetCutsceneFlag:
PHX PHX
LDY.b #$01 ; wrote over LDY.b #$01 ; wrote over
LDA.w DungeonID : BMI .no_cutscene LDA.w DungeonID : BMI .no_cutscene
LDA.w RoomItemsTaken : BIT #$80 : BNE .dungeon_prize LDA.w RoomItemsTaken : BIT.b #$80 : BNE .dungeon_prize
.no_cutscene .no_cutscene
SEP #$30 SEP #$30
PLX PLX
@@ -124,7 +124,7 @@ AnimatePrizeCutscene:
LDA.w ItemReceiptMethod : CMP.b #$03 : BNE + LDA.w ItemReceiptMethod : CMP.b #$03 : BNE +
JSR CrystalOrPendantBehavior : BCC + JSR CrystalOrPendantBehavior : BCC +
LDA.w DungeonID : BMI + LDA.w DungeonID : BMI +
LDA.w RoomItemsTaken : BIT #$80 : BEQ + LDA.w RoomItemsTaken : BIT.b #$80 : BEQ +
SEC SEC
RTL RTL
+ +
@@ -141,7 +141,7 @@ PrizeDropSparkle:
RTL RTL
HandleDropSFX: HandleDropSFX:
LDA.w RoomItemsTaken : BIT #$80 : BEQ .no_sound LDA.w RoomItemsTaken : BIT.b #$80 : BEQ .no_sound
JSR CrystalOrPendantBehavior : BCC .no_sound JSR CrystalOrPendantBehavior : BCC .no_sound
SEC SEC
RTL RTL
@@ -161,7 +161,7 @@ RTL
MaybeKeepLootID: MaybeKeepLootID:
PHA PHA
LDA.w DungeonID : BMI .no_prize LDA.w DungeonID : BMI .no_prize
LDA.w RoomItemsTaken : BIT #$80 : BNE .prize LDA.w RoomItemsTaken : BIT.b #$80 : BNE .prize
.no_prize .no_prize
STZ.w ItemReceiptID STZ.w ItemReceiptID
STZ.w ItemReceiptPose STZ.w ItemReceiptPose

View File

@@ -25,7 +25,7 @@ DoDungeonMapBossIcon:
; get first byte to make sure it isn't an empty room ; get first byte to make sure it isn't an empty room
SEP #$20 SEP #$20
LDA.b [$00], Y LDA.b [Scrap00], Y
CMP.b #$FF CMP.b #$FF
BNE ++ BNE ++
@@ -34,7 +34,7 @@ DoDungeonMapBossIcon:
; check first sprite ; check first sprite
++ INY #2 ++ INY #2
LDA.b [$00], Y LDA.b [Scrap00], Y
SEP #$10 SEP #$10
; match boss id ; match boss id
@@ -99,13 +99,13 @@ DoDungeonMapBossIcon:
STA.w DAS1L STA.w DAS1L
LDX.b #$02 LDX.b #$02
STX.w MDMAEN STX.w DMAENABLE
STA.w DAS1L STA.w DAS1L
LDA.w #$A260>>1 LDA.w #$A260>>1
STA.w VMADDL STA.w VMADDL
STX.w MDMAEN STX.w DMAENABLE
; done ; done
SEP #$30 SEP #$30

View File

@@ -10,10 +10,10 @@ NMIHookActionEnemizer:
LDA.l !SHELL_DMA_FLAG : BEQ .return ; check our draw flag LDA.l !SHELL_DMA_FLAG : BEQ .return ; check our draw flag
AND.b #$01 : BNE .loadKholdstare AND.b #$01 : BNE .loadKholdstare
LDA.l !SHELL_DMA_FLAG : AND #$02 : BNE .loadTrinexx LDA.l !SHELL_DMA_FLAG : AND.b #$02 : BNE .loadTrinexx
BRA .return ; just in case BRA .return ; just in case
;BIT #$01 : BEQ .loadKholdstare ;BIT.b #$01 : BEQ .loadKholdstare
;BIT #$02 : BEQ .loadTrinexx ;BIT.b #$02 : BEQ .loadTrinexx
.loadKholdstare .loadKholdstare
JSL DMAKholdstare JSL DMAKholdstare

View File

@@ -15,7 +15,7 @@ pullpc
check_blind_boss_room: check_blind_boss_room:
LDA.b RoomIndex ; load room index (low byte) LDA.b RoomIndex ; load room index (low byte)
CMP.b #172 : BNE + ; Is is Thieves Town Boss Room CMP.b #$AC : BNE + ; Is is Thieves Town Boss Room
LDA.l !BLIND_DOOR_FLAG : BNE + ; Blind maiden does not need rescuing LDA.l !BLIND_DOOR_FLAG : BNE + ; Blind maiden does not need rescuing
LDA.l FollowerIndicator : JML Check_for_Blind_Fight LDA.l FollowerIndicator : JML Check_for_Blind_Fight

View File

@@ -57,10 +57,10 @@ boss_move:
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
;Close the door if !BLIND_DOOR_FLAG == 1 ;Close the door if !BLIND_DOOR_FLAG == 1
LDA.l !BLIND_DOOR_FLAG : BEQ .no_blind_door LDA.l !BLIND_DOOR_FLAG : BEQ .no_blind_door
INC.w $0468 ; $0468[0x02] - Flag that is set when trap doors are down. INC.w TrapDoorFlag
STZ.w $068E ; $068E[0x02] - (Dungeon) ???? related to trap doors and if they are open ; possibly bomb doors too? Update: module 0x07.0x4 probably uses this to know whether it's a key door or big key door to open. STZ.w TileMapDoorPos
STZ.w $0690 ; $0690[0x02] - (Overworld) Generally is used as an animation step indicator, only for doors that animate when they open, such as the Santuary and Hyrule Castle doors. This variable is incremented up to a value of 3, at which point a logic check kicks in and stops animating the opening of a door. STZ.w DoorTimer
INC.w $0CF3 ; $0CF3[0x01] - free ram INC.w BossSpecialAction
; ;That must be called after the room load! ; ;That must be called after the room load!
.no_blind_door .no_blind_door
BRL .move_to_bottom_right BRL .move_to_bottom_right

View File

@@ -1,6 +1,6 @@
org $8780CA ; Bank07.asm(179) org $8780CA ; Bank07.asm(179)
JSL CheckIfLinkShouldDie : NOP : NOP : NOP JSL CheckIfLinkShouldDie : NOP : NOP : NOP
;SEC : SBC.b $00 : CMP #$00 : BEQ .linkIsDead ; Bank07.asm(179) - ;SEC : SBC.b Scrap00 : CMP.b #$00 : BEQ .linkIsDead ; Bank07.asm(179) -
org $8780D1 org $8780D1
BNE linkNotDead : NOP : NOP ; Bank07.asm(183) - CMP.b #$A8 : BCC .linkNotDead BNE linkNotDead : NOP : NOP ; Bank07.asm(183) - CMP.b #$A8 : BCC .linkNotDead

View File

@@ -3,8 +3,8 @@
org $9DD88E org $9DD88E
{ {
; original: GiantMoldorm_Draw+5lines (sprite_giant_moldorm.asm) ; original: GiantMoldorm_Draw+5lines (sprite_giant_moldorm.asm)
; lda.b $90 : add.w #$0008 : sta.b $90 ; lda.b OAMPtr : add.w #$0008 : sta.b OAMPtr
; INC.b $92 : INC.b $92 ; INC.b OAMPtr+2 : INC.b OAMPtr+2
JSL Moldorm_UpdateOamPosition JSL Moldorm_UpdateOamPosition
NOP #08 NOP #08

View File

@@ -13,36 +13,36 @@ org $89C50B ; 0x4C50B
} }
org $89C510 ; 0x4C510 org $89C510 ; 0x4C510
LDA.b [$00], Y ; replace LDA ($00), Y LDA.b [Scrap00], Y ; replace LDA ($00), Y
; CMP.b #$FF : BEQ .stopLoading ; CMP.b #$FF : BEQ .stopLoading
; INY #2 ; INY #2
org $89C518 ; 0x4C518 org $89C518 ; 0x4C518
LDA.b [$00], Y ; replace LDA ($00), Y LDA.b [Scrap00], Y ; replace LDA ($00), Y
; DEY #2 : CMP.b #$F4 : BNE .notFallingRocks ; DEY #2 : CMP.b #$F4 : BNE .notFallingRocks
; INC.w $0FFD ; INC.w $0FFD
; INY #3 ; INY #3
; BRA .nextSprite ; BRA .nextSprite
; .notFallingRocks ; Anything other than falling rocks. ; .notFallingRocks ; Anything other than falling rocks.
org $89C528 ; 0x4C528 org $89C528 ; 0x4C528
LDA.b [$00], Y ; replace LDA ($00), Y LDA.b [Scrap00], Y ; replace LDA ($00), Y
; PHA : LSR #4 : ASL #2 : ; PHA : LSR #4 : ASL #2 :
org $89C531 ; 0x4C531 org $89C531 ; 0x4C531
STA.b Scrap0A ; STA.b $02 STA.b Scrap0A ; STA.b $02
; INY ; INY
org $89C534 ; 0x4C534 org $89C534 ; 0x4C534
LDA.b [$00], Y ; replace LDA ($00), Y LDA.b [Scrap00], Y ; replace LDA ($00), Y
; LSR #4 : CLC ; LSR #4 : CLC
org $89C53B ; 0x4C53B org $89C53B ; 0x4C53B
ADC.b Scrap0A ; ADC.b $02 ADC.b Scrap0A ; ADC.b $02
; STA.b $06 ; STA.b $06
; PLA : ASL #4 : STA.b $07 ; PLA : ASL #4 : STA.b $07
org $89C546 ; 0x4C546 org $89C546 ; 0x4C546
LDA.b [$00], Y ; replace LDA ($00), Y LDA.b [Scrap00], Y ; replace LDA ($00), Y
; AND.b #$0F : ORA.b $07 : STA.b $05 ; AND.b #$0F : ORA.b $07 : STA.b $05
; INY ; INY
org $89C54F ; 0x4C54F org $89C54F ; 0x4C54F
LDA.b [$00], Y ; replace LDA ($00), Y LDA.b [Scrap00], Y ; replace LDA ($00), Y
; LDX.b $05 : INC A : STA.l $7FDF80, X ; LDX.b Scrap05 : INC A : STA.l $7FDF80, X
; ; $4C558- ; ; $4C558-
; ; Move on to the next sprite / overlord. ; ; Move on to the next sprite / overlord.

View File

@@ -6,25 +6,25 @@ JSL LoadUnderworldSprites : NOP
; also needs to change the use of $02 to $03 for slot index to make that possible ; also needs to change the use of $02 to $03 for slot index to make that possible
org $89C2B2 org $89C2B2
LDA.b [$00] LDA.b [Scrap00]
org $89C2C1 org $89C2C1
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C2CA org $89C2CA
INC.b Scrap03 ; change slot variable to $03 INC.b Scrap03 ; change slot variable to $03
;org $09C329 standing items overwrote this one ;org $09C329 standing items overwrote this one
;LDA.b [$00],Y ;LDA.b [Scrap00],Y
org $89C332 org $89C332
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C345 org $89C345
DEC.b Scrap03 : LDX.b Scrap03 DEC.b Scrap03 : LDX.b Scrap03
org $89C350 org $89C350
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C35A org $89C35A
DEC.b Scrap03 DEC.b Scrap03
@@ -36,31 +36,31 @@ org $89C383
LDX.b Scrap03 LDX.b Scrap03
org $89C38C org $89C38C
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C398 org $89C398
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C3AA org $89C3AA
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C3BF org $89C3BF
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C3DF org $89C3DF
LDA.b Scrap03 LDA.b Scrap03
org $89C3F3 org $89C3F3
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C3FB org $89C3FB
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C404 org $89C404
LDA.b [$00],Y LDA.b [Scrap00],Y
org $89C416 org $89C416
LDA.b [$00],Y LDA.b [Scrap00],Y

View File

@@ -2,7 +2,7 @@ pushpc
org $9EC147 org $9EC147
JSL NewKodongoCollision JSL NewKodongoCollision
JMP.w .continue : NOP #2 JMP .continue : NOP #2
.continue .continue
org $9EC152 org $9EC152

View File

@@ -2,13 +2,6 @@
lorom lorom
;================================================================================
!ADD = "CLC : ADC"
!SUB = "SEC : SBC"
!BLT = "BCC"
!BGE = "BCS"
;=Constants====================================================================== ;=Constants======================================================================
!BUSHES_FLAG = "$368100" !BUSHES_FLAG = "$368100"

View File

@@ -58,7 +58,7 @@ SpritePrep_EyegoreNew:
.mimic .mimic
SBC.b #$6C : STA.w SpriteTypeTable, X : JSL SpritePrep_LoadProperties ; pretending to be $83 or $84 SBC.b #$6C : STA.w SpriteTypeTable, X : JSL SpritePrep_LoadProperties ; pretending to be $83 or $84
JSL SpritePrep_Eyegore_become_mimic JSL SpritePrep_Eyegore_become_mimic
; LDA.w SpriteTypeTable, X : ADC #$6C : STA.w SpriteTypeTable, X ; set the sprite back to special mimic ; LDA.w SpriteTypeTable, X : ADC.b #$6C : STA.w SpriteTypeTable, X ; set the sprite back to special mimic
; todo? unsure about this code - seems unnecessary ; todo? unsure about this code - seems unnecessary
; LDA.w $0CAA, X : AND.b #$FB : ORA.b #$80 : STA.w $0CAA, X ; STZ.w $0CAA, X ; LDA.w $0CAA, X : AND.b #$FB : ORA.b #$80 : STA.w $0CAA, X ; STZ.w $0CAA, X
RTL RTL

View File

@@ -4,8 +4,8 @@ Moldorm_UpdateOamPosition:
LDA.l !MOLDORM_EYES_FLAG : TAX LDA.l !MOLDORM_EYES_FLAG : TAX
.more_eyes .more_eyes
LDA.b $90 : CLC : ADC.w #$0004 : STA.b $90 LDA.b OAMPtr : CLC : ADC.w #$0004 : STA.b OAMPtr
LDA.b $92 : CLC : ADC.w #$0001 : STA.b $92 LDA.b OAMPtr+2 : CLC : ADC.w #$0001 : STA.b OAMPtr+2
DEX : BPL .more_eyes ; X >= 0 DEX : BPL .more_eyes ; X >= 0
PLX PLX

View File

@@ -3,9 +3,9 @@
;================================================================================ ;================================================================================
check_special_action: check_special_action:
{ {
LDA.w $0CF3 : BEQ .no_special_action LDA.w BossSpecialAction : BEQ .no_special_action
LDA.b #$05 : STA.b GameSubMode ; $11[0x01] - (Main) Submodule Index (See $B0) LDA.b #$05 : STA.b GameSubMode
STZ.w $0CF3 ; $0CF3[0x01] - free ram STZ.w BossSpecialAction
.no_special_action .no_special_action
JSL Player_Main JSL Player_Main
RTL RTL

View File

@@ -87,7 +87,7 @@ AllowStartFromSingleEntranceCave:
+ +
DEC DEC
STA.b Scrap00 STA.b Scrap00
ASL #2 : !ADD Scrap00 : ASL #2 ; mult by 20 ASL #2 : !ADD.l Scrap00 : ASL #2 ; mult by 20
TAX TAX
LDA.w #$0016 : STA.l EN_MAINDESQ ; Cache the main screen designation LDA.w #$0016 : STA.l EN_MAINDESQ ; Cache the main screen designation

View File

@@ -27,7 +27,7 @@ DontUseZSNES:
LDA.b #$00 LDA.b #$00
STA.l NMITIMEN ; disable NMI and IRQ STA.l NMITIMEN ; disable NMI and IRQ
STA.l HDMAEN ; disable HDMA STA.l HDMAENABLE ; disable HDMA
ROR ; A = 0x80 from carry ROR ; A = 0x80 from carry
STA.l INIDISP STA.l INIDISP
@@ -48,7 +48,7 @@ DontUseZSNES:
STA.l DAS0L STA.l DAS0L
LDA.w #$0001 LDA.w #$0001
STA.l MDMAEN STA.l DMAENABLE
JSR ConfigurePPUForFailureReport JSR ConfigurePPUForFailureReport
JSR ConfigureBSODVWF JSR ConfigureBSODVWF
@@ -93,7 +93,7 @@ Crashed:
LDA.b #$00 LDA.b #$00
STA.l NMITIMEN ; disable NMI and IRQ STA.l NMITIMEN ; disable NMI and IRQ
STA.l HDMAEN ; disable HDMA STA.l HDMAENABLE ; disable HDMA
ROR ; A = 0x80 from carry ROR ; A = 0x80 from carry
STA.l INIDISP STA.l INIDISP
@@ -114,7 +114,7 @@ Crashed:
STA.l DAS0L STA.l DAS0L
LDA.w #$0001 LDA.w #$0001
STA.l MDMAEN STA.l DMAENABLE
;=================================================================================================== ;===================================================================================================
@@ -312,7 +312,7 @@ DrawVWFMessage:
STZ.w A1B0 STZ.w A1B0
LDA.b #$01 LDA.b #$01
STA.w MDMAEN STA.w DMAENABLE
REP #$20 REP #$20
@@ -376,7 +376,7 @@ DrawFailureVWFChar:
LDY.w #$0000 LDY.w #$0000
.next_row .next_row
LDA.b ($08),Y LDA.b (Scrap08),Y
AND.w #$00FF AND.w #$00FF
XBA XBA
LDX.w VWFS LDX.w VWFS
@@ -427,7 +427,7 @@ LoadBSODHexFont:
STA.w A1B0 STA.w A1B0
LDA.b #$01 LDA.b #$01
STA.w MDMAEN STA.w DMAENABLE
REP #$30 REP #$30

View File

@@ -23,12 +23,12 @@ macro fs_draw16x8(screenrow,screencol)
endmacro endmacro
macro fs_draw8x16(screenrow,screencol) macro fs_draw8x16(screenrow,screencol)
%fs_draw8x8(<screenrow>,<screencol>) %fs_draw8x8(<screenrow>,<screencol>)
!ADD #$0010 !ADD.w #$0010
%fs_draw8x8(<screenrow>+1,<screencol>) %fs_draw8x8(<screenrow>+1,<screencol>)
endmacro endmacro
macro fs_draw16x16(screenrow,screencol) macro fs_draw16x16(screenrow,screencol)
%fs_draw16x8(<screenrow>,<screencol>) %fs_draw16x8(<screenrow>,<screencol>)
!ADD #$000F !ADD.w #$000F
%fs_draw16x8(<screenrow>+1,<screencol>) %fs_draw16x8(<screenrow>+1,<screencol>)
endmacro endmacro
@@ -771,7 +771,7 @@ LoadFullItemTiles:
LDA.b #FileSelectNewGraphics>>16 : STA.w A1B0 LDA.b #FileSelectNewGraphics>>16 : STA.w A1B0
LDX.w #FileSelectNewGraphics : STX.w A1T0L LDX.w #FileSelectNewGraphics : STX.w A1T0L
LDX.w #$0C00 : STX.w DAS0L LDX.w #$0C00 : STX.w DAS0L
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; z colon @ ; z colon @
@@ -788,7 +788,7 @@ LoadLowerCaseLettersSymbols:
LDX.w #NewFont+$400 : STX.w A1T0L LDX.w #NewFont+$400 : STX.w A1T0L
LDX.w #$0400 : STX.w DAS0L LDX.w #$0400 : STX.w DAS0L
LDX.w #$2D00 : STX.w VMADDL LDX.w #$2D00 : STX.w VMADDL
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
; : @ # ; : @ #
LDA.b #NewFont>>16 : STA.w A1B0 LDA.b #NewFont>>16 : STA.w A1B0
@@ -798,9 +798,9 @@ LoadLowerCaseLettersSymbols:
LDX.w #$0030 : STX.w DAS0L : STX.w DAS1L LDX.w #$0030 : STX.w DAS0L : STX.w DAS1L
LDX.w #$2E50 : STX.w VMADDL LDX.w #$2E50 : STX.w VMADDL
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
LDX.w #$2ED0 : STX.w VMADDL LDX.w #$2ED0 : STX.w VMADDL
LDA.b #$02 : STA.w MDMAEN LDA.b #$02 : STA.w DMAENABLE
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadFileSelectVanillaItems: LoadFileSelectVanillaItems:
@@ -814,7 +814,7 @@ LoadFileSelectVanillaItems:
LDX.w #DecompBuffer2 : STX.w A1T0L LDX.w #DecompBuffer2 : STX.w A1T0L
LDX.w #$0600 : STX.w DAS0L LDX.w #$0600 : STX.w DAS0L
LDX.w #$2F00 : STX.w VMADDL LDX.w #$2F00 : STX.w VMADDL
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
SEP #$10 SEP #$10
RTL RTL

View File

@@ -24,15 +24,15 @@ RTL
NMIHookAction: NMIHookAction:
PHA : PHX : PHY : PHD ; thing we wrote over, push stuff PHA : PHX : PHY : PHD ; thing we wrote over, push stuff
LDA !NMI_MW : BEQ ++ LDA.l !NMI_MW : BEQ ++
PHP PHP
SEP #$30 SEP #$30
LDA #$00 : STA !NMI_MW LDA.b #$00 : STA.l !NMI_MW
; Multiworld text ; Multiworld text
LDA !NMI_MW+1 : BEQ + LDA.l !NMI_MW+1 : BEQ +
LDA #$00 : STA !NMI_MW+1 LDA.b #$00 : STA.l !NMI_MW+1
JSL WriteText JSL WriteText
+ +
PLP PLP

View File

@@ -62,12 +62,12 @@ CheckGanonVulnerability:
.all_dungeons_no_agahnim .all_dungeons_no_agahnim
LDA.l PendantsField : AND.b #$07 : CMP.b #$07 : BNE .fail ; require all pendants LDA.l PendantsField : AND.b #$07 : CMP.b #$07 : BNE .fail ; require all pendants
LDA.l CrystalsField : AND.b #$7F : CMP.b #$7F : BNE .fail ; require all crystals LDA.l CrystalsField : AND.b #$7F : CMP.b #$7F : BNE .fail ; require all crystals
LDA RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; require aga2 defeated (pyramid hole open) LDA.l RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; require aga2 defeated (pyramid hole open)
BRA .success BRA .success
; 03 = crystals and aga 2 ; 03 = crystals and aga 2
.crystals_and_aga .crystals_and_aga
LDA RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; check aga2 first then bleed in LDA.l RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; check aga2 first then bleed in
; 04 = crystals only ; 04 = crystals only
.crystals .crystals

View File

@@ -100,7 +100,7 @@ SearchAncilla:
LDX.b #$00 LDX.b #$00
.loop .loop
LDA.w AncillaID, X LDA.w AncillaID, X
INX : CPX #$0A : BEQ .notFound INX : CPX.b #$0A : BEQ .notFound
CMP.b Scrap05 : BNE .loop CMP.b Scrap05 : BNE .loop
LDA.b #$01 LDA.b #$01
BRA .return BRA .return

View File

@@ -78,7 +78,7 @@ DMAAlphabetTilemap:
LDA.b #BigRAM>>16 : STA.w A1B0 LDA.b #BigRAM>>16 : STA.w A1B0
LDX.w #BigRAM : STX.w A1T0L LDX.w #BigRAM : STX.w A1T0L
LDX.w #$0080 : STX.w DAS0L LDX.w #$0080 : STX.w DAS0L
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
SEP #$10 SEP #$10
PLX : PLA PLX : PLA
RTS RTS

View File

@@ -145,40 +145,39 @@ HeartContainerSpritePrep:
+ JML RequestStandingItemVRAMSlot + JML RequestStandingItemVRAMSlot
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadHeartPieceRoomValue: LoadHeartPieceRoomValue:
LDA.b IndoorsFlag : BEQ .outdoors ; check if we're indoors or outdoors LDA.b IndoorsFlag : BEQ .outdoors ; check if we're indoors or outdoors
.indoors .indoors
JSL LoadIndoorValue JSL LoadIndoorValue
JMP .done JMP .done
.outdoors .outdoors
JSL LoadOutdoorValue JSL LoadOutdoorValue
.done .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!DynamicDropGFXSlotCount_UW = (FreeUWGraphics_end-FreeUWGraphics)>>1 !DynamicDropGFXSlotCount_UW = (FreeUWGraphics_end-FreeUWGraphics)>>1
!DynamicDropGFXSlotCount_OW = (FreeOWGraphics_end-FreeOWGraphics)>>1 !DynamicDropGFXSlotCount_OW = (FreeOWGraphics_end-FreeOWGraphics)>>1
HPItemReset: HPItemReset:
PHA PHA
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
PLA PLA
JSL GiveRupeeGift ; thing we wrote over JSL GiveRupeeGift ; thing we wrote over
BRA .done BRA .done
.skip .skip
PLA PLA
.done .done
PHA PHA
JSL HeartPieceSetRedraw JSL HeartPieceSetRedraw
PLA PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MaybeMarkDigSpotCollected: MaybeMarkDigSpotCollected:
PHA : PHP PHA : PHP
LDA.b IndoorsFlag : BNE + LDA.b IndoorsFlag : BNE +
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.b OverworldIndex LDA.b OverworldIndex : CMP.w #$002A : BNE +
CMP.w #$2A : BNE + LDA.l HasGroveItem : ORA.w #$0001 : STA.l HasGroveItem
LDA.l HasGroveItem : ORA.w #$0001 : STA.l HasGroveItem +
+ PLP : PLA
PLP : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartPieceSpawnDelayFix: HeartPieceSpawnDelayFix:
@@ -189,22 +188,22 @@ HeartPieceSpawnDelayFix:
+ CLC : RTL + CLC : RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
macro GetPossiblyEncryptedItem(ItemLabel,TableLabel) macro GetPossiblyEncryptedItem(ItemLabel,TableLabel)
LDA.l IsEncrypted : BNE ?encrypted LDA.l IsEncrypted : BNE ?encrypted
LDA.l <ItemLabel> LDA.l <ItemLabel>
BRA ?done BRA ?done
?encrypted: ?encrypted:
PHX : PHP PHX : PHP
REP #$30 ; set 16-bit accumulator & index registers REP #$30 ; set 16-bit accumulator & index registers
LDA.b Scrap00 : PHA : LDA.b Scrap02 : PHA LDA.b Scrap00 : PHA : LDA.b Scrap02 : PHA
LDA.w #<TableLabel> : STA.b Scrap00 LDA.w #<TableLabel> : STA.b Scrap00
LDA.w #<TableLabel>>>16 : STA.b Scrap02 LDA.w #<TableLabel>>>16 : STA.b Scrap02
LDA.w #<ItemLabel>-<TableLabel> LDA.w #<ItemLabel>-<TableLabel>
JSL RetrieveValueFromEncryptedTable JSL RetrieveValueFromEncryptedTable
PLX : STX.b Scrap02 : PLX : STX.b Scrap01 PLX : STX.b Scrap02 : PLX : STX.b Scrap01
PLP : PLX PLP : PLX
?done: ?done:
endmacro endmacro
LoadIndoorValue: LoadIndoorValue:
@@ -241,10 +240,10 @@ LoadIndoorValue:
LDA.l StandingKey_Hera LDA.l StandingKey_Hera
JMP .done JMP .done
+ +
PHX PHX
LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite
LDA.w SprItemReceipt,X ; we can see and are interacting with LDA.w SprItemReceipt,X ; we can see and are interacting with
PLX PLX
.done .done
AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before
PLP PLP
@@ -446,10 +445,10 @@ LoadOutdoorValue:
%GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues)
JMP .done JMP .done
+ +
PHX PHX
LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite
LDA.w SprItemReceipt,X ; we can see and are interacting with. LDA.w SprItemReceipt,X ; we can see and are interacting with.
PLX PLX
.done .done
AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before
PLP PLP
@@ -561,63 +560,63 @@ HeartPieceGetPlayer:
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.b RoomIndex ; these are all decimal because i got them that way LDA.b RoomIndex ; these are all decimal because i got them that way
CMP.w #135 : BNE + CMP.w #135 : BNE +
LDA StandingKey_Hera_Player LDA.l StandingKey_Hera_Player
BRL .done BRL .done
+ CMP.w #200 : BNE + + CMP.w #200 : BNE +
LDA HeartContainer_ArmosKnights_Player LDA.l HeartContainer_ArmosKnights_Player
BRL .done BRL .done
+ CMP.w #51 : BNE + + CMP.w #51 : BNE +
LDA HeartContainer_Lanmolas_Player LDA.l HeartContainer_Lanmolas_Player
BRL .done BRL .done
+ CMP.w #7 : BNE + + CMP.w #7 : BNE +
LDA HeartContainer_Moldorm_Player LDA.l HeartContainer_Moldorm_Player
BRL .done BRL .done
+ CMP.w #90 : BNE + + CMP.w #90 : BNE +
LDA HeartContainer_HelmasaurKing_Player LDA.l HeartContainer_HelmasaurKing_Player
BRL .done BRL .done
+ CMP.w #6 : BNE + + CMP.w #6 : BNE +
LDA HeartContainer_Arrghus_Player LDA.l HeartContainer_Arrghus_Player
BRL .done BRL .done
+ CMP.w #41 : BNE + + CMP.w #41 : BNE +
LDA HeartContainer_Mothula_Player LDA.l HeartContainer_Mothula_Player
BRL .done BRL .done
+ CMP.w #172 : BNE + + CMP.w #172 : BNE +
LDA HeartContainer_Blind_Player LDA.l HeartContainer_Blind_Player
BRL .done BRL .done
+ CMP.w #222 : BNE + + CMP.w #222 : BNE +
LDA HeartContainer_Kholdstare_Player LDA.l HeartContainer_Kholdstare_Player
BRL .done BRL .done
+ CMP.w #144 : BNE + + CMP.w #144 : BNE +
LDA HeartContainer_Vitreous_Player LDA.l HeartContainer_Vitreous_Player
BRL .done BRL .done
+ CMP.w #164 : BNE + + CMP.w #164 : BNE +
LDA HeartContainer_Trinexx_Player LDA.l HeartContainer_Trinexx_Player
BRL .done BRL .done
+ CMP.w #225 : BNE + + CMP.w #225 : BNE +
LDA HeartPiece_Forest_Thieves_Player LDA.l HeartPiece_Forest_Thieves_Player
BRL .done BRL .done
+ CMP.w #226 : BNE + + CMP.w #226 : BNE +
LDA HeartPiece_Lumberjack_Tree_Player LDA.l HeartPiece_Lumberjack_Tree_Player
BRL .done BRL .done
+ CMP.w #234 : BNE + + CMP.w #234 : BNE +
LDA HeartPiece_Spectacle_Cave_Player LDA.l HeartPiece_Spectacle_Cave_Player
BRL .done BRL .done
+ CMP.w #283 : BNE + + CMP.w #283 : BNE +
LDA.b LinkPosX : XBA : AND.w #$0001 ; figure out where link is LDA.b LinkPosX : XBA : AND.w #$0001 ; figure out where link is
BNE ++ BNE ++
LDA HeartPiece_Circle_Bushes_Player LDA.l HeartPiece_Circle_Bushes_Player
BRL .done BRL .done
++ ++
LDA HeartPiece_Graveyard_Warp_Player LDA.l HeartPiece_Graveyard_Warp_Player
BRL .done BRL .done
+ CMP.w #288 : BNE + + CMP.w #288 : BNE +
LDA.l OWBonkPrizeTable[$2A].mw_player LDA.l OWBonkPrizeTable[$2A].mw_player
BRL .done BRL .done
+ CMP.w #294 : BNE + + CMP.w #294 : BNE +
LDA HeartPiece_Mire_Warp_Player LDA.l HeartPiece_Mire_Warp_Player
BRL .done BRL .done
+ CMP.w #295 : BNE + + CMP.w #295 : BNE +
LDA HeartPiece_Smith_Pegs_Player LDA.l HeartPiece_Smith_Pegs_Player
BRL .done BRL .done
LDA.w #$0000 LDA.w #$0000
BRL .done BRL .done
@@ -631,17 +630,17 @@ HeartPieceGetPlayer:
BRL .done BRL .done
+ CMP.w #$03 : BNE + + CMP.w #$03 : BNE +
LDA.b LinkPosX : CMP.w #1890 : !BLT ++ LDA.b LinkPosX : CMP.w #1890 : !BLT ++
LDA HeartPiece_Spectacle_Player LDA.l HeartPiece_Spectacle_Player
BRL .done BRL .done
++ ++
LDA EtherItem_Player LDA.l EtherItem_Player
BRL .done BRL .done
+ CMP.w #$05 : BNE + + CMP.w #$05 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++ LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$01].mw_player LDA.l OWBonkPrizeTable[$01].mw_player
BRL .done BRL .done
++ ++
LDA HeartPiece_Mountain_Warp_Player LDA.l HeartPiece_Mountain_Warp_Player
BRL .done BRL .done
+ CMP.w #$0A : BNE + + CMP.w #$0A : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++ LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
@@ -701,7 +700,7 @@ HeartPieceGetPlayer:
LDA.l OWBonkPrizeTable[$13].mw_player LDA.l OWBonkPrizeTable[$13].mw_player
BRL .done BRL .done
+ CMP.w #$28 : BNE + + CMP.w #$28 : BNE +
LDA HeartPiece_Maze_Player LDA.l HeartPiece_Maze_Player
BRL .done BRL .done
+ CMP.w #$2A : BNE + + CMP.w #$2A : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++ LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
@@ -711,7 +710,7 @@ HeartPieceGetPlayer:
LDA.l OWBonkPrizeTable[$15].mw_player LDA.l OWBonkPrizeTable[$15].mw_player
BRL .done BRL .done
++ ++
LDA HauntedGroveItem_Player LDA.l HauntedGroveItem_Player
BRL .done BRL .done
+ CMP.w #$2B : BNE + + CMP.w #$2B : BNE +
LDA.l OWBonkPrizeTable[$16].mw_player LDA.l OWBonkPrizeTable[$16].mw_player
@@ -725,10 +724,10 @@ HeartPieceGetPlayer:
BRL .done BRL .done
+ CMP.w #$30 : BNE + + CMP.w #$30 : BNE +
LDA.b LinkPosX : CMP.w #512 : !BGE ++ LDA.b LinkPosX : CMP.w #512 : !BGE ++
LDA HeartPiece_Desert_Player LDA.l HeartPiece_Desert_Player
BRL .done BRL .done
++ ++
LDA BombosItem_Player LDA.l BombosItem_Player
BRL .done BRL .done
+ CMP.w #$32 : BNE + + CMP.w #$32 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++ LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
@@ -738,20 +737,20 @@ HeartPieceGetPlayer:
LDA.l OWBonkPrizeTable[$1A].mw_player LDA.l OWBonkPrizeTable[$1A].mw_player
BRL .done BRL .done
+ CMP.w #$35 : BNE + + CMP.w #$35 : BNE +
LDA HeartPiece_Lake_Player LDA.l HeartPiece_Lake_Player
BRL .done BRL .done
+ CMP.w #$3B : BNE + + CMP.w #$3B : BNE +
LDA HeartPiece_Swamp_Player LDA.l HeartPiece_Swamp_Player
BRL .done BRL .done
+ CMP.w #$42 : BNE + + CMP.w #$42 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++ LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1B].mw_player LDA.l OWBonkPrizeTable[$1B].mw_player
BRL .done BRL .done
++ ++
LDA HeartPiece_Cliffside_Player LDA.l HeartPiece_Cliffside_Player
BRL .done BRL .done
+ CMP.w #$4A : BNE + + CMP.w #$4A : BNE +
LDA HeartPiece_Cliffside_Player LDA.l HeartPiece_Cliffside_Player
BRL .done BRL .done
+ CMP.w #$51 : BNE + + CMP.w #$51 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++ LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
@@ -785,13 +784,13 @@ HeartPieceGetPlayer:
LDA.l OWBonkPrizeTable[$24].mw_player LDA.l OWBonkPrizeTable[$24].mw_player
BRL .done BRL .done
++ ++
LDA HeartPiece_Pyramid_Player LDA.l HeartPiece_Pyramid_Player
BRL .done BRL .done
+ CMP.w #$5E : BNE + + CMP.w #$5E : BNE +
LDA.l OWBonkPrizeTable[$25].mw_player LDA.l OWBonkPrizeTable[$25].mw_player
BRL .done BRL .done
+ CMP.w #$68 : BNE + + CMP.w #$68 : BNE +
LDA HeartPiece_Digging_Player LDA.l HeartPiece_Digging_Player
BRL .done BRL .done
+ CMP.w #$6E : BNE + + CMP.w #$6E : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++ LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
@@ -807,7 +806,7 @@ HeartPieceGetPlayer:
LDA.l OWBonkPrizeTable[$29].mw_player LDA.l OWBonkPrizeTable[$29].mw_player
BRL .done BRL .done
+ CMP.w #$81 : BNE + + CMP.w #$81 : BNE +
LDA HeartPiece_Zora_Player LDA.l HeartPiece_Zora_Player
BRL .done BRL .done
+ +
LDA.w #$0000 LDA.w #$0000

View File

@@ -476,7 +476,7 @@ JSL Overworld_InvertedTRPuzzle
BRA + : NOP #12 : + BRA + : NOP #12 : +
org $84E7B9 ; <- bank0E.asm : 4237 (LDX $04C8) org $84E7B9 ; <- bank0E.asm : 4237 (LDX $04C8)
JMP.w TurtleRockTrollPegs JMP TurtleRockTrollPegs
TurtleRockPegCheck: TurtleRockPegCheck:
org $84E7C9 org $84E7C9
@@ -495,11 +495,11 @@ JSL GetRandomInt
LDA.l PegProbability : BEQ .vanilla : CMP.l $7E0FA1 LDA.l PegProbability : BEQ .vanilla : CMP.l $7E0FA1
REP #$20 : !BGE .succeed REP #$20 : !BGE .succeed
.fail .fail
JMP.w TurtleRockPegFail JMP TurtleRockPegFail
.succeed .succeed
JMP.w TurtleRockPegSuccess JMP TurtleRockPegSuccess
.vanilla .vanilla
REP #$20 : JMP.w TurtleRockPegCheck REP #$20 : JMP TurtleRockPegCheck
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $9BBD05 ; <- bank1B.asm : 261 (TYA : STA $00) ; hook starts at the STA org $9BBD05 ; <- bank1B.asm : 261 (TYA : STA $00) ; hook starts at the STA
JML PreventEnterOnBonk : NOP JML PreventEnterOnBonk : NOP
@@ -831,8 +831,6 @@ db $B1, $C6, $F9, $C9, $C6, $F9 ; data insert - 2 chests, fat fairy room
org $81E97E org $81E97E
dw $0116 : db $08 dw $0116 : db $08
dw $0116 : db $25 dw $0116 : db $25
;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $9EE16E ; <- F616E - sprite_bomb_shop_entity.asm : 73 org $9EE16E ; <- F616E - sprite_bomb_shop_entity.asm : 73
NOP #8 ; fix bomb shop dialog for dwarfless big bomb NOP #8 ; fix bomb shop dialog for dwarfless big bomb
@@ -1130,7 +1128,7 @@ JSL ItemCheck_Library
org $8DDF38 ; <- 6DF38 - equipment.asm : 480 org $8DDF38 ; <- 6DF38 - equipment.asm : 480
JSL ProcessMenuButtons JSL ProcessMenuButtons
BCC _equipment_497 BCC _equipment_497
JMP.w _equipment_544 JMP _equipment_544
ResetEquipment: ResetEquipment:
JSR RestoreNormalMenu ; (short) JSR RestoreNormalMenu ; (short)
RTL RTL
@@ -1222,30 +1220,17 @@ JSL DrawMushroom
org $85EE97 ; <- 2EE97 - sprite_mushroom.asm : 81 org $85EE97 ; <- 2EE97 - sprite_mushroom.asm : 81
NOP #14 NOP #14
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $86C09C ; <- - bank06.asm : 1885 (JSL SpritePrep_PotionShopLong) org $86C09C ; <- - bank06.asm : 1885 (JSL SpritePrep_MagicShopAssistant)
JSL SpritePrep_ShopKeeper_PotionShop JSL SpritePrep_ShopKeeper_PotionShop
org $85F521
SpritePrep_PotionShopLong:
org $85F539
SpawnMagicPowder:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $85F568 ; <- 2F568 - sprite_potion_shop.asm org $85F568 ; <- 2F568 - sprite_potion_shop.asm
LDA.b #$B0 : STA.w SpritePosYLow, Y : LDA.b #$90 : STA.w SpritePosXLow, Y ; manually set position of powder item LDA.b #$B0 : STA.w SpritePosYLow, Y : LDA.b #$90 : STA.w SpritePosXLow, Y ; manually set position of powder item
LDA.b #$21 : STA.w SpritePosYHigh, Y : LDA.b #$12 : STA.w SpritePosXHigh, Y LDA.b #$21 : STA.w SpritePosYHigh, Y : LDA.b #$12 : STA.w SpritePosXHigh, Y
JMP $F61D JMP MagicShopAssistant_SpawnObject
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $85F633 ; <- 2F633 - sprite_potion_shop.asm org $85F633 ; <- 2F633 - sprite_potion_shop.asm
JSL Sprite_ShopKeeperPotion : RTS : NOP ;; TODO: i don't remember prices being set on top of the player JSL Sprite_ShopKeeperPotion : RTS : NOP ;; TODO: i don't remember prices being set on top of the player
PotionShopkeeperJumpTable: PotionShopkeeperJumpTable:
org $85F893 ; <- witch behavior here
Sprite_WitchAssistant:
org $85F644 ; <- powder behavior here
Sprite_MagicPowderItem:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $85EB1D ; <- 2EB1D - sprite_bottle_vendor.asm : 158 org $85EB1D ; <- 2EB1D - sprite_bottle_vendor.asm : 158
JSL Multiworld_BottleVendor_GiveBottle JSL Multiworld_BottleVendor_GiveBottle
@@ -1955,7 +1940,7 @@ org $8690BD ; <- 310BD - SpritePrep_FluteBoy : 2202
JSL ItemCheck_TreeKid2 JSL ItemCheck_TreeKid2
org $86AF9B ; <- 32F9B - FluteBoy_Chillin : 73 : LDA $7EF34C : CMP.b #$02 : BCS .player_has_flute org $86AF9B ; <- 32F9B - FluteBoy_Chillin : 73 : LDA $7EF34C : CMP.b #$02 : BCS .player_has_flute
LDA HasGroveItem : AND.b #$01 LDA.l HasGroveItem : AND.b #$01
db $D0 ; BNE db $D0 ; BNE
org $86B062 ; <- 33062 - FluteAardvark_InitialStateFromFluteState : 225 : LDA $7EF34C : AND.b #$03 : !BGE #$05 org $86B062 ; <- 33062 - FluteAardvark_InitialStateFromFluteState : 225 : LDA $7EF34C : AND.b #$03 : !BGE #$05
@@ -2349,7 +2334,7 @@ Overworld_Entrance_BRANCH_RHO: ; branch here to continue into door
;================================================================================ ;================================================================================
; Paradox Cave Shopkeeper Fixes ; Paradox Cave Shopkeeper Fixes
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $808C19 ; Bank00.asm 1633 (LDA.b #$01 : STA MDMAEN) org $808C19 ; Bank00.asm 1633 (LDA.b #$01 : STA DMAENABLE)
JSL ParadoxCaveGfxFix : NOP JSL ParadoxCaveGfxFix : NOP
;================================================================================ ;================================================================================
@@ -2384,7 +2369,7 @@ JSL LoadActualGearPalettesWithGloves : RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Bunny Palette/Overworld Map Bugfix ; Bunny Palette/Overworld Map Bugfix
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $82FDF0 ; <- 017df0 - bank0E (LDA [$00] : STA $7EC300, X : STA $7EC500, X) org $82FDF0 ; <- 017df0 - bank0E (LDA [Scrap00] : STA $7EC300, X : STA $7EC500, X)
JSL LoadGearPalette_safe_for_bunny : RTS JSL LoadGearPalette_safe_for_bunny : RTS
;================================================================================ ;================================================================================
@@ -2412,15 +2397,15 @@ JSL NewElderCode
; Add him to Castle Map post-rain, and post aga1 ; Add him to Castle Map post-rain, and post aga1
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $89D0A9 org $89D0A9
db $18, $0A, $D8, $18, $0F, $43, $FF;remove heart from tree adjancent map [LW1] db $18, $0A, $D8, $18, $0F, $43, $FF ; remove heart from tree adjancent map [LW1]
db $12, $19, $16 ;add sahasrala in castle Y, X, Sprite ID db $12, $19, $16 ; add sahasrala in castle Y, X, Sprite ID
org $89C937 org $89C937
db $B0, $D0 ;change [LW1] map 01C pointers db $B0, $D0 ; change [LW1] map 01C pointers
org $89D421 org $89D421
db $18, $0F, $45, $FF;remove heart from tree adjancent map [LW2] db $18, $0F, $45, $FF ; remove heart from tree adjancent map [LW2]
db $12, $19, $16 ;add sahasrala in castle Y, X, Sprite ID db $12, $19, $16 ; add sahasrala in castle Y, X, Sprite ID
org $89CA57 org $89CA57
db $25, $D4 ;change [LW2] map 01C pointers db $25, $D4 ; change [LW2] map 01C pointers
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Expanded trinexx sheet gfx. ; Expanded trinexx sheet gfx.
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -2539,13 +2524,13 @@ org $8EE828 : JSL PreparePointer : LDA.b [CreditsPtr],Y : NOP
org $8EE83F : LDA.b [CreditsPtr],Y : NOP org $8EE83F : LDA.b [CreditsPtr],Y : NOP
org $8EE853 org $8EE853
LDA.b [CreditsPtr],Y : NOP : AND.w #$00FF : ASL A : JSL CheckFontTable LDA.b [CreditsPtr],Y : NOP : AND.w #$00FF : ASL A : JSL CheckFontTable
org $8EE86D : JSL RenderCreditsStatCounter : JMP.w AfterDeathCounterOutput org $8EE86D : JSL RenderCreditsStatCounter : JMP AfterDeathCounterOutput
org $82857D : JSL LoadOverworldCreditsTiles org $82857D : JSL LoadOverworldCreditsTiles
;================================================================================ ;================================================================================
; Fast credits ; Fast credits
org $8EC2B1 : JSL FlagFastCredits org $8EC2B1 : JSL FlagFastCredits
org $82A096 : JSL DumbFlagForMSU org $82A096 : JSL DumbFlagForMSU
org $8EC3AF : JSL FastCreditsScrollOW : JMP.w Credits_ScrollScene_Overworld_no_scroll org $8EC3AF : JSL FastCreditsScrollOW : JMP Credits_ScrollScene_Overworld_no_scroll
org $8EC41F : JSL FastCreditsCutsceneUnderworldY org $8EC41F : JSL FastCreditsCutsceneUnderworldY
org $8EC42C : JSL FastCreditsCutsceneUnderworldX org $8EC42C : JSL FastCreditsCutsceneUnderworldX
org $8EC488 : JSL FastCreditsCutsceneTimer org $8EC488 : JSL FastCreditsCutsceneTimer
@@ -2710,4 +2695,4 @@ NOP #2 ; this fixes Link's direction after mirroring and falling after entering
; Enable new room header table ; Enable new room header table
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $81B5E6 org $81B5E6
LDA.b #$30 LDA.b #$30

View File

@@ -17,7 +17,7 @@ PHP
LDX.b #$7E : STX.w A1B4 LDX.b #$7E : STX.w A1B4
LDA.w #$0040 : STA.w DAS4L LDA.w #$0040 : STA.w DAS4L
LDA.w #$1801 : STA.w DMAP4 LDA.w #$1801 : STA.w DMAP4
LDX.b #$10 : STX.w MDMAEN LDX.b #$10 : STX.w DMAENABLE
LDX.b #$0F : STX.w INIDISP LDX.b #$0F : STX.w INIDISP
PLP PLP
@@ -36,7 +36,7 @@ PHP
LDA.w #$0040 : STA.w DAS4L LDA.w #$0040 : STA.w DAS4L
LDA.w #$1801 : STA.w DMAP4 LDA.w #$1801 : STA.w DMAP4
LDX.b #$10 : STX.w MDMAEN LDX.b #$10 : STX.w DMAENABLE
LDX.b #$0F : STX.w INIDISP LDX.b #$0F : STX.w INIDISP
PLP PLP

View File

@@ -1,6 +1,6 @@
ShouldOverrideFileLoad: ShouldOverrideFileLoad:
; Y = Graphics file being loaded ; Y = Graphics file being loaded
CPY #$0A ; 0A = Ice/Mire floor file CPY.b #$0A ; 0A = Ice/Mire floor file
BNE .no BNE .no
LDA.w DungeonID ; Dungeon number LDA.w DungeonID ; Dungeon number
@@ -33,14 +33,14 @@ BgGraphicsLoading:
LDX.b #64*2 ; Tiles to load * 2 LDX.b #64*2 ; Tiles to load * 2
- -
; Unrolled loop to upload half a tile ; Unrolled loop to upload half a tile
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
LDA.b [$00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00 LDA.b [Scrap00] : STA.w VMDATAL : INC.b Scrap00 : INC.b Scrap00
DEX DEX
BNE - BNE -

View File

@@ -49,10 +49,10 @@ RTL
PLX PLX
LDA.l SilverArrowsUseRestriction : BEQ ++ LDA.l SilverArrowsUseRestriction : BEQ ++
LDA.b RoomIndex : ORA.b RoomIndex+1 : BEQ ++ ; not in ganon's room in restricted mode LDA.b RoomIndex : ORA.b RoomIndex+1 : BEQ ++ ; not in ganon's room in restricted mode
LDA.l BowEquipment : CMP.b #$03 : !BLT .errorJump : !SUB #$02 : STA.l BowEquipment LDA.l BowEquipment : CMP.b #$03 : !BLT .errorJump : !SUB.b #$02 : STA.l BowEquipment
BRA .errorJump2 BRA .errorJump2
++ ++
LDA.l BowEquipment : !SUB #$01 : EOR.b #$02 : !ADD #$01 : STA.l BowEquipment ; swap bows LDA.l BowEquipment : !SUB.b #$01 : EOR.b #$02 : !ADD.b #$01 : STA.l BowEquipment ; swap bows
LDA.b #$20 : STA.w SFX3 ; menu select sound LDA.b #$20 : STA.w SFX3 ; menu select sound
JMP .captured JMP .captured
+ BRA + + BRA +
@@ -269,7 +269,7 @@ IncrementYAItems:
BIT.b #$20 : BNE .bow_check BIT.b #$20 : BNE .bow_check
BIT.b #$04 : BEQ .not_y BIT.b #$04 : BEQ .not_y
.y_item .y_item
LDA.l YAItemCounter : !ADD #$08 : STA.l YAItemCounter LDA.l YAItemCounter : !ADD.b #$08 : STA.l YAItemCounter
BRA .done BRA .done
.not_y .not_y
BIT.b #$08 : BEQ .done BIT.b #$08 : BEQ .done
@@ -310,7 +310,7 @@ IncrementBossSword:
BRA .none BRA .none
+ +
ASL : TAX ASL : TAX
JMP.w (.vectors,X) JMP (.vectors,X)
.vectors .vectors
dw .none dw .none
@@ -359,7 +359,7 @@ IncrementFinalSword:
BRA IncrementBossSword_none BRA IncrementBossSword_none
+ +
ASL : TAX ASL : TAX
JMP.w (IncrementBossSword_vectors,X) JMP (IncrementBossSword_vectors,X)
.done .done
SEP #$20 SEP #$20
PLX PLX
@@ -473,7 +473,7 @@ FluteCallForDuck:
LDA.l ProgressIndicator : CMP.b #$02 : BCS .vanilla ; must rescue Zelda first LDA.l ProgressIndicator : CMP.b #$02 : BCS .vanilla ; must rescue Zelda first
.noDuck .noDuck
LDA.b #$02 : RTL LDA.b #$02 : RTL
.vanilla .vanilla
LDA.l FluteEquipment ; what we wrote over LDA.l FluteEquipment ; what we wrote over
@@ -822,4 +822,4 @@ CPY.b #$4A : BNE +
+ ; normal itemget sfx + ; normal itemget sfx
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -228,7 +228,7 @@ MirrorBonk:
PLB : PLP : PLX PLB : PLP : PLX
BRA .forceBonk BRA .forceBonk
++ ++
TXA : !ADD #$0008 : CMP.w #.tableEnd-.bonkRectanglesTable : BEQ .endLoop TXA : !ADD.w #$0008 : CMP.w #.tableEnd-.bonkRectanglesTable : BEQ .endLoop
TAX TAX
BRA .loop BRA .loop
.endbonkRectanglesTable .endbonkRectanglesTable

View File

@@ -1132,7 +1132,7 @@ OverworldMapChangePointers2:
Overworld_InvertedTRPuzzle: Overworld_InvertedTRPuzzle:
{ {
REP #$30 REP #$30
LDA.l OWTileMapAlt+07 : AND #$00FF : BNE .inverted LDA.l OWTileMapAlt+07 : AND.w #$00FF : BNE .inverted
LDA.w #$0212 : LDX.w #$0720 : STA.l TileMapA,X ; what we wrote over LDA.w #$0212 : LDX.w #$0720 : STA.l TileMapA,X ; what we wrote over
JSL Overworld_MemorizeMap16Change : JSL Overworld_DrawPersistentMap16+4 ; what we wrote over JSL Overworld_MemorizeMap16Change : JSL Overworld_DrawPersistentMap16+4 ; what we wrote over
RTL RTL

View File

@@ -36,8 +36,8 @@ RTL
.isBlueBoomerang .isBlueBoomerang
.isBow .isBow
.isBowAndArrows .isBowAndArrows
CMP.b [$00] : !BGE .done ; finished if we're upgrading CMP.b [Scrap00] : !BGE .done ; finished if we're upgrading
LDA.b [$00] ; reload old value LDA.b [Scrap00] ; reload old value
RTL RTL
.isSilverArrowBow .isSilverArrowBow
.isRedBoomerang .isRedBoomerang

View File

@@ -329,8 +329,8 @@ DrawPotItem:
JSL Sprite_DrawMultiple_quantity_preset JSL Sprite_DrawMultiple_quantity_preset
PLB PLB
LDA.b $90 : CLC : ADC.b #$08 : STA.b $90 LDA.b OAMPtr : CLC : ADC.b #$08 : STA.b OAMPtr
INC.b $92 : INC.b $92 INC.b OAMPtr+2 : INC.b OAMPtr+2
PLA PLA
CLC CLC
@@ -348,7 +348,7 @@ ConditionalPushBlockTransfer:
LDA.b #$0F ; don't transfer push block when on the OW LDA.b #$0F ; don't transfer push block when on the OW
BRA .return-3 BRA .return-3
+ +
LDA.b #$1F : STA.w $420B ; what we wrote over LDA.b #$1F : STA.w DMAENABLE ; what we wrote over
.return .return
RTL RTL

View File

@@ -70,8 +70,6 @@ org $8681F4
Sprite_SpawnSecret_pool_ID: Sprite_SpawnSecret_pool_ID:
org $868283 org $868283
Sprite_SpawnSecret_NotRandomBush: Sprite_SpawnSecret_NotRandomBush:
org $8682A5
Sprite_SpawnSecret_SetCoords:
org $86d23a org $86d23a
Sprite_DrawAbsorbable: Sprite_DrawAbsorbable:
org $86D038 org $86D038
@@ -187,7 +185,7 @@ RevealPotItem:
.next_pot .next_pot
INY : INY : INY INY : INY : INY
LDA.b [$00],Y LDA.b [Scrap00],Y
CMP.w #$FFFF : BEQ .exit CMP.w #$FFFF : BEQ .exit
INX INX
@@ -232,7 +230,7 @@ RevealPotItem:
LoadMultiWorldPotItem: LoadMultiWorldPotItem:
INY : INY INY : INY
LDA.b [$00],Y : AND.w #$00FF LDA.b [Scrap00],Y : AND.w #$00FF
INC.w SpawnedItemIsMultiWorld INC.w SpawnedItemIsMultiWorld
PHX PHX
@@ -251,7 +249,7 @@ RTL
LoadMajorPotItem: LoadMajorPotItem:
INY : INY INY : INY
LDA.b [$00],Y : AND.w #$00FF LDA.b [Scrap00],Y : AND.w #$00FF
SaveMajorItemDrop: SaveMajorItemDrop:
; A currently holds the item receipt ID ; A currently holds the item receipt ID
@@ -295,7 +293,7 @@ RTL
RTL RTL
ShouldCountNormalPot: ShouldCountNormalPot:
INY : INY : LDA.b [$00], Y : AND.w #$00FF : CMP.w #$0080 : BCS .clear INY : INY : LDA.b [Scrap00], Y : AND.w #$00FF : CMP.w #$0080 : BCS .clear
LDA.l PotCountMode : BEQ .clear LDA.l PotCountMode : BEQ .clear
LDA.l PotCollectionRateTable, X : BIT.b Scrap0A : BEQ .clear ; don't count if clear LDA.l PotCollectionRateTable, X : BIT.b Scrap0A : BEQ .clear ; don't count if clear
.set .set
@@ -388,20 +386,20 @@ RTS
; Runs during sprite load of the room ; Runs during sprite load of the room
LoadSpriteData: LoadSpriteData:
INY : INY INY : INY
LDA.b [$00], Y LDA.b [Scrap00], Y
CMP.b #$F3 : BCC .normal CMP.b #$F3 : BCC .normal
PHA PHA
DEC.b Scrap03 ; standing items shouldn't consume a sprite slot DEC.b Scrap03 ; standing items shouldn't consume a sprite slot
LDX.b Scrap03 ; these were changed to $03, for moved sprites LDX.b Scrap03 ; these were changed to $03, for moved sprites
CMP.b #$F9 : BNE .not_multiworld CMP.b #$F9 : BNE .not_multiworld
DEY : LDA.b [$00], Y : STA.w SprItemMWPlayer, X DEY : LDA.b [Scrap00], Y : STA.w SprItemMWPlayer, X
LDA.b #$02 : STA.w SprDropsItem, X : BRA .common LDA.b #$02 : STA.w SprDropsItem, X : BRA .common
.not_multiworld .not_multiworld
LDA.b #$00 : STA.w SprItemMWPlayer, X LDA.b #$00 : STA.w SprItemMWPlayer, X
LDA.b #$01 : STA.w SprDropsItem, X LDA.b #$01 : STA.w SprDropsItem, X
DEY DEY
.common .common
DEY : LDA.b [$00], Y : STA.w SprSourceItemId, X DEY : LDA.b [Scrap00], Y : STA.w SprSourceItemId, X
STA.b Scrap0E STA.b Scrap0E
LDA.w SprItemMWPlayer, X : BNE + ; skip if multiworld LDA.w SprItemMWPlayer, X : BNE + ; skip if multiworld
PHX PHX
@@ -636,73 +634,73 @@ SpriteKeyPrep:
SpriteKeyDrawGFX: SpriteKeyDrawGFX:
JSL Sprite_DrawRippleIfInWater JSL Sprite_DrawRippleIfInWater
PHA PHA
LDA.l SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w SprRedrawFlag, X : BEQ + LDA.w SprRedrawFlag, X : BEQ +
LDA.w SprSourceItemId, X LDA.w SprSourceItemId, X
JSL RequestStandingItemVRAMSlot JSL RequestStandingItemVRAMSlot
LDA.w SprRedrawFlag, X : CMP.b #$02 : BEQ + LDA.w SprRedrawFlag, X : CMP.b #$02 : BEQ +
BRA .skipDraw BRA .skipDraw
+ LDA.w SprItemReceipt, X + LDA.w SprItemReceipt, X
CMP.b #$24 : BNE + CMP.b #$24 : BNE +
LDA.b RoomIndex : CMP.b #$80 : BNE ++ LDA.b RoomIndex : CMP.b #$80 : BNE ++
LDA.w SpawnedItemFlag : BNE ++ LDA.w SpawnedItemFlag : BNE ++
LDA.b #$24 : BRA + LDA.b #$24 : BRA +
++ PLA ++ PLA
PHK : PEA.w .jslrtsreturn-1 PHK : PEA.w .jslrtsreturn-1
PEA.w $868014 ; an rtl address - 1 in Bank06 PEA.w $868014 ; an rtl address - 1 in Bank06
JML Sprite_DrawAbsorbable JML Sprite_DrawAbsorbable
.jslrtsreturn .jslrtsreturn
RTL RTL
+ JSL DrawPotItem : BCS .skipDraw + JSL DrawPotItem : BCS .skipDraw
; draw shadow ; draw shadow
CMP.b #$02 : BNE + CMP.b #$02 : BNE +
PHA PHA
LDA.w SpriteControl, X : AND.b #$DF : STA.w SpriteControl, X LDA.w SpriteControl, X : AND.b #$DF : STA.w SpriteControl, X
REP #$20 REP #$20
LDA.b Scrap00 : SEC : SBC.w #$0004 : STA.b Scrap00 LDA.b Scrap00 : SEC : SBC.w #$0004 : STA.b Scrap00
SEP #$20 SEP #$20
PLA PLA
+ CMP.b #$03 : BNE + + CMP.b #$03 : BNE +
PHA : LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X : PLA PHA : LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X : PLA
+ JSL Sprite_DrawShadowLong + JSL Sprite_DrawShadowLong
.skipDraw .skipDraw
PLA : RTL PLA : RTL
KeyGet: KeyGet:
LDA.l CurrentSmallKeys ; what we wrote over LDA.l CurrentSmallKeys ; what we wrote over
PHA PHA
LDA.l StandingItemsOn : BNE + LDA.l StandingItemsOn : BNE +
PLA : RTL PLA : RTL
+ LDY.w SprItemReceipt, X + LDY.w SprItemReceipt, X
LDA.w SprItemIndex, X : STA.w SpawnedItemIndex LDA.w SprItemIndex, X : STA.w SpawnedItemIndex
LDA.w SprItemFlags, X : STA.w SpawnedItemFlag LDA.w SprItemFlags, X : STA.w SpawnedItemFlag
LDA.b RoomIndex : CMP.b #$87 : BNE + ;check for hera cage LDA.b RoomIndex : CMP.b #$87 : BNE + ;check for hera cage
LDA.w SpawnedItemFlag : BNE + ; if it came from a pot, it's fine LDA.w SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
JSR ShouldKeyBeCountedForDungeon : BCC ++ JSR ShouldKeyBeCountedForDungeon : BCC ++
JSL CountChestKeyLong JSL CountChestKeyLong
++ PLA : RTL ++ PLA : RTL
+ STY.b Scrap00 + STY.b Scrap00
LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .receive STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .receive
PHX PHX
LDA.w DungeonID : CMP.b #$FF : BNE + LDA.w DungeonID : CMP.b #$FF : BNE +
LDA.b Scrap00 : CMP.b #$AF : BNE .skip LDA.b Scrap00 : CMP.b #$AF : BNE .skip
LDA.l CurrentGenericKeys : INC : STA.l CurrentGenericKeys LDA.l CurrentGenericKeys : INC : STA.l CurrentGenericKeys
LDA.b Scrap00 : BRA .countIt LDA.b Scrap00 : BRA .countIt
+ LSR : TAX + LSR : TAX
LDA.b Scrap00 : CMP.l KeyTable, X : BNE + LDA.b Scrap00 : CMP.l KeyTable, X : BNE +
.countIt .countIt
LDA.l StandingItemCounterMask : AND.w SpawnedItemFlag : BEQ ++ LDA.l StandingItemCounterMask : AND.w SpawnedItemFlag : BEQ ++
JSL AddInventory JSL AddInventory
++ PLX : PLA : RTL ++ PLX : PLA : RTL
+ CMP.b #$AF : beq .countIt ; universal key + CMP.b #$AF : beq .countIt ; universal key
CMP.b #$24 : beq .countIt ; small key for this dungeon CMP.b #$24 : beq .countIt ; small key for this dungeon
.skip PLX .skip PLX
.receive .receive
JSL Player_HaltDashAttackLong JSL Player_HaltDashAttackLong
TYA : JSL AttemptItemSubstitution : JSL ResolveLootIDLong : TAY TYA : JSL AttemptItemSubstitution : JSL ResolveLootIDLong : TAY
JSL Link_ReceiveItem JSL Link_ReceiveItem
PLA : DEC : RTL PLA : DEC : RTL
KeyTable: KeyTable:
db $A0, $A0, $A2, $A3, $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC, $AD db $A0, $A0, $A2, $A3, $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC, $AD
@@ -712,7 +710,7 @@ ShouldKeyBeCountedForDungeon:
PHX PHX
LDA.w DungeonID : CMP.b #$FF : BEQ .done LDA.w DungeonID : CMP.b #$FF : BEQ .done
LSR : TAX LSR : TAX
TYA : cmp KeyTable, X : BNE + TYA : CMP.w KeyTable, X : BNE +
- PLX : SEC : RTS - PLX : SEC : RTS
+ CMP.b #$24 : BEQ - + CMP.b #$24 : BEQ -
.done .done
@@ -791,7 +789,7 @@ CheckSprite_Spawn:
BMI .check BMI .check
RTL RTL
.check .check
LDA.b Scrap0D : CMP #$08 : BNE + LDA.b Scrap0D : CMP.b #$08 : BNE +
LDA.w LinkDashing : BNE .error LDA.w LinkDashing : BNE .error
LDX.b #$0F LDX.b #$0F

View File

@@ -1,7 +1,7 @@
OnMenuLoad: OnMenuLoad:
LDA.b #UploadMenuOnlyIcons>>0 : STA NMIAux LDA.b #UploadMenuOnlyIcons>>0 : STA.w NMIAux
LDA.b #UploadMenuOnlyIcons>>8 : STA NMIAux+1 LDA.b #UploadMenuOnlyIcons>>8 : STA.w NMIAux+1
LDA.b #UploadMenuOnlyIcons>>16 : STA NMIAux+2 LDA.b #UploadMenuOnlyIcons>>16 : STA.w NMIAux+2
LDA.b #$0E : STA.b GameMode ; what we overwrote LDA.b #$0E : STA.b GameMode ; what we overwrote
RTL RTL
@@ -15,7 +15,7 @@ UploadMenuOnlyIcons:
SEP #$20 SEP #$20
LDA.b #MenuOnlyIcons>>16 : STA.w $4344 LDA.b #MenuOnlyIcons>>16 : STA.w $4344
LDA.b #$80 : STA.w $2118 LDA.b #$80 : STA.w $2118
LDA.b #$10 : STA.w $420B LDA.b #$10 : STA.w DMAENABLE
RTL RTL

26
msu.asm
View File

@@ -255,7 +255,7 @@ CheckMusicLoadRequest:
PLA : LSR #3 : TAX PLA : LSR #3 : TAX
LDA.w MSUFallbackTable,X : BEQ .secondary_fallback : CMP.b #$FF : BEQ .mute LDA.w MSUFallbackTable,X : BEQ .secondary_fallback : CMP.b #$FF : BEQ .mute
- : CPY #$00 : BEQ + - : CPY.b #$00 : BEQ +
LSR : DEY : BRA - LSR : DEY : BRA -
+ +
@@ -271,8 +271,8 @@ CheckMusicLoadRequest:
TAX : LDA.l MusicShuffleTable-1,X TAX : LDA.l MusicShuffleTable-1,X
PLX PLX
CMP.w MusicControlRequest : BEQ .unmute CMP.w MusicControlRequest : BEQ .unmute
CPX #35 : !BLT + CPX.b #35 : !BLT +
CPX #47 : !BLT .dungeon_fallback CPX.b #47 : !BLT .dungeon_fallback
+ +
STA.w MusicControlRequest STA.w MusicControlRequest
@@ -503,9 +503,9 @@ PHA : XBA : PHA
JSR IsResumableTrack : BCC + JSR IsResumableTrack : BCC +
; dont save if we already saved recently ; dont save if we already saved recently
REP #$20 REP #$20
LDA.w MSUResumeTrack : AND #$00FF : BEQ ++ LDA.w MSUResumeTrack : AND.w #$00FF : BEQ ++
LDA.l NMIFrames : !SUB MSUResumeTime : PHA LDA.l NMIFrames : !SUB.w MSUResumeTime : PHA
LDA.l NMIFrames+2 : SBC MSUResumeTime+2 : BNE +++ LDA.l NMIFrames+2 : SBC.w MSUResumeTime+2 : BNE +++
PLA : CMP.l MSUResumeTimer : !BLT .too_early PLA : CMP.l MSUResumeTimer : !BLT .too_early
BRA ++ BRA ++
+++ +++
@@ -578,7 +578,7 @@ MSUMain:
PLA : LSR #3 : TAX PLA : LSR #3 : TAX
LDA.w MSUFallbackTable,X : BEQ +++ : CMP.b #$FF : BEQ ++ LDA.w MSUFallbackTable,X : BEQ +++ : CMP.b #$FF : BEQ ++
- : CPY #$00 : BEQ + - : CPY.b #$00 : BEQ +
LSR : DEY : BRA - LSR : DEY : BRA -
+ +
@@ -670,8 +670,8 @@ MSUMain:
PLX PLX
TXA : CMP.w MSUResumeTrack : BNE + ; dont resume if too late TXA : CMP.w MSUResumeTrack : BNE + ; dont resume if too late
REP #$20 REP #$20
LDA.l NMIFrames : !SUB MSUResumeTime : PHA LDA.l NMIFrames : !SUB.w MSUResumeTime : PHA
LDA.l NMIFrames+2 : SBC MSUResumeTime+2 : BNE ++ LDA.l NMIFrames+2 : SBC.w MSUResumeTime+2 : BNE ++
PLA : CMP.l MSUResumeTimer : !BGE +++ PLA : CMP.l MSUResumeTimer : !BGE +++
SEP #$20 SEP #$20
LDA.b #!FLAG_RESUME_FADEIN : BRA .done_resume LDA.b #!FLAG_RESUME_FADEIN : BRA .done_resume
@@ -684,8 +684,8 @@ MSUMain:
STA.w MSUResumeControl STA.w MSUResumeControl
LDA.b #$00 : STA.w MSUResumeTrack LDA.b #$00 : STA.w MSUResumeTrack
+ +
CPX #07 : BNE + ; Kakariko Village CPX.b #$07 : BNE + ; Kakariko Village
LDA.b GameMode : CMP #$07 : BNE + LDA.b GameMode : CMP.b #$07 : BNE +
; we're in link's house -> ignore ; we're in link's house -> ignore
LDA.b #$00 LDA.b #$00
BRA ++ BRA ++
@@ -694,7 +694,7 @@ MSUMain:
++ ++
STA.w MSULoadedTrack STA.w MSULoadedTrack
STX.w CurrentMSUTrack STX.w CurrentMSUTrack
LDA.w MSUPackCurrent : CMP #$FE : !BLT + LDA.w MSUPackCurrent : CMP.b #$FE : !BLT +
LDA.b #$00 : BRA ++ LDA.b #$00 : BRA ++
+ : LDA.l MSUTrackList-1,X + : LDA.l MSUTrackList-1,X
++ : STA.w MSUDelayedCommand ++ : STA.w MSUDelayedCommand
@@ -747,7 +747,7 @@ PendantFanfareWait:
LDA.w MSUID+2 : CMP.w #!VAL_MSU_ID_23 : BNE .spc LDA.w MSUID+2 : CMP.w #!VAL_MSU_ID_23 : BNE .spc
LDA.w MSUID+4 : CMP.w #!VAL_MSU_ID_45 : BNE .spc LDA.w MSUID+4 : CMP.w #!VAL_MSU_ID_45 : BNE .spc
SEP #$20 SEP #$20
LDA.w MSUPackCurrent : CMP #$FE : !BGE .spc LDA.w MSUPackCurrent : CMP.b #$FE : !BGE .spc
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_TRACK_MISSING : BNE .spc LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_TRACK_MISSING : BNE .spc
LDA.w MSUDelayedCommand : BNE .continue LDA.w MSUDelayedCommand : BNE .continue
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_AUDIO_PLAYING : BEQ .done LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_AUDIO_PLAYING : BEQ .done

View File

@@ -3,26 +3,26 @@
macro Print_Text(hdr, hdr_len, player_id) macro Print_Text(hdr, hdr_len, player_id)
PHX : PHY : PHP PHX : PHY : PHP
REP #$30 REP #$30
LDX #$0000 LDX.w #$0000
- -
CPX <hdr_len> : !BGE ++ CPX.w <hdr_len> : !BGE ++
LDA <hdr>, X LDA.l <hdr>, X
STA !MULTIWORLD_HUD_CHARACTER_DATA, X STA.l !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2 INX #2
BRA - BRA -
++ ++
LDY <hdr_len> LDY.w <hdr_len>
LDA <player_id> LDA.l <player_id>
AND.w #$00FF AND.w #$00FF
DEC DEC
CMP.w #$00FF : !BGE .textdone CMP.w #$00FF : !BGE .textdone
ASL #5 ASL #5
TAX TAX
- -
CPY <hdr_len>+$20 : !BGE ++ CPY.w <hdr_len>+$20 : !BGE ++
LDA PlayerNames, X LDA.l PlayerNames, X
PHX : TYX : STA !MULTIWORLD_HUD_CHARACTER_DATA, X : PLX PHX : TYX : STA.l !MULTIWORLD_HUD_CHARACTER_DATA, X : PLX
INX #2 : INY #2 INX #2 : INY #2
BRA - BRA -
++ ++
@@ -31,15 +31,15 @@ PHX : PHY : PHP
- -
CPX.w #$0040 : !BGE ++ CPX.w #$0040 : !BGE ++
LDA.w #$007F LDA.w #$007F
STA !MULTIWORLD_HUD_CHARACTER_DATA, X STA.l !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2 INX #2
BRA - BRA -
++ ++
SEP #$20 SEP #$20
LDA.b #$01 : STA !NMI_MW+1 : STA !NMI_MW LDA.b #$01 : STA.l !NMI_MW+1 : STA.l !NMI_MW
LDA !MULTIWORLD_HUD_DELAY LDA.b !MULTIWORLD_HUD_DELAY
STA !MULTIWORLD_HUD_TIMER STA.l !MULTIWORLD_HUD_TIMER
.textdone .textdone
PLP : PLY : PLX PLP : PLY : PLX
endmacro endmacro
@@ -67,7 +67,7 @@ WriteText:
LDX.b #!MULTIWORLD_HUD_CHARACTER_DATA>>16 : STX.w $4344 LDX.b #!MULTIWORLD_HUD_CHARACTER_DATA>>16 : STX.w $4344
LDA.w #$0040 : STA.w $4345 LDA.w #$0040 : STA.w $4345
LDA.w #$1801 : STA.w $4340 LDA.w #$1801 : STA.w $4340
LDX.b #$10 : STX.w $420B LDX.b #$10 : STX.w DMAENABLE
PLX : STX.w $2100 ; put screen back however it was before PLX : STX.w $2100 ; put screen back however it was before
PLX : STX.w $2117 ; restore DMA parameters PLX : STX.w $2117 ; restore DMA parameters
@@ -87,8 +87,8 @@ RTL
GetMultiworldItem: GetMultiworldItem:
{ {
PHP PHP
LDA !MULTIWORLD_ITEM : BNE + LDA.l !MULTIWORLD_ITEM : BNE +
LDA !MULTIWORLD_HUD_TIMER : BNE + LDA.l !MULTIWORLD_HUD_TIMER : BNE +
BRL .return BRL .return
+ +
@@ -99,8 +99,8 @@ GetMultiworldItem:
BRL .return BRL .return
+ +
LDA !MULTIWORLD_HUD_TIMER : BEQ .textend LDA.l !MULTIWORLD_HUD_TIMER : BEQ .textend
DEC : STA !MULTIWORLD_HUD_TIMER DEC.b #$01 : STA.l !MULTIWORLD_HUD_TIMER
CMP.b #$00 : BNE .textend CMP.b #$00 : BNE .textend
; Clear text ; Clear text
PHP : REP #$30 PHP : REP #$30
@@ -108,12 +108,12 @@ GetMultiworldItem:
- -
CPX.w #$0040 : !BGE ++ CPX.w #$0040 : !BGE ++
LDA.w #$007F LDA.w #$007F
STA !MULTIWORLD_HUD_CHARACTER_DATA, X STA.l !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2 INX #2
BRA - BRA -
++ ++
PLP PLP
LDA.b #$01 : STA !NMI_MW+1 : STA !NMI_MW LDA.b #$01 : STA.l !NMI_MW+1 : STA.l !NMI_MW
.textend .textend
LDA.b LinkState LDA.b LinkState
@@ -123,7 +123,7 @@ GetMultiworldItem:
BRL .return BRL .return
+ +
LDA !MULTIWORLD_ITEM : BNE + LDA.l !MULTIWORLD_ITEM : BNE +
BRL .return BRL .return
+ +
@@ -173,13 +173,13 @@ GetMultiworldItem:
STA.w ItemReceiptID ;Set Item to receive STA.w ItemReceiptID ;Set Item to receive
TAY TAY
LDA.b #$01 : STA !MULTIWORLD_RECEIVING_ITEM LDA.b #$01 : STA.l !MULTIWORLD_RECEIVING_ITEM
LDA.b #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.b #$00 : STA.l !MULTIWORLD_ITEM_PLAYER_ID
STZ.w ItemReceiptMethod STZ.w ItemReceiptMethod
JSL Player_HaltDashAttackLong JSL Player_HaltDashAttackLong
JSL Link_ReceiveItem JSL Link_ReceiveItem
LDA.b #$00 : STA !MULTIWORLD_ITEM : STA !MULTIWORLD_RECEIVING_ITEM LDA.b #$00 : STA.l !MULTIWORLD_ITEM : STA.l !MULTIWORLD_RECEIVING_ITEM
%Print_Text(HUD_ReceivedFrom, #$001C, !MULTIWORLD_ITEM_FROM) %Print_Text(HUD_ReceivedFrom, #$001C, !MULTIWORLD_ITEM_FROM)
@@ -193,10 +193,10 @@ Multiworld_OpenKeyedObject:
{ {
PHP PHP
SEP #$20 SEP #$20
LDA ChestData_Player+2, X : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l ChestData_Player+2, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLP PLP
LDA !Dungeon_ChestData+2, X ; thing we wrote over LDA.l !Dungeon_ChestData+2, X ; thing we wrote over
RTL RTL
} }
@@ -204,7 +204,7 @@ Multiworld_BottleVendor_GiveBottle:
{ {
PHA : PHP PHA : PHP
SEP #$20 SEP #$20
LDA BottleMerchant_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l BottleMerchant_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
@@ -215,7 +215,7 @@ Multiworld_MiddleAgedMan_ReactToSecretKeepingResponse:
{ {
PHA : PHP PHA : PHP
SEP #$20 SEP #$20
LDA PurpleChest_Item_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l PurpleChest_Item_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
@@ -226,7 +226,7 @@ Multiworld_Hobo_GrantBottle:
{ {
PHA : PHP PHA : PHP
SEP #$20 SEP #$20
LDA HoboItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l HoboItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
@@ -237,19 +237,18 @@ Multiworld_MasterSword_GrantToPlayer:
{ {
PHA : PHP PHA : PHP
SEP #$20 SEP #$20
LDA PedestalSword_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l PedestalSword_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
CPY.b #$6A : BEQ + JSL Link_ReceiveItem ; thing we wrote over
JML Link_ReceiveItem ; thing we wrote over RTL
+ JML ActivateGoal
} }
Multiworld_AddReceivedItem_notCrystal: Multiworld_AddReceivedItem_notCrystal:
{ {
TYA : STA.w CutsceneFlag : PHX ; things we wrote over TYA : STA.w CutsceneFlag : PHX ; things we wrote over
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
PHY : LDY.w ItemReceiptID : JSL AddInventory : PLY PHY : LDY.w ItemReceiptID : JSL AddInventory : PLY
%Print_Text(HUD_SentTo, #$0010, !MULTIWORLD_ITEM_PLAYER_ID) %Print_Text(HUD_SentTo, #$0010, !MULTIWORLD_ITEM_PLAYER_ID)
@@ -263,7 +262,7 @@ Multiworld_AddReceivedItem_notCrystal:
Multiworld_Ancilla_ReceiveItem_stillInMotion: Multiworld_Ancilla_ReceiveItem_stillInMotion:
{ {
CMP.b #$28 : BNE + ; thing we wrote over CMP.b #$28 : BNE + ; thing we wrote over
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE +
JML Ancilla_ReceiveItem_stillInMotion_moveon JML Ancilla_ReceiveItem_stillInMotion_moveon
+ +
JML Ancilla_ReceiveItem_dontGiveRupees JML Ancilla_ReceiveItem_dontGiveRupees

View File

@@ -48,10 +48,8 @@ Overworld_FinishMirrorWarp:
LDA.w #$0000 : STA.l FadeTimer : STA.l FadeDirection LDA.w #$0000 : STA.l FadeTimer : STA.l FadeDirection
SEP #$20 SEP #$20
JSL ReloadPreviouslyLoadedSheets JSL ReloadPreviouslyLoadedSheets
LDA.b #$80 : STA.b HDMAENABLEQ
LDA.b #$80 : STA.b HDMAENQ
JSL Overworld_DetermineAmbientSFX JSL Overworld_DetermineAmbientSFX
JSL Overworld_DetermineMusic JSL Overworld_DetermineMusic
@@ -73,7 +71,7 @@ Overworld_FinishMirrorWarp:
BirdTravel_LoadTargetAreaMusic: BirdTravel_LoadTargetAreaMusic:
JSL Overworld_DetermineAmbientSFX JSL Overworld_DetermineAmbientSFX
JSL Overworld_DetermineMusic JSL Overworld_DetermineMusic
STZ $04C8 ; Clear peg puzzle count STZ.w $04C8 ; Clear peg puzzle count
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -189,7 +187,7 @@ Overworld_MosaicDarkWorldChecks:
; ;
; On entry, A=16bit XY=8bit, A & X safe to mod, Y unknown ; On entry, A=16bit XY=8bit, A & X safe to mod, Y unknown
Underworld_DoorDown_Entry: Underworld_DoorDown_Entry:
LDX #$FF ; some junk value to be used later to determine if the below lines will change the track LDX.b #$FF ; some junk value to be used later to determine if the below lines will change the track
LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #2 : !BLT .vanilla LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #2 : !BLT .vanilla
LDA.l DRMode : BNE .done LDA.l DRMode : BNE .done
@@ -202,11 +200,11 @@ Underworld_DoorDown_Entry:
.done .done
LDA.b RoomIndex : RTL LDA.b RoomIndex : RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; This is for changing to/from ToH dungeon/boss music
; ;--------------------------------------------------------------------------------
; A=16bit XY=8bit ; Check if the boss in ToH has been defeated (16-bit accumulator)
CheckHeraBossDefeated: CheckHeraBossDefeated:
LDA RoomDataWRAM[$07].high : AND.w #$00FF : BEQ + LDA.l RoomDataWRAM[$07].high : AND.w #$00FF : BEQ +
SEC : RTL SEC : RTL
+ CLC : RTL + CLC : RTL

View File

@@ -129,7 +129,7 @@ NewHUD_DrawDungeonCounters:
LDA.w UpdateHUDFlag : BEQ NewHUD_DrawPrizeIcon LDA.w UpdateHUDFlag : BEQ NewHUD_DrawPrizeIcon
LDA.l CompassMode : ORA.l MapHUDMode : BIT.b #$03 : BEQ NewHUD_DrawPrizeIcon LDA.l CompassMode : ORA.l MapHUDMode : BIT.b #$03 : BEQ NewHUD_DrawPrizeIcon
LDX.b IndoorsFlag : BNE + LDX.b IndoorsFlag : BNE +
JMP.w NewHUD_DrawMagicMeter JMP NewHUD_DrawMagicMeter
+ +
SEP #$30 SEP #$30
; extra hard safeties for getting dungeon ID to prevent crashes ; extra hard safeties for getting dungeon ID to prevent crashes
@@ -477,7 +477,7 @@ UpdateHearts:
INC INC
.add_heart .add_heart
STA.b ($07) STA.b (Scrap07)
DEY DEY
DEX DEX
@@ -513,14 +513,14 @@ UpdateHearts:
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
ORA.w #$20A1 ORA.w #$20A1
STA.b ($09) STA.b (Scrap09)
BRA .skip_partial BRA .skip_partial
.more_than_half .more_than_half
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
ORA.w #$20A0 ORA.w #$20A0
STA.b ($09) STA.b (Scrap09)
.skip_partial .skip_partial
SEP #$30 SEP #$30

View File

@@ -98,7 +98,7 @@ ProcessEventItems:
CMP.b #$E0 : BNE + CMP.b #$E0 : BNE +
REP #$30 ; set 16-bit accumulator & index registers REP #$30 ; set 16-bit accumulator & index registers
LDA.l RNGItem : ASL : TAX LDA.l RNGItem : ASL : TAX
LDA.l EventDataOffsets, X : !ADD #EventDataTable : STA.b Scrap00 LDA.l EventDataOffsets, X : !ADD.l #EventDataTable : STA.b Scrap00
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA.b #$AF : STA.b Scrap02 LDA.b #$AF : STA.b Scrap02
@@ -110,7 +110,7 @@ ProcessEventItems:
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.l GoalItemRequirement : BEQ ++ LDA.l GoalItemRequirement : BEQ ++
LDA.l GoalCounter : INC : STA.l GoalCounter LDA.l GoalCounter : INC : STA.l GoalCounter
CMP.l GoalItemRequirement : !BLT ++ CMP.l GoalItemRequirement : BCC ++
LDA.l TurnInGoalItems : AND.w #$00FF : BNE ++ LDA.l TurnInGoalItems : AND.w #$00FF : BNE ++
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA.b OverworldIndex : CMP.b #$80 : BNE +++ LDA.b OverworldIndex : CMP.b #$80 : BNE +++
@@ -164,9 +164,9 @@ RTL
ItemBehavior: ItemBehavior:
REP #$30 REP #$30
AND #$00FF : ASL : TAX AND.w #$00FF : ASL : TAX
SEP #$20 SEP #$20
JMP.w (ItemReceipts_behavior,X) JMP (ItemReceipts_behavior,X)
.skip .skip
RTS RTS
@@ -279,7 +279,7 @@ ItemBehavior:
RTS RTS
.bow .bow
BIT #$40 : BNE .silversbow BIT.b #$40 : BNE .silversbow
LDA.b #$01 : STA.l BowEquipment LDA.b #$01 : STA.l BowEquipment
RTS RTS
@@ -297,11 +297,11 @@ ItemBehavior:
TAX TAX
LDA.l DungeonItemMasks,X : TAY LDA.l DungeonItemMasks,X : TAY
ORA.l CompassField : STA.l CompassField ORA.l CompassField : STA.l CompassField
JMP.w .increment_compass JMP .increment_compass
..hc_sewers ..hc_sewers
LDA.w #$C000 : TAY LDA.w #$C000 : TAY
ORA.l CompassField : STA.l CompassField ORA.l CompassField : STA.l CompassField
JMP.w .increment_compass JMP .increment_compass
.dungeon_bigkey .dungeon_bigkey
@@ -309,10 +309,10 @@ ItemBehavior:
LDA.w DungeonID : CMP.w #$0003 : BCC ..hc_sewers LDA.w DungeonID : CMP.w #$0003 : BCC ..hc_sewers
TAX TAX
LDA.l DungeonItemMasks,X : ORA.l BigKeyField : STA.l BigKeyField LDA.l DungeonItemMasks,X : ORA.l BigKeyField : STA.l BigKeyField
JMP.w .increment_bigkey JMP .increment_bigkey
..hc_sewers ..hc_sewers
LDA.w #$C000 : ORA.l BigKeyField : STA.l BigKeyField LDA.w #$C000 : ORA.l BigKeyField : STA.l BigKeyField
JMP.w .increment_bigkey JMP .increment_bigkey
.dungeon_map .dungeon_map
REP #$20 REP #$20
@@ -320,11 +320,11 @@ ItemBehavior:
TAX TAX
LDA.l DungeonItemMasks,X : TAY LDA.l DungeonItemMasks,X : TAY
ORA.l MapField : STA.l MapField ORA.l MapField : STA.l MapField
JMP.w .increment_map JMP .increment_map
..hc_sewers ..hc_sewers
LDA.w #$C000 : TAY LDA.w #$C000 : TAY
ORA.l MapField : STA.l MapField ORA.l MapField : STA.l MapField
JMP.w .increment_map JMP .increment_map
.bow_and_arrows .bow_and_arrows
LDA.l BowTracking : BIT.b #$40 : BEQ .no_silvers LDA.l BowTracking : BIT.b #$40 : BEQ .no_silvers
@@ -442,7 +442,7 @@ ItemBehavior:
RTS RTS
.rupoor .rupoor
REP #$20 : LDA.l CurrentRupees : !SUB RupoorDeduction : STA.l CurrentRupees : SEP #$20 ; Take 1 rupee REP #$20 : LDA.l CurrentRupees : !SUB.l RupoorDeduction : STA.l CurrentRupees : SEP #$20 ; Take 1 rupee
RTS RTS
.null .null
@@ -508,13 +508,13 @@ ItemBehavior:
LDA.l DungeonItemMasks,X : TAY LDA.l DungeonItemMasks,X : TAY
ORA.l MapField : STA.l MapField ORA.l MapField : STA.l MapField
SEP #$20 SEP #$20
JMP.w .increment_map JMP .increment_map
.hc_map .hc_map
REP #$20 REP #$20
LDA.w #$C000 : TAY LDA.w #$C000 : TAY
ORA.l MapField : STA.l MapField ORA.l MapField : STA.l MapField
JMP.w .increment_map JMP .increment_map
.free_compass .free_compass
REP #$20 REP #$20
@@ -524,14 +524,14 @@ ItemBehavior:
LDA.l DungeonItemMasks,X : TAY LDA.l DungeonItemMasks,X : TAY
ORA.l CompassField : STA.l CompassField ORA.l CompassField : STA.l CompassField
SEP #$20 SEP #$20
JMP.w .increment_compass JMP .increment_compass
.hc_compass .hc_compass
REP #$20 REP #$20
LDA.w #$C000 : TAY LDA.w #$C000 : TAY
ORA.l CompassField : STA.l CompassField ORA.l CompassField : STA.l CompassField
SEP #$20 SEP #$20
JMP.w .increment_compass JMP .increment_compass
.free_bigkey .free_bigkey
REP #$20 REP #$20
@@ -540,11 +540,11 @@ ItemBehavior:
LDA.w DungeonItemIDMap,X : TAX LDA.w DungeonItemIDMap,X : TAX
LDA.l DungeonItemMasks,X : ORA.l BigKeyField : STA.l BigKeyField LDA.l DungeonItemMasks,X : ORA.l BigKeyField : STA.l BigKeyField
SEP #$20 SEP #$20
JMP.w .increment_bigkey JMP .increment_bigkey
.hc_bigkey .hc_bigkey
LDA.b #$C0 : ORA.l BigKeyField+1 : STA.l BigKeyField+1 LDA.b #$C0 : ORA.l BigKeyField+1 : STA.l BigKeyField+1
JMP.w .increment_bigkey JMP .increment_bigkey
.free_smallkey .free_smallkey
REP #$20 REP #$20
@@ -762,30 +762,30 @@ ResolveLootID:
REP #$30 REP #$30
AND.w #$00FF : ASL : TAX AND.w #$00FF : ASL : TAX
TYA TYA
JMP.w (ItemReceipts_resolution,X) JMP (ItemReceipts_resolution,X)
.have_item .have_item
SEP #$30 SEP #$30
PLB : PLX PLB : PLX
RTS RTS
.skip .skip
JMP.w .have_item JMP .have_item
.bottles .bottles
SEP #$30 SEP #$30
JSR CountBottles : CMP.l BottleLimit : BCC + JSR CountBottles : CMP.l BottleLimit : BCC +
LDA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE + LDA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE +
LDA.l BottleLimitReplacement LDA.l BottleLimitReplacement
JMP.w .get_item JMP .get_item
+ +
TYA TYA
JMP.w .have_item JMP .have_item
.magic .magic
SEP #$20 SEP #$20
LDA.l MagicConsumption : TAX LDA.l MagicConsumption : TAX
LDA.w .magic_ids,X LDA.w .magic_ids,X
JMP.w .have_item JMP .have_item
..ids ..ids
db $4E, $4F, $4F db $4E, $4F, $4F
@@ -795,12 +795,12 @@ ResolveLootID:
LDA.l HighestSword LDA.l HighestSword
CMP.l ProgressiveSwordLimit : BCC + CMP.l ProgressiveSwordLimit : BCC +
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JMP.w .get_item JMP .get_item
++ LDA.l SwordEquipment ++ LDA.l SwordEquipment
+ +
TAX TAX
LDA.w .prog_sword_ids,X LDA.w .prog_sword_ids,X
JMP.w .have_item JMP .have_item
..ids ..ids
db $49, $50, $02, $03, $03 db $49, $50, $02, $03, $03
@@ -811,12 +811,12 @@ ResolveLootID:
LDA.l HighestShield LDA.l HighestShield
CMP.l ProgressiveShieldLimit : BCC + CMP.l ProgressiveShieldLimit : BCC +
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JMP.w .get_item JMP .get_item
++ LDA.l HighestShield ++ LDA.l HighestShield
+ +
TAX TAX
LDA.w .shields_ids,X LDA.w .shields_ids,X
JMP.w .have_item JMP .have_item
..ids ..ids
db $04, $05, $06, $06 db $04, $05, $06, $06
@@ -826,12 +826,12 @@ ResolveLootID:
LDA.l HighestMail LDA.l HighestMail
CMP.l ProgressiveArmorLimit : BCC + CMP.l ProgressiveArmorLimit : BCC +
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JMP.w .get_item JMP .get_item
+ +
++ LDA.l ArmorEquipment ++ LDA.l ArmorEquipment
TAX TAX
LDA.w .armor_ids,X LDA.w .armor_ids,X
JMP.w .have_item JMP .have_item
..ids ..ids
db $22, $23, $23 db $22, $23, $23
@@ -840,7 +840,7 @@ ResolveLootID:
SEP #$20 SEP #$20
LDA.l GloveEquipment : TAX LDA.l GloveEquipment : TAX
LDA.w .gloves_ids,X LDA.w .gloves_ids,X
JMP.w .have_item JMP .have_item
..ids ..ids
db $1B, $1C, $1C db $1B, $1C, $1C
@@ -851,7 +851,7 @@ ResolveLootID:
LDA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipbowlimit LDA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipbowlimit
LDA.l BowEquipment : INC : LSR : CMP.l ProgressiveBowLimit : BCC + LDA.l BowEquipment : INC : LSR : CMP.l ProgressiveBowLimit : BCC +
LDA.l ProgressiveBowReplacement LDA.l ProgressiveBowReplacement
JMP.w .get_item JMP .get_item
+ +
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ + LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ +
LDX.w CurrentSpriteSlot LDX.w CurrentSpriteSlot
@@ -860,14 +860,14 @@ ResolveLootID:
.skipbowlimit .skipbowlimit
LDA.l BowEquipment : TAX LDA.l BowEquipment : TAX
LDA.w ResolveLootID_bows_ids,X LDA.w ResolveLootID_bows_ids,X
JMP.w .get_item JMP .get_item
.progressive_bow_2 .progressive_bow_2
SEP #$30 SEP #$30
LDA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipbowlimit_2 LDA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipbowlimit_2
LDA.l BowEquipment : INC : LSR : CMP.l ProgressiveBowLimit : BCC + LDA.l BowEquipment : INC : LSR : CMP.l ProgressiveBowLimit : BCC +
LDA.l ProgressiveBowReplacement LDA.l ProgressiveBowReplacement
JMP.w .get_item JMP .get_item
+ +
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ + LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ +
LDX.w CurrentSpriteSlot LDX.w CurrentSpriteSlot
@@ -876,7 +876,7 @@ ResolveLootID:
+ +
LDA.l BowEquipment : TAX LDA.l BowEquipment : TAX
LDA.w ResolveLootID_bows_ids,X LDA.w ResolveLootID_bows_ids,X
JMP.w .get_item JMP .get_item
.bows .bows
..ids ..ids
@@ -884,18 +884,18 @@ ResolveLootID:
.null_chest .null_chest
; JSL ChestItemServiceRequest ; JSL ChestItemServiceRequest
JMP.w .have_item JMP .have_item
.rng_single .rng_single
JSL GetRNGItemSingle : STA.w ScratchBufferV+6 JSL GetRNGItemSingle : STA.w ScratchBufferV+6
XBA : JSR MarkRNGItemSingle XBA : JSR MarkRNGItemSingle
LDA.b #$FF : STA.l RNGLockIn ; clear lock-in LDA.b #$FF : STA.l RNGLockIn ; clear lock-in
LDA.w ScratchBufferV+6 : JMP.w .get_item LDA.w ScratchBufferV+6 : JMP .get_item
.rng_multi .rng_multi
JSL GetRNGItemMulti : STA.w ScratchBufferV+6 JSL GetRNGItemMulti : STA.w ScratchBufferV+6
LDA.b #$FF : STA.l RNGLockIn ; clear lock-in LDA.b #$FF : STA.l RNGLockIn ; clear lock-in
LDA.w ScratchBufferV+6 : JMP.w .get_item LDA.w ScratchBufferV+6 : JMP .get_item
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DungeonItemMasks: DungeonItemMasks:

View File

@@ -152,7 +152,7 @@ org $9bed95 ; < ? - palettes.asm:748 ()
jsl OWWorldCheck16 : nop jsl OWWorldCheck16 : nop
org $82b16e ; AND #$3F : ORA 7EF3CA org $82b16e ; AND #$3F : ORA 7EF3CA
and #$7f : eor #$40 : nop #2 and.b #$7f : eor.b #$40 : nop #2
org $89C3C4 org $89C3C4
jsl OWBonkDropPrepSprite : nop #2 jsl OWBonkDropPrepSprite : nop #2
@@ -290,7 +290,7 @@ OWMirrorSpriteSkipDraw:
sec : rtl sec : rtl
.vanilla .vanilla
LDA.w $0FC6 : CMP.b #$03 ; what we wrote over LDA.w GfxChrHalfSlotVerify : CMP.b #$03 ; what we wrote over
RTL RTL
} }
OWLightWorldOrCrossed: OWLightWorldOrCrossed:
@@ -322,7 +322,7 @@ OWFluteCancel2:
} }
OWSmithAccept: OWSmithAccept:
{ {
lda FollowerIndicator : cmp.b #$07 : beq + lda.l FollowerIndicator : cmp.b #$07 : beq +
cmp.b #$08 : beq + cmp.b #$08 : beq +
clc : rtl clc : rtl
+ sec : rtl + sec : rtl
@@ -359,7 +359,7 @@ LoadMapDarkOrMixed:
CMP.b #!FLAG_OW_MIXED : REP #$30 : BEQ .mixed CMP.b #!FLAG_OW_MIXED : REP #$30 : BEQ .mixed
LDX.w #$03FE ; draw vanilla Dark World (what we wrote over) LDX.w #$03FE ; draw vanilla Dark World (what we wrote over)
.copy_next .copy_next
LDA.w WorldMap_DarkWorldTilemap,X : STA.w $1000,X LDA.w WorldMap_DarkWorldTilemap,X : STA.w GFXStripes,X
DEX : DEX : BPL .copy_next DEX : DEX : BPL .copy_next
BRL .end BRL .end
.mixed .mixed
@@ -526,7 +526,7 @@ OWBonkDrops:
; JSLSpriteSFX_QueueSFX3WithPan ; JSLSpriteSFX_QueueSFX3WithPan
.load_item_and_mw .load_item_and_mw
LDA 3,S : TAX : INX : LDA.w OWBonkPrizeData,X LDA.b 3,S : TAX : INX : LDA.w OWBonkPrizeData,X
PHA : INX : LDA.w OWBonkPrizeData,X : BEQ + PHA : INX : LDA.w OWBonkPrizeData,X : BEQ +
; multiworld item ; multiworld item
DEX : PLA ; A = item id; X = row + 3 DEX : PLA ; A = item id; X = row + 3
@@ -579,11 +579,11 @@ OWBonkDrops:
PLA : BNE + ; S = FlagBitmask, X (row + 2) PLA : BNE + ; S = FlagBitmask, X (row + 2)
TYX : JSL Sprite_IsOnscreen : BCC + TYX : JSL Sprite_IsOnscreen : BCC +
LDA.b IndoorsFlag : BEQ ++ LDA.b IndoorsFlag : BEQ ++
LDA.l RoomDataWRAM[$0120].high : ORA 1,S : STA.l RoomDataWRAM[$0120].high LDA.l RoomDataWRAM[$0120].high : ORA.b 1,S : STA.l RoomDataWRAM[$0120].high
LDA.w $0400 : ORA 1,S : STA.w $0400 LDA.w $0400 : ORA.b 1,S : STA.w $0400
BRA .increment_collection BRA .increment_collection
++ ++
LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X : ORA 1,S : STA.l OverworldEventDataWRAM,X LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X : ORA.b 1,S : STA.l OverworldEventDataWRAM,X
.increment_collection .increment_collection
REP #$20 REP #$20
@@ -626,7 +626,7 @@ OWBonkDrops:
; determines the initial spawn point of item ; determines the initial spawn point of item
PLX : INX : INX : INX PLX : INX : INX : INX
LDA.w SpritePosYLow,Y : SEC : SBC.w OWBonkPrizeData,X : STA.w SpritePosYLow,Y LDA.w SpritePosYLow,Y : SEC : SBC.w OWBonkPrizeData,X : STA.w SpritePosYLow,Y
LDA.w SpritePosYHigh,Y : SBC #$00 : STA.w SpritePosYHigh,Y LDA.w SpritePosYHigh,Y : SBC.b #$00 : STA.w SpritePosYHigh,Y
BRA .return+2 BRA .return+2
@@ -661,7 +661,7 @@ OWBonkDropCollected:
LDA.l RoomDataWRAM[$0120].high : AND.b 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2) LDA.l RoomDataWRAM[$0120].high : AND.b 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2)
SEC : RTS SEC : RTS
+ +
LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X : AND 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2) LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X : AND.b 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2)
SEC : RTS SEC : RTS
.return .return
@@ -758,7 +758,7 @@ OWEdgeTransition:
LDA.l Overworld_ActualScreenID,X : ORA.l CurrentWorld ; what we wrote over LDA.l Overworld_ActualScreenID,X : ORA.l CurrentWorld ; what we wrote over
TAX : LDA.l OWMode+1 : AND.b #!FLAG_OW_MIXED : BEQ .vanilla TAX : LDA.l OWMode+1 : AND.b #!FLAG_OW_MIXED : BEQ .vanilla
LDA.l OWTileWorldAssoc,X : CMP.l CurrentWorld : BEQ .vanilla ; if dest screen mismatches the current world LDA.l OWTileWorldAssoc,X : CMP.l CurrentWorld : BEQ .vanilla ; if dest screen mismatches the current world
TXA : EOR #$40 : RTL TXA : EOR.b #$40 : RTL
.vanilla .vanilla
TXA : RTL TXA : RTL
@@ -794,18 +794,18 @@ OWShuffle:
ldx.b OverworldIndex : lda.l OWTileWorldAssoc,X : eor.l CurrentWorld : beq + ldx.b OverworldIndex : lda.l OWTileWorldAssoc,X : eor.l CurrentWorld : beq +
; fake world, will treat this OW area as opposite world ; fake world, will treat this OW area as opposite world
txa : eor.b #$40 : tax txa : eor.b #$40 : tax
+ txa : and #$40 : !add.w OverworldSlotPosition : rep #$30 : and #$00ff : asl #3 + txa : and.b #$40 : !ADD.w OverworldSlotPosition : rep #$30 : and.w #$00ff : asl #3
adc 1,S : tax adc.b 1,S : tax
asl.w OverworldSlotPosition : pla asl.w OverworldSlotPosition : pla
;x = offset to edgeoffsets table ;x = offset to edgeoffsets table
sep #$20 : lda.l OWEdgeOffsets,x : and #$ff : beq .noTransition : pha ;get number of transitions sep #$20 : lda.l OWEdgeOffsets,x : and.b #$ff : beq .noTransition : pha ;get number of transitions
;s1 = number of transitions left to check ;s1 = number of transitions left to check
inx : lda.l OWEdgeOffsets,x ;record id of first transition in table inx : lda.l OWEdgeOffsets,x ;record id of first transition in table
;multiply ^ by 16, 16bytes per record ;multiply ^ by 16, 16bytes per record
sta.w CPUMULTA : lda #16 : sta.w CPUMULTB ;wait 8 cycles sta.w CPUMULTA : lda.b #16 : sta.w CPUMULTB ;wait 8 cycles
pla ;a = number of trans pla ;a = number of trans
rep #$20 rep #$20
and.w #$00ff and.w #$00ff
@@ -814,7 +814,7 @@ OWShuffle:
.nextTransition .nextTransition
pha pha
jsr OWSearchTransition_entry : bcs .newDestination jsr OWSearchTransition_entry : bcs .newDestination
txa : !add.w #$0010 : tax txa : !ADD.w #$0010 : tax
pla : dec : bne .nextTransition : bra .noTransition pla : dec : bne .nextTransition : bra .noTransition
.newDestination .newDestination
@@ -836,8 +836,8 @@ OWSearchTransition:
;A-16 XY-16 ;A-16 XY-16
lda.w TransitionDirection : bne + ;north lda.w TransitionDirection : bne + ;north
lda.l OWNorthEdges,x : dec lda.l OWNorthEdges,x : dec
cmp.b LinkPosX : !bge .exitloop cmp.b LinkPosX : !BGE .exitloop
lda.l OWNorthEdges+2,x : cmp.b LinkPosX : !blt .exitloop lda.l OWNorthEdges+2,x : cmp.b LinkPosX : !BLT .exitloop
;MATCH ;MATCH
lda.l OWNorthEdges+14,x : tay ;y = record id of dest lda.l OWNorthEdges+14,x : tay ;y = record id of dest
lda.l OWNorthEdges+12,x ;a = current terrain lda.l OWNorthEdges+12,x ;a = current terrain
@@ -845,8 +845,8 @@ OWSearchTransition:
bra .matchfound bra .matchfound
+ dec : bne + ;south + dec : bne + ;south
lda.l OWSouthEdges,x : dec lda.l OWSouthEdges,x : dec
cmp.b LinkPosX : !bge .exitloop cmp.b LinkPosX : !BGE .exitloop
lda.l OWSouthEdges+2,x : cmp.b LinkPosX : !blt .exitloop lda.l OWSouthEdges+2,x : cmp.b LinkPosX : !BLT .exitloop
;MATCH ;MATCH
lda.l OWSouthEdges+14,x : tay ;y = record id of dest lda.l OWSouthEdges+14,x : tay ;y = record id of dest
lda.l OWSouthEdges+12,x ;a = current terrain lda.l OWSouthEdges+12,x ;a = current terrain
@@ -854,16 +854,16 @@ OWSearchTransition:
bra .matchfound bra .matchfound
+ dec : bne + ; west + dec : bne + ; west
lda.l OWWestEdges,x : dec lda.l OWWestEdges,x : dec
cmp.b LinkPosY : !bge .exitloop cmp.b LinkPosY : !BGE .exitloop
lda.l OWWestEdges+2,x : cmp.b LinkPosY : !blt .exitloop lda.l OWWestEdges+2,x : cmp.b LinkPosY : !BLT .exitloop
;MATCH ;MATCH
lda.l OWWestEdges+14,x : tay ;y = record id of dest lda.l OWWestEdges+14,x : tay ;y = record id of dest
lda.l OWWestEdges+12,x ;a = current terrain lda.l OWWestEdges+12,x ;a = current terrain
ldx.w #OWEastEdges ;x = address of table ldx.w #OWEastEdges ;x = address of table
bra .matchfound bra .matchfound
+ lda.l OWEastEdges,x : dec ;east + lda.l OWEastEdges,x : dec ;east
cmp.b LinkPosY : !bge .exitloop cmp.b LinkPosY : !BGE .exitloop
lda.l OWEastEdges+2,x : cmp.b LinkPosY : !blt .exitloop lda.l OWEastEdges+2,x : cmp.b LinkPosY : !BLT .exitloop
;MATCH ;MATCH
lda.l OWEastEdges+14,x : tay ;y = record id of dest lda.l OWEastEdges+14,x : tay ;y = record id of dest
lda.l OWEastEdges+12,x ;a = current terrain lda.l OWEastEdges+12,x ;a = current terrain
@@ -877,7 +877,7 @@ OWSearchTransition:
OWNewDestination: OWNewDestination:
{ {
tya : sta.w CPUMULTA : lda.b #16 : sta.w CPUMULTB ;wait 8 cycles tya : sta.w CPUMULTA : lda.b #16 : sta.w CPUMULTB ;wait 8 cycles
rep #$20 : txa : nop : !add.w CPUPRODUCT : tax ;a = offset to dest record rep #$20 : txa : nop : !ADD.w CPUPRODUCT : tax ;a = offset to dest record
lda.w $0008,x : sta.b Scrap04 ;save dest OW slot/ID lda.w $0008,x : sta.b Scrap04 ;save dest OW slot/ID
ldy.b LinkPosY : lda.w TransitionDirection : dec #2 : bpl + : ldy.b LinkPosX : + sty.b Scrap06 ldy.b LinkPosY : lda.w TransitionDirection : dec #2 : bpl + : ldy.b LinkPosX : + sty.b Scrap06
@@ -888,21 +888,21 @@ OWNewDestination:
LDA.l OWMode : AND.w #$0007 : BEQ .noLayoutShuffle ;temporary fix until VRAM issues are solved LDA.l OWMode : AND.w #$0007 : BEQ .noLayoutShuffle ;temporary fix until VRAM issues are solved
lda.w $0006,x : sta.b Scrap06 ;set coord lda.w $0006,x : sta.b Scrap06 ;set coord
lda.w $000a,x : sta.b OverworldMap16Buffer ;VRAM lda.w $000a,x : sta.b OverworldMap16Buffer ;VRAM
tya : and.w #$01ff : cmp.b 3,s : !blt .adjustMainAxis tya : and.w #$01ff : cmp.b 3,s : !BLT .adjustMainAxis
dec : cmp.b 1,s : !bge .adjustMainAxis dec : cmp.b 1,s : !BGE .adjustMainAxis
inc : pha : lda.b Scrap06 : and.w #$fe00 : !add.b 1,s : sta.b Scrap06 : pla inc : pha : lda.b Scrap06 : and.w #$fe00 : !ADD.b 1,s : sta.b Scrap06 : pla
; adjust and set other VRAM addresses ; adjust and set other VRAM addresses
lda.w $0006,x : pha : lda.b Scrap06 : !sub 1,s lda.w $0006,x : pha : lda.b Scrap06 : !SUB 1,s
jsl DivideByTwoPreserveSign : jsl DivideByTwoPreserveSign : jsl DivideByTwoPreserveSign : jsl DivideByTwoPreserveSign : pha ; number of tiles jsl DivideByTwoPreserveSign : jsl DivideByTwoPreserveSign : jsl DivideByTwoPreserveSign : jsl DivideByTwoPreserveSign : pha ; number of tiles
lda.w TransitionDirection : dec #2 : bmi + lda.w TransitionDirection : dec #2 : bmi +
pla : pea.w $0000 : bra ++ ;pla : asl #7 : pha : bra ++ ; y-axis shifts VRAM by increments of 0x80 (disabled for now) pla : pea.w $0000 : bra ++ ;pla : asl #7 : pha : bra ++ ; y-axis shifts VRAM by increments of 0x80 (disabled for now)
+ pla : asl : pha ; x-axis shifts VRAM by increments of 0x02 + pla : asl : pha ; x-axis shifts VRAM by increments of 0x02
++ lda.b OverworldMap16Buffer : !add 1,s : sta.b OverworldMap16Buffer : pla : pla ++ lda.b OverworldMap16Buffer : !ADD.b 1,s : sta.b OverworldMap16Buffer : pla : pla
.adjustMainAxis .adjustMainAxis
LDA.b OverworldMap16Buffer : SEC : SBC #$0400 : AND #$0F00 : ASL : XBA : STA.b OverworldTilemapIndexY ; vram LDA.b OverworldMap16Buffer : SEC : SBC.w #$0400 : AND.w #$0F00 : ASL : XBA : STA.b OverworldTilemapIndexY ; vram
LDA.b OverworldMap16Buffer : SEC : SBC #$0010 : AND #$003E : LSR : STA.b OverworldTilemapIndexX LDA.b OverworldMap16Buffer : SEC : SBC.w #$0010 : AND.w #$003E : LSR : STA.b OverworldTilemapIndexX
.noLayoutShuffle .noLayoutShuffle
LDA.w $000F,X : AND.w #$00FF : STA.w RandoOverworldWalkDist ; position to walk to after transition (if non-zero) LDA.w $000F,X : AND.w #$00FF : STA.w RandoOverworldWalkDist ; position to walk to after transition (if non-zero)
@@ -920,47 +920,47 @@ OWNewDestination:
pla : pla : sep #$10 : ldy.w TransitionDirection pla : pla : sep #$10 : ldy.w TransitionDirection
ldx.w OWCoordIndex,y : lda.b LinkPosY,x : and.w #$fe00 : pha ldx.w OWCoordIndex,y : lda.b LinkPosY,x : and.w #$fe00 : pha
lda.b LinkPosY,x : and.w #$01ff : pha ;s1 = relative cur, s3 = ow cur lda.b LinkPosY,x : and.w #$01ff : pha ;s1 = relative cur, s3 = ow cur
lda.b Scrap06 : and #$fe00 : !sub.b 3,s : pha ;set coord, s1 = ow diff, s3 = relative cur, s5 = ow cur lda.b Scrap06 : and.w #$fe00 : !SUB.b 3,s : pha ;set coord, s1 = ow diff, s3 = relative cur, s5 = ow cur
lda.b Scrap06 : and.w #$01ff : !sub.b 3,s : pha ;s1 = rel diff, s3 = ow diff, s5 = relative cur, s7 = ow cur lda.b Scrap06 : and.w #$01ff : !SUB.b 3,s : pha ;s1 = rel diff, s3 = ow diff, s5 = relative cur, s7 = ow cur
lda.b Scrap06 : sta.b LinkPosY,x : and.w #$fe00 : sta.b Scrap06 ;set coord lda.b Scrap06 : sta.b LinkPosY,x : and.w #$fe00 : sta.b Scrap06 ;set coord
ldx.w OWBGIndex,y : lda.b BG2H,x : !add.b 1,s : adc.b 3,s : sta.b BG2H,x ldx.w OWBGIndex,y : lda.b BG2H,x : !ADD.b 1,s : adc.b 3,s : sta.b BG2H,x
ldx.w OWCameraIndex,y : lda.w CameraScrollN,x : !add.b 1,s : adc.b 3,s : sta.w CameraScrollN,x ldx.w OWCameraIndex,y : lda.w CameraScrollN,x : !ADD.b 1,s : adc.b 3,s : sta.w CameraScrollN,x
ldx.w OWCameraIndex,y : lda.w CameraScrollS,x : !add.b 1,s : adc.b 3,s : sta.w CameraScrollS,x ldx.w OWCameraIndex,y : lda.w CameraScrollS,x : !ADD.b 1,s : adc.b 3,s : sta.w CameraScrollS,x
pla : jsl DivideByTwoPreserveSign : pha pla : jsl DivideByTwoPreserveSign : pha
ldx.w OWBGIndex,y : lda.b BG1H,x : !add.b 1,s : sta.b BG1H,x : pla ldx.w OWBGIndex,y : lda.b BG1H,x : !ADD.b 1,s : sta.b BG1H,x : pla
ldx.w OWBGIndex,y : lda.b BG1H,x : !add.b 1,s : sta.b BG1H,x : pla ldx.w OWBGIndex,y : lda.b BG1H,x : !ADD.b 1,s : sta.b BG1H,x : pla
pla : pla pla : pla
;fix camera unlock ;fix camera unlock
lda.b BG2H,x : !sub.b Scrap06 : bpl + lda.b BG2H,x : !SUB.b Scrap06 : bpl +
pha : lda.b Scrap06 : sta.b BG2H,x pha : lda.b Scrap06 : sta.b BG2H,x
ldx.w OWCameraIndex,y : lda.w CameraScrollN,x : !sub.b 1,s : sta.w CameraScrollN,x ldx.w OWCameraIndex,y : lda.w CameraScrollN,x : !SUB.b 1,s : sta.w CameraScrollN,x
lda.w CameraScrollS,x : !sub.b 1,s : sta.w CameraScrollS,x : pla lda.w CameraScrollS,x : !SUB.b 1,s : sta.w CameraScrollS,x : pla
bra .adjustOppositeAxis bra .adjustOppositeAxis
+ lda.b Scrap06 : ldx.w OWCameraRangeIndex,y : !add.w OWCameraRange,x : sta.b Scrap06 + lda.b Scrap06 : ldx.w OWCameraRangeIndex,y : !ADD.w OWCameraRange,x : sta.b Scrap06
ldx.w OWBGIndex,y : !sub.b BG2H,x : bcs .adjustOppositeAxis ldx.w OWBGIndex,y : !SUB.b BG2H,x : bcs .adjustOppositeAxis
pha : lda.b Scrap06 : sta.b BG2H,x pha : lda.b Scrap06 : sta.b BG2H,x
ldx.w OWCameraIndex,y : lda.w CameraScrollN,x : !add.b 1,s : sta.w CameraScrollN,x ldx.w OWCameraIndex,y : lda.w CameraScrollN,x : !ADD.b 1,s : sta.w CameraScrollN,x
lda.w CameraScrollS,x : !add.b 1,s : sta.w CameraScrollS,x : pla lda.w CameraScrollS,x : !ADD.b 1,s : sta.w CameraScrollS,x : pla
.adjustOppositeAxis .adjustOppositeAxis
;opposite coord stuff ;opposite coord stuff
rep #$30 : lda OWOppDirectionOffset,y : and.w #$00ff : bit.w #$0080 : beq + rep #$30 : lda.w OWOppDirectionOffset,y : and.w #$00ff : bit.w #$0080 : beq +
ora.w #$ff00 ;extend 8-bit negative to 16-bit negative ora.w #$ff00 ;extend 8-bit negative to 16-bit negative
+ pha : cpy.w #$0002 : lda.w OverworldSlotPosition : !bge + + pha : cpy.w #$0002 : lda.w OverworldSlotPosition : !BGE +
and.w #$00f0 : pha : lda.b Scrap04 : asl : and.w #$0070 : !sub.b 1,s : tax : pla : txa and.w #$00f0 : pha : lda.b Scrap04 : asl : and.w #$0070 : !SUB.b 1,s : tax : pla : txa
!add 1,s : tax : pla : txa : asl : asl : asl : asl : asl : pha : bra ++ !ADD.b 1,s : tax : pla : txa : asl : asl : asl : asl : asl : pha : bra ++
+ and.w #$000f : pha : lda.b Scrap04 : asl : and.w #$000f : !sub.b 1,s : !add.b 3,s + and.w #$000f : pha : lda.b Scrap04 : asl : and.w #$000f : !SUB.b 1,s : !ADD.b 3,s
sep #$10 : tax : phx : ldx.b #$0 : phx : rep #$10 : pla : plx : plx : pha sep #$10 : tax : phx : ldx.b #$0 : phx : rep #$10 : pla : plx : plx : pha
++ sep #$10 : ldx OWOppCoordIndex,y : lda.b LinkPosY,x : !add.b 1,s : sta.b LinkPosY,x ;set coord ++ sep #$10 : ldx.w OWOppCoordIndex,y : lda.b LinkPosY,x : !ADD.b 1,s : sta.b LinkPosY,x ;set coord
ldx OWOppBGIndex,y : lda.b BG2H,x : !add.b 1,s : sta.b BG2H,x ldx.w OWOppBGIndex,y : lda.b BG2H,x : !ADD.b 1,s : sta.b BG2H,x
ldx OWOppCameraIndex,y : lda.w CameraScrollN,x : !add.b 1,s : sta.w CameraScrollN,x ldx.w OWOppCameraIndex,y : lda.w CameraScrollN,x : !ADD.b 1,s : sta.w CameraScrollN,x
ldx OWOppCameraIndex,y : lda.w CameraScrollS,x : !add.b 1,s : sta.w CameraScrollS,x ldx.w OWOppCameraIndex,y : lda.w CameraScrollS,x : !ADD.b 1,s : sta.w CameraScrollS,x
ldx OWOppBGIndex,y : lda.b BG1H,x : !add.b 1,s : sta.b BG1H,x ldx.w OWOppBGIndex,y : lda.b BG1H,x : !ADD.b 1,s : sta.b BG1H,x
lda.w TransitionDirection : asl : tax : lda.w CameraTargetN,x : !add.b 1,s : sta.w CameraTargetN,x : pla lda.w TransitionDirection : asl : tax : lda.w CameraTargetN,x : !ADD.b 1,s : sta.w CameraTargetN,x : pla
sep #$30 : lda.b Scrap04 : and.b #$3f : !add OWOppSlotOffset,y : asl : sta.w OverworldSlotPosition sep #$30 : lda.b Scrap04 : and.b #$3f : !ADD.w OWOppSlotOffset,y : asl : sta.w OverworldSlotPosition
; crossed OW shuffle and terrain ; crossed OW shuffle and terrain
ldx.b Scrap05 : ldy.b Scrap08 : jsr OWWorldTerrainUpdate ldx.b Scrap05 : ldy.b Scrap08 : jsr OWWorldTerrainUpdate

View File

@@ -260,7 +260,7 @@ LoadPasswordStripeTemplate:
LDA.b #Password_StripeImageTemplate_end-Password_StripeImageTemplate>>8 LDA.b #Password_StripeImageTemplate_end-Password_StripeImageTemplate>>8
STA.w DAS0H ; set transfer size STA.w DAS0H ; set transfer size
LDA.b #$01 : STA.w MDMAEN ; begin DMA transfer LDA.b #$01 : STA.w DMAENABLE ; begin DMA transfer
PLA : STA.w DAS0H : PLA : STA.w DAS0L : PLA : STA.w A1B0 ; restore DMA parameters PLA : STA.w DAS0H : PLA : STA.w DAS0L : PLA : STA.w A1B0 ; restore DMA parameters
PLA : STA.w A1T0H : PLA : STA.w A1T0L : PLA : STA.w BBAD0 ; restore DMA parameters PLA : STA.w A1T0H : PLA : STA.w A1T0L : PLA : STA.w BBAD0 ; restore DMA parameters

View File

@@ -83,7 +83,7 @@ BringMenuDownEnhanced:
EOR.w #$FFFF : !ADD.w #$0001 ; negate menu speed EOR.w #$FFFF : !ADD.w #$0001 ; negate menu speed
!ADD BG3VOFSQL : CMP.w #$FF18 : !BGE .noOvershoot !ADD.l BG3VOFSQL : CMP.w #$FF18 : !BGE .noOvershoot
LDA.w #$FF18 ; if we went past the limit, go to the limit LDA.w #$FF18 ; if we went past the limit, go to the limit
.noOvershoot .noOvershoot
STA.b BG3VOFSQL : CMP.w #$FF18 STA.b BG3VOFSQL : CMP.w #$FF18
@@ -101,7 +101,7 @@ RaiseHudMenu:
LDA.l MenuSpeed : AND.w #$00FF LDA.l MenuSpeed : AND.w #$00FF
++ ++
!ADD BG3VOFSQL : BMI .noOvershoot !ADD.l BG3VOFSQL : BMI .noOvershoot
LDA.w #$0000 ; if we went past the limit, go to the limit LDA.w #$0000 ; if we went past the limit, go to the limit
.noOvershoot .noOvershoot
STA.b BG3VOFSQL STA.b BG3VOFSQL

View File

@@ -128,5 +128,5 @@ RTL
TYA : CLC : ADC.b Scrap03 : TAY TYA : CLC : ADC.b Scrap03 : TAY
SEP #$20 SEP #$20
LDA.b Scrap07 : ORA.b #$80 : STA.w VMAIN LDA.b Scrap07 : ORA.b #$80 : STA.w VMAIN
LDA.b #$02 : STA.w MDMAEN LDA.b #$02 : STA.w DMAENABLE
JMP.w .check_next JMP .check_next

View File

@@ -14,7 +14,7 @@ RefillHealth:
LDA.l PotionHealthRefill : CMP.b #$A0 : !BGE .done LDA.l PotionHealthRefill : CMP.b #$A0 : !BGE .done
LDA.l BusyHealth : BNE ++ LDA.l BusyHealth : BNE ++
LDA.l PotionHealthRefill ; load refill amount LDA.l PotionHealthRefill ; load refill amount
!ADD CurrentHealth ; add to current health !ADD.l CurrentHealth ; add to current health
CMP.l MaximumHealth : !BLT +++ : LDA.l MaximumHealth : +++ CMP.l MaximumHealth : !BLT +++ : LDA.l MaximumHealth : +++
STA.l BusyHealth STA.l BusyHealth
++ ++
@@ -60,7 +60,7 @@ RefillMagic:
LDA.l PotionMagicRefill : CMP.b #$80 : !BGE .done LDA.l PotionMagicRefill : CMP.b #$80 : !BGE .done
LDA.l BusyMagic : BNE ++ LDA.l BusyMagic : BNE ++
LDA.l PotionMagicRefill ; load refill amount LDA.l PotionMagicRefill ; load refill amount
!ADD CurrentMagic ; add to current magic !ADD.l CurrentMagic ; add to current magic
CMP.b #$80 : !BLT +++ : LDA.b #$80 : +++ CMP.b #$80 : !BLT +++ : LDA.b #$80 : +++
STA.l BusyMagic STA.l BusyMagic
++ ++

16
ram.asm
View File

@@ -108,7 +108,7 @@ W34SELQ = $7E0097 ;
WOBJSELQ = $7E0098 ; WOBJSELQ = $7E0098 ;
CGWSELQ = $7E0099 ; CGWSELQ = $7E0099 ;
CGADSUBQ = $7E009A ; CGADSUBQ = $7E009A ;
HDMAENQ = $7E009B ; HDMA enable flags HDMAENABLEQ = $7E009B ; HDMA enable flags
; ;
RoomIndex = $7E00A0 ; Underworld room index. Word length. High byte: $00 = EG1 | $01 = EG2 RoomIndex = $7E00A0 ; Underworld room index. Word length. High byte: $00 = EG1 | $01 = EG2
; Not zeroed on exit to overworld. ; Not zeroed on exit to overworld.
@@ -270,6 +270,8 @@ DungeonID = $7E040C ; High byte mostly unused but sometimes read.
; ;
TransitionDirection = $7E0418 ; OW: 0=N 1=S 2=W 3=E UW: 0=S 1=N 2=E 3=W TransitionDirection = $7E0418 ; OW: 0=N 1=S 2=W 3=E UW: 0=S 1=N 2=E 3=W
; ;
TrapDoorFlag = $7E0468 ; Flag that is set when trap doors are down. 2 bytes
;
LayerAdjustment = $7E047A ; Flags layer adjustments. Arms EG. LayerAdjustment = $7E047A ; Flags layer adjustments. Arms EG.
; ;
RoomIndexMirror = $7E048E ; Mirrors RoomIndex RoomIndexMirror = $7E048E ; Mirrors RoomIndex
@@ -296,6 +298,9 @@ SpriteRoomTag = $7E0642 ; Set high by sprites triggering room tags.
; ;
SomariaSwitchFlag = $7E0646 ; Set by Somaria when on a switch. SomariaSwitchFlag = $7E0646 ; Set by Somaria when on a switch.
; ;
TileMapDoorPos = $7E068E ; (Dungeon) ???? related to trap doors and if they are open ; possibly bomb doors too? Update: module 0x07.0x4 probably uses this to know whether it's a key door or big key door to open. Word length.
DoorTimer = $7E0690 ; Timer for animating doors, like Sanc or HC overworld doors
;
TileMapEntranceDoors = $7E0696 ; Tilemap location of entrance doors. Word length. TileMapEntranceDoors = $7E0696 ; Tilemap location of entrance doors. Word length.
TileMapTile32 = $7E0698 ; Tilemap location of new tile32 objects, such as from graves/rocks. Word length. TileMapTile32 = $7E0698 ; Tilemap location of new tile32 objects, such as from graves/rocks. Word length.
; ;
@@ -382,6 +387,7 @@ SpriteForceDrop = $7E0CBA ; Forces drops on sprite death. $10 bytes.
; ;
SpriteBump = $7E0CD2 ; See symbols_wram.asm. $10 bytes. SpriteBump = $7E0CD2 ; See symbols_wram.asm. $10 bytes.
; ;
BossSpecialAction = $7E0CF3 ; Indicates special action required for some bosses
TreePullKills = $7E0CFB ; Kills for tree pulls. TreePullKills = $7E0CFB ; Kills for tree pulls.
TreePullHits = $7E0CFC ; Hits taken for tree pulls. TreePullHits = $7E0CFC ; Hits taken for tree pulls.
; ;
@@ -410,7 +416,7 @@ SpriteOAMProperties = $7E0E40 ; h m w o o o o o | h = Harmless | m = m
SpriteHitPoints = $7E0E50 ; Set from $0DB173 SpriteHitPoints = $7E0E50 ; Set from $0DB173
SpriteControl = $7E0E60 ; n i o s p p p t | n = Death animation? | i = Immune to attack/collion? SpriteControl = $7E0E60 ; n i o s p p p t | n = Death animation? | i = Immune to attack/collion?
; o = Shadow | p = OAM prop palette | t = OAM prop name table ; o = Shadow | p = OAM prop palette | t = OAM prop name table
SpriteJumpIndex = $7E0E80 ; Sprite Item Type. Also used for jump table local. $10 bytes. SpriteJumpIndex = $7E0E80 ; Sprite jump table local. $10 bytes.
; ;
SpriteDirectionTable = $7E0EB0 ; Sprite direction. $10 bytes. SpriteDirectionTable = $7E0EB0 ; Sprite direction. $10 bytes.
; ;
@@ -763,7 +769,7 @@ endmacro
%assertRAM(WOBJSELQ, $7E0098) %assertRAM(WOBJSELQ, $7E0098)
%assertRAM(CGWSELQ, $7E0099) %assertRAM(CGWSELQ, $7E0099)
%assertRAM(CGADSUBQ, $7E009A) %assertRAM(CGADSUBQ, $7E009A)
%assertRAM(HDMAENQ, $7E009B) %assertRAM(HDMAENABLEQ, $7E009B)
%assertRAM(RoomIndex, $7E00A0) %assertRAM(RoomIndex, $7E00A0)
%assertRAM(PreviousRoom, $7E00A2) %assertRAM(PreviousRoom, $7E00A2)
%assertRAM(CameraBoundH, $7E00A6) %assertRAM(CameraBoundH, $7E00A6)
@@ -847,6 +853,7 @@ endmacro
%assertRAM(OverworldIndexMirror, $7E040A) %assertRAM(OverworldIndexMirror, $7E040A)
%assertRAM(DungeonID, $7E040C) %assertRAM(DungeonID, $7E040C)
%assertRAM(TransitionDirection, $7E0418) %assertRAM(TransitionDirection, $7E0418)
%assertRAM(TrapDoorFlag, $7E0468)
%assertRAM(LayerAdjustment, $7E047A) %assertRAM(LayerAdjustment, $7E047A)
%assertRAM(RoomIndexMirror, $7E048E) %assertRAM(RoomIndexMirror, $7E048E)
%assertRAM(RespawnFlag, $7E04AA) %assertRAM(RespawnFlag, $7E04AA)
@@ -864,6 +871,8 @@ endmacro
%assertRAM(NMIAux, $7E0632) %assertRAM(NMIAux, $7E0632)
%assertRAM(SpriteRoomTag, $7E0642) %assertRAM(SpriteRoomTag, $7E0642)
%assertRAM(SomariaSwitchFlag, $7E0646) %assertRAM(SomariaSwitchFlag, $7E0646)
%assertRAM(TileMapDoorPos, $7E068E)
%assertRAM(DoorTimer, $7E0690)
%assertRAM(TileMapEntranceDoors, $7E0696) %assertRAM(TileMapEntranceDoors, $7E0696)
%assertRAM(TileMapTile32, $7E0698) %assertRAM(TileMapTile32, $7E0698)
%assertRAM(RandoOverworldEdgeAddr, $7E06F8) %assertRAM(RandoOverworldEdgeAddr, $7E06F8)
@@ -911,6 +920,7 @@ endmacro
%assertRAM(AncillaLayer, $7E0C7C) %assertRAM(AncillaLayer, $7E0C7C)
%assertRAM(SpriteForceDrop, $7E0CBA) %assertRAM(SpriteForceDrop, $7E0CBA)
%assertRAM(SpriteBump, $7E0CD2) %assertRAM(SpriteBump, $7E0CD2)
%assertRAM(BossSpecialAction, $7E0CF3)
%assertRAM(TreePullKills, $7E0CFB) %assertRAM(TreePullKills, $7E0CFB)
%assertRAM(TreePullHits, $7E0CFC) %assertRAM(TreePullHits, $7E0CFC)
%assertRAM(SpritePosYLow, $7E0D00) %assertRAM(SpritePosYLow, $7E0D00)

View File

@@ -1390,8 +1390,8 @@ endmacro
%assertREG(HTIMEH, $4208) %assertREG(HTIMEH, $4208)
%assertREG(VTIMEL, $4209) %assertREG(VTIMEL, $4209)
%assertREG(VTIMEH, $420A) %assertREG(VTIMEH, $420A)
%assertREG(MDMAEN, $420B) %assertREG(DMAENABLE, $420B)
%assertREG(HDMAEN, $420C) %assertREG(HDMAENABLE, $420C)
%assertREG(MEMSEL, $420D) %assertREG(MEMSEL, $420D)
%assertREG(RDNMI, $4210) %assertREG(RDNMI, $4210)
%assertREG(TIMEUP, $4211) %assertREG(TIMEUP, $4211)

View File

@@ -67,7 +67,7 @@ macro ServiceRequestChest(type)
LDA.b OverworldIndex : STA.l TxBuffer+9 ; area id LDA.b OverworldIndex : STA.l TxBuffer+9 ; area id
LDA.b #$00 : STA.l TxBuffer+10 ; protocol defines this as a ushort LDA.b #$00 : STA.l TxBuffer+10 ; protocol defines this as a ushort
++ ++
LDA.b $76 : !SUB #$58 : STA.l TxBuffer+11 ; object index (type 2 only) LDA.b $76 : !SUB.b #$58 : STA.l TxBuffer+11 ; object index (type 2 only)
LDA.b #<type> : STA.l TxBuffer ; item get LDA.b #<type> : STA.l TxBuffer ; item get
LDA.b #$01 : STA.l TxStatus ; mark ready for reading LDA.b #$01 : STA.l TxStatus ; mark ready for reading
SEC ; mark request as successful SEC ; mark request as successful

View File

@@ -77,12 +77,12 @@ dw 4, 0, -4, -8
SpritePrep_ShopKeeper_PotionShop: SpritePrep_ShopKeeper_PotionShop:
JSL SpritePrep_ShopKeeper JSL SpritePrep_ShopKeeper
LDA.l ShopType : CMP.b #$FF : BNE + LDA.l ShopType : CMP.b #$FF : BNE +
JSL SpritePrep_PotionShopLong JSL SpritePrep_MagicShopAssistant
RTL RTL
+ LDX.b #$0 + LDX.b #$0
PHK : PEA.w .jslrtsreturn-1 PHK : PEA.w .jslrtsreturn-1
PEA.w $85f527 ; an rtl address - 1 in Bank05 PEA.w $85f527 ; an rtl address - 1 in Bank05
JML SpawnMagicPowder JML MagicShopAssistant_SpawnPowder
.jslrtsreturn .jslrtsreturn
RTL RTL
@@ -132,7 +132,7 @@ SpritePrep_ShopKeeper:
PLA : STA.l ShopInventoryPlayer, X : LDA.b #0 : STA.l ShopInventoryDisguise, X : PLX PLA : STA.l ShopInventoryPlayer, X : LDA.b #0 : STA.l ShopInventoryDisguise, X : PLX
PHY PHY
PHX PHX
LDA.b #$00 : XBA : TYA : LSR #2 : !ADD ShopSRAMIndex : TAX LDA.b #0 : XBA : TYA : LSR #2 : !ADD.l ShopSRAMIndex : TAX
LDA.l PurchaseCounts, X : TYX : STA.l ShopInventory+3, X : TAY LDA.l PurchaseCounts, X : TYX : STA.l ShopInventory+3, X : TAY
PLX PLX
@@ -258,11 +258,11 @@ Shopkepeer_CallOriginal:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
Sprite_ShopKeeperPotion: Sprite_ShopKeeperPotion:
LDA.l ShopType : CMP.b #$FF : BNE + : JMP.w ShopkepeerPotion_CallOriginal : + LDA.l ShopType : CMP.b #$FF : BNE + : JMP ShopkepeerPotion_CallOriginal : +
TXA : BEQ + TXA : BEQ +
PHK : PEA.w .jslrtsreturn2-1 PHK : PEA.w .jslrtsreturn2-1
PEA.w $85f527 ; an rtl address - 1 in Bank05 PEA.w $85f527 ; an rtl address - 1 in Bank05
JML Sprite_MagicPowderItem JML Sprite_BagOfPowder
.jslrtsreturn2 .jslrtsreturn2
RTL RTL
+ +
@@ -277,14 +277,14 @@ Sprite_ShopKeeperPotion:
LDA.w SpriteJumpIndex, X : BNE + LDA.w SpriteJumpIndex, X : BNE +
PHK : PEA.w .jslrtsreturn-1 PHK : PEA.w .jslrtsreturn-1
PEA.w $85f527 ; an rtl address - 1 in Bank05 PEA.w $85f527 ; an rtl address - 1 in Bank05
JML Sprite_WitchAssistant JML MagicShopAssistant_Main
.jslrtsreturn .jslrtsreturn
+ +
RTL RTL
Sprite_ShopKeeper: Sprite_ShopKeeper:
LDA.l ShopType : CMP.b #$FF : BNE + : JMP.w Shopkepeer_CallOriginal : + LDA.l ShopType : CMP.b #$FF : BNE + : JMP Shopkepeer_CallOriginal : +
PHB : PHK : PLB PHB : PHK : PLB
JSL Sprite_PlayerCantPassThrough JSL Sprite_PlayerCantPassThrough
@@ -368,7 +368,7 @@ Shopkeeper_DrawMerchant_Type1:
LDA.b #$01 : STA.b Scrap06 ; request 1 OAM slot LDA.b #$01 : STA.b Scrap06 ; request 1 OAM slot
LDA.b #$04 : JSL OAM_AllocateFromRegionA ; request 4 bytes LDA.b #$04 : JSL OAM_AllocateFromRegionA ; request 4 bytes
STZ.b Scrap07 STZ.b Scrap07
LDA.b FrameCounter : AND #$08 : BEQ + LDA.b FrameCounter : AND.b #$08 : BEQ +
LDA.b #.oam_shopkeeper_f1 : STA.b Scrap08 LDA.b #.oam_shopkeeper_f1 : STA.b Scrap08
LDA.b #.oam_shopkeeper_f1>>8 : STA.b Scrap09 LDA.b #.oam_shopkeeper_f1>>8 : STA.b Scrap09
BRA ++ BRA ++
@@ -454,12 +454,12 @@ Shopkeeper_BuyItem:
JMP .done JMP .done
.buy .buy
LDA.l ShopType : AND.b #$80 : BNE ++ ; don't charge if this is a take-any LDA.l ShopType : AND.b #$80 : BNE ++ ; don't charge if this is a take-any
REP #$20 : LDA.l CurrentRupees : !SUB ShopInventory+1, X : STA.l CurrentRupees : SEP #$20 ; Take price away REP #$20 : LDA.l CurrentRupees : !SUB.l ShopInventory+1, X : STA.l CurrentRupees : SEP #$20 ; Take price away
++ ++
PHX PHX
LDA.b #0 : XBA : TXA : LSR #2 : TAX LDA.b #0 : XBA : TXA : LSR #2 : TAX
LDA.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
TXA : !ADD ShopSRAMIndex : TAX TXA : !ADD.l ShopSRAMIndex : TAX
LDA.l PurchaseCounts, X : BNE +++ ;Is this the first time buying this slot? LDA.l PurchaseCounts, X : BNE +++ ;Is this the first time buying this slot?
LDA.l EnableShopItemCount, X : STA.l ShopEnableCount ; If so, store the permission to count the item here. LDA.l EnableShopItemCount, X : STA.l ShopEnableCount ; If so, store the permission to count the item here.
+++ +++
@@ -472,10 +472,10 @@ Shopkeeper_BuyItem:
LDA.b #0 : STA.l ShopEnableCount LDA.b #0 : STA.l ShopEnableCount
TXA : LSR #2 : TAX TXA : LSR #2 : TAX
LDA.l ShopType : BIT.b #$80 : BNE + LDA.l ShopType : BIT.b #$80 : BNE +
LDA ShopkeeperRefill : BNE +++ LDA.l ShopkeeperRefill : BNE +++
LDA.l ShopState : ORA.w Shopkeeper_ItemMasks, X : STA.l ShopState LDA.l ShopState : ORA.w Shopkeeper_ItemMasks, X : STA.l ShopState
+++ PHX +++ PHX
TXA : !ADD ShopSRAMIndex : TAX TXA : !ADD.l ShopSRAMIndex : TAX
LDA.l PurchaseCounts, X : INC : BEQ +++ : STA.l PurchaseCounts, X : +++ LDA.l PurchaseCounts, X : INC : BEQ +++ : STA.l PurchaseCounts, X : +++
PLX PLX
BRA ++ BRA ++
@@ -496,7 +496,7 @@ Shopkeeper_BuyItem:
PLX PLX
++ ++
.done .done
LDA.b #$0 : STA.l ShopkeeperRefill LDA.b #$00 : STA.l ShopkeeperRefill
PLY : PLX PLY : PLX
RTS RTS
Shopkeeper_ItemMasks: Shopkeeper_ItemMasks:
@@ -520,7 +520,7 @@ Setup_ShopItemCollisionHitbox:
LDA.w Shopkeeper_DrawNextItem_item_offsets_idx, Y : STA.b Scrap00 ; get table from the table table LDA.w Shopkeeper_DrawNextItem_item_offsets_idx, Y : STA.b Scrap00 ; get table from the table table
PLY : PLA PLY : PLA
!ADD ($00), Y !ADD.b (Scrap00), Y
!ADD.w #$0002 ; a small negative margin !ADD.w #$0002 ; a small negative margin
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
@@ -532,7 +532,7 @@ Setup_ShopItemCollisionHitbox:
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
PHY : INY #2 PHY : INY #2
!ADD ($00), Y !ADD.b (Scrap00), Y
PLY PLY
PHA : LDA.l ShopType : AND.w #$0080 : BEQ + ; lower by 4 for Take-any PHA : LDA.l ShopType : AND.w #$0080 : BEQ + ; lower by 4 for Take-any
PLA : !ADD.w #$0004 PLA : !ADD.w #$0004
@@ -625,12 +625,12 @@ Shopkeeper_DrawNextItem:
LDA.b RoomIndex : CMP.w #$109 : BNE + : INY #6 : + LDA.b RoomIndex : CMP.w #$109 : BNE + : INY #6 : +
LDA.w .item_offsets_idx, Y : STA.b Scrap00 ; get table from the table table LDA.w .item_offsets_idx, Y : STA.b Scrap00 ; get table from the table table
LDA.b 1,s : ASL #2 : TAY ; set Y to the item index LDA.b 1,s : ASL #2 : TAY ; set Y to the item index
LDA.b ($00), Y : STA.l SpriteOAM ; load X-coordinate LDA.b (Scrap00), Y : STA.l SpriteOAM ; load X-coordinate
INY #2 INY #2
LDA.l ShopType : AND.w #$0080 : BNE + LDA.l ShopType : AND.w #$0080 : BNE +
LDA.b ($00), Y : STA.l SpriteOAM+2 : BRA ++ ; load Y-coordinate LDA.b (Scrap00), Y : STA.l SpriteOAM+2 : BRA ++ ; load Y-coordinate
+ +
LDA.b ($00), Y : !ADD.w #$0004 : STA.l SpriteOAM+2 ; load Y-coordinate LDA.b (Scrap00), Y : !ADD.w #$0004 : STA.l SpriteOAM+2 ; load Y-coordinate
++ ++
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
PLY PLY
@@ -804,10 +804,10 @@ Shopkeeper_DrawNextPrice:
LDA.w .price_columns_idx, Y : STA.b Scrap02 ; get table from the table table LDA.w .price_columns_idx, Y : STA.b Scrap02 ; get table from the table table
PLY : PHY PLY : PHY
TYA : ASL #2 : TAY TYA : ASL #2 : TAY
LDA.b ($00), Y : STA.b Scrap0E ; set coordinate LDA.b (Scrap00), Y : STA.b Scrap0E ; set coordinate
TYA : LSR : TAY TYA : LSR : TAY
LDA.b ($02), Y : STA.l ShopPriceColumn LDA.b (Scrap02), Y : STA.l ShopPriceColumn
INY : LDA.b ($02), Y : STA.l ShopPriceColumn+1 INY : LDA.b (Scrap02), Y : STA.l ShopPriceColumn+1
PLY PLY
LDA.l ShopInventory+1, X : STA.b Scrap0C ; set value LDA.l ShopInventory+1, X : STA.b Scrap0C ; set value
@@ -822,9 +822,9 @@ Shopkeeper_DrawNextPrice:
PHX : PHA : LDA.l ShopScratch : TAX : PLA : JSL Sprite_DrawMultiple_quantity_preset : PLX PHX : PHA : LDA.l ShopScratch : TAX : PLA : JSL Sprite_DrawMultiple_quantity_preset : PLX
LDA.b 1,s LDA.b 1,s
ASL #2 : !ADD OAMPtr : STA.b OAMPtr ; increment oam pointer ASL #2 : !ADD.b OAMPtr : STA.b OAMPtr ; increment oam pointer
PLA PLA
!ADD OAMPtr+2 : STA.b OAMPtr+2 !ADD.b OAMPtr+2 : STA.b OAMPtr+2
.free .free
PLP : PLY : PLX PLP : PLY : PLX
PLB PLB

View File

@@ -42,7 +42,7 @@ DungeonHoleEntranceTransition:
LDA.l BowTracking : AND.b #$40 : BEQ + ; skip if we don't have silvers LDA.l BowTracking : AND.b #$40 : BEQ + ; skip if we don't have silvers
LDA.l BowEquipment : BEQ + ; skip if we have no bow LDA.l BowEquipment : BEQ + ; skip if we have no bow
CMP.b #$03 : !BGE + ; skip if the bow is already silver CMP.b #$03 : !BGE + ; skip if the bow is already silver
!ADD #$02 : STA.l BowEquipment ; increase bow to silver !ADD.b #$02 : STA.l BowEquipment ; increase bow to silver
+ +
BRA StatTransitionCounter BRA StatTransitionCounter
@@ -339,19 +339,19 @@ StatsFinalPrep:
LDA.l ScreenTransitions : DEC : STA.l ScreenTransitions ; remove extra transition from exiting gtower via duck LDA.l ScreenTransitions : DEC : STA.l ScreenTransitions ; remove extra transition from exiting gtower via duck
.ramPostOnly .ramPostOnly
LDA.l SwordBossKills : LSR #4 : !ADD SwordBossKills : STA.l BossKills LDA.l SwordBossKills : LSR #4 : !ADD.l SwordBossKills : STA.l BossKills
LDA.l SwordBossKills+1 : LSR #4 : !ADD SwordBossKills+1 : !ADD BossKills : AND.b #$0F : STA.l BossKills LDA.l SwordBossKills+1 : LSR #4 : !ADD.l SwordBossKills+1 : !ADD.l BossKills : AND.b #$0F : STA.l BossKills
LDA.l NMIFrames : !SUB LoopFrames : STA.l LagTime LDA.l NMIFrames : !SUB.l LoopFrames : STA.l LagTime
LDA.l NMIFrames+1 : SBC LoopFrames+1 : STA.l LagTime+1 LDA.l NMIFrames+1 : SBC.l LoopFrames+1 : STA.l LagTime+1
LDA.l NMIFrames+2 : SBC LoopFrames+2 : STA.l LagTime+2 LDA.l NMIFrames+2 : SBC.l LoopFrames+2 : STA.l LagTime+2
LDA.l NMIFrames+3 : SBC LoopFrames+3 : STA.l LagTime+3 LDA.l NMIFrames+3 : SBC.l LoopFrames+3 : STA.l LagTime+3
LDA.l RupeesSpent : !ADD DisplayRupees : STA.l RupeesCollected LDA.l RupeesSpent : !ADD.l DisplayRupees : STA.l RupeesCollected
LDA.l RupeesSpent+1 : ADC DisplayRupees+1 : STA.l RupeesCollected+1 LDA.l RupeesSpent+1 : ADC.l DisplayRupees+1 : STA.l RupeesCollected+1
REP #$20 REP #$20
LDA.l TotalItemCounter : !SUB ChestsOpened : STA.l NonChestCounter LDA.l TotalItemCounter : !SUB.l ChestsOpened : STA.l NonChestCounter
.done .done
PLP : PLX : PLA PLP : PLX : PLA

View File

@@ -1,11 +1,5 @@
lorom lorom
!ADD = "CLC : ADC"
!SUB = "SEC : SBC"
!BLT = "BCC"
!BGE = "BCS"
; Custom addresses. Most are arbitrary. Feel free to make sure they're okay or moving them elsewhere within ZP ; Custom addresses. Most are arbitrary. Feel free to make sure they're okay or moving them elsewhere within ZP
CreditsPtr = $7C ; 3 bytes CreditsPtr = $7C ; 3 bytes
Temp = $B3 ; 2 bytes Temp = $B3 ; 2 bytes
@@ -141,11 +135,11 @@ LastHexDigit:
BNE + BNE +
; Upper half ; Upper half
PLA PLA
ADC #$3D40 ADC.w #$3D40
RTS RTS
+ ; Lower half + ; Lower half
PLA PLA
ADC #$3D50 ADC.w #$3D50
RTS RTS
FindLine: FindLine:
@@ -153,7 +147,7 @@ FindLine:
- LDA.w CreditsStats,y - LDA.w CreditsStats,y
STZ.b StatsBottom STZ.b StatsBottom
CMP #$FFFF CMP.w #$FFFF
BEQ .noLine BEQ .noLine
XBA XBA
@@ -516,14 +510,14 @@ LoadCreditsTiles:
LDA.b #FileSelectNewGraphics>>16 : STA.w A1B0 LDA.b #FileSelectNewGraphics>>16 : STA.w A1B0
LDX.w #FileSelectNewGraphics : STX.w A1T0L LDX.w #FileSelectNewGraphics : STX.w A1T0L
LDX.w #$0C00 : STX.w DAS0L LDX.w #$0C00 : STX.w DAS0L
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
; Small characters A-Z ; Small characters A-Z
LDX.w #$7F00 : STX.w VMADDL LDX.w #$7F00 : STX.w VMADDL
LDA.b #SmallCharacters>>16 : STA.w A1B0 LDA.b #SmallCharacters>>16 : STA.w A1B0
LDX.w #SmallCharacters : STX.w A1T0L LDX.w #SmallCharacters : STX.w A1T0L
LDX.w #$0200 : STX.w DAS0L LDX.w #$0200 : STX.w DAS0L
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
SEP #$10 SEP #$10
RTL RTL
@@ -540,7 +534,7 @@ LoadOverworldCreditsTiles:
LDX.w #SmallCharacters : STX.w A1T0L LDX.w #SmallCharacters : STX.w A1T0L
LDX.w #$0200 : STX.w DAS0L LDX.w #$0200 : STX.w DAS0L
LDX.w #$7F00 : STX.w VMADDL LDX.w #$7F00 : STX.w VMADDL
LDA.b #$01 : STA.w MDMAEN LDA.b #$01 : STA.w DMAENABLE
SEP #$10 SEP #$10
RTL RTL

View File

@@ -33,7 +33,7 @@ RTL
;================================================================================ ;================================================================================
LoadModifiedSwordLevel: ; returns short LoadModifiedSwordLevel: ; returns short
LDA.l SwordModifier : BEQ + LDA.l SwordModifier : BEQ +
!ADD SwordEquipment ; add normal sword value to modifier !ADD.l SwordEquipment ; add normal sword value to modifier
BNE ++ : LDA.b #$01 : RTS : ++ BNE ++ : LDA.b #$01 : RTS : ++
CMP.b #$05 : !BLT ++ : LDA.b #$04 : RTS : ++ CMP.b #$05 : !BLT ++ : LDA.b #$04 : RTS : ++
RTS RTS
@@ -44,18 +44,18 @@ RTS
; ArmorEquipment - Armor Inventory ; ArmorEquipment - Armor Inventory
LoadModifiedArmorLevel: LoadModifiedArmorLevel:
PHA PHA
LDA.l ArmorEquipment : !ADD ArmorModifier LDA.l ArmorEquipment : !ADD.l ArmorModifier
CMP.b #$FF : BNE + : LDA.b #$00 : + CMP.b #$FF : BNE + : LDA.b #$00 : +
CMP.b #$03 : !BLT + : LDA.b #$02 : + CMP.b #$03 : !BLT + : LDA.b #$02 : +
STA.l ScratchBufferV STA.l ScratchBufferV
PLA PLA
!ADD ScratchBufferV !ADD.w ScratchBufferV
RTL RTL
;================================================================================ ;================================================================================
; MagicConsumption - Magic Inventory ; MagicConsumption - Magic Inventory
LoadModifiedMagicLevel: LoadModifiedMagicLevel:
LDA.l MagicModifier : BEQ + LDA.l MagicModifier : BEQ +
!ADD MagicConsumption ; add normal magic value to modifier !ADD.l MagicConsumption ; add normal magic value to modifier
CMP.b #$FF : BNE ++ : LDA.b #$00 : RTL : ++ CMP.b #$FF : BNE ++ : LDA.b #$00 : RTL : ++
CMP.b #$03 : !BLT ++ : LDA.b #$02 : ++ CMP.b #$03 : !BLT ++ : LDA.b #$02 : ++
RTL RTL

View File

@@ -50,15 +50,15 @@ RTL
PrepDynamicTile: PrepDynamicTile:
PHX : PHY : PHB PHX : PHY : PHB
LDA.l RemoteItems : BEQ .notRemote LDA.l RemoteItems : BEQ .notRemote
LDA.l SprItemReceipt, X : CMP.l !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++ LDA.w SprItemReceipt, X : CMP.l !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
LDA.l !MULTIWORLD_SCOUTREPLY_PLAYER : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l !MULTIWORLD_SCOUTREPLY_PLAYER : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l !MULTIWORLD_SCOUTREPLY_ITEM LDA.l !MULTIWORLD_SCOUTREPLY_ITEM
STA.l SprItemReceipt, X STA.w SprItemReceipt, X
BRA .notRemote BRA .notRemote
++ ++
STA.l !MULTIWORLD_SCOUT_LOCATION STA.l !MULTIWORLD_SCOUT_LOCATION
LDA.b #$00 : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.b #$00 : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b #$6B : STA.l SprItemReceipt, X ; make it a power star, I guess LDA.b #$6B : STA.w SprItemReceipt, X ; make it a power star, I guess
.notRemote .notRemote
JSR ResolveLootID JSR ResolveLootID
- -
@@ -226,7 +226,7 @@ PrepDrawRemoteItemSprite:
LDA.l !MULTIWORLD_SCOUTREPLY_LOCATION LDA.l !MULTIWORLD_SCOUTREPLY_LOCATION
STA.l SprItemReceipt, X STA.l SprItemReceipt, X
JSL PrepDynamicTile JSL PrepDynamicTile
LDA #$00 LDA.b #$00
BRA ++ BRA ++
+++ +++
LDA.l !MULTIWORLD_SCOUTREPLY_PLAYER : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l !MULTIWORLD_SCOUTREPLY_PLAYER : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
@@ -323,7 +323,7 @@ SkipDrawEOR:
LDA.w #$0000 : STA.l SpriteSkipEOR LDA.w #$0000 : STA.l SpriteSkipEOR
LDA.w #$0F00 : TRB.b Scrap04 LDA.w #$0F00 : TRB.b Scrap04
.normal .normal
LDA.b ($08), Y : EOR.w Scrap04 ; thing we wrote over LDA.b (Scrap08), Y : EOR.w Scrap04 ; thing we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -508,7 +508,7 @@ AuxPaletteCheck:
SEP #$30 SEP #$30
LDA.w ItemReceiptMethod : BNE .main_buffer ; Never use aux if we're actually receiving an item LDA.w ItemReceiptMethod : BNE .main_buffer ; Never use aux if we're actually receiving an item
LDA.b RoomIndex : CMP.b #$8C : BEQ .aux_buffer ; GT torch/Hope room LDA.b RoomIndex : CMP.b #$8C : BEQ .aux_buffer ; GT torch/Hope room
LDA.b RoomIndex : CMP.b #$87 : BEQ .aux_buffer ; Hera cage/basement CMP.b #$87 : BEQ .aux_buffer ; Hera cage/basement
.main_buffer .main_buffer
REP #$31 REP #$31
PLX PLX

View File

@@ -68,6 +68,7 @@ Sprite_ZeldaLong = $85EC96
Sprite_EA_HeartContainer = $85EF3F Sprite_EA_HeartContainer = $85EF3F
Sprite_EB_HeartPiece_handle_flags = $85F0C0 Sprite_EB_HeartPiece_handle_flags = $85F0C0
Sprite_16_Elder = $85F0CD Sprite_16_Elder = $85F0CD
SpritePrep_MagicShopAssistant = $85F521
Player_ApplyRumbleToSprites = $8680FA Player_ApplyRumbleToSprites = $8680FA
Sprite_Main = $868328 Sprite_Main = $868328
Utility_CheckIfHitBoxesOverlapLong = $8683E6 Utility_CheckIfHitBoxesOverlapLong = $8683E6
@@ -185,6 +186,11 @@ RecoverPositionAfterDrowning = $829485
OverworldHandleTransitions_change_palettes = $82A9F3 OverworldHandleTransitions_change_palettes = $82A9F3
Palette_RestoreFixedColor = $82FF58 Palette_RestoreFixedColor = $82FF58
Sprite_EA_HeartContainer_main = $85EF47 Sprite_EA_HeartContainer_main = $85EF47
MagicShopAssistant_SpawnPowder = $85F539
MagicShopAssistant_SpawnObject = $85F61D
Sprite_BagOfPowder = $85F644
MagicShopAssistant_Main = $85F893
Sprite_SpawnSecret_SetCoords = $8682A5
Chicken_SpawnAvengerChicken = $86A7DB Chicken_SpawnAvengerChicken = $86A7DB
Link_PerformRead = $87B4DB Link_PerformRead = $87B4DB
Link_PerformOpenChest_no_replacement = $87B59F Link_PerformOpenChest_no_replacement = $87B59F