private static void _BankSwitchCallAndRestore() { A.Set(BankSwitching.Bank); Stack.Preserve(A, () => { GoSub(_BankCall); //Using JSR here instead of the usual JMP so it comes back here instead, because BC tables are all addr-1 }); //GoSub(BankSwitching._SwitchBanks); BankSwitching.SwitchPrgTo(A); }
private static void _BankCall() { //X = bankcallfunc ID A.Set(BankLabel[X]); BankSwitching.SwitchPrgTo(A); A.Set(SubHiLabel[X]); Stack.Backup(A); A.Set(SubLoLabel[X]); Stack.Backup(A); }
public static void FullChrCopy() { //Set GraphicsPtr before calling! //const byte CHR_ONE_PAGE = 16; const byte CHR_TWO_PAGES = 32; Comment("Backup current bank"); A.Set(BankSwitching.Bank); Stack.Backup(Register.A); BankSwitching.SwitchPrgTo(30); //TODO: finish after implementing Pointer X.Set(CHR_TWO_PAGES); Y.Set(0); GoSub(ChrCopy); //Globals.graphicsPtr.PointTo(LabelFor(Rom.ChrBank1)); //X.Set(CHR_ONE_PAGE); //Y.Set(10); //GoSub(ChrCopy); Stack.Restore(Register.A); GoSub(BankSwitching._SwitchBanks); }