mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-26 13:49:21 +00:00
40 lines
848 B
C++
40 lines
848 B
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2020-2021 akuker
|
|
//
|
|
// [ SCSI Bus Monitor ]
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#include "shared/scsi.h"
|
|
#include "data_sample.h"
|
|
|
|
const char *GetPhaseStr(const data_capture *sample)
|
|
{
|
|
return BUS::GetPhaseStrRaw(GetPhase(sample));
|
|
}
|
|
|
|
BUS::phase_t GetPhase(const data_capture *sample)
|
|
{
|
|
// Selection Phase
|
|
if (GetSel(sample))
|
|
{
|
|
return BUS::phase_t::selection;
|
|
}
|
|
|
|
// Bus busy phase
|
|
if (!GetBsy(sample))
|
|
{
|
|
return BUS::phase_t::busfree;
|
|
}
|
|
|
|
// Get target phase from bus signal line
|
|
uint32_t mci = GetMsg(sample) ? 0x04 : 0x00;
|
|
mci |= GetCd(sample) ? 0x02 : 0x00;
|
|
mci |= GetIo(sample) ? 0x01 : 0x00;
|
|
return BUS::GetPhase(mci);
|
|
}
|