From f50f719b0210330996a505168d941bcfb93e7f97 Mon Sep 17 00:00:00 2001 From: dingusdev Date: Fri, 27 Mar 2020 12:43:29 -0700 Subject: [PATCH] Started connecting ATI Rage --- devices/atirage.cpp | 8 +++++--- devices/atirage.h | 8 +++++++- devices/heathrow.cpp | 9 +++++++++ devices/macio.h | 2 ++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/devices/atirage.cpp b/devices/atirage.cpp index f856b21..ae3a307 100644 --- a/devices/atirage.cpp +++ b/devices/atirage.cpp @@ -22,17 +22,19 @@ along with this program. If not, see . #include #include #include "endianswap.h" +#include ATIRage::ATIRage() { } -uint32_t ATIRage::read() { +uint32_t ATIRage::read(int reg, int size) { + LOG_F(INFO, "Reading reg=%X, size %d", reg, (size * 8)); } -uint32_t ATIRage::write() { - +uint32_t ATIRage::write(int reg, uint32_t value, int size) { + LOG_F(INFO, "Writing reg=%X, value=%X, size %d", reg, value, (size * 8)); } void ATIRage::atirage_init() { diff --git a/devices/atirage.h b/devices/atirage.h index 0d2441d..0ef44e4 100644 --- a/devices/atirage.h +++ b/devices/atirage.h @@ -6,7 +6,13 @@ using namespace std; /** Mach registers offsets. */ enum { - ATI_DSP_CONFIG = 0x0020, /*memory buffer registers*/ + ATI_CTRC_H_TOTAL_DISP = 0x0000, + ATI_CRTC_H_SYNC_STRT_WID = 0x0004, + ATI_CTRC_V_TOTAL_DISP = 0x0008, + ATI_CRTC_V_SYNC_STRT_WID = 0x000C, + ATI_CTRC_INT_CNTL = 0x0018, + ATI_CTRC_GEN_CNTL = 0x001C, + ATI_DSP_CONFIG = 0x0020, ATI_DSP_TOGGLE = 0x0024, ATI_TIMER_CFG = 0x0028, ATI_MEM_BUF_CNTL = 0x002C, diff --git a/devices/heathrow.cpp b/devices/heathrow.cpp index 059ea59..432026a 100644 --- a/devices/heathrow.cpp +++ b/devices/heathrow.cpp @@ -26,6 +26,7 @@ along with this program. If not, see . #include "viacuda.h" #include "awacs.h" #include "dbdma.h" +#include "atirage.h" #include "machines/machinebase.h" /** Heathrow Mac I/O device emulation. @@ -42,6 +43,8 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io/heathrow") this->viacuda = new ViaCuda(); gMachineObj->add_subdevice("ViaCuda", this->viacuda); + this->atirage = new ATIRage(); + this->screamer = new AWACDevice(); this->snd_out_dma = new DMAChannel(this->screamer); this->screamer->set_dma_out(this->snd_out_dma); @@ -128,6 +131,9 @@ uint32_t HeathrowIC::read(uint32_t offset, int size) case 8: res = dma_read(offset - 0x8000, size); break; + case 0x12: + res = this->atirage->read(offset - 0x12000, size); + break; case 0x14: res = this->screamer->snd_ctrl_read(offset - 0x14000, size); break; @@ -160,6 +166,9 @@ void HeathrowIC::write(uint32_t offset, uint32_t value, int size) case 8: dma_write(offset - 0x8000, value, size); break; + case 0x12: + this->atirage->write(offset - 0x12000, value, size); + break; case 0x14: this->screamer->snd_ctrl_write(offset - 0x14000, value, size); break; diff --git a/devices/macio.h b/devices/macio.h index 97c37a3..db7db9e 100644 --- a/devices/macio.h +++ b/devices/macio.h @@ -61,6 +61,7 @@ along with this program. If not, see . #include "nvram.h" #include "awacs.h" #include "dbdma.h" +#include "atirage.h" /** Heathrow ASIC emulation @@ -134,6 +135,7 @@ private: ViaCuda *viacuda; /* VIA cell with Cuda MCU attached to it */ NVram *nvram; /* NVRAM cell */ AWACDevice *screamer; /* Screamer audio codec instance */ + ATIRage *atirage; /* Screamer audio codec instance */ DMAChannel *snd_out_dma; };