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: CartFE.cxx,v 1.2 1998/07/15 20:51:03 bwmott Exp $
17
//============================================================================
23
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24
CartridgeFE::CartridgeFE(const uInt8* image)
26
// Copy the ROM image into my buffer
27
for(uInt32 addr = 0; addr < 8192; ++addr)
29
myImage[addr] = image[addr];
33
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
34
CartridgeFE::~CartridgeFE()
38
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
39
const char* CartridgeFE::name() const
44
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45
void CartridgeFE::reset()
49
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
50
void CartridgeFE::install(System& system)
53
uInt16 shift = mySystem->pageShift();
54
uInt16 mask = mySystem->pageMask();
56
// Make sure the system we're being installed in has a page size that'll work
57
assert((0x1000 & mask) == 0);
59
// Map all of the accesses to call peek and poke
60
System::PageAccess access;
61
for(uInt32 i = 0x1000; i < 0x2000; i += (1 << shift))
63
access.directPeekBase = 0;
64
access.directPokeBase = 0;
66
mySystem->setPageAccess(i >> shift, access);
70
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
71
uInt8 CartridgeFE::peek(uInt16 address)
73
// The bank is determined by A13 of the processor
74
return myImage[(address & 0x0FFF) + (((address & 0x2000) == 0) ? 4096 : 0)];
77
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
78
void CartridgeFE::poke(uInt16, uInt8)