Esempio n. 1
0
        private bool Import()
        {
            string path = Settings.LastCmdFile;

            if (String.IsNullOrWhiteSpace(path))
            {
                path = Path.Combine(Storage.AppDataPath, @"CMD Files\");
            }

            path = Dialogs.GetCommandFilePath(path);

            if (path.Length > 0)
            {
                CmdFile = new CmdFile(path);

                if (CmdFile.Valid)
                {
                    Settings.LastCmdFile = path;
                    return(true);
                }
                else
                {
                    Dialogs.AlertUser("CMD File import failed: file not valid");
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public CmdPage(CmdFile file)
        {
            //Console.WriteLine("DEBUG > ObjentryPage > Filepath: " + filepath);
            handler     = new CmdPageHandler(file);
            DataContext = handler;

            InitializeComponent();
        }
Esempio n. 3
0
        public CmdPageHandler(CmdFile file)
        {
            MemOffsetFallback = "21CCB5A0"; // PCSX2 CCZ's eng patch
            fileType          = Enum.FileType.KH2_03SYSTEM;
            subBarName        = "cmd\0";
            stringToFind      = subBarName;

            findAddress();
            Console.WriteLine("DEBUG > CmdPageHandler > Processing file...");
            CmdFileLoaded = file;
            processFile();
            Console.WriteLine("DEBUG > CmdPageHandler > File processed!");
        }
Esempio n. 4
0
        private async Task DoAssembly()
        {
            // Simple multibyte multiplication program
            string program =
                ";Mul16:; This routine performs the operation DEHL = BC * DE" + NL +
                "\tOrg\t8000h" + NL +
                "MUL16\tDI" + NL +
                "\tld\thl,0" + NL +
                "\tld\ta, 16" + NL +
                "MUL16LOOP:\tadd\thl, hl" + NL +
                "\trl\te" + NL +
                "\trl\td" + NL +
                "\tjp\tnc, NOMUL16" + NL +
                "\tadd\thl, bc" + NL +
                "\tjp\tnc, NOMUL16" + NL +
                "\tinc\tde ;This instruction (with the jump) is like an 'ADC DE,0'" + NL +
                "NOMUL16" + NL +
                "\tdec\ta" + NL +
                "\tjp\tnz, MUL16LOOP" + NL +
                "\tret" + NL +
                "entry\tld\tbc,12345" + NL +
                "\tld\tde,34567" + NL +
                "\tcall\tMUL16" + NL +
                "\tld\t(LOW), HL" + NL +
                "\tpush\tde" + NL +
                "\tpop\thl" + NL +
                "\tld\t(HIGH), HL" + NL +
                "\thalt" + NL +
                "\tORG\t9000h" + NL +
                "LOW\tDW\t0" + NL +
                "HIGH\tDS\t2" + NL +
                "\tEND";

            await StartToBasic(ClockSpeed.Unlimited);

            var assembly = computer.Assemble(program);
            var cmdFile  = new CmdFile(assembly, Path.GetTempFileName());

            computer.LoadCMDFile(cmdFile);

            Assert.IsTrue(assembly.AssembledOK && cmdFile.Valid, "Failed to assemble");
        }