diff --git a/devices/ioctrl/grandcentral.cpp b/devices/ioctrl/grandcentral.cpp index d806865..c8b31d3 100644 --- a/devices/ioctrl/grandcentral.cpp +++ b/devices/ioctrl/grandcentral.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . #include #include #include +#include #include #include #include @@ -67,6 +68,9 @@ GrandCentral::GrandCentral() : PCIDevice("mac-io/grandcentral"), InterruptCtrl() this->scsi_0 = std::unique_ptr (new Sc53C94()); gMachineObj->add_subdevice("Curio_SCSI0", this->scsi_0.get()); + + this->swim3 = std::unique_ptr (new Swim3::Swim3Ctrl()); + gMachineObj->add_subdevice("SWIM3", this->swim3.get()); } void GrandCentral::notify_bar_change(int bar_num) @@ -103,6 +107,8 @@ uint32_t GrandCentral::read(uint32_t reg_start, uint32_t offset, int size) return this->escc->read((offset >> 4) & 0xF); case 4: // AWACS return this->awacs->snd_ctrl_read(offset & 0xFF, size); + case 5: // SWIM3 + return this->swim3->read((offset >> 4) & 0xF); case 6: case 7: // VIA-CUDA return this->viacuda->read((offset >> 9) & 0xF); @@ -163,6 +169,9 @@ void GrandCentral::write(uint32_t reg_start, uint32_t offset, uint32_t value, in case 4: // AWACS this->awacs->snd_ctrl_write(offset & 0xFF, value, size); break; + case 5: + this->swim3->write((offset >> 4) & 0xF, value); + break; case 6: case 7: // VIA-CUDA this->viacuda->write((offset >> 9) & 0xF, value); diff --git a/devices/ioctrl/heathrow.cpp b/devices/ioctrl/heathrow.cpp index f366ed8..e03cb0d 100644 --- a/devices/ioctrl/heathrow.cpp +++ b/devices/ioctrl/heathrow.cpp @@ -76,7 +76,10 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io/heathrow"), InterruptCtrl() this->mesh = std::unique_ptr (new MESHController(HeathrowMESHID)); this->escc = std::unique_ptr (new EsccController()); + + // intialize floppy disk HW this->swim3 = std::unique_ptr (new Swim3::Swim3Ctrl()); + gMachineObj->add_subdevice("SWIM3", this->swim3.get()); } void HeathrowIC::notify_bar_change(int bar_num) @@ -147,7 +150,7 @@ uint32_t HeathrowIC::read(uint32_t reg_start, uint32_t offset, int size) { res = this->screamer->snd_ctrl_read(offset - 0x14000, size); break; case 0x15: // SWIM3 - return this->swim3->read(offset & 0xF); + return this->swim3->read((offset >> 4 )& 0xF); case 0x16: case 0x17: res = this->viacuda->read((offset - 0x16000) >> 9); @@ -190,8 +193,8 @@ void HeathrowIC::write(uint32_t reg_start, uint32_t offset, uint32_t value, int case 0x14: this->screamer->snd_ctrl_write(offset - 0x14000, value, size); break; - case 0x15: - this->swim3->write(offset & 0xF, value); + case 0x15: // SWIM3 + this->swim3->write((offset >> 4) & 0xF, value); break; case 0x16: case 0x17: diff --git a/devices/ioctrl/macio.h b/devices/ioctrl/macio.h index 3862550..98ee1f8 100644 --- a/devices/ioctrl/macio.h +++ b/devices/ioctrl/macio.h @@ -113,12 +113,13 @@ private: uint32_t nvram_addr_hi; // device cells - std::unique_ptr mace; - std::unique_ptr awacs; // AWACS audio codec instance - std::unique_ptr viacuda; // VIA cell with Cuda MCU attached to it - std::unique_ptr nvram; // NVRAM module - std::unique_ptr escc; // ESCC serial controller - std::unique_ptr scsi_0; // external SCSI + std::unique_ptr mace; + std::unique_ptr awacs; // AWACS audio codec instance + std::unique_ptr viacuda; // VIA cell with Cuda MCU attached to it + std::unique_ptr nvram; // NVRAM module + std::unique_ptr escc; // ESCC serial controller + std::unique_ptr scsi_0; // external SCSI + std::unique_ptr swim3; // floppy disk controller std::unique_ptr snd_out_dma; }; diff --git a/machines/machinegossamer.cpp b/machines/machinegossamer.cpp index 0c7d7f0..28c0d89 100644 --- a/machines/machinegossamer.cpp +++ b/machines/machinegossamer.cpp @@ -72,7 +72,7 @@ int create_gossamer(std::string& id) { MPC106* grackle_obj = dynamic_cast(gMachineObj->get_comp_by_name("Grackle")); /* add the machine ID register */ - gMachineObj->add_component("MachineID", new GossamerID(0x3d8c)); + gMachineObj->add_component("MachineID", new GossamerID(0xBF3D)); grackle_obj->add_mmio_region( 0xFF000004, 4096, dynamic_cast(gMachineObj->get_comp_by_name("MachineID")));