示例#1
0
        public void LoadRom()
        {
            ROM.LoadROM(System.IO.File.ReadAllBytes("Advanced Wars  # GBA.GBA"));
            ROM.ParseROM();
            ROM.DumpInfo();
            ROM.VerifyChecksum();
            Log(ROM.VerifyMagic().ToString());
            //int i = ROM.FindPattern(Encoding.ASCII.GetBytes("FLASH_V"));
            ROM.BackupType t = ROM.CheckBackup();
            Log("BACKUP: {0:X}", ROM.BackupToString(t));
            //CPU.DecodeARM(0x2e0000ea);
            //CPU.DecodeARM(0xea00002e);
            CPU.AddHandlers();
            Registers r = new Registers();

            //r.DumpRegs();
            r[13] = 16;
            r.DumpRegs();
            r.SwitchABT();
            r[13] = 32;
            r.DumpRegs();
            r.SwitchUSR();
            r.DumpRegs();
            r.SwitchABT();
            r.DumpRegs();
            CPSR c = new CPSR();

            c[CPSR.Flag.Carry] = true;
            c[CPSR.Flag.User]  = true;
            c.Dump();
        }
示例#2
0
 public unsafe Registers()
 {
     //AllocUserRegisters();
     //_R = new GCHandle[16];
     //_R_FIQ = new GCHandle[8];
     _MappedR = new UInt32 *[16];
     AllocRegisters(ref _R, 16, 0);
     AllocRegisters(ref _R_FIQ, 8, 1);
     AllocRegisters(ref _R_SVC, 2, 2);
     AllocRegisters(ref _R_ABT, 2, 3);
     AllocRegisters(ref _R_IRQ, 2, 4);
     AllocRegisters(ref _R_UND, 2, 5);
     CreateMap();
     _CPSR = new CPSR();
     //DumpRegs();
     //SwitchFIQ();
     //SwitchIRQ();
     //DumpRegs();
 }