Merged in DR v1.4.1.6
This commit is contained in:
@@ -70,7 +70,7 @@ CutoffEntranceRug:
|
||||
CMP.w #$000C : BNE .norm
|
||||
+ LDX.w #$0000 : LDA.l CutoffRooms, x
|
||||
- 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
|
||||
PLX : PLA : LDA.w $9B52, Y : STA.l TileMapA, X ; what we wrote over
|
||||
RTL
|
||||
|
||||
@@ -2,7 +2,17 @@
|
||||
; 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:
|
||||
LDA.b RoomIndex ; load room index (low byte)
|
||||
CMP.b #172 : BNE + ; Is is Thieves Town Boss Room
|
||||
|
||||
@@ -6,7 +6,7 @@ db #$00 ;368100 ; Enable random enemy under bushes
|
||||
db #$00 ;408101 : 200101 ; Enable blind's door closing for other bosses
|
||||
.moldorm_eye_count
|
||||
db #$01 ;408102 : 200102 ; Moldorm eye count, default to 2 eyes (1)
|
||||
.randomize_sprites
|
||||
EnemizerFlag_Randomize_Sprites:
|
||||
db #$00 ;408103 : 200103 ; Randomize Sprites.
|
||||
.agahnim_fun_balls
|
||||
db #$00 ;408104 : 200104 ; make Agahnim balls deflect back
|
||||
|
||||
@@ -14,6 +14,4 @@ incsrc hooks/damage_hooks.asm
|
||||
|
||||
incsrc hooks/overworld_sprite_hooks.asm
|
||||
|
||||
incsrc hooks/underworld_sprite_hooks.asm
|
||||
|
||||
incsrc hooks/blindboss_hooks.asm
|
||||
incsrc hooks/underworld_sprite_hooks.asm
|
||||
@@ -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:
|
||||
@@ -47,6 +47,7 @@ incsrc bossdrop.asm
|
||||
incsrc moldorm.asm
|
||||
incsrc kodongo_fixes.asm
|
||||
incsrc mimic_fixes.asm
|
||||
incsrc swamola_fix.asm
|
||||
; vitreous key fix for boss shuffle - uses FixPrizeOnTheEyes flag
|
||||
|
||||
incsrc overworld_sprites.asm
|
||||
|
||||
18
enemizer/swamola_fix.asm
Normal file
18
enemizer/swamola_fix.asm
Normal 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
|
||||
@@ -2430,7 +2430,7 @@ org $80D17E+178 : db ExpandedTrinexx>>0
|
||||
; Use above sheet in Hyrule castle courtyard after rain state.
|
||||
org $80DB9E ; Hyrule Castle GFX Sprite Sheet 4 on [LW1]
|
||||
db $3F
|
||||
db $80DBA2 ; Hyrule Castle GFX Sprite Sheet 4 on [RainState]
|
||||
org $80DBA2 ; Hyrule Castle GFX Sprite Sheet 4 on [RainState]
|
||||
db $3F
|
||||
org $80DC0A ; Hyrule Castle GFX Sprite Sheet 4 on [LW2]
|
||||
db $3F
|
||||
|
||||
@@ -685,7 +685,8 @@ KeyGet:
|
||||
JSL CountChestKeyLong
|
||||
++ PLA : RTL
|
||||
+ 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 !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .receive
|
||||
PHX
|
||||
LDA.w DungeonID : CMP.b #$FF : BNE +
|
||||
LDA.b Scrap00 : CMP.b #$AF : BNE .skip
|
||||
@@ -702,7 +703,7 @@ KeyGet:
|
||||
.skip PLX
|
||||
.receive
|
||||
JSL Player_HaltDashAttackLong
|
||||
TYA : JSL.l AttemptItemSubstitution : JSL.l ResolveLootIDLong : TAY
|
||||
TYA : JSL AttemptItemSubstitution : JSL ResolveLootIDLong : TAY
|
||||
JSL Link_ReceiveItem
|
||||
PLA : DEC : RTL
|
||||
|
||||
|
||||
13
newitems.asm
13
newitems.asm
@@ -731,20 +731,15 @@ ResolveReceipt:
|
||||
PHA : PHX
|
||||
PHK : PLB
|
||||
JSL PreItemGet
|
||||
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE +
|
||||
LDA.w ItemReceiptID
|
||||
.get_item
|
||||
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
|
||||
LDA.w ItemReceiptID : STA.l !MULTIWORLD_ITEM_ID
|
||||
JSL AttemptItemSubstitution
|
||||
JSR HandleBowTracking
|
||||
+
|
||||
LDA.w ItemReceiptID
|
||||
STA.l !MULTIWORLD_ITEM_ID
|
||||
JSR ResolveLootID
|
||||
.have_item
|
||||
STA.w ItemReceiptID
|
||||
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE +
|
||||
LDA.w ItemReceiptID
|
||||
JSR IncrementItemCounters
|
||||
LDA.w ItemReceiptID
|
||||
JSR IncrementItemCounters
|
||||
+
|
||||
PLX : PLA
|
||||
RTS
|
||||
|
||||
101
ram.asm
101
ram.asm
@@ -726,8 +726,8 @@ endmacro
|
||||
%assertRAM(LinkRecoilY, $7E0027)
|
||||
%assertRAM(LinkRecoilX, $7E0028)
|
||||
%assertRAM(LinkRecoilZ, $7E0029)
|
||||
%assertRAM(LinkDirection, $7E002F)
|
||||
%assertRAM(LinkAnimationStep, $7E002E)
|
||||
%assertRAM(LinkDirection, $7E002F)
|
||||
%assertRAM(OAMOffsetY, $7E0044)
|
||||
%assertRAM(OAMOffsetX, $7E0045)
|
||||
%assertRAM(LinkIncapacitatedTimer, $7E0046)
|
||||
@@ -770,8 +770,8 @@ endmacro
|
||||
%assertRAM(SubSubModule, $7E00B0)
|
||||
%assertRAM(ObjPtr, $7E00B7)
|
||||
%assertRAM(ObjPtrOffset, $7E00BA)
|
||||
%assertRAM(ScrapBufferBD, $7E00BD)
|
||||
%assertRAM(PlayerSpriteBank, $7E00BC)
|
||||
%assertRAM(ScrapBufferBD, $7E00BD)
|
||||
%assertRAM(FileSelectPosition, $7E00C8)
|
||||
%assertRAM(PasswordCodePosition, $7E00C8)
|
||||
%assertRAM(PasswordSelectPosition, $7E00C9)
|
||||
@@ -794,7 +794,6 @@ endmacro
|
||||
%assertRAM(BG1ShakeH, $7E011C)
|
||||
%assertRAM(CurrentVolume, $7E0127)
|
||||
%assertRAM(TargetVolume, $7E0129)
|
||||
%assertRAM(CurrentControlRequest, $7E0133)
|
||||
%assertRAM(MusicControl, $7E012B)
|
||||
%assertRAM(MusicControlRequest, $7E012C)
|
||||
%assertRAM(SFX1, $7E012D)
|
||||
@@ -883,12 +882,11 @@ endmacro
|
||||
%assertRAM(SprItemFlags, $7E0770)
|
||||
%assertRAM(SprItemGFX, $7E0780)
|
||||
%assertRAM(SprRedrawFlag, $7E0790)
|
||||
%assertRAM(DynamicDropGFXIndex, $7E07F0)
|
||||
%assertRAM(OAMBuffer, $7E0800)
|
||||
%assertRAM(OAMBuffer2, $7E0A00)
|
||||
%assertRAM(TransparencyFlag, $7E0ABD)
|
||||
%assertRAM(OWTransitionFlag, $7E0ABF)
|
||||
%assertRAM(TreePullKills, $7E0CFB)
|
||||
%assertRAM(TreePullHits, $7E0CFC)
|
||||
%assertRAM(ArcVariable, $7E0B08)
|
||||
%assertRAM(OverlordXLow, $7E0B08)
|
||||
%assertRAM(OverlordXHigh, $7E0B10)
|
||||
@@ -906,6 +904,8 @@ endmacro
|
||||
%assertRAM(AncillaLayer, $7E0C7C)
|
||||
%assertRAM(SpriteForceDrop, $7E0CBA)
|
||||
%assertRAM(SpriteBump, $7E0CD2)
|
||||
%assertRAM(TreePullKills, $7E0CFB)
|
||||
%assertRAM(TreePullHits, $7E0CFC)
|
||||
%assertRAM(SpritePosYLow, $7E0D00)
|
||||
%assertRAM(SpritePosXLow, $7E0D10)
|
||||
%assertRAM(SpritePosYHigh, $7E0D20)
|
||||
@@ -927,12 +927,56 @@ endmacro
|
||||
%assertRAM(SpriteHitPoints, $7E0E50)
|
||||
%assertRAM(SpriteControl, $7E0E60)
|
||||
%assertRAM(SpriteItemType, $7E0E80)
|
||||
%assertRAM(SpriteSpawnStep, $7E0ED0)
|
||||
%assertRAM(SpriteDirectionTable, $7E0EB0)
|
||||
%assertRAM(SpriteSpawnStep, $7E0ED0)
|
||||
%assertRAM(SpriteHalt, $7E0F00)
|
||||
%assertRAM(SpriteTimerE, $7E0F10)
|
||||
%assertRAM(SpriteLayer, $7E0F20)
|
||||
%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_MAINDESQ, $7EC142)
|
||||
%assertRAM(EN_SUBDESQ, $7EC143)
|
||||
@@ -960,51 +1004,6 @@ endmacro
|
||||
%assertRAM(EN_SCRMODYB, $7EC16C)
|
||||
%assertRAM(EN_SCRMODXA, $7EC16E)
|
||||
%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(GameOverSongCache, $7EC227)
|
||||
%assertRAM(LastBGSet, $7EC2F8)
|
||||
|
||||
138
shopkeeper.asm
138
shopkeeper.asm
@@ -425,80 +425,78 @@ Shopkeeper_SetupHitboxes:
|
||||
RTS
|
||||
|
||||
Shopkeeper_BuyItem:
|
||||
PHX : PHY
|
||||
TYX
|
||||
PHX : PHY
|
||||
TYX
|
||||
|
||||
LDA.l ShopInventory, X
|
||||
CMP.b #$0E : BEQ .refill ; Bee Refill
|
||||
CMP.b #$2E : BEQ .refill ; Red Potion Refill
|
||||
CMP.b #$2F : BEQ .refill ; Green Potion Refill
|
||||
CMP.b #$30 : BEQ .refill ; Blue Potion Refill
|
||||
BRA +
|
||||
.refill
|
||||
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.l ShopInventory, X
|
||||
CMP.b #$0E : BEQ .refill ; Bee Refill
|
||||
CMP.b #$2E : BEQ .refill ; Red Potion Refill
|
||||
CMP.b #$2F : BEQ .refill ; Green Potion Refill
|
||||
CMP.b #$30 : BEQ .refill ; Blue Potion Refill
|
||||
BRA +
|
||||
.refill
|
||||
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.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
|
||||
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
|
||||
|
||||
.cant_afford
|
||||
LDA.b #$7A
|
||||
LDY.b #$01
|
||||
JSL Sprite_ShowMessageUnconditional
|
||||
LDA.b #$3C : STA.w SFX2 ; error sound
|
||||
JMP .done
|
||||
.full_bottles
|
||||
LDA.b #$6B : LDY.b #$01
|
||||
JSL Sprite_ShowMessageUnconditional
|
||||
LDA.b #$3C : STA.w SFX2 ; error sound
|
||||
JMP .done
|
||||
.buy
|
||||
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
|
||||
++
|
||||
.cant_afford
|
||||
LDA.b #$7A
|
||||
LDY.b #$01
|
||||
BRA .message
|
||||
.full_bottles
|
||||
LDA.b #$6B : LDY.b #$01
|
||||
.message
|
||||
JSL Sprite_ShowMessageUnconditional
|
||||
LDA.b #$3C : STA.w SFX2 ; error sound
|
||||
JMP .done
|
||||
.buy
|
||||
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
|
||||
++
|
||||
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.l AttemptItemSubstitution
|
||||
JSL.l 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
|
||||
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.l AttemptItemSubstitution
|
||||
JSL.l 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
|
||||
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
|
||||
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.b #$0 : STA.l ShopkeeperRefill
|
||||
PLY : PLX
|
||||
RTS
|
||||
Shopkeeper_ItemMasks:
|
||||
db #$01, #$02, #$04, #$08
|
||||
|
||||
Reference in New Issue
Block a user