From 1d5ea6a9ebc3bda34969cf9bd23e84eec6c0ae75 Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 5 Nov 2011 22:31:40 +0000 Subject: [PATCH] Updated DPC+ code to latest changes from Spiceware for the Frantic ROM. Specifically, the 3-voice audio routines read from ROM instead of RAM, and the setting the ARM MAM register no longer causes the ARM emulation to crash. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2278 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/common/Version.hxx | 2 +- src/emucore/CartDPCPlus.cxx | 10 +++++----- src/emucore/Thumbulator.cxx | 12 ++++++++++++ src/emucore/Thumbulator.hxx | 1 + 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 9f1c98c16..4064098cc 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -22,7 +22,7 @@ #include -#define STELLA_VERSION "3.4.2_svn" +#define STELLA_VERSION "3.5_svn_test1" #define STELLA_BUILD atoi("$Rev$" + 6) #endif diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 23c4baad0..8011b1148 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -291,11 +291,11 @@ uInt8 CartridgeDPCPlus::peek(uInt16 address) // Update the music data fetchers (counter & flag) updateMusicModeDataFetchers(); - // using myProgramImage[] instead of myDisplayImage[] because waveforms - // could also be in the 1K Frequency table. - uInt32 i = myProgramImage[6*4096 + (myMusicWaveforms[0] << 5) + (myMusicCounters[0] >> 27)] + - myProgramImage[6*4096 + (myMusicWaveforms[1] << 5) + (myMusicCounters[1] >> 27)] + - myProgramImage[6*4096 + (myMusicWaveforms[2] << 5) + (myMusicCounters[2] >> 27)]; + // using myDisplayImage[] instead of myProgramImage[] because waveforms + // can be modified during runtime. + uInt32 i = myDisplayImage[(myMusicWaveforms[0] << 5) + (myMusicCounters[0] >> 27)] + + myDisplayImage[(myMusicWaveforms[1] << 5) + (myMusicCounters[1] >> 27)] + + myDisplayImage[(myMusicWaveforms[2] << 5) + (myMusicCounters[2] >> 27)]; result = (uInt8)i; break; diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index 0b688993c..b97fd7c98 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -213,6 +213,13 @@ void Thumbulator::write16 ( uInt32 addr, uInt32 data ) ram[addr]=data&0xFFFF; #endif return; + + case 0xE0000000: //MAMCR + if(addr == 0xE01FC000) + { + mamcr = data; + return; + } } fatalError("write16", addr, data, "abort"); } @@ -298,6 +305,10 @@ uInt32 Thumbulator::read16 ( uInt32 addr ) if(DBUG) statusMsg << HEX4 << data << endl; return(data); + + case 0xE0000000: //MAMCR + if(addr == 0xE01FC000) + return mamcr; } return fatalError("read16", addr, "abort"); } @@ -2072,6 +2083,7 @@ int Thumbulator::reset ( void ) reg_svc[14]=0x00000c00; //lr (duz this use odd addrs) reg_sys[15]=0x00000c0b; // entry point of 0xc09+2 // reg_sys[15]+=2; + mamcr = 0; // fxq: don't care about below so much (maybe to guess timing???) instructions=0; diff --git a/src/emucore/Thumbulator.hxx b/src/emucore/Thumbulator.hxx index 592161b75..c4296eb74 100644 --- a/src/emucore/Thumbulator.hxx +++ b/src/emucore/Thumbulator.hxx @@ -118,6 +118,7 @@ class Thumbulator //uInt32 reg_und[16]; //Undefined mode uInt32 reg_irq[16]; //Interrupt mode //uInt32 reg_fiq[16]; //Fast Interrupt mode + uInt32 mamcr; uInt64 instructions; uInt64 fetches;