--- nono/vm/sio.cpp 2026/04/29 17:05:28 1.1.1.13 +++ nono/vm/sio.cpp 2026/04/29 17:05:49 1.1.1.17 @@ -10,6 +10,7 @@ #define MPSCC_SIO_LOG_HACK #include "sio.h" +#include "event.h" #include "hostcom.h" #include "keyboard.h" #include "mainapp.h" @@ -47,17 +48,9 @@ SIODevice::SIODevice() mpscc.chan[0].xc12_ns = 78.125_usec; mpscc.chan[1].xc12_ns = 78.125_usec; - // LUNA では SIO と呼ぶほうが通りがいい。 - // イベントの登録は親クラスで行ってある。 - for (int ch = 0; ch < txevent.size(); ch++) { - auto& chan = mpscc.chan[ch]; - txevent[ch].SetName(string_format("SIO Ch%c TX", chan.name)); - rxevent[ch].SetName(string_format("SIO Ch%c RX", chan.name)); - } - - monitor.func = ToMonitorCallback(&SIODevice::MonitorUpdate); - monitor.SetSize(70, 24); - monitor.Regist(ID_MONITOR_SIO); + monitor = gMonitorManager->Regist(ID_MONITOR_SIO, this); + monitor->func = ToMonitorCallback(&SIODevice::MonitorUpdate); + monitor->SetSize(70, 24); } // デストラクタ @@ -73,8 +66,18 @@ SIODevice::Init() return false; } + hostcom->SetPortName("SIO Ch.A"); + keyboard = GetKeyboard(); + // LUNA では SIO と呼ぶほうが通りがいい。 + // イベントの登録は親クラスで行ってある。 + for (int ch = 0; ch < txevent.size(); ch++) { + auto& chan = mpscc.chan[ch]; + txevent[ch]->SetName(string_format("SIO Ch%c TX", chan.name)); + rxevent[ch]->SetName(string_format("SIO Ch%c RX", chan.name)); + } + return true; } @@ -803,7 +806,6 @@ SIODevice::GetHighestInt() const if ((mpscc.chan[1].intpend & INTPEND_TX)) return MPSCC::VS_TxB; if ((mpscc.chan[0].intpend & INTPEND_ES)) return MPSCC::VS_ESA; if ((mpscc.chan[1].intpend & INTPEND_ES)) return MPSCC::VS_ESB; - } else { if ((mpscc.chan[0].intpend & INTPEND_SP)) return MPSCC::VS_SPA; if ((mpscc.chan[0].intpend & INTPEND_RX)) return MPSCC::VS_RxA;