コード例 #1
0
ファイル: ComputerAssembly.cs プロジェクト: viert/vm68k
    void Update()
    {
        if (initiated)
        {
            registers = Cpu.Registers;
            uiRegisterMap["PC"].text = string.Format("PC 0x{0:X8}", registers.PC);
            uiRegisterMap["A0"].text = string.Format("A0 0x{0:X8}", registers.A0);
            uiRegisterMap["A1"].text = string.Format("A1 0x{0:X8}", registers.A1);
            uiRegisterMap["A2"].text = string.Format("A2 0x{0:X8}", registers.A2);
            uiRegisterMap["A3"].text = string.Format("A3 0x{0:X8}", registers.A3);
            uiRegisterMap["A4"].text = string.Format("A4 0x{0:X8}", registers.A4);
            uiRegisterMap["A5"].text = string.Format("A5 0x{0:X8}", registers.A5);
            uiRegisterMap["A6"].text = string.Format("A6 0x{0:X8}", registers.A6);
            uiRegisterMap["A7"].text = string.Format("A7 0x{0:X8}", registers.A7);
            uiRegisterMap["D0"].text = string.Format("D0 0x{0:X8}", registers.D0);
            uiRegisterMap["D1"].text = string.Format("D1 0x{0:X8}", registers.D1);
            uiRegisterMap["D2"].text = string.Format("D2 0x{0:X8}", registers.D2);
            uiRegisterMap["D3"].text = string.Format("D3 0x{0:X8}", registers.D3);
            uiRegisterMap["D4"].text = string.Format("D4 0x{0:X8}", registers.D4);
            uiRegisterMap["D5"].text = string.Format("D5 0x{0:X8}", registers.D5);
            uiRegisterMap["D6"].text = string.Format("D6 0x{0:X8}", registers.D6);
            uiRegisterMap["D7"].text = string.Format("D7 0x{0:X8}", registers.D7);
            uiRegisterMap["SR"].text = string.Format("SR {0}", Convert.ToString(registers.SR, 2).PadLeft(16, '0'));
            interruptsRequested      = Cpu.interruptsRequested;
            disassemble.text         = dasm;
        }

        if (Input.GetKeyDown(KeyCode.F8))
        {
            nextStep = true;
        }

        if (Input.GetKeyDown(KeyCode.F5))
        {
            triggerReset = true;
            flash.FlashMessage("CPU Reset");
        }
    }