~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/emucore/CartFA2.hxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-06-02 07:33:16 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120602073316-20r4hr32t4oj36u9
Tags: 3.7-1
* New upstream version.
* Update description and documentation with new features in 3.7, notably
  Blargg TV filters (replacing the filters available in versions 3.4.1
  and earlier).
* Switch to debhelper compatibility level 9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
//
17
 
// $Id: CartFA2.hxx 2435 2012-03-30 21:07:57Z stephena $
 
17
// $Id: CartFA2.hxx 2440 2012-04-14 19:28:53Z stephena $
18
18
//============================================================================
19
19
 
20
20
#ifndef CARTRIDGEFA2_HXX
29
29
  This is an extended version of the CBS RAM Plus bankswitching scheme
30
30
  supported by the Harmony cartridge.
31
31
  
32
 
  There are six (or seven) 4K banks and 256 bytes of RAM.
 
32
  There are six (or seven) 4K banks and 256 bytes of RAM.  The 256 bytes
 
33
  of RAM can be loaded/saved to Harmony cart flash, which is emulated by
 
34
  storing in a file.
33
35
 
34
36
  @author  Chris D. Walton
35
 
  @version $Id: CartFA2.hxx 2435 2012-03-30 21:07:57Z stephena $
 
37
  @version $Id: CartFA2.hxx 2440 2012-04-14 19:28:53Z stephena $
36
38
*/
37
39
class CartridgeFA2 : public Cartridge
38
40
{
42
44
 
43
45
      @param image     Pointer to the ROM image
44
46
      @param size      The size of the ROM image
45
 
      @param settings  A reference to the various settings (read-only)
 
47
      @param osystem   A reference to the OSystem currently in use
46
48
    */
47
 
    CartridgeFA2(const uInt8* image, uInt32 size, const Settings& settings);
 
49
    CartridgeFA2(const uInt8* image, uInt32 size, const OSystem& osystem);
48
50
 
49
51
    /**
50
52
      Destructor
122
124
    */
123
125
    string name() const { return "CartridgeFA2"; }
124
126
 
 
127
    /**
 
128
      Informs the cartridge about the name of the ROM file used when
 
129
      creating this cart.
 
130
 
 
131
      @param name  The properties file name of the ROM
 
132
    */
 
133
    void setRomName(const string& name);
 
134
 
125
135
  public:
126
136
    /**
127
137
      Get the byte at the specified address.
140
150
    bool poke(uInt16 address, uInt8 value);
141
151
 
142
152
  private:
 
153
    /**
 
154
      Either load or save internal RAM to Harmony flash (represented by
 
155
      a file in emulation).
 
156
 
 
157
      @return  The value at $FF4 with bit 6 set or cleared (depending on
 
158
               whether the RAM access was busy or successful)
 
159
    */
 
160
    uInt8 ramReadWrite();
 
161
 
 
162
  private:
 
163
    // OSsytem currently in use
 
164
    const OSystem& myOSystem;
 
165
 
143
166
    // Indicates which bank is currently active
144
167
    uInt16 myCurrentBank;
145
168
 
149
172
    // The 256 bytes of RAM on the cartridge
150
173
    uInt8 myRAM[256];
151
174
 
 
175
    // The time after which the first request of a load/save operation
 
176
    // will actually be completed
 
177
    // Due to flash RAM constraints, a read/write isn't instantaneous,
 
178
    // so we need to emulate the delay as well
 
179
    uInt64 myRamAccessTimeout;
 
180
 
 
181
    // Full pathname of the file to use when emulating load/save
 
182
    // of internal RAM to Harmony cart flash
 
183
    string myFlashFile;
 
184
 
152
185
    // Size of the ROM image
153
186
    uInt32 mySize;
154
187
};