Initial merge of (incomplete) Banana Pi updates (#993)

This commit is contained in:
akuker
2022-12-02 22:20:27 -06:00
committed by GitHub
parent a403ec3ded
commit eb71c31cf1
78 changed files with 8367 additions and 2881 deletions

40
cpp/hal/data_sample.cpp Normal file
View File

@@ -0,0 +1,40 @@
//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI Reloaded
// for Raspberry Pi
//
// Copyright (C) 2022 akuker
//
// [ SCSI Bus Monitor ]
//
//---------------------------------------------------------------------------
#include "hal/bus.h"
#include "hal/data_sample.h"
#include <string>
using namespace std;
string DataSample::GetPhaseStr() const
{
return BUS::GetPhaseStrRaw(GetPhase());
}
phase_t DataSample::GetPhase() const
{
// Selection Phase
if (GetSEL()) {
return phase_t::selection;
}
// Bus busy phase
if (!GetBSY()) {
return phase_t::busfree;
}
// Get target phase from bus signal line
uint32_t mci = GetMSG() ? 0x04 : 0x00;
mci |= GetCD() ? 0x02 : 0x00;
mci |= GetIO() ? 0x01 : 0x00;
return BUS::GetPhase(mci);
}