--- nono/vm/mpu680x0.cpp 2026/04/29 17:04:36 1.1.1.2 +++ nono/vm/mpu680x0.cpp 2026/04/29 17:04:42 1.1.1.4 @@ -27,10 +27,13 @@ std::unique_ptr gMPUATC; // できる。すごい楽。 MPU680x0Device::MPU680x0Device(uint32 reset_vector) { - monitor.Init(79, 16); + monitor_size = nnSize(79, 16); cpu = m68030_init(reset_vector); + // リセット例外イベントコールバック設定 + reset_event.func = (DeviceCallback_t)&MPU680x0Device::ResetCallback; + // モニタ用の別オブジェクト gMPUATC.reset(new MPUATC(cpu)); } @@ -60,10 +63,9 @@ MPU680x0Device::Init() return true; } -// リセット -// (MPU が動くのはこの後 Scheduler::Run() を発行した後) +// リセット例外イベントコールバック void -MPU680x0Device::ResetHard() +MPU680x0Device::ResetCallback(Event& ev) { m68030_exception_reset(cpu); } @@ -120,8 +122,8 @@ MPU680x0Device::SetHaltCallback(void (*c } // モニター更新 (レジスタウィンドウ) -bool -MPU680x0Device::MonitorUpdate() +void +MPU680x0Device::MonitorUpdate(TextScreen& monitor) { m68kreg reg; uint32 ppc; @@ -297,8 +299,6 @@ MPU680x0Device::MonitorUpdate() // FPIAR monitor.Print(x, y++, "FPIAR:%08x", reg.fpframe.fpf_fpiar); - - return true; } // CPU 側からのコールバック。RESET 命令ハンドラ @@ -315,14 +315,14 @@ MPUATC::MPUATC(m68kcpu *cpu_) { cpu = cpu_; #if !defined(ATC_SINGLE) - monitor.Init(131, m68030ATCTable::LINES + 3); + monitor_size = nnSize(131, m68030ATCTable::LINES + 3); #else - monitor.Init(31, 24); + monitor_size = nnSize(31, 24); #endif } -bool -MPUATC::MonitorUpdate() +void +MPUATC::MonitorUpdate(TextScreen& monitor) { m68030ATCTable *table; #if !defined(ATC_SINGLE) @@ -430,5 +430,4 @@ MPUATC::MonitorUpdate() } } #endif - return true; }