1
//============================================================================
5
// SS tttttt eeee ll ll aaaa
6
// SSSS tt ee ee ll ll aa
7
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
8
// SS SS tt ee ll ll aa aa
9
// SSSS ttt eeeee llll llll aaaaa
11
// Copyright (c) 1995-2010 by Bradford W. Mott, Stephen Anthony
12
// and the Stella Team
14
// See the file "License.txt" for information on usage and redistribution of
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
17
// $Id: CartFA.hxx 2001 2010-04-10 21:37:23Z stephena $
18
//============================================================================
20
#ifndef CARTRIDGEFA_HXX
21
#define CARTRIDGEFA_HXX
29
Cartridge class used for CBS' RAM Plus cartridges. There are
30
three 4K banks and 256 bytes of RAM.
32
@author Bradford W. Mott
33
@version $Id: CartFA.hxx 2001 2010-04-10 21:37:23Z stephena $
35
class CartridgeFA : public Cartridge
39
Create a new cartridge using the specified image
41
@param image Pointer to the ROM image
43
CartridgeFA(const uInt8* image);
48
virtual ~CartridgeFA();
52
Reset device to its power-on state
57
Install cartridge in the specified system. Invoked by the system
58
when the cartridge is attached to it.
60
@param system The system the device should install itself in
62
void install(System& system);
65
Install pages for the specified bank in the system.
67
@param bank The bank that should be installed in the system
69
void bank(uInt16 bank);
77
Query the number of banks supported by the cartridge.
79
uInt16 bankCount() const;
82
Patch the cartridge ROM.
84
@param address The ROM address to patch
85
@param value The value to place into the address
86
@return Success or failure of the patch operation
88
bool patch(uInt16 address, uInt8 value);
91
Access the internal ROM image for this cartridge.
93
@param size Set to the size of the internal ROM image data
94
@return A pointer to the internal ROM image data
96
const uInt8* getImage(int& size) const;
99
Save the current state of this cart to the given Serializer.
101
@param out The Serializer object to use
102
@return False on any errors, else true
104
bool save(Serializer& out) const;
107
Load the current state of this cart from the given Serializer.
109
@param in The Serializer object to use
110
@return False on any errors, else true
112
bool load(Serializer& in);
115
Get a descriptor for the device name (used in error checking).
117
@return The name of the object
119
string name() const { return "CartridgeFA"; }
123
Get the byte at the specified address.
125
@return The byte at the specified address
127
uInt8 peek(uInt16 address);
130
Change the byte at the specified address to the given value
132
@param address The address where the value should be stored
133
@param value The value to be stored at the address
134
@return True if the poke changed the device address space, else false
136
bool poke(uInt16 address, uInt8 value);
139
// Indicates which bank is currently active
140
uInt16 myCurrentBank;
142
// The 12K ROM image of the cartridge
143
uInt8 myImage[12288];
145
// The 256 bytes of RAM on the cartridge