mirror of
https://github.com/akuker/RASCSI.git
synced 2026-10-23 14:02:23 +00:00
Port the X68000 SASI probe handling and completion-message behavior from the older RaSCSI SASI implementation. Borrow BlueSCSI v2-compatible Assign Disk Parameters (0xC2) handling: accept its six-byte CDB and consume the ten-byte parameter payload.
35 lines
967 B
C++
35 lines
967 B
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator PiSCSI
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2026 Daniel Markstedt <daniel@mindani.net>
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#include "controllers/controller_manager.h"
|
|
#include "sasi_controller.h"
|
|
|
|
SasiController::SasiController(BUS& bus, int target_id)
|
|
: ScsiController(bus, target_id, ControllerManager::GetSasiLunMax())
|
|
{
|
|
}
|
|
|
|
int SasiController::GetEffectiveLun() const
|
|
{
|
|
// The X68000 probes for a SASI disk with the non-standard CDB 00 28.
|
|
// Treat it as a LUN 0 command so that the device can return the expected
|
|
// CHECK CONDITION instead of rejecting the encoded LUN as unsupported.
|
|
if (GetOpcode() == scsi_defs::scsi_command::eCmdTestUnitReady && GetCmdByte(1) == 0x28) {
|
|
return 0;
|
|
}
|
|
|
|
return GetLun();
|
|
}
|
|
|
|
void SasiController::MsgOut()
|
|
{
|
|
// SASI does not define a message-out phase.
|
|
Command();
|
|
}
|