--- nono/vm/spc.cpp 2026/04/29 17:04:36 1.1.1.4 +++ nono/vm/spc.cpp 2026/04/29 17:04:39 1.1.1.5 @@ -37,7 +37,7 @@ SPCDevice::SPCDevice() SetConfigName("spc0"); myid = -1; - monitor.Init(70, 15); + monitor_size = nnSize(70, 15); // 汎用イベント // 名前とコールバック関数は都度セットする。 @@ -401,8 +401,8 @@ SPCDevice::Peek(uint32 addr) __unreachable(); } -bool -SPCDevice::MonitorUpdate() +void +SPCDevice::MonitorUpdate(TextScreen& monitor) { int x; int y; @@ -461,14 +461,14 @@ SPCDevice::MonitorUpdate() static const char * const sctl_bits[] = { "RST", "CTRL", "DIAG", "ARB", "PARI", "SEL", "RESL", "INTR" }; - MonitorReg(x, y, sctl, sctl_bits); + MonitorReg(monitor, x, y, sctl, sctl_bits); y++; // SCMD static const char * const scmd_bits[] = { "", "", "", "RST", "INTC", "PROG", "", "TERM" }; - MonitorReg(x, y, scmd, scmd_bits); + MonitorReg(monitor, x, y, scmd, scmd_bits); static const char * const scmd_cmd[] = { //12345678901234 "(Bus Release)", @@ -487,28 +487,28 @@ SPCDevice::MonitorUpdate() static const char * const ints_bits[] = { "Sel", "Resl", "Disc", "Cmpl", "SReq", "TOut", "HErr", "Rst" }; - MonitorReg(x, y, ints, ints_bits); + MonitorReg(monitor, x, y, ints, ints_bits); y++; // PSNS static const char * const psns_bits[] = { "REQ", "ACK", "ATN", "SEL", "BSY", "MSG", "C/D", "I/O" }; - MonitorReg(x, y, psns, psns_bits); + MonitorReg(monitor, x, y, psns, psns_bits); y++; // SDGC static const char * const sdgc_bits[] = { "", "", "XfEn", "", "", "", "", "" }; - MonitorReg(x, y, sdgc, sdgc_bits); + MonitorReg(monitor, x, y, sdgc, sdgc_bits); y++; // SSTS static const char * const ssts_bits[] = { "", "", "SBSY", "XInP", "RSTI", "TCZ", "Full", "Empt" }; - MonitorReg(x, y, ssts, ssts_bits); + MonitorReg(monitor, x, y, ssts, ssts_bits); static const char * const ssts_conn[] = { //12345678 "(NotConn)", @@ -523,14 +523,14 @@ SPCDevice::MonitorUpdate() static const char * const serr_bits[] = { "", "", "XOut", "", "PErr", "", "Shrt", "" }; - MonitorReg(x, y, serr, serr_bits); + MonitorReg(monitor, x, y, serr, serr_bits); y++; // PCTL static const char * const pctl_bits[] = { "BIE", "", "", "", "", "MSG", "C/D", "I/O" }; - MonitorReg(x, y, pctl, pctl_bits); + MonitorReg(monitor, x, y, pctl, pctl_bits); y++; // バス状態 @@ -620,13 +620,12 @@ SPCDevice::MonitorUpdate() } } } - - return true; } // レジスタをビットごとに表示する。MonitorUpdate の下請け。 void -SPCDevice::MonitorReg(int x, int y, uint32 reg, const char * const *names) +SPCDevice::MonitorReg(TextScreen& monitor, + int x, int y, uint32 reg, const char * const *names) { for (int i = 0; i < 8; i++) { bool b = reg & (1 << (7 - i));