Merged in DR v1.4.1.6

This commit is contained in:
codemann8
2024-02-23 11:34:04 -06:00
23 changed files with 192 additions and 185 deletions

View File

@@ -70,7 +70,7 @@ CutoffEntranceRug:
CMP.w #$000C : BNE .norm CMP.w #$000C : BNE .norm
+ LDX.w #$0000 : LDA.l CutoffRooms, x + LDX.w #$0000 : LDA.l CutoffRooms, x
- CMP.b RoomIndex : BEQ .check - CMP.b RoomIndex : BEQ .check
INX #2 : LDA.l CutoffRooms, x : CMP.w #$FFFF : BNE - INX #2 : LDA.l CutoffRooms, x : CMP.w #$FFFF : BNE -
.norm .norm
PLX : PLA : LDA.w $9B52, Y : STA.l TileMapA, X ; what we wrote over PLX : PLA : LDA.w $9B52, Y : STA.l TileMapA, X ; what we wrote over
RTL RTL

View File

@@ -18,7 +18,7 @@ DoDungeonMapBossIcon:
TAX TAX
; get sprite pointer for room ; get sprite pointer for room
LDA.l RoomData_SpritePointers,X LDA.l UWSpritesPointers,X
STA.b Scrap00 ; pointer in $00 STA.b Scrap00 ; pointer in $00
LDA.w #$0028 : STA.b Scrap02 ; set the bank to 28 for now LDA.w #$0028 : STA.b Scrap02 ; set the bank to 28 for now
LDY.w #$0001 ; to skip the "sort" LDY.w #$0001 ; to skip the "sort"

View File

@@ -2,7 +2,17 @@
; Blind Boss fight ; Blind Boss fight
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
print "Blind Spawn Code Check: ", pc pushpc
org $9DA081 ; Original Code
JML check_blind_boss_room
Check_for_Blind_Fight:
org $9DA090
Initialize_Blind_Fight:
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 #172 : BNE + ; Is is Thieves Town Boss Room

View File

@@ -6,7 +6,7 @@ db #$00 ;368100 ; Enable random enemy under bushes
db #$00 ;408101 : 200101 ; Enable blind's door closing for other bosses db #$00 ;408101 : 200101 ; Enable blind's door closing for other bosses
.moldorm_eye_count .moldorm_eye_count
db #$01 ;408102 : 200102 ; Moldorm eye count, default to 2 eyes (1) db #$01 ;408102 : 200102 ; Moldorm eye count, default to 2 eyes (1)
.randomize_sprites EnemizerFlag_Randomize_Sprites:
db #$00 ;408103 : 200103 ; Randomize Sprites. db #$00 ;408103 : 200103 ; Randomize Sprites.
.agahnim_fun_balls .agahnim_fun_balls
db #$00 ;408104 : 200104 ; make Agahnim balls deflect back db #$00 ;408104 : 200104 ; make Agahnim balls deflect back

View File

@@ -14,6 +14,4 @@ incsrc hooks/damage_hooks.asm
incsrc hooks/overworld_sprite_hooks.asm incsrc hooks/overworld_sprite_hooks.asm
incsrc hooks/underworld_sprite_hooks.asm incsrc hooks/underworld_sprite_hooks.asm
incsrc hooks/blindboss_hooks.asm

View File

@@ -1,11 +0,0 @@
;================================================================================
; Blind Boss fight
;--------------------------------------------------------------------------------
org $9DA081 ; Original Code
JML check_blind_boss_room
Check_for_Blind_Fight:
org $9DA090
Initialize_Blind_Fight:

View File

@@ -47,6 +47,7 @@ incsrc bossdrop.asm
incsrc moldorm.asm incsrc moldorm.asm
incsrc kodongo_fixes.asm incsrc kodongo_fixes.asm
incsrc mimic_fixes.asm incsrc mimic_fixes.asm
incsrc swamola_fix.asm
; vitreous key fix for boss shuffle - uses FixPrizeOnTheEyes flag ; vitreous key fix for boss shuffle - uses FixPrizeOnTheEyes flag
incsrc overworld_sprites.asm incsrc overworld_sprites.asm

18
enemizer/swamola_fix.asm Normal file
View File

@@ -0,0 +1,18 @@
pushpc
org $8683B5
JSL MaybeDoCachedSprites ; JSL ExecuteCachedSprites
org $9DE9DA
ExecuteCachedSprites:
pullpc
MaybeDoCachedSprites:
LDA.l EnemizerFlag_Randomize_Sprites
BNE .enemizer
JML ExecuteCachedSprites ; what we copied over
.enemizer
RTL

View File

@@ -1,6 +1,6 @@
LoadUnderworldSprites: LoadUnderworldSprites:
STA.b Scrap00 ; part one of what we replaced STA.b Scrap00 ; part one of what we replaced
LDA.w #$0028 : STA.b Scrap02 ; set the bank to 28 for now LDA.w #UWSpritesData>>16 : STA.b Scrap02 ; set the bank to 28 for now
LDA.w $048E LDA.w $048E
RTL RTL

View File

