heathrow: connect DMA channel for MESH.

This commit is contained in:
Maxim Poliakovski 2023-09-19 14:19:15 +02:00
parent 04acf120d6
commit 0ebcd15a3d
2 changed files with 8 additions and 1 deletions

View File

@ -77,8 +77,9 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io/heathrow"), InterruptCtrl()
std::bind(&AwacsScreamer::dma_out_stop, this->snd_codec)
);
// connect SCSI HW
// connect SCSI HW and the corresponding DMA channel
this->mesh = dynamic_cast<MeshController*>(gMachineObj->get_comp_by_name("Mesh"));
this->scsi_dma = std::unique_ptr<DMAChannel> (new DMAChannel());
// connect IDE HW
this->ide_0 = dynamic_cast<IdeChannel*>(gMachineObj->get_comp_by_name("Ide0"));
@ -117,6 +118,8 @@ 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);
case MIO_OHARE_DMA_FLOPPY:
return this->floppy_dma->reg_read(offset & 0xFF, size);
case MIO_OHARE_DMA_AUDIO_OUT:
@ -130,6 +133,9 @@ 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);
break;
case MIO_OHARE_DMA_FLOPPY:
this->floppy_dma->reg_write(offset & 0xFF, value, size);
break;

View File

@ -298,6 +298,7 @@ private:
BigMac* bmac; // Ethernet MAC cell
// DMA channels
std::unique_ptr<DMAChannel> scsi_dma;
std::unique_ptr<DMAChannel> snd_out_dma;
std::unique_ptr<DMAChannel> floppy_dma;
};