summaryrefslogtreecommitdiff
path: root/libpcsxcore/plugins.c
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-07 04:31:29 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-07 04:31:29 +0000
commit2d5a9a02425951f4efed764d135be96867eb532f (patch)
treed94be7649ef8ccb627df551ac69f5d4a6a941cb6 /libpcsxcore/plugins.c
parent6a4fd490f8c754883bee9468be8d35dc7a651cee (diff)
downloadpcsxr-2d5a9a02425951f4efed764d135be96867eb532f.tar.gz
preparing for refactor/cleanup, moved all definations into .c files, other minor cleanups. (Breaks Mac OS X and maybe windows as well for now, will fix later.)
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47542 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/plugins.c')
-rw-r--r--libpcsxcore/plugins.c127
1 files changed, 119 insertions, 8 deletions
diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c
index 3d66de51..5f6369c9 100644
--- a/libpcsxcore/plugins.c
+++ b/libpcsxcore/plugins.c
@@ -24,8 +24,123 @@
#include "plugins.h"
#include "cdriso.h"
-char cdrfilename[MAXPATHLEN] = "";
-int cdOpenCase = 0;
+// FIXME: Stuff these into structs
+GPUupdateLace GPU_updateLace;
+GPUinit GPU_init;
+GPUshutdown GPU_shutdown;
+GPUconfigure GPU_configure;
+GPUtest GPU_test;
+GPUabout GPU_about;
+GPUopen GPU_open;
+GPUclose GPU_close;
+GPUreadStatus GPU_readStatus;
+GPUreadData GPU_readData;
+GPUreadDataMem GPU_readDataMem;
+GPUwriteStatus GPU_writeStatus;
+GPUwriteData GPU_writeData;
+GPUwriteDataMem GPU_writeDataMem;
+GPUdmaChain GPU_dmaChain;
+GPUkeypressed GPU_keypressed;
+GPUdisplayText GPU_displayText;
+GPUmakeSnapshot GPU_makeSnapshot;
+GPUfreeze GPU_freeze;
+GPUgetScreenPic GPU_getScreenPic;
+GPUshowScreenPic GPU_showScreenPic;
+GPUclearDynarec GPU_clearDynarec;
+
+CDRinit CDR_init;
+CDRshutdown CDR_shutdown;
+CDRopen CDR_open;
+CDRclose CDR_close;
+CDRtest CDR_test;
+CDRgetTN CDR_getTN;
+CDRgetTD CDR_getTD;
+CDRreadTrack CDR_readTrack;
+CDRgetBuffer CDR_getBuffer;
+CDRplay CDR_play;
+CDRstop CDR_stop;
+CDRgetStatus CDR_getStatus;
+CDRgetDriveLetter CDR_getDriveLetter;
+CDRgetBufferSub CDR_getBufferSub;
+CDRconfigure CDR_configure;
+CDRabout CDR_about;
+CDRsetfilename CDR_setfilename;
+
+SPUconfigure SPU_configure;
+SPUabout SPU_about;
+SPUinit SPU_init;
+SPUshutdown SPU_shutdown;
+SPUtest SPU_test;
+SPUopen SPU_open;
+SPUclose SPU_close;
+SPUplaySample SPU_playSample;
+SPUstartChannels1 SPU_startChannels1;
+SPUstartChannels2 SPU_startChannels2;
+SPUstopChannels1 SPU_stopChannels1;
+SPUstopChannels2 SPU_stopChannels2;
+SPUputOne SPU_putOne;
+SPUgetOne SPU_getOne;
+SPUsetAddr SPU_setAddr;
+SPUsetPitch SPU_setPitch;
+SPUsetVolumeL SPU_setVolumeL;
+SPUsetVolumeR SPU_setVolumeR;
+SPUwriteRegister SPU_writeRegister;
+SPUreadRegister SPU_readRegister;
+SPUwriteDMA SPU_writeDMA;
+SPUreadDMA SPU_readDMA;
+SPUwriteDMAMem SPU_writeDMAMem;
+SPUreadDMAMem SPU_readDMAMem;
+SPUplayADPCMchannel SPU_playADPCMchannel;
+SPUfreeze SPU_freeze;
+SPUregisterCallback SPU_registerCallback;
+SPUasync SPU_async;
+SPUplayCDDAchannel SPU_playCDDAchannel;
+
+PADconfigure PAD1_configure;
+PADabout PAD1_about;
+PADinit PAD1_init;
+PADshutdown PAD1_shutdown;
+PADtest PAD1_test;
+PADopen PAD1_open;
+PADclose PAD1_close;
+PADquery PAD1_query;
+PADkeypressed PAD1_keypressed;
+PADstartPoll PAD1_startPoll;
+PADpoll PAD1_poll;
+PADsetSensitive PAD1_setSensitive;
+
+PADconfigure PAD2_configure;
+PADabout PAD2_about;
+PADinit PAD2_init;
+PADshutdown PAD2_shutdown;
+PADtest PAD2_test;
+PADopen PAD2_open;
+PADclose PAD2_close;
+PADquery PAD2_query;
+PADkeypressed PAD2_keypressed;
+PADstartPoll PAD2_startPoll;
+PADpoll PAD2_poll;
+PADsetSensitive PAD2_setSensitive;
+
+NETinit NET_init;
+NETshutdown NET_shutdown;
+NETopen NET_open;
+NETclose NET_close;
+NETtest NET_test;
+NETconfigure NET_configure;
+NETabout NET_about;
+NETpause NET_pause;
+NETresume NET_resume;
+NETqueryPlayer NET_queryPlayer;
+NETsendData NET_sendData;
+NETrecvData NET_recvData;
+NETsendPadData NET_sendPadData;
+NETrecvPadData NET_recvPadData;
+NETsetInfo NET_setInfo;
+NETkeypressed NET_keypressed;
+
+char cdrfilename[MAXPATHLEN] = ""; // FIXME: cleanup
+int cdOpenCase = 0; // FIXME: cleanup
#define CheckErr(func) \
err = SysLibError(); \
@@ -635,7 +750,6 @@ void CALLBACK clearDynarec(void) {
psxCpu->Reset();
}
-/* TODO If there's an error, need to notify user which plugin failed, rather than silently fail */
int LoadPlugins() {
int ret;
char Plugin[MAXPATHLEN];
@@ -643,7 +757,7 @@ int LoadPlugins() {
ReleasePlugins();
if (cdrfilename[0] != '\0') {
- imageReaderInit();
+ cdrIsoInit();
} else {
sprintf(Plugin, "%s/%s", Config.PluginsDir, Config.Cdr);
if (LoadCDRplugin(Plugin) == -1) return -1;
@@ -669,7 +783,6 @@ int LoadPlugins() {
if (LoadNETplugin(Plugin) == -1) Config.UseNet = 0;
}
- /* TODO Proper error code handling - report the appropriate error */
ret = CDR_init();
if (ret < 0) { SysMessage (_("Error initializing CD-ROM plugin: %d"), ret); return -1; }
ret = GPU_init();
@@ -691,15 +804,13 @@ int LoadPlugins() {
}
void ReleasePlugins() {
- extern FILE *cdHandle;
-
if (Config.UseNet) {
int ret = NET_close();
if (ret < 0) Config.UseNet = 0;
NetOpened = 0;
}
- if (hCDRDriver != NULL || cdHandle != NULL) CDR_shutdown();
+ if (hCDRDriver != NULL || cdrIsoActive()) CDR_shutdown();
if (hGPUDriver != NULL) GPU_shutdown();
if (hSPUDriver != NULL) SPU_shutdown();
if (hPAD1Driver != NULL) PAD1_shutdown();