@@ -84,8 +84,8 @@ HeartContainerSound:
LDA.b #$2E LDA.b #$2E
SEC SEC
RTL RTL
+ +
CLC CLC
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
NormalItemSkipSound: NormalItemSkipSound:

View File

@@ -2349,7 +2349,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 MDMAEN)
JSL ParadoxCaveGfxFix : NOP JSL ParadoxCaveGfxFix : NOP
;================================================================================ ;================================================================================
@@ -2430,7 +2430,7 @@ org $80D17E+178 : db ExpandedTrinexx>>0
; Use above sheet in Hyrule castle courtyard after rain state. ; Use above sheet in Hyrule castle courtyard after rain state.
org $80DB9E ; Hyrule Castle GFX Sprite Sheet 4 on [LW1] org $80DB9E ; Hyrule Castle GFX Sprite Sheet 4 on [LW1]
db $3F db $3F
db $80DBA2 ; Hyrule Castle GFX Sprite Sheet 4 on [RainState] org $80DBA2 ; Hyrule Castle GFX Sprite Sheet 4 on [RainState]
db $3F db $3F
org $80DC0A ; Hyrule Castle GFX Sprite Sheet 4 on [LW2] org $80DC0A ; Hyrule Castle GFX Sprite Sheet 4 on [LW2]
db $3F db $3F

View File

@@ -608,7 +608,6 @@ RTL
LoadMushroom: LoadMushroom:
LDA.b #$00 : STA.w SpriteGFXControl, X ; thing we wrote over LDA.b #$00 : STA.w SpriteGFXControl, X ; thing we wrote over
.justGFX .justGFX
PHA PHA
LDA.l MushroomItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l MushroomItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
@@ -651,7 +650,7 @@ CollectPowder:
; if for any reason the item value is 0 reload it, just in case ; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY
+ PHA + PHA
LDA WitchItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l WitchItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
LDA.b #$01 : STA.l ShopEnableCount LDA.b #$01 : STA.l ShopEnableCount
PLA PLA
STZ.w ItemReceiptMethod ; item from NPC STZ.w ItemReceiptMethod ; item from NPC

View File

@@ -241,14 +241,14 @@ DrawPotItem:
.draw .draw
; special handling ; special handling
LDY.b Scrap07 : CPY.b #$B2 : BNE + ; fairy LDY.b Scrap07 : CPY.b #$D2 : BNE + ; fairy
LDA.b FrameCounter : AND.w #$0020 : BEQ ++ ; alternate every 32 frames LDA.b FrameCounter : AND.w #$0020 : BEQ ++ ; alternate every 32 frames
LDA.w SpriteDynamicOAM+4 : CLC : ADC.w #$02 ; use other fairy GFX LDA.w SpriteDynamicOAM+4 : CLC : ADC.w #$02 ; use other fairy GFX
STA.w SpriteDynamicOAM+4 STA.w SpriteDynamicOAM+4
++ LDA.b FrameCounter : SEC : SBC.w #$10 : AND.w #$0020 : BEQ + ; alternate every 32 frames ++ LDA.b FrameCounter : SEC : SBC.w #$10 : AND.w #$0020 : BEQ + ; alternate every 32 frames
LDA.w SpriteDynamicOAM+2 : SEC : SBC.w #$02 ; move fairy up 2 pixels LDA.w SpriteDynamicOAM+2 : SEC : SBC.w #$02 ; move fairy up 2 pixels
STA.w SpriteDynamicOAM+2 STA.w SpriteDynamicOAM+2
+ CPY.b #$B5 : BNE + ; good bee + CPY.b #$D6 : BNE + ; good bee
LDA.b FrameCounter : AND.w #$0020 : BEQ ++ ; alternate every 32 frames LDA.b FrameCounter : AND.w #$0020 : BEQ ++ ; alternate every 32 frames
LDA.w SpriteDynamicOAM+12 : SEC : SBC.w #$10 ; use other fairy GFX LDA.w SpriteDynamicOAM+12 : SEC : SBC.w #$10 ; use other fairy GFX
STA.w SpriteDynamicOAM+12 STA.w SpriteDynamicOAM+12

View File

