From f0c75eb1ff4caf2b385c8e1e585c0d7eeb21c5c7 Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 24 Jan 2008 23:43:24 +0000 Subject: [PATCH] Finished changes to 4A50 class so it compiles again. It's still not working though. I think there still needs to be TIA/RIOT chained from the peek/poke methods. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1395 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/emucore/Cart4A50.cxx | 15 +++++++++++---- stella/src/emucore/Cart4A50.hxx | 10 ++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/stella/src/emucore/Cart4A50.cxx b/stella/src/emucore/Cart4A50.cxx index 236adaddb..d49b2429e 100644 --- a/stella/src/emucore/Cart4A50.cxx +++ b/stella/src/emucore/Cart4A50.cxx @@ -13,13 +13,14 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4A50.cxx,v 1.7 2008-01-24 20:43:41 stephena Exp $ +// $Id: Cart4A50.cxx,v 1.8 2008-01-24 23:43:24 stephena Exp $ //============================================================================ #include #include "Random.hxx" #include "System.hxx" +#include "TIA.hxx" #include "Cart4A50.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -83,7 +84,7 @@ uInt8 Cartridge4A50::peek(uInt16 address) if(!(address & 0x1000)) { // ReadHardware(); - bank(address); + checkBankSwitch(address, 0); } else { @@ -126,7 +127,7 @@ void Cartridge4A50::poke(uInt16 address, uInt8 value) if(!(address & 0x1000)) { // WriteHardware(); - bank(address); + checkBankSwitch(address, value); } else { @@ -158,7 +159,7 @@ void Cartridge4A50::poke(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Cartridge4A50::bank(uInt16 address) +void Cartridge4A50::checkBankSwitch(uInt16 address, uInt8 value) { // Not bankswitching in the normal sense // This scheme contains so many hotspots that it's easier to just check @@ -249,6 +250,12 @@ void Cartridge4A50::bank(uInt16 address) } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Cartridge4A50::bank(uInt16) +{ + // Doesn't support bankswitching in the normal sense +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int Cartridge4A50::bank() { diff --git a/stella/src/emucore/Cart4A50.hxx b/stella/src/emucore/Cart4A50.hxx index f45842fa8..6b13896df 100644 --- a/stella/src/emucore/Cart4A50.hxx +++ b/stella/src/emucore/Cart4A50.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4A50.hxx,v 1.8 2008-01-24 20:43:41 stephena Exp $ +// $Id: Cart4A50.hxx,v 1.9 2008-01-24 23:43:24 stephena Exp $ //============================================================================ #ifndef CARTRIDGE4A50_HXX @@ -37,7 +37,7 @@ class System; bytes of ROM. @author Stephen Anthony - @version $Id: Cart4A50.hxx,v 1.8 2008-01-24 20:43:41 stephena Exp $ + @version $Id: Cart4A50.hxx,v 1.9 2008-01-24 23:43:24 stephena Exp $ */ class Cartridge4A50 : public Cartridge { @@ -143,6 +143,12 @@ class Cartridge4A50 : public Cartridge */ virtual void poke(uInt16 address, uInt8 value); + private: + /** + Check all possible hotspots + */ + void checkBankSwitch(uInt16 address, uInt8 value); + private: // The 64K ROM image of the cartridge uInt8 myImage[65536];