Core commit. Compile and run on the OpenPandora
[mupen64plus-pandora.git] / source / mupen64plus-core / src / plugin / plugin.h
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  *   Mupen64plus - plugin.h                                                *
3  *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
4  *   Copyright (C) 2002 Hacktarux                                          *
5  *   Copyright (C) 2009 Richard Goedeken                                   *
6  *                                                                         *
7  *   This program is free software; you can redistribute it and/or modify  *
8  *   it under the terms of the GNU General Public License as published by  *
9  *   the Free Software Foundation; either version 2 of the License, or     *
10  *   (at your option) any later version.                                   *
11  *                                                                         *
12  *   This program is distributed in the hope that it will be useful,       *
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
15  *   GNU General Public License for more details.                          *
16  *                                                                         *
17  *   You should have received a copy of the GNU General Public License     *
18  *   along with this program; if not, write to the                         *
19  *   Free Software Foundation, Inc.,                                       *
20  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
21  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22
23 #ifndef PLUGIN_H
24 #define PLUGIN_H
25
26 #include "api/m64p_common.h"
27 #include "api/m64p_plugin.h"
28
29 extern m64p_error plugin_connect(m64p_plugin_type, m64p_dynlib_handle plugin_handle);
30 extern m64p_error plugin_start(m64p_plugin_type);
31 extern m64p_error plugin_check(void);
32
33 extern CONTROL Controls[4];
34
35 /*** Version requirement information ***/
36 #define RSP_API_VERSION   0x20000
37 #define GFX_API_VERSION   0x20200
38 #define AUDIO_API_VERSION 0x20000
39 #define INPUT_API_VERSION 0x20000
40
41 /* video plugin function pointers */
42 typedef struct _gfx_plugin_functions
43 {
44         ptr_PluginGetVersion getVersion;
45         ptr_ChangeWindow     changeWindow;
46         ptr_InitiateGFX      initiateGFX;
47         ptr_MoveScreen       moveScreen;
48         ptr_ProcessDList     processDList;
49         ptr_ProcessRDPList   processRDPList;
50         ptr_RomClosed        romClosed;
51         ptr_RomOpen          romOpen;
52         ptr_ShowCFB          showCFB;
53         ptr_UpdateScreen     updateScreen;
54         ptr_ViStatusChanged  viStatusChanged;
55         ptr_ViWidthChanged   viWidthChanged;
56         ptr_ReadScreen2      readScreen;
57         ptr_SetRenderingCallback setRenderingCallback;
58     ptr_ResizeVideoOutput    resizeVideoOutput;
59
60         /* frame buffer plugin spec extension */
61         ptr_FBRead          fBRead;
62         ptr_FBWrite         fBWrite;
63         ptr_FBGetFrameBufferInfo fBGetFrameBufferInfo;
64 } gfx_plugin_functions;
65
66 extern gfx_plugin_functions gfx;
67
68 /* audio plugin function pointers */
69 typedef struct _audio_plugin_functions
70 {
71         ptr_PluginGetVersion  getVersion;
72         ptr_AiDacrateChanged  aiDacrateChanged;
73         ptr_AiLenChanged      aiLenChanged;
74         ptr_InitiateAudio     initiateAudio;
75         ptr_ProcessAList      processAList;
76         ptr_RomClosed         romClosed;
77         ptr_RomOpen           romOpen;
78         ptr_SetSpeedFactor    setSpeedFactor;
79         ptr_VolumeUp          volumeUp;
80         ptr_VolumeDown        volumeDown;
81         ptr_VolumeGetLevel    volumeGetLevel;
82         ptr_VolumeSetLevel    volumeSetLevel;
83         ptr_VolumeMute        volumeMute;
84         ptr_VolumeGetString   volumeGetString;
85 } audio_plugin_functions;
86
87 extern audio_plugin_functions audio;
88
89 /* input plugin function pointers */
90 typedef struct _input_plugin_functions
91 {
92         ptr_PluginGetVersion    getVersion;
93         ptr_ControllerCommand   controllerCommand;
94         ptr_GetKeys             getKeys;
95         ptr_InitiateControllers initiateControllers;
96         ptr_ReadController      readController;
97         ptr_RomClosed           romClosed;
98         ptr_RomOpen             romOpen;
99         ptr_SDL_KeyDown         keyDown;
100         ptr_SDL_KeyUp           keyUp;
101 } input_plugin_functions;
102
103 extern input_plugin_functions input;
104
105 /* RSP plugin function pointers */
106 typedef struct _rsp_plugin_functions
107 {
108         ptr_PluginGetVersion    getVersion;
109         ptr_DoRspCycles         doRspCycles;
110         ptr_InitiateRSP         initiateRSP;
111         ptr_RomClosed           romClosed;
112 } rsp_plugin_functions;
113
114 extern rsp_plugin_functions rsp;
115
116 #endif
117