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

« back to all changes in this revision

Viewing changes to src/emucore/CartF8.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:
8
8
//  SS  SS   tt   ee      ll   ll  aa  aa
9
9
//   SSSS     ttt  eeeee llll llll  aaaaa
10
10
//
11
 
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
 
11
// Copyright (c) 1995-2010 by Bradford W. Mott, Stephen Anthony
 
12
// and the Stella Team
12
13
//
13
 
// See the file "license" for information on usage and redistribution of
 
14
// See the file "License.txt" for information on usage and redistribution of
14
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
16
//
16
 
// $Id: CartF8.hxx,v 1.12 2008/02/06 13:45:21 stephena Exp $
 
17
// $Id: CartF8.hxx 2001 2010-04-10 21:37:23Z stephena $
17
18
//============================================================================
18
19
 
19
20
#ifndef CARTRIDGEF8_HXX
29
30
  are two 4K banks.
30
31
 
31
32
  @author  Bradford W. Mott
32
 
  @version $Id: CartF8.hxx,v 1.12 2008/02/06 13:45:21 stephena Exp $
 
33
  @version $Id: CartF8.hxx 2001 2010-04-10 21:37:23Z stephena $
33
34
*/
34
35
class CartridgeF8 : public Cartridge
35
36
{
38
39
      Create a new cartridge using the specified image
39
40
 
40
41
      @param image     Pointer to the ROM image
41
 
      @param swapbanks Whether to swap the startup bank
 
42
      @param startlow  Whether to use the lower or upper bank for startup
42
43
    */
43
 
    CartridgeF8(const uInt8* image, bool swapbanks);
 
44
    CartridgeF8(const uInt8* image, bool startlow = false);
44
45
 
45
46
    /**
46
47
      Destructor
51
52
    /**
52
53
      Reset device to its power-on state
53
54
    */
54
 
    virtual void reset();
 
55
    void reset();
55
56
 
56
57
    /**
57
58
      Install cartridge in the specified system.  Invoked by the system
59
60
 
60
61
      @param system The system the device should install itself in
61
62
    */
62
 
    virtual void install(System& system);
 
63
    void install(System& system);
63
64
 
64
65
    /**
65
66
      Install pages for the specified bank in the system.
66
67
 
67
68
      @param bank The bank that should be installed in the system
68
69
    */
69
 
    virtual void bank(uInt16 bank);
 
70
    void bank(uInt16 bank);
70
71
 
71
72
    /**
72
73
      Get the current bank.
73
 
 
74
 
      @return  The current bank, or -1 if bankswitching not supported
75
74
    */
76
 
    virtual int bank();
 
75
    uInt16 bank() const;
77
76
 
78
77
    /**
79
78
      Query the number of banks supported by the cartridge.
80
79
    */
81
 
    virtual int bankCount();
 
80
    uInt16 bankCount() const;
82
81
 
83
82
    /**
84
83
      Patch the cartridge ROM.
87
86
      @param value    The value to place into the address
88
87
      @return    Success or failure of the patch operation
89
88
    */
90
 
    virtual bool patch(uInt16 address, uInt8 value);
 
89
    bool patch(uInt16 address, uInt8 value);
91
90
 
92
91
    /**
93
92
      Access the internal ROM image for this cartridge.
95
94
      @param size  Set to the size of the internal ROM image data
96
95
      @return  A pointer to the internal ROM image data
97
96
    */
98
 
    virtual uInt8* getImage(int& size);
 
97
    const uInt8* getImage(int& size) const;
99
98
 
100
99
    /**
101
100
      Save the current state of this cart to the given Serializer.
103
102
      @param out  The Serializer object to use
104
103
      @return  False on any errors, else true
105
104
    */
106
 
    virtual bool save(Serializer& out) const;
 
105
    bool save(Serializer& out) const;
107
106
 
108
107
    /**
109
 
      Load the current state of this cart from the given Deserializer.
 
108
      Load the current state of this cart from the given Serializer.
110
109
 
111
 
      @param in  The Deserializer object to use
 
110
      @param in  The Serializer object to use
112
111
      @return  False on any errors, else true
113
112
    */
114
 
    virtual bool load(Deserializer& in);
 
113
    bool load(Serializer& in);
115
114
 
116
115
    /**
117
116
      Get a descriptor for the device name (used in error checking).
118
117
 
119
118
      @return The name of the object
120
119
    */
121
 
    virtual string name() const { return "CartridgeF8"; }
 
120
    string name() const { return "CartridgeF8"; }
122
121
 
123
122
  public:
124
123
    /**
126
125
 
127
126
      @return The byte at the specified address
128
127
    */
129
 
    virtual uInt8 peek(uInt16 address);
 
128
    uInt8 peek(uInt16 address);
130
129
 
131
130
    /**
132
131
      Change the byte at the specified address to the given value
133
132
 
134
133
      @param address The address where the value should be stored
135
134
      @param value The value to be stored at the address
 
135
      @return  True if the poke changed the device address space, else false
136
136
    */
137
 
    virtual void poke(uInt16 address, uInt8 value);
 
137
    bool poke(uInt16 address, uInt8 value);
138
138
 
139
139
  private:
140
140
    // Indicates which bank is currently active
141
141
    uInt16 myCurrentBank;
142
142
 
143
 
    // Indicates the bank to use when resetting
144
 
    uInt16 myResetBank;
145
 
 
146
143
    // The 8K ROM image of the cartridge
147
144
    uInt8 myImage[8192];
148
145
};