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

« back to all changes in this revision

Viewing changes to src/emucore/Cart4K.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna, Franczen Attila, Luca Falavigna
  • Date: 2008-11-08 12:04:12 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20081108120412-w6xq87vzgokstfey
Tags: 2.6.1-0ubuntu1
[ Franczen Attila ]
* New upstream release (LP: #183571).
* Updated policy to 3.8.0.

[ Luca Falavigna ]
* debian/patches/gcc-4.3: fix FTBFS with gcc-4.3 compiler.

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-2005 by Bradford W. Mott and the Stella team
 
11
// Copyright (c) 1995-2008 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: Cart4K.cxx,v 1.7 2005/07/30 16:25:48 urchlay Exp $
 
16
// $Id: Cart4K.cxx,v 1.13 2008/02/19 12:33:03 stephena Exp $
17
17
//============================================================================
18
18
 
19
 
#include <assert.h>
 
19
#include <cassert>
 
20
 
 
21
#include "System.hxx"
20
22
#include "Cart4K.hxx"
21
 
#include "System.hxx"
22
 
#include "Serializer.hxx"
23
 
#include "Deserializer.hxx"
24
 
#include <iostream>
25
23
 
26
24
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
27
25
Cartridge4K::Cartridge4K(const uInt8* image)
39
37
}
40
38
 
41
39
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
42
 
const char* Cartridge4K::name() const
43
 
{
44
 
  return "Cartridge4K";
45
 
}
46
 
 
47
 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
48
40
void Cartridge4K::reset()
49
41
{
50
42
}
84
76
85
77
 
86
78
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
79
void Cartridge4K::bank(uInt16)
 
80
{
 
81
  // Doesn't support bankswitching
 
82
}
 
83
 
 
84
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
85
int Cartridge4K::bank()
 
86
{
 
87
  // Doesn't support bankswitching
 
88
  return 0;
 
89
}
 
90
 
 
91
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
92
int Cartridge4K::bankCount()
 
93
{
 
94
  return 1;
 
95
}
 
96
 
 
97
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
87
98
bool Cartridge4K::patch(uInt16 address, uInt8 value)
88
99
{
89
 
        myImage[address & 0x0FFF] = value;
90
 
        return true;
 
100
  myImage[address & 0x0FFF] = value;
 
101
  return true;
91
102
92
103
 
93
104
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
94
 
bool Cartridge4K::save(Serializer& out)
 
105
uInt8* Cartridge4K::getImage(int& size)
 
106
{
 
107
  size = 4096;
 
108
  return &myImage[0];
 
109
}
 
110
 
 
111
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
112
bool Cartridge4K::save(Serializer& out) const
95
113
{
96
114
  string cart = name();
97
115
 
99
117
  {
100
118
    out.putString(cart);
101
119
  }
102
 
  catch(char *msg)
 
120
  catch(const char* msg)
103
121
  {
104
122
    cerr << msg << endl;
105
123
    return false;
123
141
    if(in.getString() != cart)
124
142
      return false;
125
143
  }
126
 
  catch(char *msg)
 
144
  catch(const char* msg)
127
145
  {
128
146
    cerr << msg << endl;
129
147
    return false;
136
154
 
137
155
  return true;
138
156
}
139
 
 
140
 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
141
 
uInt8* Cartridge4K::getImage(int& size) {
142
 
  size = 4096;
143
 
  return &myImage[0];
144
 
}