Backport terrorpin ai fix from enemizer. (and fix a bug with it.)

This commit is contained in:
CaitSith2
2020-08-05 08:48:25 -07:00
parent dad73fc883
commit a892ff39b2
4 changed files with 33 additions and 0 deletions

19
terrorpin.asm Normal file
View File

@@ -0,0 +1,19 @@
;================================================================================
; Terrorpin AI Fixes
;================================================================================
FixTerrorpin:
{
PHA ;save A so that checking the option doesn't smoke A
LDA.b Enable_TerrorPin_AI_Fix : BNE .new ; check if option is on
PLA ;restore A
; do the old code that smokes A
AND.b #$03 : STA $0DE0, X
RTL
.new
PLA ; Restore A
PHA ; save A so the orignal code doesn't kill it
AND.b #$03 : STA $0DE0, X ; restore what we overwrote
PLA ; restore A so the AND/BNE in the original code actually does something
RTL
}