8
8
// SS SS tt ee ll ll aa aa
9
9
// SSSS ttt eeeee llll llll aaaaa
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
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.
16
// $Id: Console.hxx,v 1.68 2008/05/21 14:01:29 stephena Exp $
17
// $Id: Console.hxx 2001 2010-04-10 21:37:23Z stephena $
17
18
//============================================================================
19
20
#ifndef CONSOLE_HXX
20
21
#define CONSOLE_HXX
29
29
#include "bspf.hxx"
30
30
#include "Control.hxx"
36
36
#include "Serializable.hxx"
39
Contains detailed info about a console.
49
string InitialFrameRate;
39
53
This class represents the entire game console.
41
55
@author Bradford W. Mott
42
@version $Id: Console.hxx,v 1.68 2008/05/21 14:01:29 stephena Exp $
56
@version $Id: Console.hxx 2001 2010-04-10 21:37:23Z stephena $
44
58
class Console : public Serializable
128
142
bool save(Serializer& out) const;
131
Loads the current state of this console class from the given Deserializer.
145
Loads the current state of this console class from the given Serializer.
133
@param in The deserializer device to load from.
147
@param in The Serializer device to load from.
134
148
@return The result of the load. True on success, false on failure.
136
bool load(Deserializer& in);
150
bool load(Serializer& in);
139
153
Get a descriptor for this console class (used in error checking).
150
164
void setProperties(const Properties& props);
153
Query some information about this console.
167
Query detailed information about this console.
155
const string& about() const { return myAboutString; }
169
inline const ConsoleInfo& about() const { return myConsoleInfo; }
198
212
@param full Whether we want a full initialization,
199
213
or only reset certain attributes.
215
@return False on any errors, else true
201
void initializeVideo(bool full = true);
217
bool initializeVideo(bool full = true);
204
220
Initialize the audio subsystem wrt this class.
241
257
Toggles the TIA bit specified in the method name.
243
void toggleP0Bit() const { toggleTIABit(TIA::P0, "P0"); }
244
void toggleP1Bit() const { toggleTIABit(TIA::P1, "P1"); }
245
void toggleM0Bit() const { toggleTIABit(TIA::M0, "M0"); }
246
void toggleM1Bit() const { toggleTIABit(TIA::M1, "M1"); }
247
void toggleBLBit() const { toggleTIABit(TIA::BL, "BL"); }
248
void togglePFBit() const { toggleTIABit(TIA::PF, "PF"); }
259
void toggleP0Bit() const { toggleTIABit(P0Bit, "P0"); }
260
void toggleP1Bit() const { toggleTIABit(P1Bit, "P1"); }
261
void toggleM0Bit() const { toggleTIABit(M0Bit, "M0"); }
262
void toggleM1Bit() const { toggleTIABit(M1Bit, "M1"); }
263
void toggleBLBit() const { toggleTIABit(BLBit, "BL"); }
264
void togglePFBit() const { toggleTIABit(PFBit, "PF"); }
265
void toggleHMOVE() const;
249
266
void enableBits(bool enable) const;
251
// TODO - make the core code work without needing to access this
252
AtariVox* atariVox() { return myAVox; }
269
Toggles the TIA collisions specified in the method name.
271
void toggleP0Collision() const { toggleTIACollision(P0Bit, "P0"); }
272
void toggleP1Collision() const { toggleTIACollision(P1Bit, "P1"); }
273
void toggleM0Collision() const { toggleTIACollision(M0Bit, "M0"); }
274
void toggleM1Collision() const { toggleTIACollision(M1Bit, "M1"); }
275
void toggleBLCollision() const { toggleTIACollision(BLBit, "BL"); }
276
void togglePFCollision() const { toggleTIACollision(PFBit, "PF"); }
277
void enableCollisions(bool enable) const;
280
Toggles the TIA 'fixed debug colors' mode.
282
void toggleFixedColors() const;
256
286
Adds the left and right controllers to the console
258
void setControllers();
260
void toggleTIABit(TIA::TIABit bit, const string& bitname, bool show = true) const;
288
void setControllers(const string& rommd5);
263
291
Loads a user-defined palette file (from OSystem::paletteFile), filling the
266
294
void loadUserPalette();
269
Loads all defined palettes with PAL color-loss data depending
297
Loads all defined palettes with PAL color-loss data, even those that
298
normally can't have it enabled (NTSC), since it's also used for
299
'greying out' the frame in the debugger.
272
void setColorLossPalette(bool state);
301
void setColorLossPalette();
275
304
Returns a pointer to the palette data for the palette currently defined
278
307
const uInt32* getPalette(int direction) const;
309
void toggleTIABit(TIABit bit, const string& bitname, bool show = true) const;
310
void toggleTIACollision(TIABit bit, const string& bitname, bool show = true) const;
281
313
// Pointer to the osystem object
282
314
OSystem* myOSystem;
318
348
// successfully loaded
319
349
bool myUserPaletteDefined;
321
// Contains info about this console in string format
322
string myAboutString;
351
// Contains detailed info about this console
352
ConsoleInfo myConsoleInfo;
324
354
// Table of RGB values for NTSC, PAL and SECAM
325
355
static uInt32 ourNTSCPalette[256];