adding new "saver" setting
[drnoksnes] / platform / platform.h
1 #ifndef _PLATFORM_H_
2 #define _PLATFORM_H_
3
4 #include "port.h"
5
6 // Configuration and command line parsing
7 void S9xLoadConfig(int argc, char ** argv);
8 void S9xUnloadConfig();
9 void S9xSetRomFile(const char * file);
10 extern struct config {
11         /** Unfreeze from .frz.gz snapshot on start */
12         bool snapshotLoad;
13         /** Freeze to .frz.gz on exit */
14         bool snapshotSave;
15         /** Create fullscreen surface */
16         bool fullscreen;
17         /** Name of the scaler to use or NULL for default */
18         char * scaler;
19         /** Audio output enabled */
20         bool enableAudio;
21         /** Quit when the emulator window is deactivated */
22         bool saver;
23         /** Speedhacks file to use */
24         char * hacksFile;
25         /** Enable touchscreen controls */
26         bool touchscreenInput;
27         /** Display touchscreen controls grid */
28         bool touchscreenShow;
29         /** If true, next time the main loop is entered application will close */
30         bool quitting;
31         /** Current scancode->joypad mapping */
32         unsigned short joypad1Mapping[256];
33         unsigned short joypad2Mapping[256];
34         unsigned char action[256];
35 } Config;
36
37 // Video
38 extern struct gui {
39         /** Size of the GUI Window */
40         unsigned short Width, Height;
41         /** Size of the (scaled) rendering area, relative to window. */
42         unsigned short RenderX, RenderY, RenderW, RenderH;
43         /** Scaling ratio */
44         float ScaleX, ScaleY;
45 } GUI;
46
47 void S9xInitDisplay(int argc, char **argv);
48 void S9xDeinitDisplay();
49 void S9xVideoToggleFullscreen();
50 void S9xSetTitle (const char *title);
51
52 // Audio output
53 void S9xInitAudioOutput();
54 void S9xDeinitAudioOutput();
55 void S9xAudioOutputEnable(bool enable);
56
57 // Input devices
58 void S9xInitInputDevices();
59 void S9xDeinitInputDevices();
60 void S9xInputScreenChanged();
61 void S9xInputScreenDraw(int pixelSize, void * buffer, int pitch);
62 void S9xProcessEvents(bool block);
63
64 // Input actions
65 #define kActionNone                                             0
66 #define kActionQuit                                     (1U << 0)
67 #define kActionToggleFullscreen         (1U << 1)
68 #define kActionQuickLoad1                       (1U << 2)
69 #define kActionQuickSave1                       (1U << 3)
70 #define kActionQuickLoad2                       (1U << 4)
71 #define kActionQuickSave2                       (1U << 5)
72
73 void S9xDoAction(unsigned char action);
74
75 #endif