@@ -540,10 +540,12 @@ db $36, $DB ; RED RUPEE ($36)
db $42, $D8 ; HEART ($42) db $42, $D8 ; HEART ($42)
db $44, $E2 ; ARROW REFILL 10 ($44) db $44, $E2 ; ARROW REFILL 10 ($44)
db $45, $DF ; SMALL MAGIC DECANTER ($45) db $45, $DF ; SMALL MAGIC DECANTER ($45)
db $D1, $AC ; APPLES ($D1)
db $D2, $E3 ; FAERIE ($D2) db $D2, $E3 ; FAERIE ($D2)
db $D3, $0B ; CUCCO ($D3) db $D3, $0B ; CUCCO ($D3)
db $D4, $E0 ; LARGE MAGIC DECANTER ($D4) db $D4, $E0 ; LARGE MAGIC DECANTER ($D4)
db $D5, $E1 ; ARROW REFILL 5 (x$D5) db $D5, $E1 ; ARROW REFILL 5 ($D5)
db $D6, $79 ; GOOD BEE ($D6)
IncrementCountForMinor: IncrementCountForMinor:
@@ -628,7 +630,7 @@ SpriteKeyPrep:
BRA + BRA +
.continue .continue
LDA.w SpawnedItemIndex : STA.w SprItemIndex, X LDA.w SpawnedItemIndex : STA.w SprItemIndex, X
LDA.w SpawnedItemMWPlayer : STA.w 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.w SprItemFlags, X : BEQ + LDA.w SpawnedItemFlag : STA.w SprItemFlags, X : BEQ +
LDA.w SpawnedItemID : STA.w SpriteItemType, X LDA.w SpawnedItemID : STA.w SpriteItemType, X
PHA : PHY : PHX PHA : PHY : PHX
@@ -646,7 +648,7 @@ SpriteKeyPrep:
SpriteKeyDrawGFX: SpriteKeyDrawGFX:
JSL Sprite_DrawRippleIfInWater JSL Sprite_DrawRippleIfInWater
PHA PHA
LDA.l SprItemMWPlayer, X : STA.w !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w SprRedrawFlag, X : BEQ + LDA.w SprRedrawFlag, X : BEQ +
LDA.w SpriteItemType, X LDA.w SpriteItemType, X
JSL RequestStandingItemVRAMSlot JSL RequestStandingItemVRAMSlot
@@ -685,7 +687,8 @@ KeyGet:
JSL CountChestKeyLong JSL CountChestKeyLong
++ PLA : RTL ++ PLA : RTL
+ STY.b Scrap00 + STY.b Scrap00
LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
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
@@ -702,7 +705,7 @@ KeyGet:
.skip PLX .skip PLX
.receive .receive
JSL Player_HaltDashAttackLong JSL Player_HaltDashAttackLong
TYA : JSL.l AttemptItemSubstitution : JSL.l ResolveLootIDLong : TAY TYA : JSL AttemptItemSubstitution : JSL ResolveLootIDLong : TAY
JSL Link_ReceiveItem JSL Link_ReceiveItem
PLA : DEC : RTL PLA : DEC : RTL

View File

@@ -241,10 +241,8 @@ Multiworld_MasterSword_GrantToPlayer:
PLP : PLA PLP : PLA
CPY.b #$6A : BEQ + CPY.b #$6A : BEQ +
JSL Link_ReceiveItem ; thing we wrote over JML Link_ReceiveItem ; thing we wrote over
RTL + JML ActivateGoal
+ JSL ActivateGoal
RTL
} }
Multiworld_AddReceivedItem_notCrystal: Multiworld_AddReceivedItem_notCrystal:

View File

@@ -132,7 +132,7 @@ RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
AddReceivedItemExpanded: AddReceivedItemExpanded:
PHA : PHX PHA : PHX
LDA.l RemoteItems : BEQ + : LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ + LDA.l RemoteItems : BEQ + : LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
LDA.w ItemReceiptMethod : BEQ ++ : CMP.b #$03 : BNE +++ : ++ LDA.w ItemReceiptMethod : BEQ ++ : CMP.b #$03 : BNE +++ : ++
; fromTextOrObject ; fromTextOrObject
LDA.w $0345 : BEQ ++ : LDA.b #$04 : ++ : STA.b LinkState ; Restore Link to his swimming state LDA.w $0345 : BEQ ++ : LDA.b #$04 : ++ : STA.b LinkState ; Restore Link to his swimming state
@@ -731,20 +731,15 @@ ResolveReceipt:
PHA : PHX PHA : PHX
PHK : PLB PHK : PLB
JSL PreItemGet JSL PreItemGet
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w ItemReceiptID LDA.w ItemReceiptID : STA.l !MULTIWORLD_ITEM_ID
.get_item
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSR HandleBowTracking JSR HandleBowTracking
+
LDA.w ItemReceiptID
STA.l !MULTIWORLD_ITEM_ID
JSR ResolveLootID JSR ResolveLootID
.have_item
STA.w ItemReceiptID STA.w ItemReceiptID
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA.w ItemReceiptID LDA.w ItemReceiptID
JSR IncrementItemCounters JSR IncrementItemCounters
+ +
PLX : PLA PLX : PLA
RTS RTS
@@ -811,7 +806,7 @@ ResolveLootID:
.shields .shields
SEP #$20 SEP #$20
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE ++ LDA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE ++
LDA.b #$01 : STA.l ProgressiveFlag LDA.b #$01 : STA.l ProgressiveFlag
LDA.l HighestShield LDA.l HighestShield
CMP.l ProgressiveShieldLimit : BCC + CMP.l ProgressiveShieldLimit : BCC +

View File

