mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-05 15:05:54 +00:00
08194af424
- Moved C++ code to cpp/ from src/raspberrypi - Related updates to Makefile, easyinstall.sh, and the github build rules - Removed the native X68k C code in src/x68k from the repo
40 lines
856 B
C++
40 lines
856 B
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2020-2021 akuker
|
|
//
|
|
// [ SCSI Bus Monitor ]
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
#include "os.h"
|
|
#include "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);
|
|
}
|