--- nono/vm/spc.cpp 2026/04/29 17:05:28 1.1.1.16 +++ nono/vm/spc.cpp 2026/04/29 17:05:32 1.1.1.17 @@ -11,6 +11,7 @@ #include "spc.h" #include "config.h" #include "mainapp.h" +#include "monitor.h" #include "pedec.h" #include "scheduler.h" #include "scsidev.h" @@ -28,11 +29,12 @@ SPCDevice::SPCDevice() : inherited(OBJ_SPC) { - myid = -1; + // 初期値は不定だが表示上困るのでとりあえず。 + myid = 7; - monitor.func = ToMonitorCallback(&SPCDevice::MonitorUpdate); + monitor = gMonitorManager->Regist(ID_MONITOR_SPC, this); + monitor->func = ToMonitorCallback(&SPCDevice::MonitorUpdate); // サイズは Init で決まる - monitor.Regist(ID_MONITOR_SPC); } // デストラクタ @@ -108,14 +110,14 @@ SPCDevice::Init() // モニタに表示するアドレス if (vmtype == VMType::X68030) { - baseaddr = 0xe96001; + baseaddr = 0xe96021; regoffset = 2; } else { baseaddr = 0xe1000000; regoffset = 4; } // 「イニシエータ以外のターゲット数」はここでは確定している。 - monitor.SetSize(80, 15 + scsi->GetOwnedBus()->GetTargetCount() + 1); + monitor->SetSize(80, 15 + scsi->GetOwnedBus()->GetTargetCount() + 1); return true; } @@ -140,6 +142,10 @@ SPCDevice::ResetHard(bool poweron) // このビットは落ちるのではないだろうか spc.sdgc = 0x00; + // キューはリセットされる。 + // mb89351-scsi.pdf (日本語) + spc.dreg.Clear(); + // 内部状態 MakeIntsMask(); ChangeInterrupt();