--- nono/vm/lance.cpp 2026/04/29 17:04:35 1.1.1.4 +++ nono/vm/lance.cpp 2026/04/29 17:04:42 1.1.1.6 @@ -20,7 +20,7 @@ LanceDevice::LanceDevice() devname = "Lance"; devaddr = 0xf1000000; - monitor.Init(80, 34); + monitor_size = nnSize(80, 34); rx_event.dev = this; rx_event.func = (DeviceCallback_t)&LanceDevice::Callback; @@ -157,8 +157,8 @@ LanceDevice::Peek(uint32 addr) __unreachable(); } -bool -LanceDevice::MonitorUpdate() +void +LanceDevice::MonitorUpdate(TextScreen& monitor) { /* CSR0: $1111 ERR BABL CERR MISS MERR RINT TINT IDON IADR:$123456 @@ -194,8 +194,8 @@ LADRF:$12345678_12345678 TDRP: // CSR uint16 csr0 = reg.GetCSR0(); monitor.Print(0, y, "CSR0:$%04x", csr0); - MonitorReg(11, y, csr0 >> 8, csr0names); - MonitorReg(11, y + 1, csr0, csr0names + 8); + MonitorReg(monitor, 11, y, csr0 >> 8, csr0names); + MonitorReg(monitor, 11, y + 1, csr0, csr0names + 8); monitor.Print(54, y++, "IADR:$%06x", reg.iadr); monitor.Print(54, y, "CSR3:$%04x", reg.csr3); @@ -380,14 +380,13 @@ LADRF:$12345678_12345678 TDRP: } } } - - return true; } // レジスタをビットごとに表示する。 // data は下位8ビットのみ使用し、上位は無視する。 void -LanceDevice::MonitorReg(int x, int y, uint32 data, const char * const *names) +LanceDevice::MonitorReg(TextScreen& monitor, + int x, int y, uint32 data, const char * const *names) { for (int i = 0; i < 8; i++) { bool b = data & (1 << (7 - i)); @@ -1172,12 +1171,12 @@ LanceDevice::RXMiss() // イベントハンドラ void -LanceDevice::Callback(int arg) +LanceDevice::Callback(Event& ev) { std::unique_lock lock(mtx); // ワーカスレッドにフェーズ遷移を伝えるだけ - request |= arg; + request |= ev.code; cv.notify_one(); }