grandcentral: use MeshStub on machines without MESH.

This commit is contained in:
Maxim Poliakovski 2024-02-12 02:38:08 +01:00
parent a0e56aa4cf
commit 28e7a806b4
3 changed files with 14 additions and 1 deletions

View File

@ -109,6 +109,16 @@ enum SeqState : uint32_t {
}; // namespace MeshScsi
class MeshStub : public HWComponent {
public:
MeshStub() = default;
~MeshStub() = default;
// registers access
uint8_t read(uint8_t reg_offset) { return 0; };
void write(uint8_t reg_offset, uint8_t value) {};
};
class MeshController : public HWComponent {
public:
MeshController(uint8_t mesh_id) {

View File

@ -70,7 +70,9 @@ GrandCentral::GrandCentral() : PCIDevice("mac-io/grandcentral"), InterruptCtrl()
// connect MESH (internal SCSI)
this->mesh = dynamic_cast<MeshController*>(gMachineObj->get_comp_by_name("MeshTnt"));
if (this->mesh == nullptr) {
LOG_F(WARNING, "%s: Mesh not found, install MeshStub", this->name.c_str());
LOG_F(WARNING, "%s: Mesh not found, using MeshStub instead", this->name.c_str());
this->mesh_stub = std::unique_ptr<MeshStub>(new MeshStub());
this->mesh = dynamic_cast<MeshController*>(this->mesh_stub.get());
} else {
this->mesh_dma = std::unique_ptr<DMAChannel> (new DMAChannel());
this->mesh_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCSI_MESH));

View File

@ -135,6 +135,7 @@ private:
// subdevice objects
std::unique_ptr<AwacsScreamer> awacs; // AWACS audio codec instance
std::unique_ptr<MeshStub> mesh_stub = nullptr;
NVram* nvram; // NVRAM module
MaceController* mace;