mesh: add MESH TNT variant.

This commit is contained in:
Maxim Poliakovski 2023-12-11 08:05:16 +01:00
parent c41f5355fd
commit fd92d86954
3 changed files with 18 additions and 6 deletions

View File

@ -262,8 +262,13 @@ void MeshController::update_irq()
} }
} }
static const DeviceDescription Mesh_Descriptor = { static const DeviceDescription Mesh_Tnt_Descriptor = {
MeshController::create, {}, {} MeshController::create_for_tnt, {}, {}
}; };
REGISTER_DEVICE(Mesh, Mesh_Descriptor); static const DeviceDescription Mesh_Heathrow_Descriptor = {
MeshController::create_for_heathrow, {}, {}
};
REGISTER_DEVICE(MeshTnt, Mesh_Tnt_Descriptor);
REGISTER_DEVICE(MeshHeathrow, Mesh_Heathrow_Descriptor);

View File

@ -32,6 +32,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
class InterruptCtrl; class InterruptCtrl;
class ScsiBus; class ScsiBus;
// Chip ID returned by the MESH ASIC on TNT machines (Apple part 343S1146-a)
#define TntMeshID 0xE2
// Chip ID returned by the MESH cell inside the Heathrow ASIC // Chip ID returned by the MESH cell inside the Heathrow ASIC
#define HeathrowMESHID 4 #define HeathrowMESHID 4
@ -115,7 +118,11 @@ public:
}; };
~MeshController() = default; ~MeshController() = default;
static std::unique_ptr<HWComponent> create() { static std::unique_ptr<HWComponent> create_for_tnt() {
return std::unique_ptr<MeshController>(new MeshController(TntMeshID));
}
static std::unique_ptr<HWComponent> create_for_heathrow() {
return std::unique_ptr<MeshController>(new MeshController(HeathrowMESHID)); return std::unique_ptr<MeshController>(new MeshController(HeathrowMESHID));
} }

View File

@ -78,7 +78,7 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io/heathrow"), InterruptCtrl()
); );
// connect SCSI HW and the corresponding DMA channel // connect SCSI HW and the corresponding DMA channel
this->mesh = dynamic_cast<MeshController*>(gMachineObj->get_comp_by_name("Mesh")); this->mesh = dynamic_cast<MeshController*>(gMachineObj->get_comp_by_name("MeshHeathrow"));
this->scsi_dma = std::unique_ptr<DMAChannel> (new DMAChannel()); this->scsi_dma = std::unique_ptr<DMAChannel> (new DMAChannel());
// connect IDE HW // connect IDE HW
@ -548,7 +548,7 @@ void HeathrowIC::clear_cpu_int()
} }
static const vector<string> Heathrow_Subdevices = { static const vector<string> Heathrow_Subdevices = {
"NVRAM", "ViaCuda", "Scsi0", "Mesh", "Escc", "Swim3", "Ide0", "Ide1", "NVRAM", "ViaCuda", "Scsi0", "MeshHeathrow", "Escc", "Swim3", "Ide0", "Ide1",
"BigMacHeathrow" "BigMacHeathrow"
}; };