new controls dialog; using gconf instead of hgw
[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, const 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         /** Speedhacks file to use */
22         char * hacksFile;
23         /** Enable touchscreen controls */
24         bool touchscreenInput;
25         /** Display touchscreen controls grid */
26         bool touchscreenShow;
27         /** If true, next time the main loop is entered application will close */
28         bool quitting;
29         /** Current scancode->joypad mapping */
30         unsigned short joypad1Mapping[256];
31         unsigned short joypad2Mapping[256];
32         unsigned char action[256];
33 } Config;
34
35 // Video
36 extern struct gui {
37         /** Size of the GUI Window */
38         unsigned short Width, Height;
39         /** Size of the (scaled) rendering area, relative to window. */
40         unsigned short RenderX, RenderY, RenderW, RenderH;
41         /** Scaling ratio */
42         float ScaleX, ScaleY;
43 } GUI;
44 void S9xVideoToggleFullscreen();
45
46 // Audio output
47 void S9xInitAudioOutput();
48 void S9xDeinitAudioOutput();
49 void S9xAudioOutputEnable(bool enable);
50
51 // Input devices
52 EXTERN_C void S9xInitInputDevices();
53 void S9xDeinitInputDevices();
54 void S9xInputScreenChanged();
55 void S9xInputScreenDraw(int pixelSize, void * buffer, int pitch);
56
57 // Input actions
58 #define kActionNone                                             0
59 #define kActionQuit                                     (1U << 0)
60 #define kActionToggleFullscreen         (1U << 1)
61 #define kActionQuickLoad1                       (1U << 2)
62 #define kActionQuickSave1                       (1U << 3)
63 #define kActionQuickLoad2                       (1U << 4)
64 #define kActionQuickSave2                       (1U << 5)
65
66 void S9xDoAction(unsigned char action);
67
68 #endif