org $C23BFA jmp extra1 TYX BIT $3DE8,X jmp extra2 org $C2???? extra1: TYX BIT $3DD4,X bne repeat JMP $0E32 (Set status picked bytes 1 or 2) extra2: BNE repeat ORA $3DE8,Y (Set status picked bytes 3 or 4) STA $3DE8,Y RTS repeat: JMP try_again (i.e. C2/3BEB) (21 extra bytes, so so) (will repeat infinitely for Mind Blast if there're less than 4 statuses marked in spell data.) =========================== (EOR earlier than C2/3BFA could work, where $3DD4 or $3DE8 is just a subset of $11AA or $11AC.) org $C23BF4 jsr extra org $C2???? extra: bcs second_pair eor $3DD4,Y bra proceed second_pair: eor $3DE8,Y proceed: JSR $522A rts (14 extra bytes. better.) ------------- (what if they're somehow not a subset? i.e. somebody edited code.) org $C23BEC LDA $3DD4,Y BCC $3BF4 (branch if we're attempting to set a status from status byte 1 or 2) LDA $3DE8,Y (otherwise, it's from byte 3 or 4) jsr extra org $C2???? extra: eor #$ffff bcs second_pair AND $11AA bra proceed second_pair: AND $11AC proceed: JSR $522A rts (17 extra bytes.)