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-1998 by Bradford W. Mott
13
// See the file "license" for information on usage and redistribution of
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
// $Id: CartE7.hxx,v 1.2 1998/07/15 20:30:56 bwmott Exp $
17
//============================================================================
19
#ifndef CARTRIDGEE7_HXX
20
#define CARTRIDGEE7_HXX
28
This is the cartridge class for M-Network bankswitched games.
29
In this bankswitching scheme the 2600's 4K cartridge address
30
space is broken into two 2K segments.
32
Kevin Horton describes E7 as follows:
34
Only M-Network used this scheme. This has to be the
35
most complex method used in any cart! :-) It allows
36
for the capability of 2K of RAM; although it doesn't
37
have to be used (in fact, only one cart used it).
38
There are now 8 2K banks, instead of 4. The last 2K
39
in the cart always points to the last 2K of the ROM
40
image, while the first 2K is selectable. You access
41
1FE0 to 1FE6 to select which 2K bank. Note that you
42
cannot select the last 2K of the ROM image into the
43
lower 2K of the cart! Accessing 1FE7 selects 1K of
44
RAM at 1000-17FF instead of ROM! The 2K of RAM is
45
broken up into two 1K sections. One 1K section is
46
mapped in at 1000-17FF if 1FE7 has been accessed.
47
1000-13FF is the write port, while 1400-17FF is the
48
read port. The second 1K of RAM appears at 1800-19FF.
49
1800-18FF is the write port while 1900-19FF is the
50
read port. You select which 256 byte block appears
51
here by accessing 1FF8 to 1FFB.
53
@author Bradford W. Mott
54
@version $Id: CartE7.hxx,v 1.2 1998/07/15 20:30:56 bwmott Exp $
56
class CartridgeE7 : public Cartridge
60
Create a new cartridge using the specified image
62
@param image Pointer to the ROM image
64
CartridgeE7(const uInt8* image);
69
virtual ~CartridgeE7();
73
Get a null terminated string which is the device's name (i.e. "M6532")
75
@return The name of the device
77
virtual const char* name() const;
80
Reset device to its power-on state
85
Install cartridge in the specified system. Invoked by the system
86
when the cartridge is attached to it.
88
@param system The system the device should install itself in
90
virtual void install(System& system);
94
Get the byte at the specified address.
96
@return The byte at the specified address
98
virtual uInt8 peek(uInt16 address);
101
Change the byte at the specified address to the given value
103
@param address The address where the value should be stored
104
@param value The value to be stored at the address
106
virtual void poke(uInt16 address, uInt8 value);
110
Map the specfied bank into the first segment
112
@param bank The bank that should be installed in the system
114
void bank(uInt16 bank);
117
Install pages for the specified 256 byte bank of RAM
119
@param bank The bank that should be installed in the system
121
void bankRAM(uInt16 bank);
124
// Indicates which slice is in the segment
125
uInt16 myCurrentSlice[2];
127
// Indicates which 256 byte bank of RAM is being used
130
// The 16K ROM image of the cartridge
131
uInt8 myImage[16384];
133
// The 2048 bytes of RAM