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

« back to all changes in this revision

Viewing changes to src/emucore/CartF4.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Mario Iseli
  • Date: 2006-04-08 18:38:25 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060408183825-vu1jk57rk929derx
* New Maintainer (Closes: #361345)
* New upstream release (Closes: #349725)
* Build-Depend now on libslang2-dev (Closes: #325577)
* Complete rebuild of debian/, upgraded to policy-standards
  3.6.2 and compat-level 5.
* Removed stellarc since stella only reads ~/.stellarc and even
  works without a first config.
* New debian/watch file.

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-2002 by Bradford W. Mott
 
11
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
12
12
//
13
13
// See the file "license" for information on usage and redistribution of
14
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
15
//
16
 
// $Id: CartF4.cxx,v 1.1 2002/08/14 02:30:52 bwmott Exp $
 
16
// $Id: CartF4.cxx,v 1.7 2005/12/17 01:23:07 stephena Exp $
17
17
//============================================================================
18
18
 
19
19
#include <assert.h>
103
103
}
104
104
 
105
105
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
106
bool CartridgeF4::patch(uInt16 address, uInt8 value)
 
107
{
 
108
        address = address & 0x0FFF;
 
109
        myImage[myCurrentBank * 4096 + address] = value;
 
110
        return true;
 
111
 
112
 
 
113
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
106
114
void CartridgeF4::bank(uInt16 bank)
107
115
 
116
  if(bankLocked) return;
 
117
 
108
118
  // Remember what bank we're in
109
119
  myCurrentBank = bank;
110
120
  uInt16 offset = myCurrentBank * 4096;
126
136
}
127
137
 
128
138
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
139
int CartridgeF4::bank() {
 
140
  return myCurrentBank;
 
141
}
 
142
 
 
143
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
144
int CartridgeF4::bankCount() {
 
145
  return 8;
 
146
}
 
147
 
 
148
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
129
149
bool CartridgeF4::save(Serializer& out)
130
150
{
131
151
  string cart = name();
133
153
  try
134
154
  {
135
155
    out.putString(cart);
136
 
    out.putLong(myCurrentBank);
 
156
    out.putInt(myCurrentBank);
137
157
  }
138
158
  catch(char* msg)
139
159
  {
161
181
      return false;
162
182
    }
163
183
 
164
 
    myCurrentBank = (uInt16)in.getLong();
 
184
    myCurrentBank = (uInt16)in.getInt();
165
185
  }
166
186
  catch(char* msg)
167
187
  {
180
200
  return true;
181
201
}
182
202
 
 
203
 
 
204
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
205
uInt8* CartridgeF4::getImage(int& size) {
 
206
  size = 32768;
 
207
  return &myImage[0];
 
208
}