Some byte designation corrections + formatting

This commit is contained in:
codemann8
2024-04-09 15:51:05 -05:00
committed by aerinon
parent 0339e09b5d
commit d75c72f85d
24 changed files with 244 additions and 240 deletions

View File

@@ -74,7 +74,7 @@ DRHUD_DrawKeyCounter:
LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished
TXA : LSR : TAX TXA : LSR : TAX
LDA.l GenericKeys : AND.w #$00FF : BNE .total_only LDA.l GenericKeys : AND.w #$00FF : BNE .total_only
LDA.l DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained
LDA.w #!SlashTile : STA.w HUDKeysSlash LDA.w #!SlashTile : STA.w HUDKeysSlash
.total_only .total_only
LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal

View File

@@ -433,7 +433,7 @@ HandleSpecialDoorLanding: {
HandleIncomingDoorState: HandleIncomingDoorState:
PHA PHA
LDA.l DRMode : BEQ .noDoor LDA.l DRMode : BEQ .noDoor
PLA : PHA : AND.b #$FA : CMP.b #$80 : bne .noDoor LDA.b 1,S : AND.b #$FA : CMP.b #$80 : bne .noDoor
.setDoorState .setDoorState
LDA.w TransitionDirection : AND.b #$02 : BNE + : INC LDA.w TransitionDirection : AND.b #$02 : BNE + : INC

View File

@@ -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

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

@@ -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,7 +3,7 @@
;================================================================================ ;================================================================================
check_special_action: check_special_action:
{ {
LDA.l BossSpecialAction : BEQ .no_special_action LDA.w BossSpecialAction : BEQ .no_special_action
LDA.b #$05 : STA.b GameSubMode LDA.b #$05 : STA.b GameSubMode
STZ.w BossSpecialAction STZ.w BossSpecialAction
.no_special_action .no_special_action

View File

@@ -353,7 +353,7 @@ IncrementBossSword:
IncrementFinalSword: IncrementFinalSword:
PHX PHX
REP #$20 REP #$20
LDA.w RoomIndex : BNE .done LDA.b RoomIndex : BNE .done
SEP #$20 SEP #$20
LDA.l SwordEquipment : CMP.b #$FF : BNE + LDA.l SwordEquipment : CMP.b #$FF : BNE +
BRA IncrementBossSword_none BRA IncrementBossSword_none
@@ -820,7 +820,7 @@ LDA.b #$0F : JML Ancilla_SFX3_Near ; what we wrote over
; A = item id being collected ; A = item id being collected
ItemGetOverworldAlternateSFX: ItemGetOverworldAlternateSFX:
CMP.b #$4A : BNE + CPY.b #$4A : BNE +
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2 JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2
RTL RTL
+ ; normal itemget sfx + ; normal itemget sfx

View File

@@ -206,6 +206,7 @@ MirrorBonk:
LDA.b OverworldIndex : AND.b #$40 : BEQ .endLoop ;World we're in? branch if we are in LW we don't want bonks LDA.b OverworldIndex : AND.b #$40 : BEQ .endLoop ;World we're in? branch if we are in LW we don't want bonks
REP #$30 REP #$30
LDX.w #$0000 LDX.w #$0000
.loop .loop
LDA.l .bonkRectanglesTable, X ;Load X1 LDA.l .bonkRectanglesTable, X ;Load X1
CMP.b LinkPosX : !BGE ++ CMP.b LinkPosX : !BGE ++
@@ -230,6 +231,7 @@ MirrorBonk:
.endLoop .endLoop
PLB : PLP : PLX PLB : PLP : PLX
.normal .normal
;Not forcing a bonk, so the vanilla bonk detection run. ;Not forcing a bonk, so the vanilla bonk detection run.
LDA.b Scrap0C : ORA.b Scrap0E LDA.b Scrap0C : ORA.b Scrap0E

View File

@@ -1,6 +1,6 @@
; Come in with ; Come in with
; A = item receipt ID ; A = item receipt ID
; X = slot ; X = sprite slot
RequestStandingItemVRAMSlot: RequestStandingItemVRAMSlot:
PHA PHA
@@ -83,21 +83,21 @@ DrawPotItem:
.draw .draw
PHB : PHK : PLB PHB : PHK : PLB
STA.b $08 STA.b Scrap08
LDA.w SprItemGFX,X LDA.w SprItemGFX,X
AND.w #$00FF AND.w #$00FF
ASL : ASL : ASL : ASL ASL : ASL : ASL : ASL
ADC.b $08 ADC.b Scrap08
STA.b $08 STA.b Scrap08
SEP #$20 SEP #$20
STZ.b $07 STZ.b Scrap07
LDA.b #$00 : STA.l SpriteSkipEOR LDA.b #$00 : STA.l SpriteSkipEOR
JSL Sprite_DrawMultiple_quantity_preset JSL Sprite_DrawMultiple_quantity_preset
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 OAMPtr+2
INC.b $92 INC.b OAMPtr+2
PLB PLB
PLA PLA

View File

@@ -327,8 +327,8 @@ ClearSpriteData:
PHX PHX
LDA.b #$00 : LDX.b #$00 LDA.b #$00 : LDX.b #$00
.loop .loop
STA.l SprDropsItem, X : STA.l SprItemReceipt, X : STA.l SprItemIndex, X STA.w SprDropsItem, X : STA.w SprItemReceipt, X : STA.w SprItemIndex, X
STA.l SprItemMWPlayer, X : STA.l SprItemFlags, X STA.w SprItemMWPlayer, X : STA.w SprItemFlags, X
INX : CPX.b #$10 : BCC .loop INX : CPX.b #$10 : BCC .loop
JSR SetupEnemyDropIndicator JSR SetupEnemyDropIndicator
PLX PLX
@@ -393,23 +393,23 @@ LoadSpriteData:
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 [Scrap00], Y : STA.l SprItemMWPlayer, X DEY : LDA.b [Scrap00], Y : STA.w SprItemMWPlayer, X
LDA.b #$02 : STA.l SprDropsItem, X : BRA .common LDA.b #$02 : STA.w SprDropsItem, X : BRA .common
.not_multiworld .not_multiworld
LDA.b #$00 : STA.l SprItemMWPlayer, X LDA.b #$00 : STA.w SprItemMWPlayer, X
LDA.b #$01 : STA.l SprDropsItem, X LDA.b #$01 : STA.w SprDropsItem, X
DEY DEY
.common .common
DEY : LDA.b [Scrap00], Y : STA.l SprItemReceipt, X DEY : LDA.b [Scrap00], Y : STA.w SprItemReceipt, X
STA.b Scrap0E STA.b Scrap0E
LDA.l SprItemMWPlayer, X : BNE + ; skip if multiworld LDA.w SprItemMWPlayer, X : BNE + ; skip if multiworld
PHX PHX
LDX.b #$00 ; see if the item should be replaced by an absorbable LDX.b #$00 ; see if the item should be replaced by an absorbable
- CPX.b #$1A : BCS .done - CPX.b #$1A : BCS .done
LDA.l MinorForcedDrops, X LDA.l MinorForcedDrops, X
CMP.b Scrap0E : BEQ ++ CMP.b Scrap0E : BEQ ++
INX #2 : BRA - INX #2 : BRA -
++ PLX : LDA.l SprItemFlags, X : ORA.b #$80 : STA.l SprItemFlags, X : PHX ++ PLX : LDA.w SprItemFlags, X : ORA.b #$80 : STA.w SprItemFlags, X : PHX
.done PLX .done PLX
+ +
INY : INY INY : INY
@@ -422,23 +422,23 @@ LoadSpriteData:
; Run when a sprite dies ... Sets Flag to #$02 and Index to sprite slot for ; Run when a sprite dies ... Sets Flag to #$02 and Index to sprite slot for
RevealSpriteDrop: RevealSpriteDrop:
LDA.l SprDropsItem, X : BNE CheckIfDropValid LDA.w SprDropsItem, X : BNE CheckIfDropValid
JMP DoNormalDrop JMP DoNormalDrop
CheckIfDropValid: CheckIfDropValid:
JSR CheckIfDropsInThisLocation : BCC DoNormalDrop JSR CheckIfDropsInThisLocation : BCC DoNormalDrop
;This section sets up the drop ;This section sets up the drop
LDA.b #$02 : STA.l SpawnedItemFlag LDA.b #$02 : STA.w SpawnedItemFlag
STX.w SpawnedItemIndex STX.w SpawnedItemIndex
LDA.l SprItemReceipt, X : STA.l SpawnedItemID LDA.w SprItemReceipt, X : STA.w SpawnedItemID
LDA.l SprItemMWPlayer, X : STA.l SpawnedItemMWPlayer LDA.w SprItemMWPlayer, X : STA.w SpawnedItemMWPlayer
LDY.b #$01 ; trigger the small key routines LDY.b #$01 ; trigger the small key routines
LDA.w SpawnedItemID : STA.b Scrap00 : CMP.b #$32 : BNE + LDA.w SpawnedItemID : STA.b Scrap00 : CMP.b #$32 : BNE +
LDA.l StandingItemsOn : BNE + LDA.l StandingItemsOn : BNE +
INY ; big key routine INY ; big key routine
+ +
PHX PHX
LDA.l SpawnedItemMWPlayer : BNE .done ; abort check for absorbables it belong to someone else LDA.w SpawnedItemMWPlayer : BNE .done ; abort check for absorbables it belong to someone else
LDX.b #$00 ; see if the item should be replaced by an absorbable LDX.b #$00 ; see if the item should be replaced by an absorbable
- CPX.b #$1A : BCS .done - CPX.b #$1A : BCS .done
LDA.l MinorForcedDrops, X LDA.l MinorForcedDrops, X
@@ -475,7 +475,7 @@ PikitOverride:
CMP.b #$AA : BNE .no_pikit_drop CMP.b #$AA : BNE .no_pikit_drop
LDY.w $0E90,X : BEQ .no_pikit_drop LDY.w $0E90,X : BEQ .no_pikit_drop
CPY.b #$04 : BEQ .normal_pikit CPY.b #$04 : BEQ .normal_pikit
LDA.l SprDropsItem, X : BEQ .normal_pikit LDA.w SprDropsItem, X : BEQ .normal_pikit
JSR CheckIfDropsInThisLocation : BCC .normal_pikit JSR CheckIfDropsInThisLocation : BCC .normal_pikit
.no_pikit_drop .no_pikit_drop
PLA : PLA : PEA.w Sprite_DoTheDeath_NotAPikitDrop-1 PLA : PLA : PEA.w Sprite_DoTheDeath_NotAPikitDrop-1
@@ -597,7 +597,7 @@ MarkSRAMForItem:
LDA.w RoomItemsTaken : ORA.w KeyRoomFlagMasks, Y : RTL LDA.w RoomItemsTaken : ORA.w KeyRoomFlagMasks, Y : RTL
+ PHX : PHY : REP #$30 + PHX : PHY : REP #$30
LDA.b RoomIndex : ASL : TAY LDA.b RoomIndex : ASL : TAY
LDA.l SpawnedItemIndex : ASL LDA.w SpawnedItemIndex : ASL
TAX : LDA.l BitFieldMasks, X : STA.b Scrap00 TAX : LDA.l BitFieldMasks, X : STA.b Scrap00
TYX TYX
LDA.w SpawnedItemFlag : CMP.w #$0001 : BEQ + LDA.w SpawnedItemFlag : CMP.w #$0001 : BEQ +
@@ -616,20 +616,20 @@ SpriteKeyPrep:
LDA.b RoomIndex : CMP.b #$87 : BNE .continue LDA.b RoomIndex : CMP.b #$87 : BNE .continue
CPX.b #$0A : BNE .continue ; the hera basement key is always sprite 0x0A CPX.b #$0A : BNE .continue ; the hera basement key is always sprite 0x0A
LDA.b LinkQuadrantH : ORA.b LinkQuadrantV : AND.b #$03 : CMP.b #$02 : BNE .continue LDA.b LinkQuadrantH : ORA.b LinkQuadrantV : AND.b #$03 : CMP.b #$02 : BNE .continue
LDA.b #$00 : STA.w SpawnedItemFlag : STA.l SprItemFlags, X LDA.b #$00 : STA.w SpawnedItemFlag : STA.w SprItemFlags, X
LDA.b #$24 : STA.w $0E80, X LDA.b #$24 : STA.w $0E80, X
BRA + BRA +
.continue .continue
LDA.w SpawnedItemIndex : STA.l SprItemIndex, X LDA.w SpawnedItemIndex : STA.w SprItemIndex, X
LDA.w SpawnedItemMWPlayer : STA.l SprItemMWPlayer, X : STA.w !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.w SpawnedItemMWPlayer : STA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w SpawnedItemFlag : STA.l SprItemFlags, X : BEQ + LDA.w SpawnedItemFlag : STA.w SprItemFlags, X : BEQ +
LDA.l SpawnedItemID : STA.w $0E80, X LDA.w SpawnedItemID : STA.w $0E80, X
PHA : PHY : PHX PHA : PHY : PHX
JSL GetSpritePalette : PLX : STA.w SpriteOAMProp, X ; setup the palette JSL GetSpritePalette : PLX : STA.w SpriteOAMProp, X ; setup the palette
PLY : PLA PLY : PLA
CMP.b #$24 : BNE ++ ; CMP.b #$24 : BNE ++ ;
LDA.b RoomIndex : CMP.b #$80 : BNE + LDA.b RoomIndex : CMP.b #$80 : BNE +
LDA.l SpawnedItemFlag : BNE + LDA.w SpawnedItemFlag : BNE +
LDA.b #$24 ; it's the big key drop? LDA.b #$24 ; it's the big key drop?
++ JSL RequestStandingItemVRAMSlot ++ JSL RequestStandingItemVRAMSlot
+ PLA + PLA
@@ -638,11 +638,11 @@ SpriteKeyPrep:
SpriteKeyDrawGFX: SpriteKeyDrawGFX:
JSL Sprite_DrawRippleIfInWater JSL Sprite_DrawRippleIfInWater
PHA PHA
LDA.l SprItemMWPlayer, X : STA.w !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w $0E80, X LDA.w $0E80, X
CMP.b #$24 : BNE + CMP.b #$24 : BNE +
LDA.b RoomIndex : CMP.b #$80 : BNE ++ LDA.b RoomIndex : CMP.b #$80 : BNE ++
LDA.l 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
@@ -662,15 +662,15 @@ KeyGet:
LDA.l StandingItemsOn : BNE + LDA.l StandingItemsOn : BNE +
PLA : RTL PLA : RTL
+ LDY.w $0E80, X + LDY.w $0E80, X
LDA.l SprItemIndex, X : STA.l SpawnedItemIndex LDA.w SprItemIndex, X : STA.w SpawnedItemIndex
LDA.l SprItemFlags, X : STA.l 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.l 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.l 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 +

View File

@@ -1,7 +1,7 @@
OnMenuLoad: OnMenuLoad:
LDA.b #UploadMenuOnlyIcons>>0 : STA.l NMIAux LDA.b #UploadMenuOnlyIcons>>0 : STA.w NMIAux
LDA.b #UploadMenuOnlyIcons>>8 : STA.l NMIAux+1 LDA.b #UploadMenuOnlyIcons>>8 : STA.w NMIAux+1
LDA.b #UploadMenuOnlyIcons>>16 : STA.l 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

12
msu.asm
View File

@@ -235,7 +235,7 @@ CheckMusicLoadRequest:
.dungeon .dungeon
LDA.w DungeonID : CMP.b #$1A : BNE + LDA.w DungeonID : CMP.b #$1A : BNE +
PHA : LDA.l DRMode : BEQ ++ PHA : LDA.l DRMode : BEQ ++
LDA.w BigKeyField : AND.b #$04 : BEQ ++ LDA.l BigKeyField : AND.b #$04 : BEQ ++
; if door rando and entering GT with BK ; if door rando and entering GT with BK
PLA : LDA.b #59 : BRA .check_fallback-3 PLA : LDA.b #59 : BRA .check_fallback-3
++ PLA ++ PLA
@@ -497,8 +497,8 @@ PHA : XBA : PHA
; dont save if we already saved recently ; dont save if we already saved recently
REP #$20 REP #$20
LDA.w MSUResumeTrack : AND.w #$00FF : BEQ ++ LDA.w MSUResumeTrack : AND.w #$00FF : BEQ ++
LDA.l NMIFrames : !SUB.l MSUResumeTime : PHA LDA.l NMIFrames : !SUB.w MSUResumeTime : PHA
LDA.l NMIFrames+2 : SBC.l 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 ++
+++ +++
@@ -663,8 +663,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.l MSUResumeTime : PHA LDA.l NMIFrames : !SUB.w MSUResumeTime : PHA
LDA.l NMIFrames+2 : SBC.l 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
@@ -677,7 +677,7 @@ MSUMain:
STA.w MSUResumeControl STA.w MSUResumeControl
LDA.b #$00 : STA.w MSUResumeTrack LDA.b #$00 : STA.w MSUResumeTrack
+ +
CPX.b #07 : BNE + ; Kakariko Village CPX.b #$07 : BNE + ; Kakariko Village
LDA.b GameMode : CMP.b #$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

View File

@@ -289,7 +289,7 @@ LDA.l RoomDataWRAM[$07].high : AND.w #$00FF : BEQ +
FallingMusicFadeOut: FallingMusicFadeOut:
CMP.w #$0017 ; what we wrote over CMP.w #$0017 ; what we wrote over
BNE .return BNE .return
LDA.w $0130 : AND.w #$00FF : CMP.w #$0015 ; if boss music is playing, then fade out LDA.w LastAPUCommand : AND.w #$00FF : CMP.w #$0015 ; if boss music is playing, then fade out
.return .return
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -103,7 +103,7 @@ NewHUD_DrawGoal:
;================================================================================ ;================================================================================
NewHUD_DrawKeys: NewHUD_DrawKeys:
LDA.l CurrentSmallKeys LDA.w CurrentSmallKeys
CMP.b #$FF CMP.b #$FF
BNE .in_dungeon BNE .in_dungeon
@@ -172,7 +172,7 @@ NewHUD_DrawPrizeIcon:
REP #$30 REP #$30
BEQ .prize BEQ .prize
LDA.l MapField LDA.w MapField
AND.l DungeonItemMasks,X AND.l DungeonItemMasks,X
BEQ .no_prize BEQ .no_prize
@@ -302,7 +302,7 @@ DrawCompassCounts:
BIT.b #$02 : BNE .draw_compass_count BIT.b #$02 : BNE .draw_compass_count
TYX : LDA.l ExistsTransfer, X : TAX : LDA.l CompassExists, X : BEQ .draw_compass_count TYX : LDA.l ExistsTransfer, X : TAX : LDA.l CompassExists, X : BEQ .draw_compass_count
REP #$20 REP #$20
LDX.w DungeonID : LDA.l CompassField : AND.l DungeonItemMasks,X : BEQ .early_exit LDX.w DungeonID : LDA.w CompassField : AND.l DungeonItemMasks,X : BEQ .early_exit
.draw_compass_count .draw_compass_count
LDX.w DungeonID LDX.w DungeonID
@@ -311,7 +311,7 @@ DrawCompassCounts:
.not_sewers .not_sewers
REP #$20 REP #$20
LDA.l DungeonLocationsChecked, X LDA.w DungeonLocationsChecked, X
PHA PHA
LDA.w #!SlashTile : STA.w HUDTileMapBuffer+$98 ; always slash LDA.w #!SlashTile : STA.w HUDTileMapBuffer+$98 ; always slash
@@ -361,7 +361,7 @@ DrawMapCounts:
; no map needed if this bit is set ; no map needed if this bit is set
BIT.b #$02 : BNE .draw_map_count BIT.b #$02 : BNE .draw_map_count
REP #$20 REP #$20
LDA.l MapField : AND.l DungeonItemMasks,X : BEQ .done LDA.w MapField : AND.l DungeonItemMasks,X : BEQ .done
.draw_map_count .draw_map_count
SEP #$20 SEP #$20
@@ -369,7 +369,7 @@ DrawMapCounts:
INX INX
.not_sewers .not_sewers
LDA.l DungeonCollectedKeys, X LDA.w DungeonCollectedKeys, X
PHA PHA
LDA.l MapTotalsWRAM,X LDA.l MapTotalsWRAM,X

View File

@@ -628,6 +628,7 @@ VTIMEH = $00420A
; f - DMA channel 5 (0: disabled | 1: enabled) ; f - DMA channel 5 (0: disabled | 1: enabled)
; g - DMA channel 6 (0: disabled | 1: enabled) ; g - DMA channel 6 (0: disabled | 1: enabled)
; h - DMA channel 7 (0: disabled | 1: enabled) ; h - DMA channel 7 (0: disabled | 1: enabled)
MDMAEN = $00420B
DMAENABLE = $00420B DMAENABLE = $00420B
; H-BLANK DIRECT MEMORY ACCESS CHANNEL DESIGNATION ; H-BLANK DIRECT MEMORY ACCESS CHANNEL DESIGNATION
@@ -641,6 +642,7 @@ DMAENABLE = $00420B
; f - HDMA channel 5 (0: disabled | 1: enabled) ; f - HDMA channel 5 (0: disabled | 1: enabled)
; g - HDMA channel 6 (0: disabled | 1: enabled) ; g - HDMA channel 6 (0: disabled | 1: enabled)
; h - HDMA channel 7 (0: disabled | 1: enabled) ; h - HDMA channel 7 (0: disabled | 1: enabled)
HDMAEN = $00420C
HDMAENABLE = $00420C HDMAENABLE = $00420C
; ACCESS CYCLE DESIGNATION ; ACCESS CYCLE DESIGNATION

View File

@@ -128,11 +128,11 @@ SpritePrep_ShopKeeper:
LDA.l ShopContentsTable+2, X : PHX : TYX : STA.l ShopInventory+1, X : PLX LDA.l ShopContentsTable+2, X : PHX : TYX : STA.l ShopInventory+1, X : PLX
LDA.l ShopContentsTable+3, X : PHX : TYX : STA.l ShopInventory+2, X : PLX LDA.l ShopContentsTable+3, X : PHX : TYX : STA.l ShopInventory+2, X : PLX
LDA.l ShopContentsTable+8, X : PHX : PHA : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l ShopContentsTable+8, X : PHX : PHA : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode) LDA.b #$00 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
PLA : STA.l ShopInventoryPlayer, X : LDA.b #00 : STA.l ShopInventoryDisguise, X : PLX PLA : STA.l ShopInventoryPlayer, X : LDA.b #$00 : STA.l ShopInventoryDisguise, X : PLX
PHY PHY
PHX PHX
LDA.b #0 : XBA : TYA : LSR #2 : !ADD.l ShopSRAMIndex : TAX LDA.b #$00 : 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
@@ -143,8 +143,8 @@ SpritePrep_ShopKeeper:
LDA.l ShopContentsTable+6, X : PHX : TYX : STA.l ShopInventory+1, X : PLX LDA.l ShopContentsTable+6, X : PHX : TYX : STA.l ShopInventory+1, X : PLX
LDA.l ShopContentsTable+7, X : PHX : TYX : STA.l ShopInventory+2, X : PLX LDA.l ShopContentsTable+7, X : PHX : TYX : STA.l ShopInventory+2, X : PLX
LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX
PHX : LDA.b #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode) PHX : LDA.b #$00 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
LDA.b #0 : STA.l ShopInventoryPlayer, X : PLX LDA.b #$00 : STA.l ShopInventoryPlayer, X : PLX
BRA +++ BRA +++
+ : PLY : LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX : BRA +++ + : PLY : LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX : BRA +++
++ ++
@@ -156,7 +156,7 @@ SpritePrep_ShopKeeper:
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong
CMP.b #$D0 : BNE + CMP.b #$D0 : BNE +
PHX : LDA.b #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode) PHX : LDA.b #$00 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
JSL GetRandomInt : AND.b #$3F JSL GetRandomInt : AND.b #$3F
BNE ++ : LDA.b #$49 : ++ : CMP.b #$26 : BNE ++ : LDA.b #$6A : ++ ; if 0 (fighter's sword + shield), set to just sword, if filled container (bugged palette), switch to triforce piece BNE ++ : LDA.b #$49 : ++ : CMP.b #$26 : BNE ++ : LDA.b #$6A : ++ ; if 0 (fighter's sword + shield), set to just sword, if filled container (bugged palette), switch to triforce piece
STA.l ShopInventoryDisguise, X : PLX STA.l ShopInventoryDisguise, X : PLX
@@ -458,7 +458,8 @@ Shopkeeper_BuyItem:
REP #$20 : LDA.l CurrentRupees : !SUB.l 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.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.b #$00 : XBA : TXA : LSR #2 : TAX
LDA.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
TXA : !ADD.l 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.
@@ -467,10 +468,9 @@ Shopkeeper_BuyItem:
LDA.l ShopInventory, X LDA.l ShopInventory, X
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong
TAY TAY : JSL Link_ReceiveItem
JSL Link_ReceiveItem
LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X
LDA.b #0 : STA.l ShopEnableCount LDA.b #$00 : 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.l ShopkeeperRefill : BNE +++ LDA.l ShopkeeperRefill : BNE +++
@@ -645,7 +645,7 @@ Shopkeeper_DrawNextItem:
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
PLY PLY
PHX : LDA.b #0 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$0 : BNE ++ PHX : LDA.b #$00 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$00 : BNE ++
CPX.b #$0C : BCC .not_powder CPX.b #$0C : BCC .not_powder
LDA.l PowderFlag : BRA .resolve LDA.l PowderFlag : BRA .resolve
.not_powder LDA.l ShopInventory, X ; get item id .not_powder LDA.l ShopInventory, X ; get item id
@@ -671,7 +671,7 @@ Shopkeeper_DrawNextItem:
STA.l SpriteOAM+4 STA.l SpriteOAM+4
PHX : LDA.b #0 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$0 : BNE ++ PHX : LDA.b #$00 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$00 : BNE ++
LDA.b Scrap0D LDA.b Scrap0D
++ ++
PHX PHX
@@ -682,7 +682,7 @@ Shopkeeper_DrawNextItem:
LDA.b #$00 : STA.l SpriteOAM+6 LDA.b #$00 : STA.l SpriteOAM+6
PHX : LDA.b #0 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$0 : BNE ++ PHX : LDA.b #$00 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$00 : BNE ++
LDA.b Scrap0D LDA.b Scrap0D
++ ++
PHX PHX
@@ -774,9 +774,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.l OAMPtr : STA.b OAMPtr ; increment oam pointer ASL #2 : !ADD.b OAMPtr : STA.b OAMPtr ; increment oam pointer
PLA PLA
!ADD.l 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

@@ -98,7 +98,7 @@ IncrementSmallKeysNoPrimary:
PHP : REP #$20 ; set 16-bit accumulator PHP : REP #$20 ; set 16-bit accumulator
LDA.b RoomIndex : CMP.w #$0087 : BNE ++ ; hera basement LDA.b RoomIndex : CMP.w #$0087 : BNE ++ ; hera basement
LDA.b $A8 : AND.w #$0003 : CMP.w #$0002 : BNE ++ ; must be quadrant 2 LDA.b $A8 : AND.w #$0003 : CMP.w #$0002 : BNE ++ ; must be quadrant 2
LDA.l SprDropsItem, X : AND.w #$00FF : BNE ++ ; must not be a standing item LDA.w SprDropsItem, X : AND.w #$00FF : BNE ++ ; must not be a standing item
PLP : PHY PLP : PHY
LDY.b #$24 LDY.b #$24
JSL AddInventory JSL AddInventory

View File

@@ -49,7 +49,7 @@ LoadModifiedArmorLevel:
CMP.b #$03 : !BLT + : LDA.b #$02 : + CMP.b #$03 : !BLT + : LDA.b #$02 : +
STA.l ScratchBufferV STA.l ScratchBufferV
PLA PLA
!ADD.l ScratchBufferV !ADD.w ScratchBufferV
RTL RTL
;================================================================================ ;================================================================================
; MagicConsumption - Magic Inventory ; MagicConsumption - Magic Inventory

View File

@@ -75,7 +75,6 @@ org $B08028 ; PC 0x180028
FairySword: FairySword:
db $03 ; #$03 = Golden Sword (default) db $03 ; #$03 = Golden Sword (default)
PedestalMusicCheck:
;org $88C435 ; <- 44435 - ancilla_receive_item.asm : 125 ;org $88C435 ; <- 44435 - ancilla_receive_item.asm : 125
;db $01 ; #$01 = Master Sword (default) ;db $01 ; #$01 = Master Sword (default)
org $8589B0 ; PC 0x289B0 ; sprite_master_sword.asm : 179 org $8589B0 ; PC 0x289B0 ; sprite_master_sword.asm : 179
@@ -164,7 +163,7 @@ org $B08045 ; PC 0x180045
HUDDungeonItems: HUDDungeonItems:
db $00 db $00
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x180046 (unused) ; 0x180046 - 0x180047 (unused)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B08048 ; PC 0x180048 org $B08048 ; PC 0x180048
MenuSpeed: MenuSpeed:

View File

@@ -51,15 +51,15 @@ RTL
PrepDynamicTile: PrepDynamicTile:
PHX : PHY : PHB PHX : PHY : PHB
LDA.l RemoteItems : BEQ .notRemote LDA.l RemoteItems : BEQ .notRemote
LDA.l SpriteID, X : CMP.l !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++ LDA.w SpriteID, 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 SpriteID, X STA.w SpriteID, 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 SpriteID, X ; make it a power star, I guess LDA.b #$6B : STA.w SpriteID, X ; make it a power star, I guess
.notRemote .notRemote
JSR ResolveLootID JSR ResolveLootID
- -
@@ -219,7 +219,7 @@ PrepDrawRemoteItemSprite:
CMP.l !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++ CMP.l !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
LDA.l !MULTIWORLD_SCOUT_LOCATION : BEQ +++ LDA.l !MULTIWORLD_SCOUT_LOCATION : BEQ +++
LDA.l !MULTIWORLD_SCOUTREPLY_LOCATION LDA.l !MULTIWORLD_SCOUTREPLY_LOCATION
STA.l SpriteID, X STA.w SpriteID, X
JSL PrepDynamicTile JSL PrepDynamicTile
LDA.b #$00 LDA.b #$00
BRA ++ BRA ++
@@ -229,7 +229,7 @@ PrepDrawRemoteItemSprite:
RTS RTS
++ ++
STA.l !MULTIWORLD_SCOUT_LOCATION STA.l !MULTIWORLD_SCOUT_LOCATION
LDA.b #$00 : STA.b !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.b #$00 : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b #$6B LDA.b #$6B
RTS RTS
+ +
@@ -502,8 +502,8 @@ AuxPaletteCheck:
PHX PHX
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.w 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.w 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

@@ -190,6 +190,7 @@ MagicShopAssistant_SpawnPowder = $85F539
MagicShopAssistant_SpawnObject = $85F61D MagicShopAssistant_SpawnObject = $85F61D
Sprite_BagOfPowder = $85F644 Sprite_BagOfPowder = $85F644
MagicShopAssistant_Main = $85F893 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