Rename Curio and Mesh.

This commit is contained in:
joevt 2023-09-30 12:34:47 -07:00 committed by dingusdev
parent 1b147151f0
commit 1e78512c95
11 changed files with 49 additions and 46 deletions

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-23 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -35,7 +35,7 @@ using namespace MeshScsi;
int MeshController::device_postinit()
{
this->bus_obj = dynamic_cast<ScsiBus*>(gMachineObj->get_comp_by_name("Scsi0"));
this->bus_obj = dynamic_cast<ScsiBus*>(gMachineObj->get_comp_by_name("ScsiMesh"));
this->int_ctrl = dynamic_cast<InterruptCtrl*>(
gMachineObj->get_comp_by_type(HWCompType::INT_CTRL));

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-23 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -43,7 +43,7 @@ Sc53C94::Sc53C94(uint8_t chip_id, uint8_t my_id) : ScsiDevice("SC53C94", my_id)
int Sc53C94::device_postinit()
{
this->bus_obj = dynamic_cast<ScsiBus*>(gMachineObj->get_comp_by_name("Scsi0"));
this->bus_obj = dynamic_cast<ScsiBus*>(gMachineObj->get_comp_by_name("ScsiCurio"));
this->bus_obj->register_device(7, static_cast<ScsiDevice*>(this));
this->int_ctrl = dynamic_cast<InterruptCtrl*>(

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-23 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -216,12 +216,12 @@ public:
ScsiBus(const std::string name);
~ScsiBus() = default;
static std::unique_ptr<HWComponent> create_first() {
return std::unique_ptr<ScsiBus>(new ScsiBus("SCSIO"));
static std::unique_ptr<HWComponent> create_ScsiMesh() {
return std::unique_ptr<ScsiBus>(new ScsiBus("ScsiMesh"));
}
static std::unique_ptr<HWComponent> create_second() {
return std::unique_ptr<ScsiBus>(new ScsiBus("SCSI1"));
static std::unique_ptr<HWComponent> create_ScsiCurio() {
return std::unique_ptr<ScsiBus>(new ScsiBus("ScsiCurio"));
}
// low-level state management

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-23 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -286,13 +286,13 @@ void ScsiBus::disconnect(int dev_id)
}
}
static const DeviceDescription Scsi0_Descriptor = {
ScsiBus::create_first, {}, {}
static const DeviceDescription ScsiCurio_Descriptor = {
ScsiBus::create_ScsiCurio, {}, {}
};
static const DeviceDescription Scsi1_Descriptor = {
ScsiBus::create_second, {}, {}
static const DeviceDescription ScsiMesh_Descriptor = {
ScsiBus::create_ScsiMesh, {}, {}
};
REGISTER_DEVICE(Scsi0, Scsi0_Descriptor);
REGISTER_DEVICE(Scsi1, Scsi1_Descriptor);
REGISTER_DEVICE(ScsiCurio, ScsiCurio_Descriptor);
REGISTER_DEVICE(ScsiMesh, ScsiMesh_Descriptor);

View File

@ -53,8 +53,8 @@ AMIC::AMIC() : MMIODevice()
// connect internal SCSI controller
this->scsi = dynamic_cast<Sc53C94*>(gMachineObj->get_comp_by_name("Sc53C94"));
this->scsi_dma = std::unique_ptr<AmicScsiDma> (new AmicScsiDma());
this->scsi->set_dma_channel(this->scsi_dma.get());
this->curio_dma = std::unique_ptr<AmicScsiDma> (new AmicScsiDma());
this->scsi->set_dma_channel(this->curio_dma.get());
this->scsi->set_drq_callback([this](const uint8_t drq_state) {
if (drq_state & 1)
via2_ifr |= VIA2_INT_SCSI_DRQ;
@ -190,7 +190,7 @@ uint32_t AMIC::read(uint32_t rgn_start, uint32_t offset, int size)
case AMICReg::DMA_Base_Addr_3:
return (this->dma_base >> (3 - (offset & 3)) * 8) & 0xFF;
case AMICReg::SCSI_DMA_Ctrl:
return this->scsi_dma->read_stat();
return this->curio_dma->read_stat();
case AMICReg::Floppy_Addr_Ptr_0:
case AMICReg::Floppy_Addr_Ptr_1:
case AMICReg::Floppy_Addr_Ptr_2:
@ -372,13 +372,13 @@ void AMIC::write(uint32_t rgn_start, uint32_t offset, uint32_t value, int size)
case AMICReg::SCSI_DMA_Ctrl:
if (value & 1) { // RST bit set?
this->scsi_addr_ptr = this->scsi_dma_base;
this->scsi_dma->reset(this->scsi_addr_ptr);
this->curio_dma->reset(this->scsi_addr_ptr);
}
if (value & 2) { // RUN bit set?
this->scsi_dma->reinit(this->scsi_dma_base);
this->curio_dma->reinit(this->scsi_dma_base);
this->scsi->real_dma_xfer((value >> 6) & 1);
}
this->scsi_dma->write_ctrl(value);
this->curio_dma->write_ctrl(value);
break;
case AMICReg::Enet_DMA_Rcv_Ctrl:
LOG_F(INFO, "AMIC Ethernet Receive DMA Ctrl updated, val=%x", value);
@ -742,7 +742,7 @@ DmaPullResult AmicSerialXmitDma::pull_data(uint32_t req_len, uint32_t *avail_len
};
static vector<string> Amic_Subdevices = {
"Scsi0", "Sc53C94", "Escc", "Mace", "ViaCuda", "Swim3"
"ScsiCurio", "Sc53C94", "Escc", "Mace", "ViaCuda", "Swim3"
};
static const DeviceDescription Amic_Descriptor = {

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-23 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -348,7 +348,7 @@ private:
std::unique_ptr<AwacDevicePdm> awacs;
std::unique_ptr<AmicSndOutDma> snd_out_dma;
std::unique_ptr<AmicFloppyDma> floppy_dma;
std::unique_ptr<AmicScsiDma> scsi_dma;
std::unique_ptr<AmicScsiDma> curio_dma;
std::unique_ptr<AmicSerialXmitDma> escc_xmit_b_dma;
// on-board video

View File

@ -80,10 +80,10 @@ GrandCentral::GrandCentral() : PCIDevice("mac-io/grandcentral"), InterruptCtrl()
}
// connect external SCSI controller (Curio) to its DMA channel
this->ext_scsi = dynamic_cast<Sc53C94*>(gMachineObj->get_comp_by_name("Sc53C94"));
this->ext_scsi_dma = std::unique_ptr<DMAChannel> (new DMAChannel("curio_scsi"));
this->ext_scsi_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCSI_CURIO));
this->ext_scsi->set_dma_channel(this->ext_scsi_dma.get());
this->curio = dynamic_cast<Sc53C94*>(gMachineObj->get_comp_by_name("Sc53C94"));
this->curio_dma = std::unique_ptr<DMAChannel> (new DMAChannel("curio_scsi"));
this->curio_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCSI_CURIO));
this->curio->set_dma_channel(this->curio_dma.get());
// connect Ethernet HW
this->mace = dynamic_cast<MaceController*>(gMachineObj->get_comp_by_name("Mace"));
@ -117,7 +117,7 @@ uint32_t GrandCentral::read(uint32_t rgn_start, uint32_t offset, int size)
switch (subdev_num) {
case 0: // Curio SCSI
return this->ext_scsi->read((offset >> 4) & 0xF);
return this->curio->read((offset >> 4) & 0xF);
case 1: // MACE
return this->mace->read((offset >> 4) & 0x1F);
case 2: // ESCC compatible addressing
@ -160,7 +160,7 @@ uint32_t GrandCentral::read(uint32_t rgn_start, uint32_t offset, int size)
switch (dma_channel) {
case MIO_GC_DMA_SCSI_CURIO:
return this->ext_scsi_dma->reg_read(offset & 0xFF, size);
return this->curio_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_FLOPPY:
return this->floppy_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_AUDIO_OUT:
@ -198,7 +198,7 @@ void GrandCentral::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in
switch (subdev_num) {
case 0: // Curio SCSI
this->ext_scsi->write((offset >> 4) & 0xF, value);
this->curio->write((offset >> 4) & 0xF, value);
break;
case 1: // MACE registers
this->mace->write((offset >> 4) & 0x1F, value);
@ -262,7 +262,7 @@ void GrandCentral::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in
switch (dma_channel) {
case MIO_GC_DMA_SCSI_CURIO:
this->ext_scsi_dma->reg_write(offset & 0xFF, value, size);
this->curio_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_GC_DMA_FLOPPY:
this->floppy_dma->reg_write(offset & 0xFF, value, size);
@ -381,7 +381,7 @@ void GrandCentral::clear_cpu_int() {
}
static const vector<string> GCSubdevices = {
"NVRAM", "ViaCuda", "Escc", "Scsi0", "Sc53C94", "Mace", "Swim3"
"NVRAM", "ViaCuda", "Escc", "ScsiCurio", "Sc53C94", "Mace", "Swim3"
};
static const DeviceDescription GC_Descriptor = {

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-23 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -79,7 +79,7 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io/heathrow"), InterruptCtrl()
// connect SCSI HW and the corresponding DMA channel
this->mesh = dynamic_cast<MeshController*>(gMachineObj->get_comp_by_name("MeshHeathrow"));
this->scsi_dma = std::unique_ptr<DMAChannel> (new DMAChannel("mesh"));
this->mesh_dma = std::unique_ptr<DMAChannel> (new DMAChannel("mesh"));
// connect IDE HW
this->ide_0 = dynamic_cast<IdeChannel*>(gMachineObj->get_comp_by_name("Ide0"));
@ -121,7 +121,10 @@ void HeathrowIC::notify_bar_change(int bar_num)
uint32_t HeathrowIC::dma_read(uint32_t offset, int size) {
switch (offset >> 8) {
case MIO_OHARE_DMA_MESH:
return this->scsi_dma->reg_read(offset & 0xFF, size);
if (this->mesh_dma)
return this->mesh_dma->reg_read(offset & 0xFF, size);
else
return 0;
case MIO_OHARE_DMA_FLOPPY:
return this->floppy_dma->reg_read(offset & 0xFF, size);
case MIO_OHARE_DMA_ETH_XMIT:
@ -140,7 +143,7 @@ uint32_t HeathrowIC::dma_read(uint32_t offset, int size) {
void HeathrowIC::dma_write(uint32_t offset, uint32_t value, int size) {
switch (offset >> 8) {
case MIO_OHARE_DMA_MESH:
this->scsi_dma->reg_write(offset & 0xFF, value, size);
if (this->mesh_dma) this->mesh_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_OHARE_DMA_FLOPPY:
this->floppy_dma->reg_write(offset & 0xFF, value, size);
@ -548,7 +551,7 @@ void HeathrowIC::clear_cpu_int()
}
static const vector<string> Heathrow_Subdevices = {
"NVRAM", "ViaCuda", "Scsi0", "MeshHeathrow", "Escc", "Swim3", "Ide0", "Ide1",
"NVRAM", "ViaCuda", "ScsiMesh", "MeshHeathrow", "Escc", "Swim3", "Ide0", "Ide1",
"BigMacHeathrow"
};

View File

@ -157,10 +157,10 @@ private:
ViaCuda* viacuda; // VIA cell with Cuda MCU attached to it
EsccController* escc; // ESCC serial controller
MeshController* mesh; // internal SCSI (fast)
Sc53C94* ext_scsi; // external SCSI (slow)
Sc53C94* curio; // external SCSI (slow)
Swim3::Swim3Ctrl* swim3; // floppy disk controller
std::unique_ptr<DMAChannel> ext_scsi_dma;
std::unique_ptr<DMAChannel> curio_dma;
std::unique_ptr<DMAChannel> mesh_dma;
std::unique_ptr<DMAChannel> snd_out_dma;
std::unique_ptr<DMAChannel> floppy_dma;
@ -318,7 +318,7 @@ private:
BigMac* bmac; // Ethernet MAC cell
// DMA channels
std::unique_ptr<DMAChannel> scsi_dma;
std::unique_ptr<DMAChannel> mesh_dma;
std::unique_ptr<DMAChannel> floppy_dma;
std::unique_ptr<DMAChannel> enet_xmit_dma;
std::unique_ptr<DMAChannel> enet_rcv_dma;

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-22 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -227,7 +227,7 @@ void OHare::ack_dma_int(uint32_t irq_id, uint8_t irq_line_state)
}
static const vector<string> OHare_Subdevices = {
"NVRAM", "ViaCuda", "Scsi0", "Mesh", "Escc", "Swim3"
"NVRAM", "ViaCuda", "ScsiMesh", "Mesh", "Escc", "Swim3"
};
static const DeviceDescription OHare_Descriptor = {

View File

@ -1,6 +1,6 @@
/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-22 divingkatae and maximum
Copyright (C) 2018-24 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@ -85,7 +85,7 @@ int initialize_pdm(std::string& id)
}
// get internal SCSI bus object
auto scsi_bus = dynamic_cast<ScsiBus*>(gMachineObj->get_comp_by_name("Scsi0"));
auto scsi_bus = dynamic_cast<ScsiBus*>(gMachineObj->get_comp_by_name("ScsiCurio"));
std::string hd_image_path = GET_STR_PROP("hdd_img");
if (!hd_image_path.empty()) {