--- nono/vm/dmac.cpp 2026/04/29 17:04:35 1.1.1.3 +++ nono/vm/dmac.cpp 2026/04/29 17:04:38 1.1.1.4 @@ -18,7 +18,7 @@ DMACDevice::DMACDevice() devaddr = baseaddr; devlen = 0x2000; - monitor.Init(80, 30); + monitor_size = nnSize(80, 30); for (int i = 0; i < countof(dmac.chan); i++) { dmac.chan[i].ch = i; @@ -475,8 +475,8 @@ DMACDevice::Peek(uint32 addr) return data; } -bool -DMACDevice::MonitorUpdate() +void +DMACDevice::MonitorUpdate(TextScreen& monitor) { int x; int y; @@ -527,8 +527,8 @@ DMACDevice::MonitorUpdate() static const char * const csrname[] = { "COC", "BTC", "NDT", "ERR", "ACT", "---", "PCT", "PCS", }; - MonitorReg4(x, y++, val >> 4, &csrname[0]); - MonitorReg4(x, y++, val & 0xff, &csrname[4]); + MonitorReg4(monitor, x, y++, val >> 4, &csrname[0]); + MonitorReg4(monitor, x, y++, val & 0xff, &csrname[4]); // CER val = chan->cer & 0x1f; @@ -639,8 +639,8 @@ DMACDevice::MonitorUpdate() static const char * const ccrnames[] = { "STR", "CNT", "HLT", "SAB", "INT", "---", "---", "---", }; - MonitorReg4(x, y++, (val >> 4), &ccrnames[0]); - MonitorReg4(x, y++, (val & 0xff), &ccrnames[4]); + MonitorReg4(monitor, x, y++, (val >> 4), &ccrnames[0]); + MonitorReg4(monitor, x, y++, (val & 0xff), &ccrnames[4]); // MTC monitor.Print(x, y++, "$%04x", chan->mtc); @@ -684,13 +684,12 @@ DMACDevice::MonitorUpdate() monitor.Print(x - 5, y++, "GCR: $%02x", dmac.gcr); } } - - return true; } // 4ビット分を表示する。MonitorUpdate の下請け void -DMACDevice::MonitorReg4(int x, int y, uint32 reg, const char * const *names) +DMACDevice::MonitorReg4(TextScreen& monitor, + int x, int y, uint32 reg, const char * const *names) { for (int i = 0; i < 4; i++) { bool b = reg & (1 << (3 - i));