--- nono/vm/pio.cpp 2026/04/29 17:04:52 1.1.1.7 +++ nono/vm/pio.cpp 2026/04/29 17:04:55 1.1.1.8 @@ -29,7 +29,8 @@ std::unique_ptr gPIO1; // // コンストラクタ -i8255Device::i8255Device() +i8255Device::i8255Device(const std::string& objname_) + : inherited(objname_) { } @@ -94,10 +95,8 @@ i8255Device::SetPC(int pc, int data) // コンストラクタ PPIDevice::PPIDevice() - : inherited() + : inherited("PPI") { - logname = "pio"; - devname = "PPI"; devaddr = baseaddr; devlen = 0x2000; } @@ -200,10 +199,8 @@ PPIDevice::Peek(uint32 offset) // コンストラクタ PIO0Device::PIO0Device() - : inherited() + : inherited("PIO0") { - logname = "pio0"; - devname = "PIO0"; devaddr = 0x49000000; devlen = 4; @@ -223,7 +220,9 @@ PIO0Device::PIO0Device() // DIP-SW#2 はユーザ定義(?)なので(今の所?)どちらも共通。 gConfig->SetDefault("luna-dipsw2", "11111111"); - monitor_size = nnSize(22, 11); + monitor.func = (MonitorCallback_t)&PIO0Device::MonitorUpdate; + monitor.SetSize(22, 11); + monitor.Regist(ID_MONITOR_PIO0); } // デストラクタ @@ -336,14 +335,14 @@ PIO0Device::Peek(uint32 offset) } void -PIO0Device::MonitorUpdate(TextScreen& monitor) +PIO0Device::MonitorUpdate(Monitor *, TextScreen& screen) { int y; - monitor.Clear(); + screen.Clear(); y = 0; - monitor.Print(0, y++, "PortA(DIPSW1):%c%c%c%c%c%c%c%c", + screen.Print(0, y++, "PortA(DIPSW1):%c%c%c%c%c%c%c%c", (dipsw1[0] ? '1' : '0'), (dipsw1[1] ? '1' : '0'), (dipsw1[2] ? '1' : '0'), @@ -352,7 +351,7 @@ PIO0Device::MonitorUpdate(TextScreen& mo (dipsw1[5] ? '1' : '0'), (dipsw1[6] ? '1' : '0'), (dipsw1[7] ? '1' : '0')); - monitor.Print(0, y++, "PortB(DIPSW2):%c%c%c%c%c%c%c%c", + screen.Print(0, y++, "PortB(DIPSW2):%c%c%c%c%c%c%c%c", (dipsw2[0] ? '1' : '0'), (dipsw2[1] ? '1' : '0'), (dipsw2[2] ? '1' : '0'), @@ -361,15 +360,15 @@ PIO0Device::MonitorUpdate(TextScreen& mo (dipsw2[5] ? '1' : '0'), (dipsw2[6] ? '1' : '0'), (dipsw2[7] ? '1' : '0')); - monitor.Puts(0, y++, "PortC"); - monitor.Puts(1, y++, TA::OnOff(xp_reset), "b7: XP Reset"); - monitor.Puts(1, y++, TA::OnOff(parity), "b6: Parity"); - monitor.Puts(1, y++, "b5: ---"); - monitor.Puts(1, y++, TA::OnOff(int5en), "b4: Int5 Enable"); - monitor.Puts(1, y++, TA::OnOff(int5rq), "b3: Int5 Request"); - monitor.Puts(1, y++, TA::OnOff(int1en), "b2: Int1 Enable"); - monitor.Puts(1, y++, "b1: ---"); - monitor.Puts(1, y++, TA::OnOff(int1rq), "b0: Intq Request"); + screen.Puts(0, y++, "PortC"); + screen.Puts(1, y++, TA::OnOff(xp_reset), "b7: XP Reset"); + screen.Puts(1, y++, TA::OnOff(parity), "b6: Parity"); + screen.Puts(1, y++, "b5: ---"); + screen.Puts(1, y++, TA::OnOff(int5en), "b4: Int5 Enable"); + screen.Puts(1, y++, TA::OnOff(int5rq), "b3: Int5 Request"); + screen.Puts(1, y++, TA::OnOff(int1en), "b2: Int1 Enable"); + screen.Puts(1, y++, "b1: ---"); + screen.Puts(1, y++, TA::OnOff(int1rq), "b0: Intq Request"); } // PortA (DIP-SW 1) 読み込み @@ -470,14 +469,11 @@ PIO0Device::SetPC(int pc, int val) // コンストラクタ PIO1Device::PIO1Device() - : inherited() + : inherited("PIO1") { - logname = "pio1"; - devname = "PIO1"; devaddr = 0x4d000000; devlen = 4; - poffevent.dev = this; poffevent.func = (DeviceCallback_t)&PIO1Device::PowerOffCallback; poffevent.SetName("PIO1 Power Off"); }