--- nono/vm/romemu_x68k.cpp 2026/04/29 17:05:38 1.1.1.5 +++ nono/vm/romemu_x68k.cpp 2026/04/29 17:05:42 1.1.1.6 @@ -37,6 +37,7 @@ #include "memorystream.h" #include "mpu680x0.h" #include "scsidev.h" +#include "scsidomain.h" #include "spc.h" #include "sram.h" @@ -44,12 +45,6 @@ ROM30EmuDevice::ROM30EmuDevice() : inherited(OBJ_IPLROM2) { - uint devlen = 0x020000; - mask = devlen - 1; - - imagebuf.reset(new uint8 [devlen]); - memset(&imagebuf[0], 0xff, devlen); - mem = &imagebuf[0]; } // デストラクタ @@ -61,6 +56,10 @@ ROM30EmuDevice::~ROM30EmuDevice() bool ROM30EmuDevice::Init() { + if (AllocROM(0x020000, 0xff) == false) { + return false; + } + mainbus = GetMainbusDevice(); spc = GetSPCDevice(); @@ -153,7 +152,7 @@ ROM30EmuDevice::SCSIBoot() const uint id = (romaddr & 0x1f) >> 2; // ターゲットディスク - SCSITarget *target = spc->GetSCSI()->GetTarget(id); + SCSITarget *target = spc->GetDomain()->GetTarget(id); if (target == NULL) { putlog(1, "%s: SCSI ID %u not found", __func__, id); return 0; @@ -257,7 +256,7 @@ ROM30EmuDevice::SCSIIOCS() uint32 lun = (d4 >> 16) & 0x0000ffff; \ std::string scsiname = GetSCSICallName(scsicall); \ /* ターゲットディスク */ \ - SCSITarget *target = spc->GetSCSI()->GetTarget(id); \ + SCSITarget *target = spc->GetDomain()->GetTarget(id); \ if (target == NULL) { \ putlog(1, "%s ID%u not found", scsiname.c_str(), id); \ return -1; \ @@ -287,7 +286,7 @@ ROM30EmuDevice::SCSI_S_INQUIRY(uint32 sc cmdseq[4] = reqlen; SCSICmd *cmd = disk->SelectCommand(cmdseq); - auto phase = cmd->Command(cmdseq); + auto phase = cmd->ExecCommand(cmdseq); if (phase != SCSI::XferPhase::DataIn) { putlog(0, "%s moved to %s (NOT IMPLEMENTED)", loghdr.c_str(), SCSI::GetPhaseName(phase)); @@ -332,7 +331,7 @@ ROM30EmuDevice::SCSI_S_READEXT(uint32 sc cmdseq[8] = blkcount; SCSICmd *cmd = disk->SelectCommand(cmdseq); - auto phase = cmd->Command(cmdseq); + auto phase = cmd->ExecCommand(cmdseq); if (phase != SCSI::XferPhase::DataIn) { // XXX 本当はステータスコードかメッセージコードを返す? putlog(0, "%s moved to %s (NOT IMPLEMENTED)", @@ -382,7 +381,7 @@ ROM30EmuDevice::SCSI_S_READCAP(uint32 sc cmdseq[1] = lun << 5; SCSICmd *cmd = disk->SelectCommand(cmdseq); - auto phase = cmd->Command(cmdseq); + auto phase = cmd->ExecCommand(cmdseq); if (phase != SCSI::XferPhase::DataIn) { putlog(0, "%s moved to %s (NOT IMPLEMENTED)", loghdr.c_str(), SCSI::GetPhaseName(phase));