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: OSystem.hxx,v 1.66 2008/05/19 21:16:58 stephena Exp $
17
// $Id: OSystem.hxx 2029 2010-04-29 12:46:07Z stephena $
17
18
//============================================================================
19
20
#ifndef OSYSTEM_HXX
187
Get the small font object of the system
189
@return The font reference
191
inline const GUI::Font& smallFont() const { return *mySmallFont; }
186
194
Get the font object of the system
188
196
@return The font reference
232
240
Get the maximum dimensions of a window for the video hardware.
234
const uInt32 desktopWidth() const { return myDesktopWidth; }
235
const uInt32 desktopHeight() const { return myDesktopHeight; }
242
inline uInt32 desktopWidth() const { return myDesktopWidth; }
243
inline uInt32 desktopHeight() const { return myDesktopHeight; }
238
246
Get the supported fullscreen resolutions for the video hardware.
242
250
const ResolutionList& supportedResolutions() const { return myResolutions; }
245
Return the default directory for storing data.
253
Return the default full/complete directory name for storing data.
247
255
const string& baseDir() const { return myBaseDir; }
250
Return the directory for storing state files.
258
Return the full/complete directory name for storing state files.
252
260
const string& stateDir() const { return myStateDir; }
255
Return the directory for storing PNG snapshots.
263
Return the full/complete directory name for storing PNG snapshots.
257
265
const string& snapshotDir() const { return mySnapshotDir; }
268
Return the full/complete directory name for storing EEPROM files.
270
const string& eepromDir() const { return myEEPROMDir; }
260
273
This method should be called to get the full path of the cheat file.
262
275
@return String representing the full path of the cheat filename.
295
308
const string& romFile() const { return myRomFile; }
298
Switches between software and OpenGL framebuffer modes.
300
void toggleFrameBuffer();
303
Creates a new game console from the specified romfile.
311
Creates a new game console from the specified romfile, and correctly
312
initializes the system state to start emulation of the Console.
305
314
@param romfile The full pathname of the ROM to use
306
315
@param md5 The MD5sum of the ROM
337
348
const string& features() const { return myFeatures; }
340
Open the given ROM and return an array containing its contents.
342
@param rom The absolute pathname of the ROM file
343
@param md5 The md5 calculated from the ROM file
344
@param image A pointer to store the ROM data
345
Note, the calling method is responsible for deleting this
346
@param size The amount of data read into the image array
348
@return False on any errors, else true
351
The build information for Stella (SDL version, architecture, etc).
353
@return The build info
350
bool openROM(const string& rom, string& md5, uInt8** image, int* size);
353
Is this a valid ROM filename (does it have a valid extension?).
355
@param filename Filename of potential ROM file
356
@param extension The extension extracted from the given file
358
bool isValidRomName(const string& filename, string& extension);
355
const string& buildInfo() const { return myBuildInfo; }
361
358
Calculate the MD5sum of the given file.
363
360
@param filename Filename of potential ROM file
365
362
string MD5FromFile(const string& filename);
370
367
void quit() { myQuitLoop = true; }
370
Output a message to the a log (normally stdout).
372
@param message The message to be output
373
@param level If 0, always output the message, only output when
374
level is less than or equal to that in 'showinfo'
376
void logMessage(const string& message, uInt8 level);
373
379
//////////////////////////////////////////////////////////////////////
374
380
// The following methods are system-specific and must be implemented
380
386
@return Current time in microseconds.
382
virtual uInt32 getTicks() const = 0;
388
virtual uInt64 getTicks() const;
384
390
//////////////////////////////////////////////////////////////////////
385
391
// The following methods are system-specific and can be overrided in
542
554
Creates the various framebuffers/renderers available in this system
543
(for now, that means either 'software' or 'opengl').
555
(for now, that means either 'software' or 'opengl'). Note that
556
it will only create one type per run of Stella.
545
558
@return Success or failure of the framebuffer creation
547
bool createFrameBuffer(bool showmessage = false);
560
bool createFrameBuffer();
550
563
Creates the various sound devices available in this system
553
566
void createSound();
556
Query valid info for creating a valid console.
558
@return Success or failure for a valid console
560
bool queryConsoleInfo(const uInt8* image, uInt32 size, const string& md5,
561
Cartridge** cart, Properties& props);
569
Creates an actual Console object based on the given info.
571
@param romfile The full pathname of the ROM to use
572
@param md5 The MD5sum of the ROM
573
@param type The bankswitch type of the ROM
574
@param id The additional id (if any) used by the ROM
576
@return The actual Console object, otherwise NULL
577
(calling method is responsible for deleting it)
579
Console* openConsole(const string& romfile, string& md5, string& type, string& id);
582
Open the given ROM and return an array containing its contents.
583
Also, the properties database is updated with a valid ROM name
584
for this ROM (if necessary).
586
@param rom The absolute pathname of the ROM file
587
@param md5 The md5 calculated from the ROM file
588
(will be recalculated if necessary)
589
@param size The amount of data read into the image array
591
@return Pointer to the array, with size >=0 indicating valid data
592
(calling method is responsible for deleting it)
594
uInt8* openROM(string rom, string& md5, uInt32& size);
597
Gets all possible info about the given console.
599
@param console The console to use
600
@return Some information about this console
602
string getROMInfo(const Console* console);
564
605
Initializes the timing so that the mainloop is reset to its