--- nono/vm/mfp.cpp 2026/04/29 17:05:29 1.1.1.16 +++ nono/vm/mfp.cpp 2026/04/29 17:05:37 1.1.1.18 @@ -11,6 +11,7 @@ #include "mfp.h" #include "interrupt.h" #include "keyboard.h" +#include "monitor.h" #include "mpu.h" #include "scheduler.h" #include "x68kkbd.h" @@ -22,9 +23,9 @@ static const busdata wait = busdata::Wai MFPDevice::MFPDevice() : inherited(OBJ_MFP) { - monitor.func = ToMonitorCallback(&MFPDevice::MonitorUpdate); - monitor.SetSize(77, 26); - monitor.Regist(ID_MONITOR_MFP); + monitor = gMonitorManager->Regist(ID_MONITOR_MFP, this); + monitor->func = ToMonitorCallback(&MFPDevice::MonitorUpdate); + monitor->SetSize(77, 26); } // デストラクタ @@ -36,10 +37,6 @@ MFPDevice::~MFPDevice() bool MFPDevice::Init() { - if (inherited::Init() == false) { - return false; - } - interrupt = GetInterruptDevice(); keyboard = dynamic_cast(GetKeyboard()); @@ -106,6 +103,16 @@ MFPDevice::ResetHard(bool poweron) // CIRQ | FMIRQ | EXPON | ALARM にしておく mfp.gpip = 0x6b; + // Human68k モードなら、10msec ごとに Timer-C 割り込みを上げる。 + // 時間計測用。 + if (gMainApp.human_mode) { + WritePort(MFP::VR, 0x40); + WritePort(MFP::TCDR, 200); + WritePort(MFP::TCDCR, 0x70); + WritePort(MFP::IMRB, 0x20); + WritePort(MFP::IERB, 0x20); + } + ChangeInterrupt(); }