--- nono/vm/spc.h 2026/04/29 17:05:42 1.1.1.18 +++ nono/vm/spc.h 2026/04/29 17:06:00 1.1.1.20 @@ -11,7 +11,6 @@ #pragma once #include "device.h" -#include "event.h" #include "fixedqueue.h" #include "mainapp.h" #include "scsi.h" @@ -69,11 +68,14 @@ struct SPC // xfer ビット(SERR_XFER_OUT) もここの bit8 に含めている。 // 残りの下位8ビットは INTS と同じ。 // - // | b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | + // b8 b7 b6 b5 b4 b3 b2 b1 b0 + // +----+----+----+----+----+----+----+----+ // INTS |SEL |RESL|DIS |CMPL|SERV|TOUT|HERR|REST| - // b8 - // ints変数 |xfer|SEL |RESL|DIS |CMPL|SERV|TOUT|HERR|REST| + // +----+----+----+----+----+----+----+----+ // + // +----+----+----+----+----+----+----+----+----+ + // ints変数 |xfer|SEL |RESL|DIS |CMPL|SERV|TOUT|HERR|REST| + // +----+----+----+----+----+----+----+----+----+ uint16 ints; static const uint INTS_SELECTED = 0x80; // Selected static const uint INTS_RESELECTED = 0x40; // Reselected @@ -178,7 +180,7 @@ class SPCDevice : public IODevice bool PokePort(uint32 offset, uint32 data); private: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); void MonitorReg(TextScreen&, int x, int y, uint32 reg, const char * const *names); @@ -242,10 +244,10 @@ class SPCDevice : public IODevice // Select コマンド実行 void SelectCommand(); - void Arbitration1(Event& ev); - void Arbitration2(Event& ev); - void Selection1(Event& ev); - void SelectionTimeout(Event& ev); + void Arbitration1(Event *); + void Arbitration2(Event *); + void Selection1(Event *); + void SelectionTimeout(Event *); // SetATN コマンド実行 void SetATNCommand(); @@ -254,7 +256,7 @@ class SPCDevice : public IODevice // Transfer コマンド実行 void TransferCommand(); - void HardwareTransfer(Event& ev); + void HardwareTransfer(Event *); void TransferComplete(); // Transfer コマンド実行中なら true bool transfer_command_running {}; @@ -317,8 +319,8 @@ class SPCDevice : public IODevice InterruptDevice *interrupt {}; // イベント - Event phase_event { this }; - Event timer_event { this }; + Event *phase_event {}; + Event *timer_event {}; // SCSI 管理 std::unique_ptr domain /*{}*/; @@ -332,6 +334,6 @@ class SPCDevice : public IODevice Monitor *monitor {}; }; -static inline SPCDevice *GetSPCDevice() { - return Object::GetObject(OBJ_SPC); +inline SPCDevice *GetSPCDevice() { + return Object::GetObject(OBJ_SPC0); }