Files
RASCSI/cpp/controllers/sasi_controller.cpp
Daniel Markstedt 1b9f279e61 introduce X68000 SASI compatibility quirks
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.
2026-08-30 08:27:35 +02:00

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();
}