@@ -98,7 +98,7 @@ ItemSet_MagicBat:
RTL RTL
ItemSet_OldMan: ItemSet_OldMan:
PHA : LDA OldManItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA PHA : LDA.l OldManItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$01 : STA.l NpcFlags : PLA PHA : LDA.l NpcFlags : ORA.b #$01 : STA.l NpcFlags : PLA
RTL RTL
@@ -108,19 +108,19 @@ ItemSet_ZoraKing:
RTL RTL
ItemSet_SickKid: ItemSet_SickKid:
PHA : LDA SickKidItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA PHA : LDA.l SickKidItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$04 : STA.l NpcFlags : PLA PHA : LDA.l NpcFlags : ORA.b #$04 : STA.l NpcFlags : PLA
RTL RTL
ItemSet_TreeKid: ItemSet_TreeKid:
PHA : LDA TreeKidItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA PHA : LDA.l TreeKidItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$08 : STA.l NpcFlags : PLA PHA : LDA.l NpcFlags : ORA.b #$08 : STA.l NpcFlags : PLA
RTL RTL
ItemSet_Sahasrala: ItemSet_Sahasrala:
PHA : LDA SahasralaItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA PHA : LDA.l SahasralaItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$10 : STA.l NpcFlags : PLA PHA : LDA.l NpcFlags : ORA.b #$10 : STA.l NpcFlags : PLA
RTL RTL
@@ -130,7 +130,7 @@ ItemSet_Catfish:
RTL RTL
ItemSet_Library: ItemSet_Library:
PHA : LDA LibraryItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA PHA : LDA.l LibraryItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$80 : STA.l NpcFlags : PLA PHA : LDA.l NpcFlags : ORA.b #$80 : STA.l NpcFlags : PLA
RTL RTL
@@ -143,7 +143,7 @@ ItemSet_Mushroom:
; if for any reason the item value is 0 reload it, just in case ; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY
+ +
LDA MushroomItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l MushroomItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLA PLA
STZ.w ItemReceiptMethod ; thing we wrote over - the mushroom is an npc for item purposes apparently STZ.w ItemReceiptMethod ; thing we wrote over - the mushroom is an npc for item purposes apparently
RTL RTL
@@ -165,19 +165,19 @@ Set300RupeeNPCItem:
CMP.w #291 : BNE + CMP.w #291 : BNE +
%GetPossiblyEncryptedItem(RupeeNPC_MoldormCave, SpriteItemValues) %GetPossiblyEncryptedItem(RupeeNPC_MoldormCave, SpriteItemValues)
TAY ; load moldorm cave value into Y TAY ; load moldorm cave value into Y
LDA RupeeNPC_MoldormCave_Player LDA.l RupeeNPC_MoldormCave_Player
BRA .done BRA .done
+ CMP.w #286 : BNE + + CMP.w #286 : BNE +
%GetPossiblyEncryptedItem(RupeeNPC_NortheastDarkSwampCave, SpriteItemValues) %GetPossiblyEncryptedItem(RupeeNPC_NortheastDarkSwampCave, SpriteItemValues)
TAY ; load northeast dark swamp cave value into Y TAY ; load northeast dark swamp cave value into Y
LDA RupeeNPC_NortheastDarkSwampCave_Player LDA.l RupeeNPC_NortheastDarkSwampCave_Player
BRA .done BRA .done
+ +
LDA #$0000 LDA.w #$0000
LDY.b #$46 ; default to a normal 300 rupees LDY.b #$46 ; default to a normal 300 rupees
.done .done
SEP #$20 SEP #$20
STA !MULTIWORLD_ITEM_PLAYER_ID STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
RTL RTL
@@ -185,7 +185,7 @@ RTL
; Randomize Zora King ; Randomize Zora King
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadZoraKingItemGFX: LoadZoraKingItemGFX:
LDA.l ZoraItem_Player : : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l ZoraItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE1C3 ; location randomizer writes zora item to LDA.l $1DE1C3 ; location randomizer writes zora item to
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong
@@ -202,7 +202,7 @@ JumpToSplashItemTarget:
; Randomize Catfish ; Randomize Catfish
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadCatfishItemGFX: LoadCatfishItemGFX:
LDA.l CatfishItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l CatfishItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE185 ; location randomizer writes catfish item to LDA.l $1DE185 ; location randomizer writes catfish item to
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong

101
ram.asm
View File

