Fix moldorm/somaria issue and add both-canes mode

This commit is contained in:
2021-12-22 00:28:27 -08:00
parent 6279f32fe3
commit 265089cedb
6 changed files with 88 additions and 27 deletions

View File

@@ -30,6 +30,7 @@ ItemDowngradeFixMain:
CPY.b #$29 : BEQ .isMushroom ; Mushroom
CPY.b #$B1 : !BLT + : CPY.b #$B6 : !BLT .isBombUpgrade : +
CPY.b #$B7 : !BLT + : CPY.b #$BC : !BLT .isCaneUpgrade : +
.done
STA [$00] ; thing we wrote over part 2
@@ -82,5 +83,16 @@ JMP .done
JMP .done
+
PLA
JMP .done
.isCaneUpgrade
PHA
TYA ; load cane upgrade item
!SUB #$B6 ; convert to cane level
CMP.l !WEAPON_LEVEL : !BGE + ; skip if highest is lower (this is an upgrade)
LDA.l !WEAPON_LEVEL : !ADD #$B6 ; convert to item id
TAY : PLA : LDA.l !WEAPON_LEVEL ; put cane level into the thing to write
JMP .done
+
PLA
JMP .done
;================================================================================