Fixed up the anti-soft lock in swamp
Combined flags and fixed a couple of bugs
This commit is contained in:
@@ -248,8 +248,8 @@ incsrc stats/main.asm
|
|||||||
|
|
||||||
incsrc menu/overworldmap.asm ; overwrites some code in bank 0A
|
incsrc menu/overworldmap.asm ; overwrites some code in bank 0A
|
||||||
incsrc doorrando.asm ; bank 27 likely A7 in the future
|
incsrc doorrando.asm ; bank 27 likely A7 in the future
|
||||||
;bank 28/A8 for keydropshuffle
|
;bank 28/A8 for keydropshuffle / standing items
|
||||||
incsrc keydrop/potsanity.asm
|
incsrc keydrop/standing_items.asm
|
||||||
incsrc enemizer/main.asm ; this is originally in bank 36, but is currently in migratory status in bank 37
|
incsrc enemizer/main.asm ; this is originally in bank 36, but is currently in migratory status in bank 37
|
||||||
|
|
||||||
org $308000 ; bank #$30
|
org $308000 ; bank #$30
|
||||||
@@ -363,7 +363,7 @@ warnpc $B08000
|
|||||||
;$23 Stats & Credits
|
;$23 Stats & Credits
|
||||||
;$24 Code Bank
|
;$24 Code Bank
|
||||||
;$27 DR Code Bank
|
;$27 DR Code Bank
|
||||||
;$28 Keydrop Code bank
|
;$28 Keydrop / Standing Items Code bank
|
||||||
;$29 External hooks (rest of bank not used)
|
;$29 External hooks (rest of bank not used)
|
||||||
;$2E Reserved for Tournament Use
|
;$2E Reserved for Tournament Use
|
||||||
;$2F Static RNG (rest is reserved for tournament use)
|
;$2F Static RNG (rest is reserved for tournament use)
|
||||||
|
|||||||
@@ -12,15 +12,18 @@ FloodGateReset:
|
|||||||
+
|
+
|
||||||
FloodGateResetInner:
|
FloodGateResetInner:
|
||||||
LDA.l Bugfix_SwampWaterLevel : BEQ .done
|
LDA.l Bugfix_SwampWaterLevel : BEQ .done
|
||||||
LDA $279004 : BEQ .check_room_53 ; Only do the check for room 55 if on door rando
|
LDA $279004 : BEQ .check_room_35; Only do the check for room 37 if on door rando
|
||||||
LDA $7EF06F : AND.b #$04 : BEQ .drain_room_55 ; Check if key in room 55 has been collected.
|
LDA.l SwampDrain1HasItem : BEQ .flipper_check
|
||||||
LDA $7EF356 : AND.b #$01 : BNE .check_room_53 ; Check for flippers. This can otherwise softlock doors if flooded without flippers and no way to reset.
|
LDA $7F666F : AND.b #$80 : BEQ .drain_room_37 ; Check if key in room 37 has been collected.
|
||||||
.drain_room_55
|
.flipper_check
|
||||||
LDA $7EF06E : AND.b #$7F : STA $7EF06E ; clear water room 55 - outer room you shouldn't be able to softlock except in major glitches
|
LDA $7EF356 : AND.b #$01 : BNE .check_room_35 ; Check for flippers. This can otherwise softlock doors if flooded without flippers and no way to reset.
|
||||||
.check_room_53
|
.drain_room_37
|
||||||
LDA $7EF06B : AND.b #$04 : BNE .done ; Check if key in room 53 has been collected.
|
LDA $7EF06E : AND.b #$7F : STA $7EF06E ; clear water room 37 - outer room you shouldn't be able to softlock except in major glitches
|
||||||
|
.check_room_35
|
||||||
|
LDA.l SwampDrain2HasItem : BEQ .done
|
||||||
|
LDA $7F666B : AND.b #$80 : BNE .done ; Check if key in room 35 has been collected.
|
||||||
; no need to check for flippers on the inner room, as you can't get to the west door no matter what, without flippers.
|
; no need to check for flippers on the inner room, as you can't get to the west door no matter what, without flippers.
|
||||||
LDA $7EF06A : AND.b #$7F : STA $7EF06A ; clear water room 53 - inner room with the easy key flood softlock
|
LDA $7EF06A : AND.b #$7F : STA $7EF06A ; clear water room 35 - inner room with the easy key flood softlock
|
||||||
.done
|
.done
|
||||||
RTL
|
RTL
|
||||||
;================================================================================
|
;================================================================================
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ org $09C2BB
|
|||||||
org $09C327
|
org $09C327
|
||||||
JSL LoadSpriteData
|
JSL LoadSpriteData
|
||||||
|
|
||||||
org $06EF7A
|
org $06F976
|
||||||
JSL RevealSpriteDrop : NOP
|
JSL RevealSpriteDrop : NOP
|
||||||
|
|
||||||
org $06926e ; <- 3126e - sprite_prep.asm : 2664 (LDA $0B9B : STA $0CBA, X)
|
org $06926e ; <- 3126e - sprite_prep.asm : 2664 (LDA $0B9B : STA $0CBA, X)
|
||||||
@@ -103,12 +103,14 @@ PotMultiWorldTable:
|
|||||||
; Reserved $250 296 * 2
|
; Reserved $250 296 * 2
|
||||||
|
|
||||||
org $A8AA50
|
org $A8AA50
|
||||||
ShuffleKeyDrops: ; 142A50 # todo : combine these flags?
|
StandingItemsOn: ; 142A50
|
||||||
db 0
|
|
||||||
StandingItemsOn: ; 142A51
|
|
||||||
db 0
|
|
||||||
MultiClientFlags: ; 142A52 -> stored in SRAM at 7ef33d
|
|
||||||
db 0
|
db 0
|
||||||
|
MultiClientFlags: ; 142A51-2 -> stored in SRAM at 7ef33d (for now)
|
||||||
|
dw 0
|
||||||
|
SwampDrain1HasItem: ; 142A53
|
||||||
|
db 1
|
||||||
|
SwampDrain2HasItem: ; 142A54
|
||||||
|
db 1
|
||||||
|
|
||||||
|
|
||||||
RevealPotItem:
|
RevealPotItem:
|
||||||
@@ -220,14 +222,18 @@ RevealSpriteDrop:
|
|||||||
LDA #$02 : STA.l SpawnedItemFlag
|
LDA #$02 : STA.l SpawnedItemFlag
|
||||||
STX SpawnedItemIndex
|
STX SpawnedItemIndex
|
||||||
LDA.l SprItemReceipt, X : STA SpawnedItemID
|
LDA.l SprItemReceipt, X : STA SpawnedItemID
|
||||||
LDA.b #$01 : STA $0CBA, X ; trigger the small key routines
|
LDA.l SprItemMWPlayer, X : STA SpawnedItemMWPlayer
|
||||||
LDA.b #$09 : STA $0DD0, X : RTL ; unstun if stunned
|
LDY.b #$01 ; trigger the small key routines
|
||||||
|
LDA SpawnedItemID : CMP #$32 : BNE +
|
||||||
|
LDA.l StandingItemsOn : BNE +
|
||||||
|
INY ; big key routine
|
||||||
|
+ RTL ; unstun if stunned
|
||||||
.normal
|
.normal
|
||||||
LDA.w $0CBA, X : BNE .no_forced_drop
|
LDY.w $0CBA, X : BEQ .no_forced_drop
|
||||||
RTL
|
RTL
|
||||||
.no_forced_drop
|
.no_forced_drop
|
||||||
PLY : PLY ; remove the JSL return lower 16 bits
|
PLA : PLA ; remove the JSL reswamturn lower 16 bits
|
||||||
PEA.w $06EF9A-1 ; change return address to .no_forced_drop of (Sprite_ApplyCalculatedDamage)
|
PEA.w $06F996-1 ; change return address to .no_forced_drop of (Sprite_DoTheDeath)
|
||||||
RTL
|
RTL
|
||||||
|
|
||||||
BitFieldMasks:
|
BitFieldMasks:
|
||||||
@@ -239,7 +245,6 @@ db $40, $20
|
|||||||
|
|
||||||
; Runs during Sprite_E4_SmallKey and duning Sprite_E5_BigKey spawns
|
; Runs during Sprite_E4_SmallKey and duning Sprite_E5_BigKey spawns
|
||||||
ShouldSpawnItem:
|
ShouldSpawnItem:
|
||||||
LDA.l StandingItemsOn : BEQ .normal
|
|
||||||
; checking our sram table
|
; checking our sram table
|
||||||
PHX : PHY
|
PHX : PHY
|
||||||
REP #$30
|
REP #$30
|
||||||
@@ -256,26 +261,21 @@ ShouldSpawnItem:
|
|||||||
SEP #$30 : PLY : PLX : LDA #$01 : RTL ; already obtained
|
SEP #$30 : PLY : PLX : LDA #$01 : RTL ; already obtained
|
||||||
.notObtained
|
.notObtained
|
||||||
SEP #$30 : PLY : PLX
|
SEP #$30 : PLY : PLX
|
||||||
LDA #$00 : RTL
|
LDA #$00
|
||||||
.normal
|
|
||||||
LDA.w $0403
|
|
||||||
AND.w KeyRoomFlagMasks,Y
|
|
||||||
RTL
|
RTL
|
||||||
|
|
||||||
MarkSRAMForItem:
|
MarkSRAMForItem:
|
||||||
LDA.l StandingItemsOn : BEQ .normal
|
|
||||||
PHX : PHY : REP #$30
|
PHX : PHY : REP #$30
|
||||||
LDA.b $A0 : ASL : TAY
|
LDA.b $A0 : ASL : TAY
|
||||||
LDA.l SpawnedItemIndex : ASL
|
LDA.l SpawnedItemIndex : ASL
|
||||||
TAX : LDA.l BitFieldMasks, X : STA $00
|
TAX : LDA.l BitFieldMasks, X : STA $00
|
||||||
TYX
|
TYX
|
||||||
LDA.w SpawnedItemFlag : CMP #$01 : BEQ +
|
LDA.w SpawnedItemFlag : CMP #$0001 : BEQ +
|
||||||
LDA SpriteItemSRAM, X : ORA $00 : STA SpriteItemSRAM, X
|
LDA SpriteItemSRAM, X : ORA $00 : STA SpriteItemSRAM, X : BRA .end
|
||||||
+ LDA PotItemSRAM, X : ORA $00 : STA PotItemSRAM, X
|
+ LDA PotItemSRAM, X : ORA $00 : STA PotItemSRAM, X
|
||||||
|
.end
|
||||||
SEP #$30 : PLY : PLX
|
SEP #$30 : PLY : PLX
|
||||||
LDA.w $0403 : RTL
|
LDA.w $0403
|
||||||
.normal
|
|
||||||
LDA.w $0403 : ORA.w KeyRoomFlagMasks,Y
|
|
||||||
RTL
|
RTL
|
||||||
|
|
||||||
SpriteKeyPrep:
|
SpriteKeyPrep:
|
||||||
@@ -319,10 +319,11 @@ SpriteKeyDrawGFX:
|
|||||||
KeyGet:
|
KeyGet:
|
||||||
LDA $7EF36F ; what we wrote over
|
LDA $7EF36F ; what we wrote over
|
||||||
PHA
|
PHA
|
||||||
LDY $0E80, X
|
LDA.l StandingItemsOn : BNE +
|
||||||
|
PLA : RTL
|
||||||
|
+ LDY $0E80, X
|
||||||
LDA SprItemIndex, X : STA SpawnedItemIndex
|
LDA SprItemIndex, X : STA SpawnedItemIndex
|
||||||
LDA SprItemFlags, X : STA SpawnedItemFlag
|
LDA SprItemFlags, X : STA SpawnedItemFlag
|
||||||
; todo: may need to check if we are in a dungeon or not $FF
|
|
||||||
LDA $A0 : CMP #$87 : BNE + ;check for hera cage
|
LDA $A0 : CMP #$87 : BNE + ;check for hera cage
|
||||||
LDA SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
|
LDA SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
|
||||||
JSR ShouldKeyBeCountedForDungeon : BCC ++
|
JSR ShouldKeyBeCountedForDungeon : BCC ++
|
||||||
@@ -331,7 +332,6 @@ KeyGet:
|
|||||||
+ STY $00
|
+ STY $00
|
||||||
LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive
|
LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive
|
||||||
PHX
|
PHX
|
||||||
; todo: may need to check if we are in a dungeon or not $FF
|
|
||||||
LDA $040C : LSR : TAX
|
LDA $040C : LSR : TAX
|
||||||
LDA $00 : CMP.l KeyTable, X : BNE +
|
LDA $00 : CMP.l KeyTable, X : BNE +
|
||||||
- JSL.l FullInventoryExternal : JSL CountChestKeyLong : PLX : PLA : RTL
|
- JSL.l FullInventoryExternal : JSL CountChestKeyLong : PLX : PLA : RTL
|
||||||
@@ -366,7 +366,8 @@ BigKeyGet:
|
|||||||
+ SEC : RTL
|
+ SEC : RTL
|
||||||
|
|
||||||
LoadProperties_PreserveCertainProps:
|
LoadProperties_PreserveCertainProps:
|
||||||
LDA.l StandingItemsOn : BNE +
|
LDA $0E20, X : CMP #$E4 : BEQ +
|
||||||
|
CMP #$E5 : BEQ +
|
||||||
JML Sprite_LoadProperties
|
JML Sprite_LoadProperties
|
||||||
+ LDA $0F50, X : PHA
|
+ LDA $0F50, X : PHA
|
||||||
LDA $0E80, X : PHA
|
LDA $0E80, X : PHA
|
||||||
@@ -245,7 +245,7 @@ IncrementSmallKeysNoPrimary:
|
|||||||
LDA $048E : CMP.w #$0087 : BNE ++ ; check for hera basement cage
|
LDA $048E : CMP.w #$0087 : BNE ++ ; check for hera basement cage
|
||||||
LDA $A8 : AND #$0003 : CMP #$0002 : BNE ++ ; must be quadrant 2
|
LDA $A8 : AND #$0003 : CMP #$0002 : BNE ++ ; must be quadrant 2
|
||||||
PLP : PHY : LDY.b #$24 : JSL.l FullInventoryExternal
|
PLP : PHY : LDY.b #$24 : JSL.l FullInventoryExternal
|
||||||
LDA ShuffleKeyDrops : BNE +++
|
LDA StandingItemsOn : BNE +++
|
||||||
JSR CountChestKey
|
JSR CountChestKey
|
||||||
+++ PLY : BRA +
|
+++ PLY : BRA +
|
||||||
++
|
++
|
||||||
|
|||||||
Reference in New Issue
Block a user