@@ -726,8 +726,8 @@ endmacro
%assertRAM(LinkRecoilY, $7E0027) %assertRAM(LinkRecoilY, $7E0027)
%assertRAM(LinkRecoilX, $7E0028) %assertRAM(LinkRecoilX, $7E0028)
%assertRAM(LinkRecoilZ, $7E0029) %assertRAM(LinkRecoilZ, $7E0029)
%assertRAM(LinkDirection, $7E002F)
%assertRAM(LinkAnimationStep, $7E002E) %assertRAM(LinkAnimationStep, $7E002E)
%assertRAM(LinkDirection, $7E002F)
%assertRAM(OAMOffsetY, $7E0044) %assertRAM(OAMOffsetY, $7E0044)
%assertRAM(OAMOffsetX, $7E0045) %assertRAM(OAMOffsetX, $7E0045)
%assertRAM(LinkIncapacitatedTimer, $7E0046) %assertRAM(LinkIncapacitatedTimer, $7E0046)
@@ -770,8 +770,8 @@ endmacro
%assertRAM(SubSubModule, $7E00B0) %assertRAM(SubSubModule, $7E00B0)
%assertRAM(ObjPtr, $7E00B7) %assertRAM(ObjPtr, $7E00B7)
%assertRAM(ObjPtrOffset, $7E00BA) %assertRAM(ObjPtrOffset, $7E00BA)
%assertRAM(ScrapBufferBD, $7E00BD)
%assertRAM(PlayerSpriteBank, $7E00BC) %assertRAM(PlayerSpriteBank, $7E00BC)
%assertRAM(ScrapBufferBD, $7E00BD)
%assertRAM(FileSelectPosition, $7E00C8) %assertRAM(FileSelectPosition, $7E00C8)
%assertRAM(PasswordCodePosition, $7E00C8) %assertRAM(PasswordCodePosition, $7E00C8)
%assertRAM(PasswordSelectPosition, $7E00C9) %assertRAM(PasswordSelectPosition, $7E00C9)
@@ -794,7 +794,6 @@ endmacro
%assertRAM(BG1ShakeH, $7E011C) %assertRAM(BG1ShakeH, $7E011C)
%assertRAM(CurrentVolume, $7E0127) %assertRAM(CurrentVolume, $7E0127)
%assertRAM(TargetVolume, $7E0129) %assertRAM(TargetVolume, $7E0129)
%assertRAM(CurrentControlRequest, $7E0133)
%assertRAM(MusicControl, $7E012B) %assertRAM(MusicControl, $7E012B)
%assertRAM(MusicControlRequest, $7E012C) %assertRAM(MusicControlRequest, $7E012C)
%assertRAM(SFX1, $7E012D) %assertRAM(SFX1, $7E012D)
@@ -883,12 +882,11 @@ endmacro
%assertRAM(SprItemFlags, $7E0770) %assertRAM(SprItemFlags, $7E0770)
%assertRAM(SprItemGFX, $7E0780) %assertRAM(SprItemGFX, $7E0780)
%assertRAM(SprRedrawFlag, $7E0790) %assertRAM(SprRedrawFlag, $7E0790)
%assertRAM(DynamicDropGFXIndex, $7E07F0)
%assertRAM(OAMBuffer, $7E0800) %assertRAM(OAMBuffer, $7E0800)
%assertRAM(OAMBuffer2, $7E0A00) %assertRAM(OAMBuffer2, $7E0A00)
%assertRAM(TransparencyFlag, $7E0ABD) %assertRAM(TransparencyFlag, $7E0ABD)
%assertRAM(OWTransitionFlag, $7E0ABF) %assertRAM(OWTransitionFlag, $7E0ABF)
%assertRAM(TreePullKills, $7E0CFB)
%assertRAM(TreePullHits, $7E0CFC)
%assertRAM(ArcVariable, $7E0B08) %assertRAM(ArcVariable, $7E0B08)
%assertRAM(OverlordXLow, $7E0B08) %assertRAM(OverlordXLow, $7E0B08)
%assertRAM(OverlordXHigh, $7E0B10) %assertRAM(OverlordXHigh, $7E0B10)
@@ -906,6 +904,8 @@ endmacro
%assertRAM(AncillaLayer, $7E0C7C) %assertRAM(AncillaLayer, $7E0C7C)
%assertRAM(SpriteForceDrop, $7E0CBA) %assertRAM(SpriteForceDrop, $7E0CBA)
%assertRAM(SpriteBump, $7E0CD2) %assertRAM(SpriteBump, $7E0CD2)
%assertRAM(TreePullKills, $7E0CFB)
%assertRAM(TreePullHits, $7E0CFC)
%assertRAM(SpritePosYLow, $7E0D00) %assertRAM(SpritePosYLow, $7E0D00)
%assertRAM(SpritePosXLow, $7E0D10) %assertRAM(SpritePosXLow, $7E0D10)
%assertRAM(SpritePosYHigh, $7E0D20) %assertRAM(SpritePosYHigh, $7E0D20)
@@ -927,12 +927,56 @@ endmacro
%assertRAM(SpriteHitPoints, $7E0E50) %assertRAM(SpriteHitPoints, $7E0E50)
%assertRAM(SpriteControl, $7E0E60) %assertRAM(SpriteControl, $7E0E60)
%assertRAM(SpriteItemType, $7E0E80) %assertRAM(SpriteItemType, $7E0E80)
%assertRAM(SpriteSpawnStep, $7E0ED0)
%assertRAM(SpriteDirectionTable, $7E0EB0) %assertRAM(SpriteDirectionTable, $7E0EB0)
%assertRAM(SpriteSpawnStep, $7E0ED0)
%assertRAM(SpriteHalt, $7E0F00) %assertRAM(SpriteHalt, $7E0F00)
%assertRAM(SpriteTimerE, $7E0F10) %assertRAM(SpriteTimerE, $7E0F10)
%assertRAM(SpriteLayer, $7E0F20) %assertRAM(SpriteLayer, $7E0F20)
%assertRAM(SpriteOAMProp, $7E0F50) %assertRAM(SpriteOAMProp, $7E0F50)
%assertRAM(SpriteZCoord, $7E0F70)
%assertRAM(SpriteVelocityZ, $7E0F80)
%assertRAM(SpriteSubPixelZ, $7E0F90)
%assertRAM(CurrentSpriteSlot, $7E0FA0)
%assertRAM(FreezeSprites, $7E0FC1)
%assertRAM(PrizePackIndexes, $7E0FC7)
%assertRAM(SpriteCoordCacheX, $7E0FD8)
%assertRAM(SpriteCoordCacheY, $7E0FDA)
%assertRAM(NoMenu, $7E0FFC)
%assertRAM(GFXStripes, $7E1000)
%assertRAM(RoomStripes, $7E1100)
%assertRAM(MirrorPortalPosXH, $7E1ACF)
%assertRAM(IrisPtr, $7E1B00)
%assertRAM(MessageSubModule, $7E1CD8)
%assertRAM(MessageCursor, $7E1CE8)
%assertRAM(DelayTimer, $7E1CE9)
%assertRAM(TextID, $7E1CF0)
%assertRAM(ToastBuffer, $7E1E0E)
%assertRAM(MSUResumeTime, $7E1E6B)
%assertRAM(MSUResumeControl, $7E1E6F)
%assertRAM(MSUFallbackTable, $7E1E70)
%assertRAM(MSUDelayedCommand, $7E1E79)
%assertRAM(MSUPackCount, $7E1E7A)
%assertRAM(MSUPackCurrent, $7E1E7B)
%assertRAM(MSUPackRequest, $7E1E7C)
%assertRAM(MSULoadedTrack, $7E1E7D)
%assertRAM(MSUResumeTrack, $7E1E7F)
%assertRAM(ClockHours, $7E1E90)
%assertRAM(ClockMinutes, $7E1E94)
%assertRAM(ClockSeconds, $7E1E98)
%assertRAM(ClockBuffer, $7E1E9C)
%assertRAM(ScratchBufferNV, $7E1EA0)
%assertRAM(ScratchBufferV, $7E1EB0)
%assertRAM(TileMapA, $7E2000)
%assertRAM(TileMapB, $7E4000)
%assertRAM(TileUploadBuffer, $7EA180)
%assertRAM(RoomFade, $7EC005)
%assertRAM(FadeTimer, $7EC007)
%assertRAM(FadeDirection, $7EC009)
%assertRAM(FadeLevel, $7EC00B)
%assertRAM(MosaicLevel, $7EC011)
%assertRAM(RoomDarkness, $7EC017)
%assertRAM(SpriteOAM, $7EC025)
%assertRAM(SpriteDynamicOAM, $7EC035)
%assertRAM(EN_OWSCR2, $7EC140) %assertRAM(EN_OWSCR2, $7EC140)
%assertRAM(EN_MAINDESQ, $7EC142) %assertRAM(EN_MAINDESQ, $7EC142)
%assertRAM(EN_SUBDESQ, $7EC143) %assertRAM(EN_SUBDESQ, $7EC143)
@@ -960,51 +1004,6 @@ endmacro
%assertRAM(EN_SCRMODYB, $7EC16C) %assertRAM(EN_SCRMODYB, $7EC16C)
%assertRAM(EN_SCRMODXA, $7EC16E) %assertRAM(EN_SCRMODXA, $7EC16E)
%assertRAM(EN_SCRMODXB, $7EC170) %assertRAM(EN_SCRMODXB, $7EC170)
%assertRAM(SpriteZCoord, $7E0F70)
%assertRAM(SpriteVelocityZ, $7E0F80)
%assertRAM(SpriteSubPixelZ, $7E0F90)
%assertRAM(CurrentSpriteSlot, $7E0FA0)
%assertRAM(FreezeSprites, $7E0FC1)
%assertRAM(PrizePackIndexes, $7E0FC7)
%assertRAM(SpriteCoordCacheX, $7E0FD8)
%assertRAM(SpriteCoordCacheY, $7E0FDA)
%assertRAM(NoMenu, $7E0FFC)
%assertRAM(GFXStripes, $7E1000)
%assertRAM(RoomStripes, $7E1100)
%assertRAM(MirrorPortalPosXH, $7E1ACF)
%assertRAM(IrisPtr, $7E1B00)
%assertRAM(MessageSubModule, $7E1CD8)
%assertRAM(MessageCursor, $7E1CE8)
%assertRAM(DelayTimer, $7E1CE9)
%assertRAM(TextID, $7E1CF0)
%assertRAM(ToastBuffer, $7E1E0E)
%assertRAM(MSUResumeTime, $7E1E6B)
%assertRAM(MSUResumeControl, $7E1E6F)
%assertRAM(MSUFallbackTable, $7E1E70)
%assertRAM(DynamicDropGFXIndex, $7E1E73)
%assertRAM(MSUDelayedCommand, $7E1E79)
%assertRAM(MSUPackCount, $7E1E7A)
%assertRAM(MSUPackCurrent, $7E1E7B)
%assertRAM(MSUPackRequest, $7E1E7C)
%assertRAM(MSULoadedTrack, $7E1E7D)
%assertRAM(MSUResumeTrack, $7E1E7F)
%assertRAM(ClockHours, $7E1E90)
%assertRAM(ClockMinutes, $7E1E94)
%assertRAM(ClockSeconds, $7E1E98)
%assertRAM(ClockBuffer, $7E1E9C)
%assertRAM(ScratchBufferNV, $7E1EA0)
%assertRAM(ScratchBufferV, $7E1EB0)
%assertRAM(TileMapA, $7E2000)
%assertRAM(TileMapB, $7E4000)
%assertRAM(TileUploadBuffer, $7EA180)
%assertRAM(RoomFade, $7EC005)
%assertRAM(FadeTimer, $7EC007)
%assertRAM(FadeDirection, $7EC009)
%assertRAM(FadeLevel, $7EC00B)
%assertRAM(MosaicLevel, $7EC011)
%assertRAM(RoomDarkness, $7EC017)
%assertRAM(SpriteOAM, $7EC025)
%assertRAM(SpriteDynamicOAM, $7EC035)
%assertRAM(PegColor, $7EC172) %assertRAM(PegColor, $7EC172)
%assertRAM(GameOverSongCache, $7EC227) %assertRAM(GameOverSongCache, $7EC227)
%assertRAM(LastBGSet, $7EC2F8) %assertRAM(LastBGSet, $7EC2F8)

