Exemplo n.º 1
0
        public static void ChrPageCopy10()
        {
            //Set GraphicsPtr before calling!
            //Set Y to 0 or 10
            //Set A to the bank containing the CHR
            const byte CHR_ONE_PAGE = 16;

            X.Set(BankSwitching.Bank);
            BankSwitching.SwitchTo(A);
            //A.Set(Bank);
            A.State.Push();                     //A is needed later and is backed up as a consequence of backing up X
            Stack.Backup(Register.X);

            //TODO: finish after implementing Pointer
            X.Set(CHR_ONE_PAGE);
            Y.Set(0x10);
            GoSub(ChrCopy);
            //X.Set(CHR_ONE_PAGE);
            //Y.Set(10);
            //GoSub(ChrCopy);

            Stack.Restore(Register.A);

            X.State.Pop();                      //get rid of the unneeded X value
            X.State.Alter();                    //indicate it's now unknown

            BankSwitching.SwitchTo(A);
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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);
        }