--- nono/vm/scsidev.h 2026/04/29 17:05:11 1.1.1.12 +++ nono/vm/scsidev.h 2026/04/29 17:05:25 1.1.1.16 @@ -36,8 +36,8 @@ class SCSIDevice : public IODevice { using inherited = IODevice; public: - SCSIDevice(const std::string& objname_); - virtual ~SCSIDevice() override; + SCSIDevice(int objid_); + ~SCSIDevice() override; // バスに接続 (SCSIBus::Attach から呼ばれる) void Attach(SCSIBus *bus_, int id) { @@ -129,8 +129,8 @@ class SCSIHostDevice : public SCSIDevice { using inherited = SCSIDevice; public: - SCSIHostDevice(const std::string& objname_); - virtual ~SCSIHostDevice() override; + SCSIHostDevice(int objid_); + ~SCSIHostDevice() override; bool Create() override; bool Init() override; @@ -150,7 +150,7 @@ class SCSIHostDevice : public SCSIDevice } // SCSIBus を取得 (UI からインジケータ表示用) - std::shared_ptr GetSCSIBus() const { return scsibus; } + SCSIBus *GetSCSIBus() const { return scsibus.get(); } protected: DECLARE_MONITOR_CALLBACK(MonitorUpdateDevs); @@ -188,7 +188,7 @@ class SCSIHostDevice : public SCSIDevice // ID0 ||<----> bus |<----------+ // || +----------+ own // - std::shared_ptr scsibus {}; + std::unique_ptr scsibus {}; std::unique_ptr target[8] {}; // 接続中のデバイス(イニシエータ含む)を ID 順に並べたリスト (モニタ用) @@ -205,8 +205,8 @@ class SCSITarget : public SCSIDevice { using inherited = SCSIDevice; public: - SCSITarget(const std::string& objname_, SCSIHostDevice *h, int id); - virtual ~SCSITarget() override; + SCSITarget(SCSIHostDevice *h, int id); + ~SCSITarget() override; void ResetHard(bool poweron) override; @@ -216,6 +216,9 @@ class SCSITarget : public SCSIDevice // 現在のコマンド列を返す (モニタ用) std::vector GetCmdSeq() const { return cmdseq; } + // コマンドを選択する (ROM30 エミュレーション用) + SCSICmd *SelectCommand(const std::vector& cmdseq_); + // 論理ブロック長 uint32 GetBlocksize() const { return blocksize; } void SetBlocksize(uint32 val) { blocksize = val; } @@ -302,7 +305,7 @@ class SCSIDisk : public SCSITarget public: SCSIDisk(SCSIHostDevice *h, int id, SCSI::DevType type); - virtual ~SCSIDisk() override; + ~SCSIDisk() override; bool Init() override; void ResetHard(bool poweron) override; @@ -379,8 +382,8 @@ class SCSIDisk : public SCSITarget void MediaChanged() const; // メディア挿入/排出コールバック - void LoadCallback(MessageID, uint32); - void UnloadCallback(MessageID, uint32); + void LoadMessage(MessageID, uint32); + void UnloadMessage(MessageID, uint32); // イメージファイルのフルパス std::string pathname {};