View File

@@ -22,7 +22,7 @@ RTL
.forceHeart .forceHeart
LDA.b #$33 : STA.b ScrapBufferBD+$0B ; assure the correct state if player talked to shopkeeper LDA.b #$33 : STA.b ScrapBufferBD+$0B ; assure the correct state if player talked to shopkeeper
LDA.w RoomItemsTaken : AND.b #$40 : BNE .notHeart LDA.w RoomItemsTaken : AND.b #$40 : BNE .notHeart
LDA ChestGameItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l ChestGameItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
LDA.b #$07 ; give prize item LDA.b #$07 ; give prize item
RTL RTL
.notHeart .notHeart

View File

@@ -425,80 +425,78 @@ Shopkeeper_SetupHitboxes:
RTS RTS
Shopkeeper_BuyItem: Shopkeeper_BuyItem:
PHX : PHY PHX : PHY
TYX TYX
LDA.l ShopInventory, X LDA.l ShopInventory, X
CMP.b #$0E : BEQ .refill ; Bee Refill CMP.b #$0E : BEQ .refill ; Bee Refill
CMP.b #$2E : BEQ .refill ; Red Potion Refill CMP.b #$2E : BEQ .refill ; Red Potion Refill
CMP.b #$2F : BEQ .refill ; Green Potion Refill CMP.b #$2F : BEQ .refill ; Green Potion Refill
CMP.b #$30 : BEQ .refill ; Blue Potion Refill CMP.b #$30 : BEQ .refill ; Blue Potion Refill
BRA + BRA +
.refill .refill
JSL Sprite_GetEmptyBottleIndex : BMI .full_bottles JSL Sprite_GetEmptyBottleIndex : BMI .full_bottles
LDA.b #$1 : STA.l ShopkeeperRefill ; If this is on, don't toggle bit to remove from shop LDA.b #$1 : STA.l ShopkeeperRefill ; If this is on, don't toggle bit to remove from shop
+ +
LDA.l ShopType : AND.b #$80 : BNE .buy ; don't charge if this is a take-any LDA.l ShopType : AND.b #$80 : BNE .buy ; don't charge if this is a take-any
REP #$20 : LDA.l CurrentRupees : CMP.l ShopInventory+1, X : SEP #$20 : !BGE .buy REP #$20 : LDA.l CurrentRupees : CMP.l ShopInventory+1, X : SEP #$20 : !BGE .buy
.cant_afford .cant_afford
LDA.b #$7A LDA.b #$7A
LDY.b #$01 LDY.b #$01
JSL Sprite_ShowMessageUnconditional BRA .message
LDA.b #$3C : STA.w SFX2 ; error sound .full_bottles
JMP .done LDA.b #$6B : LDY.b #$01
.full_bottles .message
LDA.b #$6B : LDY.b #$01 JSL Sprite_ShowMessageUnconditional
JSL Sprite_ShowMessageUnconditional LDA.b #$3C : STA.w SFX2 ; error sound
LDA.b #$3C : STA.w SFX2 ; error sound 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 ShopInventory+1, X : STA.l CurrentRupees : SEP #$20 ; Take price away ++
++ PHX
LDA.b #0 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
TXA : !ADD ShopSRAMIndex : TAX
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.
+++
PLX
LDA.l ShopInventory, X
JSL AttemptItemSubstitution
JSL ResolveLootIDLong
TAY : JSL Link_ReceiveItem
LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X
LDA.b #0 : STA.l ShopEnableCount
TXA : LSR #2 : TAX
LDA.l ShopType : BIT.b #$80 : BNE +
LDA ShopkeeperRefill : BNE +++
LDA.l ShopState : ORA.w Shopkeeper_ItemMasks, X : STA.l ShopState
+++ PHX
TXA : !ADD ShopSRAMIndex : TAX
LDA.l PurchaseCounts, X : INC : BEQ +++ : STA.l PurchaseCounts, X : +++
PLX
BRA ++
+ ; Take-any
BIT.b #$20 : BNE .takeAll
.takeAny
LDA.l ShopState : ORA.b #$07 : STA.l ShopState
PHX PHX
LDA.b #0 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.l ShopSRAMIndex : TAX : LDA.b #$01 : STA.l PurchaseCounts, X
TXA : !ADD ShopSRAMIndex : TAX LDA.l EnableShopItemCount, X : STA.l ShopEnableCount
LDA.l PurchaseCounts, X : BNE +++ ;Is this the first time buying this slot? PLX
LDA.l EnableShopItemCount, X : STA.l ShopEnableCount ; If so, store the permission to count the item here. BRA ++
+++ .takeAll
PLX LDA.l ShopState : ORA.w Shopkeeper_ItemMasks, X : STA.l ShopState
LDA.l ShopInventory, X PHX
JSL.l AttemptItemSubstitution LDA.l ShopSRAMIndex : TAX : LDA.l ShopState : STA.l PurchaseCounts, X
JSL.l ResolveLootIDLong LDA.l EnableShopItemCount, X : STA.l ShopEnableCount
TAY : JSL Link_ReceiveItem PLX
LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X ++
LDA.b #0 : STA.l ShopEnableCount .done
LDA.b #$0 : STA.l ShopkeeperRefill
TXA : LSR #2 : TAX PLY : PLX
LDA.l ShopType : BIT.b #$80 : BNE +
LDA ShopkeeperRefill : BNE +++
LDA.l ShopState : ORA.w Shopkeeper_ItemMasks, X : STA.l ShopState
+++ PHX
TXA : !ADD ShopSRAMIndex : TAX
LDA.l PurchaseCounts, X : INC : BEQ +++ : STA.l PurchaseCounts, X : +++
PLX
BRA ++
+ ; Take-any
BIT.b #$20 : BNE .takeAll
.takeAny
LDA.l ShopState : ORA.b #$07 : STA.l ShopState
PHX
LDA.l ShopSRAMIndex : TAX : LDA.b #$01 : STA.l PurchaseCounts, X
LDA.l EnableShopItemCount, X : STA.l ShopEnableCount
PLX
BRA ++
.takeAll
LDA.l ShopState : ORA.w Shopkeeper_ItemMasks, X : STA.l ShopState
PHX
LDA.l ShopSRAMIndex : TAX : LDA.l ShopState : STA.l PurchaseCounts, X
LDA.l EnableShopItemCount, X : STA.l ShopEnableCount
PLX
++
.done
LDA #$0 : STA ShopkeeperRefill
PLY : PLX
RTS RTS
Shopkeeper_ItemMasks: Shopkeeper_ItemMasks:
db #$01, #$02, #$04, #$08 db #$01, #$02, #$04, #$08

