public static void Backup(Register registers = Register.All, bool statusFlags = false) { if (statusFlags) { CPU6502.PHP(); } if (registers.HasFlag(Register.A)) { CPU6502.PHA(); A.State.Push(); } if (registers.HasFlag(Register.X)) { CPU6502.TXA(); //Use(Asm.TXA); CPU6502.PHA(); X.State.Push(); } if (registers.HasFlag(Register.Y)) { CPU6502.TYA(); //Use(Asm.TYA); CPU6502.PHA(); Y.State.Push(); } }
public static void Backup(RegisterBase reg) { if (reg is RegisterA) { CPU6502.PHA(); A.State.Push(); } else if (reg is RegisterX) { CPU6502.TXA(); //Use(Asm.TXA); CPU6502.PHA(); X.State.Push(); } else if (reg is RegisterY) { CPU6502.TYA(); //Use(Asm.TYA); CPU6502.PHA(); Y.State.Push(); } }
public static void Push(Address addr) { A.Set(addr); CPU6502.PHA(); }