--- nono/vm/mpscc.h 2026/04/29 17:05:24 1.1.1.4 +++ nono/vm/mpscc.h 2026/04/29 17:05:32 1.1.1.6 @@ -13,7 +13,6 @@ #include "device.h" #include "event.h" #include "message.h" -#include "monitor.h" #include #if defined(MPSCC_SIO_LOG_HACK) @@ -96,13 +95,13 @@ class MPSCCChan // これらのレジスタは uPD7201/Z8530 で共通 // CR3/WR3 付近 - int rxbits {}; // 受信データビット数 (レジスタ値ではない) + uint rxbits {}; // 受信データビット数 (レジスタ値ではない) uint8 cr3_sync {}; // SyncMode でだけ使う bit4-1 を保存 bool auto_enable {}; bool rx_enable {}; // CR4/WR4 付近 - int clkrate {}; // クロック倍率 (レジスタ値ではない) + uint clkrate {}; // クロック倍率 (レジスタ値ではない) uint8 syncmode {}; // bit5,4 を保存 uint8 stopbits {}; // STOPBITS_* bool parity_even {}; @@ -110,7 +109,7 @@ class MPSCCChan // CR5/WR5 付近 bool nDTR {}; // ~DTR - int txbits {}; // 送信データビット数 (レジスタ値ではない) + uint txbits {}; // 送信データビット数 (レジスタ値ではない) bool sendbreak {}; bool tx_enable {}; bool crc16 {}; @@ -175,8 +174,8 @@ class MPSCCChan double baudrate {}; // 1フレームあたりの送受信のビット数 (表示用) - int txframebits {}; - int rxframebits {}; + uint txframebits {}; + uint rxframebits {}; // LUNA の場合は TxC, RxC ピンに供給されているクロック。 // X68030 の場合は Z8530 内部で生成されている基準クロック。 @@ -523,8 +522,8 @@ class MPSCCDevice : public IODevice protected: // 指定のレジスタ名を返す - virtual const char *CRName(const MPSCCChan&, int n) const = 0; - virtual const char *SRName(const MPSCCChan&, int n) const = 0; + virtual const char *CRName(const MPSCCChan&, uint n) const = 0; + virtual const char *SRName(const MPSCCChan&, uint n) const = 0; // 現在のレジスタ名を返す const char *CRName(const MPSCCChan& chan) const { return CRName(chan, chan.ptr); @@ -536,6 +535,10 @@ class MPSCCDevice : public IODevice // チャンネルリセットの共通部 void ResetChannelCommon(MPSCCChan&); + // BusIO インタフェース + static const uint32 NPORT = 4; + bool PokePort(uint32 offset, uint32 data); + // レジスタアクセス static uint8 GetCR0(const MPSCCChan&); static void SetCR3(MPSCCChan&, uint32 data); @@ -611,6 +614,6 @@ class MPSCCDevice : public IODevice InterruptDevice *interrupt {}; - // モニタ (更新関数は継承側で用意する) - Monitor monitor { this }; + // モニタ + Monitor *monitor {}; };