1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
* Mupen64plus - plugin.c *
3
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4
* Copyright (C) 2002 Hacktarux *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
34
#include "../memory/memory.h"
35
#include "../r4300/interupt.h"
36
#include "../r4300/r4300.h"
40
static char l_PluginDir[PATH_MAX] = {0};
42
static GFX_INFO gfx_info;
43
static AUDIO_INFO audio_info;
44
static CONTROL_INFO control_info;
45
static RSP_INFO rsp_info;
47
void (*getDllInfo)(PLUGIN_INFO *PluginInfo);
48
void (*dllConfig)(HWND hParent);
49
void (*dllTest)(HWND hParent);
50
void (*dllAbout)(HWND hParent);
52
/* dummy functions to prevent mupen from crashing if a plugin is missing */
53
static void dummy_void() {}
54
static BOOL dummy_initiateGFX(GFX_INFO Gfx_Info) { return TRUE; }
55
static BOOL dummy_initiateAudio(AUDIO_INFO Audio_Info) { return TRUE; }
56
static void dummy_initiateControllers(CONTROL_INFO Control_Info) {}
57
static void dummy_old_initiateControllers(HWND hMainWindow, CONTROL Controls[4]) {}
58
static void dummy_aiDacrateChanged(int SystemType) {}
59
static DWORD dummy_aiReadLength() { return 0; }
60
static void dummy_setSpeedFactor(int percent) {}
61
static const char * dummy_volumeGetString() { return NULL; }
62
//static void dummy_aiUpdate(BOOL Wait) {}
63
static void dummy_controllerCommand(int Control, BYTE * Command) {}
64
static void dummy_getKeys(int Control, BUTTONS *Keys) {}
65
static void dummy_readController(int Control, BYTE *Command) {}
66
static void dummy_keyDown(WPARAM wParam, LPARAM lParam) {}
67
static void dummy_keyUp(WPARAM wParam, LPARAM lParam) {}
68
static void dummy_setConfigDir(char *configDir) {}
69
static void dummy_setInstallDir(char *installDir) {}
70
static unsigned int dummy;
71
static DWORD dummy_doRspCycles(DWORD Cycles) { return Cycles; };
72
static void dummy_initiateRSP(RSP_INFO Rsp_Info, DWORD * CycleCount) {};
73
static void dummy_fBRead(DWORD addr) {};
74
static void dummy_fBWrite(DWORD addr, DWORD size) {};
75
static void dummy_fBGetFrameBufferInfo(void *p) {};
77
void (*changeWindow)() = dummy_void;
78
void (*closeDLL_gfx)() = dummy_void;
79
BOOL (*initiateGFX)(GFX_INFO Gfx_Info) = dummy_initiateGFX;
80
void (*processDList)() = dummy_void;
81
void (*processRDPList)() = dummy_void;
82
void (*romClosed_gfx)() = dummy_void;
83
void (*romOpen_gfx)() = dummy_void;
84
void (*showCFB)() = dummy_void;
85
void (*updateScreen)() = dummy_void;
86
void (*viStatusChanged)() = dummy_void;
87
void (*viWidthChanged)() = dummy_void;
88
void (*readScreen)(void **dest, int *width, int *height) = 0;
89
void (*captureScreen)(char *dirpath) = 0;
90
void (*setRenderingCallback)(void (*callback)()) = dummy_void;
92
void (*aiDacrateChanged)(int SystemType) = dummy_aiDacrateChanged;
93
void (*aiLenChanged)() = dummy_void;
94
DWORD (*aiReadLength)() = dummy_aiReadLength;
95
//void (*aiUpdate)(BOOL Wait) = dummy_aiUpdate;
96
void (*closeDLL_audio)() = dummy_void;
97
BOOL (*initiateAudio)(AUDIO_INFO Audio_Info) = dummy_initiateAudio;
98
void (*processAList)() = dummy_void;
99
void (*romClosed_audio)() = dummy_void;
100
void (*romOpen_audio)() = dummy_void;
101
void (*setSpeedFactor)(int percent) = dummy_setSpeedFactor;
102
void (*volumeUp)() = dummy_void;
103
void (*volumeDown)() = dummy_void;
104
void (*volumeMute)() = dummy_void;
105
const char * (*volumeGetString)() = dummy_volumeGetString;
107
void (*closeDLL_input)() = dummy_void;
108
void (*controllerCommand)(int Control, BYTE * Command) = dummy_controllerCommand;
109
void (*getKeys)(int Control, BUTTONS *Keys) = dummy_getKeys;
110
void (*old_initiateControllers)(HWND hMainWindow, CONTROL Controls[4]) = dummy_old_initiateControllers;
111
void (*initiateControllers)(CONTROL_INFO ControlInfo) = dummy_initiateControllers;
112
void (*readController)(int Control, BYTE *Command) = dummy_readController;
113
void (*romClosed_input)() = dummy_void;
114
void (*romOpen_input)() = dummy_void;
115
void (*keyDown)(WPARAM wParam, LPARAM lParam) = dummy_keyDown;
116
void (*keyUp)(WPARAM wParam, LPARAM lParam) = dummy_keyUp;
117
void (*setConfigDir)(char *configDir) = dummy_setConfigDir;
118
void (*setInstallDir)(char *installDir) = dummy_setInstallDir;
120
void (*closeDLL_RSP)() = dummy_void;
121
DWORD (*doRspCycles)(DWORD Cycles) = dummy_doRspCycles;
122
void (*initiateRSP)(RSP_INFO Rsp_Info, DWORD * CycleCount) = dummy_initiateRSP;
123
void (*romClosed_RSP)() = dummy_void;
125
void (*fBRead)(DWORD addr) = dummy_fBRead;
126
void (*fBWrite)(DWORD addr, DWORD size) = dummy_fBWrite;
127
void (*fBGetFrameBufferInfo)(void *p) = dummy_fBGetFrameBufferInfo;
129
list_t g_PluginList = NULL;
131
HINSTANCE g_ProgramInstance = 0;
132
HWND g_RenderWindow = 0;
133
HWND g_StatusBar = 0;
135
void plugin_delete_list(void)
140
list_foreach(g_PluginList, node)
142
p = (plugin *)node->data;
144
free(p->plugin_name);
145
if (p->handle != NULL)
149
list_delete(&g_PluginList);
153
* If given filename is a valid plugin, inserts it into the plugin list and returns TRUE.
154
* file_name - string containing either full path to plugin file or, if just the filename is given, it is assumed that the
155
* plugin is in the plugins/ subfolder of the installdir.
156
* plugin_type - if nonzero, plugin_scan_file will check that the given plugin's type matches plugin_type. If it doesn't, the
157
* plugin will not be added to the list.
159
int plugin_scan_file(const char *file_name, WORD plugin_type)
161
PLUGIN_INFO pluginInfo;
165
char filepath[PATH_MAX];
168
snprintf(filepath, PATH_MAX, "%s%s", l_PluginDir, file_name);
170
if(strstr(file_name, "/"))
171
realpath(file_name, filepath);
173
strncpy(filepath, file_name, PATH_MAX);
175
// if this is not an absolute path, assume plugin file is in plugin dir
176
if (filepath[0] != '/')
178
bname = strdup(filepath);
180
snprintf(filepath, PATH_MAX, "%s%s", l_PluginDir, bname);
181
filepath[PATH_MAX-1] = '\0';
185
handle = dlopen(filepath, RTLD_NOW);
188
getDllInfo = dlsym(handle, "GetDllInfo");
191
getDllInfo(&pluginInfo);
193
if(plugin_type != 0 &&
194
pluginInfo.Type != plugin_type)
196
printf("Plugin '%s' is the wrong type!\n", file_name);
202
plugin_type = pluginInfo.Type;
207
printf("Plugin '%s' is an invalid plugin\n", file_name);
214
printf("Couldn't load plugin '%s': %s\n", file_name, dlerror());
218
p = malloc(sizeof(plugin));
219
p->type = plugin_type;
222
p->file_name = bname;
224
p->file_name = strdup(file_name);
225
p->plugin_name = strdup(pluginInfo.Name);
226
list_append(&g_PluginList, p);
231
/* plugin_scan_directory
233
* Populates plugin list with any valid plugins found in the "plugins" folder
235
void plugin_scan_directory(const char *plugindir)
238
struct dirent *entry;
240
const char* suffix = ".dll";
242
const char* suffix = ".so";
245
// open the plugins directory and if it's valid, copy it to the static l_PluginDir char array
246
dir = opendir(plugindir);
252
strncpy(l_PluginDir, plugindir, PATH_MAX-2);
253
l_PluginDir[PATH_MAX-2] = 0;
255
// make sure plugin dir has a '/' on the end.
256
if (l_PluginDir[strlen(l_PluginDir)-1] != '/')
257
strcat(l_PluginDir, "/");
259
// look for any shared libraries in this folder, and scan them
260
while((entry = readdir(dir)) != NULL)
262
if (strcmp(entry->d_name + strlen(entry->d_name) - strlen(suffix), suffix) != 0)
265
plugin_scan_file(entry->d_name, 0);
271
/* plugin_set_configdir
272
* Sets config dir of all plugins that support the SetConfigDir API call to the given dir.
274
void plugin_set_dirs(char* configdir, char* installdir)
279
list_foreach(g_PluginList, node)
281
p = (plugin*)node->data;
285
/* If plugin provides ability to set config or install directories, set them. */
286
setConfigDir = dlsym(p->handle, "SetConfigDir");
288
setConfigDir(configdir);
289
setInstallDir = dlsym(p->handle, "SetInstallDir");
291
setInstallDir(installdir);
296
plugin *plugin_get_by_name(const char *name)
301
list_foreach(g_PluginList, node)
303
p = (plugin *)node->data;
304
if (!strcmp(p->plugin_name, name))
311
char *plugin_filename_by_name(const char *name)
313
plugin *p = plugin_get_by_name(name);
315
if(p) return p->file_name;
319
char *plugin_name_by_filename(const char *filename)
323
char real_filename1[PATH_MAX], real_filename2[PATH_MAX];
326
strncpy(real_filename1, filename, PATH_MAX);
328
if (!realpath(filename, real_filename1))
329
strcpy(real_filename1, filename);
332
list_foreach(g_PluginList, node)
334
p = (plugin *)node->data;
337
strncpy(real_filename2, p->file_name, PATH_MAX);
339
if (!realpath(p->file_name, real_filename2))
340
strcpy(real_filename2, p->file_name);
343
if (!strcmp(real_filename1, real_filename2))
344
return p->plugin_name;
354
void plugin_exec_config(const char *name)
356
plugin_exec_config_with_wid(name, 0);
359
void plugin_exec_config_with_wid(const char *name, HWND wid)
361
plugin *p = plugin_get_by_name(name);
365
/* Commenting out since this interferes with Rice's initialization on Linux.
366
Added originally for better win32 compatibility? Not sure why.
369
case PLUGIN_TYPE_CONTROLLER:
370
plugin_load_input_plugin(name);
372
case PLUGIN_TYPE_RSP:
373
plugin_load_rsp_plugin(name);
375
case PLUGIN_TYPE_GFX:
376
plugin_load_gfx_plugin(name);
378
case PLUGIN_TYPE_AUDIO:
379
plugin_load_audio_plugin(name);
384
dllConfig = dlsym(p->handle, "DllConfig");
390
void plugin_exec_test(const char *name)
392
plugin_exec_test_with_wid(name, 0);
395
void plugin_exec_test_with_wid(const char *name, HWND wid)
397
plugin *p = plugin_get_by_name(name);
401
dllTest = dlsym(p->handle, "DllTest");
407
void plugin_exec_about(const char *name)
409
plugin_exec_about_with_wid(name, 0);
412
void plugin_exec_about_with_wid(const char *name, HWND wid)
414
plugin *p = plugin_get_by_name(name);
418
dllAbout = dlsym(p->handle, "DllAbout");
424
void plugin_load_plugins(const char *gfx_name,
425
const char *audio_name,
426
const char *input_name,
427
const char *RSP_name)
429
plugin_load_gfx_plugin(gfx_name);
430
plugin_load_audio_plugin(audio_name);
431
plugin_load_input_plugin(input_name);
432
plugin_load_rsp_plugin(RSP_name);
435
void plugin_load_rsp_plugin(const char* RSP_name)
438
void *handle_RSP = NULL;
440
p = plugin_get_by_name(RSP_name);
441
if(p) handle_RSP = p->handle;
445
closeDLL_RSP = dlsym(handle_RSP, "CloseDLL");
446
doRspCycles = dlsym(handle_RSP, "DoRspCycles");
447
initiateRSP = dlsym(handle_RSP, "InitiateRSP");
448
romClosed_RSP = dlsym(handle_RSP, "RomClosed");
450
if (closeDLL_RSP == NULL) closeDLL_RSP = dummy_void;
451
if (doRspCycles == NULL) doRspCycles = dummy_doRspCycles;
452
if (initiateRSP == NULL) initiateRSP = dummy_initiateRSP;
453
if (romClosed_RSP == NULL) romClosed_RSP = dummy_void;
455
rsp_info.MemoryBswaped = TRUE;
456
rsp_info.RDRAM = (BYTE*)rdram;
457
rsp_info.DMEM = (BYTE*)SP_DMEM;
458
rsp_info.IMEM = (BYTE*)SP_IMEM;
459
rsp_info.MI_INTR_REG = &MI_register.mi_intr_reg;
460
rsp_info.SP_MEM_ADDR_REG = &sp_register.sp_mem_addr_reg;
461
rsp_info.SP_DRAM_ADDR_REG = &sp_register.sp_dram_addr_reg;
462
rsp_info.SP_RD_LEN_REG = &sp_register.sp_rd_len_reg;
463
rsp_info.SP_WR_LEN_REG = &sp_register.sp_wr_len_reg;
464
rsp_info.SP_STATUS_REG = &sp_register.sp_status_reg;
465
rsp_info.SP_DMA_FULL_REG = &sp_register.sp_dma_full_reg;
466
rsp_info.SP_DMA_BUSY_REG = &sp_register.sp_dma_busy_reg;
467
rsp_info.SP_PC_REG = &rsp_register.rsp_pc;
468
rsp_info.SP_SEMAPHORE_REG = &sp_register.sp_semaphore_reg;
469
rsp_info.DPC_START_REG = &dpc_register.dpc_start;
470
rsp_info.DPC_END_REG = &dpc_register.dpc_end;
471
rsp_info.DPC_CURRENT_REG = &dpc_register.dpc_current;
472
rsp_info.DPC_STATUS_REG = &dpc_register.dpc_status;
473
rsp_info.DPC_CLOCK_REG = &dpc_register.dpc_clock;
474
rsp_info.DPC_BUFBUSY_REG = &dpc_register.dpc_bufbusy;
475
rsp_info.DPC_PIPEBUSY_REG = &dpc_register.dpc_pipebusy;
476
rsp_info.DPC_TMEM_REG = &dpc_register.dpc_tmem;
477
rsp_info.CheckInterrupts = sucre;
478
rsp_info.ProcessDlistList = processDList;
479
rsp_info.ProcessAlistList = processAList;
480
rsp_info.ProcessRdpList = processRDPList;
481
rsp_info.ShowCFB = showCFB;
482
rsp_info.hInst = g_ProgramInstance;
483
initiateRSP(rsp_info,(DWORD*) NULL);
487
closeDLL_RSP = dummy_void;
488
doRspCycles = dummy_doRspCycles;
489
initiateRSP = dummy_initiateRSP;
490
romClosed_RSP = dummy_void;
494
void plugin_load_input_plugin(const char* input_name)
498
void *handle_input = NULL;
499
PLUGIN_INFO input_pluginInfo;
501
p = plugin_get_by_name(input_name);
502
if(p) handle_input = p->handle;
506
getDllInfo = dlsym(handle_input, "GetDllInfo");
507
getDllInfo(&input_pluginInfo);
508
closeDLL_input = dlsym(handle_input, "CloseDLL");
509
controllerCommand = dlsym(handle_input, "ControllerCommand");
510
getKeys = dlsym(handle_input, "GetKeys");
511
initiateControllers = dlsym(handle_input, "InitiateControllers");
512
old_initiateControllers = dlsym(handle_input, "InitiateControllers");
513
readController = dlsym(handle_input, "ReadController");
514
romClosed_input = dlsym(handle_input, "RomClosed");
515
romOpen_input = dlsym(handle_input, "RomOpen");
516
keyDown = dlsym(handle_input, "WM_KeyDown");
517
keyUp = dlsym(handle_input, "WM_KeyUp");
519
if (closeDLL_input == NULL) closeDLL_input = dummy_void;
520
if (controllerCommand == NULL) controllerCommand = dummy_controllerCommand;
521
if (getKeys == NULL) getKeys = dummy_getKeys;
522
if (initiateControllers == NULL) initiateControllers = dummy_initiateControllers;
523
if (readController == NULL) readController = dummy_readController;
524
if (romClosed_input == NULL) romClosed_input = dummy_void;
525
if (romOpen_input == NULL) romOpen_input = dummy_void;
526
if (keyDown == NULL) keyDown = dummy_keyDown;
527
if (keyUp == NULL) keyUp = dummy_keyUp;
529
control_info.MemoryBswaped = TRUE;
530
control_info.HEADER = rom;
531
control_info.Controls = Controls;
532
control_info.hMainWindow = g_RenderWindow;
533
control_info.hinst = g_ProgramInstance;
536
Controls[i].Present = FALSE;
537
Controls[i].RawData = FALSE;
538
Controls[i].Plugin = PLUGIN_NONE;
540
if (input_pluginInfo.Version == 0x0101)
542
initiateControllers(control_info);
546
old_initiateControllers(g_RenderWindow, Controls);
551
closeDLL_input = dummy_void;
552
controllerCommand = dummy_controllerCommand;
553
getKeys = dummy_getKeys;
554
initiateControllers = dummy_initiateControllers;
555
readController = dummy_readController;
556
romClosed_input = dummy_void;
557
romOpen_input = dummy_void;
558
keyDown = dummy_keyDown;
563
void plugin_load_audio_plugin(const char* audio_name)
566
void *handle_audio = NULL;
568
p = plugin_get_by_name(audio_name);
569
if(p) handle_audio = p->handle;
573
closeDLL_audio = dlsym(handle_audio, "CloseDLL");
574
aiDacrateChanged = dlsym(handle_audio, "AiDacrateChanged");
575
aiLenChanged = dlsym(handle_audio, "AiLenChanged");
576
aiReadLength = dlsym(handle_audio, "AiReadLength");
577
//aiUpdate = dlsym(handle_audio, "AiUpdate");
578
initiateAudio = dlsym(handle_audio, "InitiateAudio");
579
processAList = dlsym(handle_audio, "ProcessAList");
580
romClosed_audio = dlsym(handle_audio, "RomClosed");
581
romOpen_audio = dlsym(handle_audio, "RomOpen");
582
setSpeedFactor = dlsym(handle_audio, "SetSpeedFactor");
583
volumeUp = dlsym(handle_audio, "VolumeUp");
584
volumeDown = dlsym(handle_audio, "VolumeDown");
585
volumeMute = dlsym(handle_audio, "VolumeMute");
586
volumeGetString = dlsym(handle_audio, "VolumeGetString");
588
if (aiDacrateChanged == NULL) aiDacrateChanged = dummy_aiDacrateChanged;
589
if (aiLenChanged == NULL) aiLenChanged = dummy_void;
590
if (aiReadLength == NULL) aiReadLength = dummy_aiReadLength;
591
//if (aiUpdate == NULL) aiUpdate = dummy_aiUpdate;
592
if (closeDLL_audio == NULL) closeDLL_audio = dummy_void;
593
if (initiateAudio == NULL) initiateAudio = dummy_initiateAudio;
594
if (processAList == NULL) processAList = dummy_void;
595
if (romClosed_audio == NULL) romClosed_audio = dummy_void;
596
if (romOpen_audio == NULL) romOpen_audio = dummy_void;
597
if (setSpeedFactor == NULL) setSpeedFactor = dummy_setSpeedFactor;
598
if (volumeUp == NULL) volumeUp = dummy_void;
599
if (volumeDown == NULL) volumeDown = dummy_void;
600
if (volumeMute == NULL) volumeMute = dummy_void;
601
if (volumeGetString == NULL) volumeGetString = dummy_volumeGetString;
603
audio_info.MemoryBswaped = TRUE;
604
audio_info.HEADER = rom;
605
audio_info.RDRAM = (BYTE*)rdram;
606
audio_info.DMEM = (BYTE*)SP_DMEM;
607
audio_info.IMEM = (BYTE*)SP_IMEM;
608
audio_info.MI_INTR_REG = &(MI_register.mi_intr_reg);
609
audio_info.AI_DRAM_ADDR_REG = &(ai_register.ai_dram_addr);
610
audio_info.AI_LEN_REG = &(ai_register.ai_len);
611
audio_info.AI_CONTROL_REG = &(ai_register.ai_control);
612
audio_info.AI_STATUS_REG = &dummy;
613
audio_info.AI_DACRATE_REG = &(ai_register.ai_dacrate);
614
audio_info.AI_BITRATE_REG = &(ai_register.ai_bitrate);
615
audio_info.CheckInterrupts = sucre;
616
audio_info.hwnd = g_RenderWindow;
617
audio_info.hinst = g_ProgramInstance;
618
initiateAudio(audio_info);
622
aiDacrateChanged = dummy_aiDacrateChanged;
623
aiLenChanged = dummy_void;
624
aiReadLength = dummy_aiReadLength;
625
//aiUpdate = dummy_aiUpdate;
626
closeDLL_audio = dummy_void;
627
initiateAudio = dummy_initiateAudio;
628
processAList = dummy_void;
629
romClosed_audio = dummy_void;
630
romOpen_audio = dummy_void;
631
setSpeedFactor = dummy_setSpeedFactor;
635
void plugin_load_gfx_plugin(const char* gfx_name)
638
void *handle_gfx = NULL;
640
p = plugin_get_by_name(gfx_name);
641
if(p) handle_gfx = p->handle;
645
changeWindow = dlsym(handle_gfx, "ChangeWindow");
646
closeDLL_gfx = dlsym(handle_gfx, "CloseDLL");
647
dllAbout = dlsym(handle_gfx, "DllAbout");
648
dllConfig = dlsym(handle_gfx, "DllConfig");
649
dllTest = dlsym(handle_gfx, "DllTest");
650
initiateGFX = dlsym(handle_gfx, "InitiateGFX");
651
processDList = dlsym(handle_gfx, "ProcessDList");
652
processRDPList = dlsym(handle_gfx, "ProcessRDPList");
653
romClosed_gfx = dlsym(handle_gfx, "RomClosed");
654
romOpen_gfx = dlsym(handle_gfx, "RomOpen");
655
showCFB = dlsym(handle_gfx, "ShowCFB");
656
updateScreen = dlsym(handle_gfx, "UpdateScreen");
657
viStatusChanged = dlsym(handle_gfx, "ViStatusChanged");
658
viWidthChanged = dlsym(handle_gfx, "ViWidthChanged");
659
readScreen = dlsym(handle_gfx, "ReadScreen");
660
captureScreen = dlsym(handle_gfx, "CaptureScreen");
661
setRenderingCallback = dlsym(handle_gfx, "SetRenderingCallback");
663
fBRead = dlsym(handle_gfx, "FBRead");
664
fBWrite = dlsym(handle_gfx, "FBWrite");
665
fBGetFrameBufferInfo = dlsym(handle_gfx, "FBGetFrameBufferInfo");
667
if (changeWindow == NULL) changeWindow = dummy_void;
668
if (closeDLL_gfx == NULL) closeDLL_gfx = dummy_void;
669
if (initiateGFX == NULL) initiateGFX = dummy_initiateGFX;
670
if (processDList == NULL) processDList = dummy_void;
671
if (processRDPList == NULL) processRDPList = dummy_void;
672
if (romClosed_gfx == NULL) romClosed_gfx = dummy_void;
673
if (romOpen_gfx == NULL) romOpen_gfx = dummy_void;
674
if (showCFB == NULL) showCFB = dummy_void;
675
if (updateScreen == NULL) updateScreen = dummy_void;
676
if (viStatusChanged == NULL) viStatusChanged = dummy_void;
677
if (viWidthChanged == NULL) viWidthChanged = dummy_void;
678
if (captureScreen == NULL) captureScreen = dummy_void;
679
if (setRenderingCallback == NULL) setRenderingCallback = dummy_void;
681
gfx_info.MemoryBswaped = TRUE;
682
gfx_info.HEADER = rom;
683
gfx_info.RDRAM = (BYTE*)rdram;
684
gfx_info.DMEM = (BYTE*)SP_DMEM;
685
gfx_info.IMEM = (BYTE*)SP_IMEM;
686
gfx_info.MI_INTR_REG = &(MI_register.mi_intr_reg);
687
gfx_info.DPC_START_REG = &(dpc_register.dpc_start);
688
gfx_info.DPC_END_REG = &(dpc_register.dpc_end);
689
gfx_info.DPC_CURRENT_REG = &(dpc_register.dpc_current);
690
gfx_info.DPC_STATUS_REG = &(dpc_register.dpc_status);
691
gfx_info.DPC_CLOCK_REG = &(dpc_register.dpc_clock);
692
gfx_info.DPC_BUFBUSY_REG = &(dpc_register.dpc_bufbusy);
693
gfx_info.DPC_PIPEBUSY_REG = &(dpc_register.dpc_pipebusy);
694
gfx_info.DPC_TMEM_REG = &(dpc_register.dpc_tmem);
695
gfx_info.VI_STATUS_REG = &(vi_register.vi_status);
696
gfx_info.VI_ORIGIN_REG = &(vi_register.vi_origin);
697
gfx_info.VI_WIDTH_REG = &(vi_register.vi_width);
698
gfx_info.VI_INTR_REG = &(vi_register.vi_v_intr);
699
gfx_info.VI_V_CURRENT_LINE_REG = &(vi_register.vi_current);
700
gfx_info.VI_TIMING_REG = &(vi_register.vi_burst);
701
gfx_info.VI_V_SYNC_REG = &(vi_register.vi_v_sync);
702
gfx_info.VI_H_SYNC_REG = &(vi_register.vi_h_sync);
703
gfx_info.VI_LEAP_REG = &(vi_register.vi_leap);
704
gfx_info.VI_H_START_REG = &(vi_register.vi_h_start);
705
gfx_info.VI_V_START_REG = &(vi_register.vi_v_start);
706
gfx_info.VI_V_BURST_REG = &(vi_register.vi_v_burst);
707
gfx_info.VI_X_SCALE_REG = &(vi_register.vi_x_scale);
708
gfx_info.VI_Y_SCALE_REG = &(vi_register.vi_y_scale);
709
gfx_info.CheckInterrupts = sucre;
710
gfx_info.hWnd = g_RenderWindow;
711
gfx_info.hStatusBar = g_StatusBar;
712
initiateGFX(gfx_info);
716
changeWindow = dummy_void;
717
closeDLL_gfx = dummy_void;
718
initiateGFX = dummy_initiateGFX;
719
processDList = dummy_void;
720
processRDPList = dummy_void;
721
romClosed_gfx = dummy_void;
722
romOpen_gfx = dummy_void;
723
showCFB = dummy_void;
724
updateScreen = dummy_void;
725
viStatusChanged = dummy_void;
726
viWidthChanged = dummy_void;
728
captureScreen = dummy_void;
729
setRenderingCallback = dummy_void;
733
void plugin_close_plugins()