--- nono/vm/newsio.cpp 2026/04/29 17:05:25 1.1.1.2 +++ nono/vm/newsio.cpp 2026/04/29 17:06:01 1.1.1.7 @@ -36,7 +36,9 @@ #include "lance.h" #include "mainbus.h" #include "mk48t02.h" +#include "monitor.h" #include "newsctlr.h" +#include "nop.h" #include "scc.h" #include "subram.h" #include "vm.h" @@ -45,7 +47,7 @@ NewsIODevice::NewsIODevice() : inherited(OBJ_NEWSIO) { - NEWDV(KBC, new KBCDevice()); + NEWDV(KBC, new BusIO_B()); NEWDV(RTC, new BusIO_B()); NEWDV(SCC, new BusIO_B()); NEWDV(Lance, new BusIO_W()); @@ -82,11 +84,10 @@ NewsIODevice::NewsIODevice() src_screen.Init(75, 64, TextScreen::Ring); - monitor.func = ToMonitorCallback(&NewsIODevice::MonitorUpdate); - monitor.SetSize(src_screen.GetCol(), 1 + 32); - monitor.SetMaxHeight(1 + 64); - monitor.Regist(ID_SUBWIN_NEWSIO); - + monitor = gMonitorManager->Regist(ID_SUBWIN_NEWSIO, this); + monitor->SetCallback(&NewsIODevice::MonitorScreen); + monitor->SetSize(src_screen.GetCol(), 1 + 32); + monitor->SetMaxHeight(1 + 64); } // デストラクタ @@ -98,10 +99,6 @@ NewsIODevice::~NewsIODevice() bool NewsIODevice::Init() { - if (inherited::Init() == false) { - return false; - } - const ConfigItem& olditem = gConfig->Find("xxx-news-sci-ignore"); const ConfigItem& newitem = gConfig->Find("xxx-news-sic-ignore"); @@ -131,59 +128,31 @@ NewsIODevice::SearchDevice(uint32 addr) } busdata -NewsIODevice::Read8(uint32 addr) +NewsIODevice::Read(busaddr addr) { - IODevice *d = SearchDevice(addr); - return d->Read8(addr); + IODevice *d = SearchDevice(addr.Addr()); + return d->Read(addr); } busdata -NewsIODevice::Read16(uint32 addr) +NewsIODevice::Write(busaddr addr, uint32 data) { - IODevice *d = SearchDevice(addr); - return d->Read16(addr); -} - -busdata -NewsIODevice::Read32(uint32 addr) -{ - IODevice *d = SearchDevice(addr); - return d->Read32(addr); -} - -busdata -NewsIODevice::Write8(uint32 addr, uint32 data) -{ - IODevice *d = SearchDevice(addr); - return d->Write8(addr, data); -} - -busdata -NewsIODevice::Write16(uint32 addr, uint32 data) -{ - IODevice *d = SearchDevice(addr); - return d->Write16(addr, data); -} - -busdata -NewsIODevice::Write32(uint32 addr, uint32 data) -{ - IODevice *d = SearchDevice(addr); - return d->Write32(addr, data); + IODevice *d = SearchDevice(addr.Addr()); + return d->Write(addr, data); } busdata -NewsIODevice::Peek8(uint32 addr) +NewsIODevice::Peek1(uint32 addr) { IODevice *d = SearchDevice(addr); - return d->Peek8(addr); + return d->Peek1(addr); } bool -NewsIODevice::Poke8(uint32 addr, uint32 data) +NewsIODevice::Poke1(uint32 addr, uint32 data) { IODevice *d = SearchDevice(addr); - return d->Poke8(addr, data); + return d->Poke1(addr, data); } // モニタを初期化。 @@ -227,11 +196,11 @@ NewsIODevice::InitMonitor() } // 下半分は NewsCtlr で処理。 - newsctlr->MonitorUpdateNewsCtlr(screen, y); + newsctlr->MonitorScreenNewsCtlr(screen, y); } void -NewsIODevice::MonitorUpdate(Monitor *, TextScreen& screen) +NewsIODevice::MonitorScreen(Monitor *, TextScreen& screen) { // pos が表示開始位置(0-) int pos = (int)screen.userdata;