~ubuntu-branches/debian/squeeze/stella/squeeze

« back to all changes in this revision

Viewing changes to src/emucore/CartFA.hxx

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Kitt
  • Date: 2010-07-12 23:49:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100712234936-juawrr3etzhr2qpv
Tags: 3.1.2-1
* New maintainer (closes: #532039).
* New upstream version (closes: #461121):
  - includes launcher (closes: #396058).
* Fix the reference to the X Window System in the description (closes:
  #411815).
* Move to main, DFSG-free ROMs are available (see README.Debian).
* Enhance the package description.
* Drop the libslang2-dev dependency (closes: #560274).
* Remove the Encoding entry from stella.desktop.
* Avoid ignoring errors when cleaning.
* Add ${misc:Depends} to the package dependencies.
* Provide a doc-base file to install the documentation using doc-base.
* Switch to debhelper 7 with a simplified rules file.
* Use autotools-dev to provide updated configuration files.
* Update to Standards-Version 3.9.0:
  - Move to menu section Applications/Emulators.
  - Move the homepage declaration.
* Re-write the manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//============================================================================
 
2
//
 
3
//   SSSS    tt          lll  lll       
 
4
//  SS  SS   tt           ll   ll        
 
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
 
10
//
 
11
// Copyright (c) 1995-2010 by Bradford W. Mott, Stephen Anthony
 
12
// and the Stella Team
 
13
//
 
14
// See the file "License.txt" for information on usage and redistribution of
 
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
 
16
//
 
17
// $Id: CartFA.hxx 2001 2010-04-10 21:37:23Z stephena $
 
18
//============================================================================
 
19
 
 
20
#ifndef CARTRIDGEFA_HXX
 
21
#define CARTRIDGEFA_HXX
 
22
 
 
23
class System;
 
24
 
 
25
#include "bspf.hxx"
 
26
#include "Cart.hxx"
 
27
 
 
28
/**
 
29
  Cartridge class used for CBS' RAM Plus cartridges.  There are
 
30
  three 4K banks and 256 bytes of RAM.
 
31
 
 
32
  @author  Bradford W. Mott
 
33
  @version $Id: CartFA.hxx 2001 2010-04-10 21:37:23Z stephena $
 
34
*/
 
35
class CartridgeFA : public Cartridge
 
36
{
 
37
  public:
 
38
    /**
 
39
      Create a new cartridge using the specified image
 
40
 
 
41
      @param image Pointer to the ROM image
 
42
    */
 
43
    CartridgeFA(const uInt8* image);
 
44
 
 
45
    /**
 
46
      Destructor
 
47
    */
 
48
    virtual ~CartridgeFA();
 
49
 
 
50
  public:
 
51
    /**
 
52
      Reset device to its power-on state
 
53
    */
 
54
    void reset();
 
55
 
 
56
    /**
 
57
      Install cartridge in the specified system.  Invoked by the system
 
58
      when the cartridge is attached to it.
 
59
 
 
60
      @param system The system the device should install itself in
 
61
    */
 
62
    void install(System& system);
 
63
 
 
64
    /**
 
65
      Install pages for the specified bank in the system.
 
66
 
 
67
      @param bank The bank that should be installed in the system
 
68
    */
 
69
    void bank(uInt16 bank);
 
70
 
 
71
    /**
 
72
      Get the current bank.
 
73
    */
 
74
    uInt16 bank() const;
 
75
 
 
76
    /**
 
77
      Query the number of banks supported by the cartridge.
 
78
    */
 
79
    uInt16 bankCount() const;
 
80
 
 
81
    /**
 
82
      Patch the cartridge ROM.
 
83
 
 
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
 
87
    */
 
88
    bool patch(uInt16 address, uInt8 value);
 
89
 
 
90
    /**
 
91
      Access the internal ROM image for this cartridge.
 
92
 
 
93
      @param size  Set to the size of the internal ROM image data
 
94
      @return  A pointer to the internal ROM image data
 
95
    */
 
96
    const uInt8* getImage(int& size) const;
 
97
 
 
98
    /**
 
99
      Save the current state of this cart to the given Serializer.
 
100
 
 
101
      @param out  The Serializer object to use
 
102
      @return  False on any errors, else true
 
103
    */
 
104
    bool save(Serializer& out) const;
 
105
 
 
106
    /**
 
107
      Load the current state of this cart from the given Serializer.
 
108
 
 
109
      @param in  The Serializer object to use
 
110
      @return  False on any errors, else true
 
111
    */
 
112
    bool load(Serializer& in);
 
113
 
 
114
    /**
 
115
      Get a descriptor for the device name (used in error checking).
 
116
 
 
117
      @return The name of the object
 
118
    */
 
119
    string name() const { return "CartridgeFA"; }
 
120
 
 
121
  public:
 
122
    /**
 
123
      Get the byte at the specified address.
 
124
 
 
125
      @return The byte at the specified address
 
126
    */
 
127
    uInt8 peek(uInt16 address);
 
128
 
 
129
    /**
 
130
      Change the byte at the specified address to the given value
 
131
 
 
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
 
135
    */
 
136
    bool poke(uInt16 address, uInt8 value);
 
137
 
 
138
  private:
 
139
    // Indicates which bank is currently active
 
140
    uInt16 myCurrentBank;
 
141
 
 
142
    // The 12K ROM image of the cartridge
 
143
    uInt8 myImage[12288];
 
144
 
 
145
    // The 256 bytes of RAM on the cartridge
 
146
    uInt8 myRAM[256];
 
147
};
 
148
 
 
149
#endif