1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus - plugin.h *
3 * Mupen64Plus homepage: https://mupen64plus.org/ *
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#include "api/m64p_types.h"
29
30extern m64p_error plugin_connect(m64p_plugin_type, m64p_dynlib_handle plugin_handle);
31extern m64p_error plugin_start(m64p_plugin_type);
32extern m64p_error plugin_check(void);
33
34enum { NUM_CONTROLLER = 4 };
35extern CONTROL Controls[NUM_CONTROLLER];
36
37/*** Version requirement information ***/
38#define RSP_API_VERSION 0x20000
39#define GFX_API_VERSION 0x20200
40#define AUDIO_API_VERSION 0x20000
41#define INPUT_API_VERSION 0x20100
42
43/* video plugin function pointers */
44typedef struct _gfx_plugin_functions
45{
46 ptr_PluginGetVersion getVersion;
47 ptr_ChangeWindow changeWindow;
48 ptr_InitiateGFX initiateGFX;
49 ptr_MoveScreen moveScreen;
50 ptr_ProcessDList processDList;
51 ptr_ProcessRDPList processRDPList;
52 ptr_RomClosed romClosed;
53 ptr_RomOpen romOpen;
54 ptr_ShowCFB showCFB;
55 ptr_UpdateScreen updateScreen;
56 ptr_ViStatusChanged viStatusChanged;
57 ptr_ViWidthChanged viWidthChanged;
58 ptr_ReadScreen2 readScreen;
59 ptr_SetRenderingCallback setRenderingCallback;
60 ptr_ResizeVideoOutput resizeVideoOutput;
61
62 /* frame buffer plugin spec extension */
63 ptr_FBRead fBRead;
64 ptr_FBWrite fBWrite;
65 ptr_FBGetFrameBufferInfo fBGetFrameBufferInfo;
66} gfx_plugin_functions;
67
68extern gfx_plugin_functions gfx;
69
70/* audio plugin function pointers */
71typedef struct _audio_plugin_functions
72{
73 ptr_PluginGetVersion getVersion;
74 ptr_AiDacrateChanged aiDacrateChanged;
75 ptr_AiLenChanged aiLenChanged;
76 ptr_InitiateAudio initiateAudio;
77 ptr_ProcessAList processAList;
78 ptr_RomClosed romClosed;
79 ptr_RomOpen romOpen;
80 ptr_SetSpeedFactor setSpeedFactor;
81 ptr_VolumeUp volumeUp;
82 ptr_VolumeDown volumeDown;
83 ptr_VolumeGetLevel volumeGetLevel;
84 ptr_VolumeSetLevel volumeSetLevel;
85 ptr_VolumeMute volumeMute;
86 ptr_VolumeGetString volumeGetString;
87} audio_plugin_functions;
88
89extern audio_plugin_functions audio;
90
91/* input plugin function pointers */
92typedef struct _input_plugin_functions
93{
94 ptr_PluginGetVersion getVersion;
95 ptr_ControllerCommand controllerCommand;
96 ptr_GetKeys getKeys;
97 ptr_InitiateControllers initiateControllers;
98 ptr_ReadController readController;
99 ptr_RomClosed romClosed;
100 ptr_RomOpen romOpen;
101 ptr_SDL_KeyDown keyDown;
102 ptr_SDL_KeyUp keyUp;
103 ptr_RenderCallback renderCallback;
104} input_plugin_functions;
105
106extern input_plugin_functions input;
107
108/* RSP plugin function pointers */
109typedef struct _rsp_plugin_functions
110{
111 ptr_PluginGetVersion getVersion;
112 ptr_DoRspCycles doRspCycles;
113 ptr_InitiateRSP initiateRSP;
114 ptr_RomClosed romClosed;
115} rsp_plugin_functions;
116
117extern rsp_plugin_functions rsp;
118
119#endif
120
121