--- nono/host/hostcom.cpp 2026/04/29 17:05:30 1.1.1.4 +++ nono/host/hostcom.cpp 2026/04/29 17:05:34 1.1.1.5 @@ -63,11 +63,13 @@ #include "hostcom.h" +#include "comdriver_cons.h" #include "comdriver_none.h" #include "comdriver_stdio.h" #include "comdriver_tcp.h" #include "config.h" #include "mainapp.h" +#include "monitor.h" // コンストラクタ // @@ -89,9 +91,9 @@ HostCOMDevice::HostCOMDevice(Device *par // のログレベルは独立。 // モニタは hostcom* のみ必要。 - monitor.func = ToMonitorCallback(&HostCOMDevice::MonitorUpdate); - monitor.SetSize(30, 17); - monitor.Regist(ID_MONITOR_HOSTCOM); + monitor = gMonitorManager->Regist(ID_MONITOR_HOSTCOM, this); + monitor->func = ToMonitorCallback(&HostCOMDevice::MonitorUpdate); + monitor->SetSize(30, 17); } } @@ -167,6 +169,19 @@ HostCOMDevice::SelectDriver() if ((bool)driver && driver->InitDriver() == false) { driver.reset(); } + + } else if (type == "cons") { + // console デバイスのいない機種では指定出来ない。 + if (gMainApp.FindObject(OBJ_CONSOLE) == NULL) { + item.Err("cannot be specified on vmtype=%s", + gMainApp.GetVMTypeStr().c_str()); + return false; + } + + driver.reset(new COMDriverCons(this)); + if ((bool)driver && driver->InitDriver() == false) { + driver.reset(); + } } else { // 知らないドライバ種別