hirom header ; ----- this segment unchanged outside of branch lengths. ----- org $C22217 ; C2/2215: A5 B3 LDA $B3 BPL continue ; Skip Clear check if bit 7 of $B3 not set org $C2221E ; C2/2219: B9 E4 3E LDA $3EE4,Y ; C2/221C: 89 10 BIT #$10 (Check for Clear status) BEQ continue ; Branch if not vanished ; ------- the real changes start here. ------- org $C22220 LDA $11A2 LSR BCS no_magic_vanish_remove ; branch if physical LDA $3DFC,Y ORA #$10 STA $3DFC,Y ; mark Clear status to be cleared. that way, ; it'll still be removed even if the attack ; misses and C2/4406, which is what normally ; removes Clear, is skipped. no_magic_vanish_remove: LDA $11A4 BIT #$40 BNE continue ; Branch if L.X spell BCS $22B5 ; miss if physical, as target is Vanished JSR high_priority ; do Instant Death, and Dead XOR Undead checks BRA $22B3 ; hit or miss, depending on result of function call hipr_helper: ; rest of high_priority function, starts in free space LDA $11A2 BIT #$04 ; Check for hit only (dead XOR undead) targets BEQ hit LDA $3EE4,Y EOR $3C95,Y ; death status XOR undead attribute BPL missed2 ; If neither or both of above set, then miss hit: CLC ; indicate it could hit missed2: RTS continue: ; next 9 lines unchanged aside from branch sizes, and being shifted LDA $11A3 BIT #$02 ; Check for not reflectable BNE noReflect ; Branch if ^ LDA $3EF8,Y BPL noReflect ; Branch if target does not have Reflect REP #$20 ; set 16-bit accumulator LDA $3018,Y TSB $A6 ; turn on target in "reflected off of" byte JMP $22E5 ; Always miss if target has Reflect noReflect: JSR high_priority ; do Instant Death, and Dead XOR Undead checks BCS $22B5 ; miss if any didn't pass ; no NOPs needed. rejoice! ; rest of function unchanged ; ; C2/2268: A5 B5 LDA $B5 ; C2/226A: C9 00 CMP #$00 ; ... ; ----------- high_priority: org $C2???? LDA $11A2 ASL ; get spell miss if instant death protected into Bit 2 SEC ; assume attack missed to start. done here because ASL ; affects Carry. AND $3AA1,Y ; Protected from instant death is in this Bit 2 BIT #$04 ; are both true? BNE missed ; Always miss if so next: JMP hipr_helper ; do some more checks missed: RTS