Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmupen64plus/mupen64plus-video-jabo/jabo_api.h
2 views
1
/**********************************************************************************
2
Common gfx plugin spec, version #1.3 maintained by zilmar ([email protected])
3
MODIFIED: Turned function prototypes into function pointer typedefs
4
5
All questions or suggestions should go through the mailing list.
6
http://www.egroups.com/group/Plugin64-Dev
7
***********************************************************************************
8
9
Notes:
10
------
11
12
Setting the approprate bits in the MI_INTR_REG and calling CheckInterrupts which
13
are both passed to the DLL in InitiateGFX will generate an Interrupt from with in
14
the plugin.
15
16
The Setting of the RSP flags and generating an SP interrupt should not be done in
17
the plugin
18
19
**********************************************************************************/
20
#ifndef _GFX_H_INCLUDED__
21
#define _GFX_H_INCLUDED__
22
23
#if defined(__cplusplus)
24
extern "C" {
25
#endif
26
27
/* Plugin types */
28
#define PLUGIN_TYPE_GFX 2
29
30
//#define EXPORT __declspec(dllexport)
31
//#define CALL _cdecl
32
33
/***** Structures *****/
34
typedef struct {
35
WORD Version; /* Set to 0x0103 */
36
WORD Type; /* Set to PLUGIN_TYPE_GFX */
37
char Name[100]; /* Name of the DLL */
38
39
/* If DLL supports memory these memory options then set them to TRUE or FALSE
40
if it does not support it */
41
BOOL NormalMemory; /* a normal BYTE array */
42
BOOL MemoryBswaped; /* a normal BYTE array where the memory has been pre
43
bswap on a dword (32 bits) boundry */
44
} PLUGIN_INFO;
45
46
typedef struct {
47
HWND hWnd; /* Render window */
48
HWND hStatusBar; /* if render window does not have a status bar then this is NULL */
49
50
BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
51
// bswap on a dword (32 bits) boundry
52
// eg. the first 8 bytes are stored like this:
53
// 4 3 2 1 8 7 6 5
54
55
BYTE * HEADER; // This is the rom header (first 40h bytes of the rom
56
// This will be in the same memory format as the rest of the memory.
57
BYTE * RDRAM;
58
BYTE * DMEM;
59
BYTE * IMEM;
60
61
DWORD * MI_INTR_REG;
62
63
DWORD * DPC_START_REG;
64
DWORD * DPC_END_REG;
65
DWORD * DPC_CURRENT_REG;
66
DWORD * DPC_STATUS_REG;
67
DWORD * DPC_CLOCK_REG;
68
DWORD * DPC_BUFBUSY_REG;
69
DWORD * DPC_PIPEBUSY_REG;
70
DWORD * DPC_TMEM_REG;
71
72
DWORD * VI_STATUS_REG;
73
DWORD * VI_ORIGIN_REG;
74
DWORD * VI_WIDTH_REG;
75
DWORD * VI_INTR_REG;
76
DWORD * VI_V_CURRENT_LINE_REG;
77
DWORD * VI_TIMING_REG;
78
DWORD * VI_V_SYNC_REG;
79
DWORD * VI_H_SYNC_REG;
80
DWORD * VI_LEAP_REG;
81
DWORD * VI_H_START_REG;
82
DWORD * VI_V_START_REG;
83
DWORD * VI_V_BURST_REG;
84
DWORD * VI_X_SCALE_REG;
85
DWORD * VI_Y_SCALE_REG;
86
87
void (*CheckInterrupts)( void );
88
} GFX_INFO;
89
90
/******************************************************************
91
Function: CaptureScreen
92
Purpose: This function dumps the current frame to a file
93
input: pointer to the directory to save the file to
94
output: none
95
*******************************************************************/
96
//EXPORT void CALL CaptureScreen ( char * Directory );
97
typedef void (*ptr_CaptureScreen)(char *);
98
99
/******************************************************************
100
Function: ChangeWindow
101
Purpose: to change the window between fullscreen and window
102
mode. If the window was in fullscreen this should
103
change the screen to window mode and vice vesa.
104
input: none
105
output: none
106
*******************************************************************/
107
//EXPORT void CALL ChangeWindow (void);
108
typedef void (*ptr_ChangeWindow)(void);
109
110
/******************************************************************
111
Function: CloseDLL
112
Purpose: This function is called when the emulator is closing
113
down allowing the dll to de-initialise.
114
input: none
115
output: none
116
*******************************************************************/
117
//EXPORT void CALL CloseDLL (void);
118
typedef void (*ptr_CloseDLL)(void);
119
120
/******************************************************************
121
Function: DllAbout
122
Purpose: This function is optional function that is provided
123
to give further information about the DLL.
124
input: a handle to the window that calls this function
125
output: none
126
*******************************************************************/
127
//EXPORT void CALL DllAbout ( HWND hParent );
128
typedef void (*ptr_DllAbout)(HWND hParent);
129
130
/******************************************************************
131
Function: DllConfig
132
Purpose: This function is optional function that is provided
133
to allow the user to configure the dll
134
input: a handle to the window that calls this function
135
output: none
136
*******************************************************************/
137
//EXPORT void CALL DllConfig ( HWND hParent );
138
typedef void (*ptr_DllConfig)(HWND hParent);
139
140
/******************************************************************
141
Function: DllTest
142
Purpose: This function is optional function that is provided
143
to allow the user to test the dll
144
input: a handle to the window that calls this function
145
output: none
146
*******************************************************************/
147
// IGNORE
148
//EXPORT void CALL DllTest ( HWND hParent );
149
150
/******************************************************************
151
Function: DrawScreen
152
Purpose: This function is called when the emulator receives a
153
WM_PAINT message. This allows the gfx to fit in when
154
it is being used in the desktop.
155
input: none
156
output: none
157
*******************************************************************/
158
//EXPORT void CALL DrawScreen (void);
159
typedef void (*ptr_DrawScreen)(void);
160
161
/******************************************************************
162
Function: GetDllInfo
163
Purpose: This function allows the emulator to gather information
164
about the dll by filling in the PluginInfo structure.
165
input: a pointer to a PLUGIN_INFO stucture that needs to be
166
filled by the function. (see def above)
167
output: none
168
*******************************************************************/
169
//EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo );
170
typedef void (*ptr_GetDllInfo)(PLUGIN_INFO * PluginInfo);
171
172
/******************************************************************
173
Function: InitiateGFX
174
Purpose: This function is called when the DLL is started to give
175
information from the emulator that the n64 graphics
176
uses. This is not called from the emulation thread.
177
Input: Gfx_Info is passed to this function which is defined
178
above.
179
Output: TRUE on success
180
FALSE on failure to initialise
181
182
** note on interrupts **:
183
To generate an interrupt set the appropriate bit in MI_INTR_REG
184
and then call the function CheckInterrupts to tell the emulator
185
that there is a waiting interrupt.
186
*******************************************************************/
187
//EXPORT BOOL CALL InitiateGFX (GFX_INFO Gfx_Info);
188
typedef void (*ptr_InitiateGFX)(GFX_INFO Gfx_Info);
189
190
/******************************************************************
191
Function: MoveScreen
192
Purpose: This function is called in response to the emulator
193
receiving a WM_MOVE passing the xpos and ypos passed
194
from that message.
195
input: xpos - the x-coordinate of the upper-left corner of the
196
client area of the window.
197
ypos - y-coordinate of the upper-left corner of the
198
client area of the window.
199
output: none
200
*******************************************************************/
201
// INGORE
202
//EXPORT void CALL MoveScreen (int xpos, int ypos);
203
typedef void (*ptr_MoveScreen)(int xpos, int ypos);
204
205
/******************************************************************
206
Function: ProcessDList
207
Purpose: This function is called when there is a Dlist to be
208
processed. (High level GFX list)
209
input: none
210
output: none
211
*******************************************************************/
212
//EXPORT void CALL ProcessDList(void);
213
typedef void (*ptr_ProcessDList)(void);
214
215
/******************************************************************
216
Function: ProcessRDPList
217
Purpose: This function is called when there is a Dlist to be
218
processed. (Low level GFX list)
219
input: none
220
output: none
221
*******************************************************************/
222
//EXPORT void CALL ProcessRDPList(void);
223
typedef void (*ptr_ProcessRDPList)(void);
224
225
/******************************************************************
226
Function: RomClosed
227
Purpose: This function is called when a rom is closed.
228
input: none
229
output: none
230
*******************************************************************/
231
//EXPORT void CALL RomClosed (void);
232
typedef void (*ptr_RomClosed)(void);
233
234
/******************************************************************
235
Function: RomOpen
236
Purpose: This function is called when a rom is open. (from the
237
emulation thread)
238
input: none
239
output: none
240
*******************************************************************/
241
//EXPORT void CALL RomOpen (void);
242
typedef void (*ptr_RomOpen)(void);
243
244
/******************************************************************
245
Function: ShowCFB
246
Purpose: Useally once Dlists are started being displayed, cfb is
247
ignored. This function tells the dll to start displaying
248
them again.
249
input: none
250
output: none
251
*******************************************************************/
252
//EXPORT void CALL ShowCFB (void);
253
typedef void (*ptr_ShowCFB)(void);
254
255
/******************************************************************
256
Function: UpdateScreen
257
Purpose: This function is called in response to a vsync of the
258
screen were the VI bit in MI_INTR_REG has already been
259
set
260
input: none
261
output: none
262
*******************************************************************/
263
//EXPORT void CALL UpdateScreen (void);
264
typedef void (*ptr_UpdateScreen)(void);
265
266
/******************************************************************
267
Function: ViStatusChanged
268
Purpose: This function is called to notify the dll that the
269
ViStatus registers value has been changed.
270
input: none
271
output: none
272
*******************************************************************/
273
//EXPORT void CALL ViStatusChanged (void);
274
typedef void (*ptr_ViStatusChanged)(void);
275
276
/******************************************************************
277
Function: ViWidthChanged
278
Purpose: This function is called to notify the dll that the
279
ViWidth registers value has been changed.
280
input: none
281
output: none
282
*******************************************************************/
283
//EXPORT void CALL ViWidthChanged (void);
284
typedef void (*ptr_ViWidthChanged)(void);
285
286
/******************************************************************
287
Function: ReadScreen
288
Purpose: Capture the current screen
289
Input: none
290
Output: dest - 24-bit RGB data
291
width - width of image
292
height - height of image
293
******************************************************************/
294
//EXPORT void CALL ReadScreen (void **dest, long *width, long *height);
295
typedef void (*ptr_ReadScreen)(void **dest, long *width, long *height);
296
297
#if defined(__cplusplus)
298
}
299
300
#endif
301
#endif
302
303