View File

@@ -121,7 +121,7 @@ GetSmithSword:
BRA .done BRA .done
.buy .buy
LDA SmithItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID LDA.l SmithItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
LDA.l SmithItem : TAY LDA.l SmithItem : TAY
STZ.w ItemReceiptMethod ; Item from NPC STZ.w ItemReceiptMethod ; Item from NPC
PHX : JSL Link_ReceiveItem : PLX PHX : JSL Link_ReceiveItem : PLX

View File

@@ -67,7 +67,7 @@ PrepDynamicTile:
CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + : BRA ++ ; if rupees, don't draw to OAM CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + : BRA ++ ; if rupees, don't draw to OAM
+ JSL TransferItemReceiptToBuffer_using_ReceiptID + JSL TransferItemReceiptToBuffer_using_ReceiptID
SEP #$30 SEP #$30
++ LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID ; clear player id ++ LDA.b #$00 : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID ; clear player id
PLB : PLY : PLX PLB : PLY : PLX
RTL RTL
.loot_resolved .loot_resolved
@@ -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
+ +

View File

@@ -254,7 +254,6 @@ EntranceData_song = $82D592
SpawnPointData_room_id = $82D8D2 SpawnPointData_room_id = $82D8D2
Overworld_CheckForSpecialOverworldTrigger_Direction = $84E879 Overworld_CheckForSpecialOverworldTrigger_Direction = $84E879
Sprite_ShowSolicitedMessage_Direction = $85E1A3 Sprite_ShowSolicitedMessage_Direction = $85E1A3
RoomData_SpritePointers = $89D62E
WorldMap_RedXChars = $8ABF70 WorldMap_RedXChars = $8ABF70
WorldMap_CalculateOAMCoordinates = $8AC3B1 WorldMap_CalculateOAMCoordinates = $8AC3B1
WorldMap_HandleSpriteBlink = $8AC52E WorldMap_HandleSpriteBlink = $8AC52E