From 78470f808411136437789aee0d33fbe0c892daea Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Mon, 10 May 2010 07:11:29 +0000 Subject: got rid of cdrfilename & cdOpenCase, windows broken for now git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47753 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/plugins.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'libpcsxcore/plugins.c') diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index cd8fc8cc..59d14bb6 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -24,8 +24,8 @@ #include "plugins.h" #include "cdriso.h" -char cdrfilename[MAXPATHLEN] = ""; // FIXME: cleanup -int cdOpenCase = 0; // FIXME: cleanup +static char IsoFile[MAXPATHLEN] = ""; +static s64 cdOpenCaseTime = 0; GPUupdateLace GPU_updateLace; GPUinit GPU_init; @@ -213,7 +213,7 @@ long CALLBACK CDR__play(unsigned char *sector) { return 0; } long CALLBACK CDR__stop(void) { return 0; } long CALLBACK CDR__getStatus(struct CdrStat *stat) { - if (cdOpenCase < 0 || cdOpenCase > time(NULL)) + if (cdOpenCaseTime < 0 || cdOpenCaseTime > (s64)time(NULL)) stat->Status = 0x10; else stat->Status = 0; @@ -460,7 +460,7 @@ int LoadPlugins() { ReleasePlugins(); - if (cdrfilename[0] != '\0') { + if (UsingIso()) { LoadCDRplugin(NULL); } else { sprintf(Plugin, "%s/%s", Config.PluginsDir, Config.Cdr); @@ -511,7 +511,7 @@ void ReleasePlugins() { if (Config.UseNet) { int ret = NET_close(); if (ret < 0) Config.UseNet = 0; - NetOpened = 0; + NetOpened = FALSE; } if (hCDRDriver != NULL || cdrIsoActive()) CDR_shutdown(); @@ -532,3 +532,23 @@ void ReleasePlugins() { SysCloseLibrary(hNETDriver); hNETDriver = NULL; } } + +void SetIsoFile(const char *filename) { + if (filename == NULL) { + IsoFile[0] = '\0'; + return; + } + strncpy(IsoFile, filename, MAXPATHLEN); +} + +const char *GetIsoFile(void) { + return IsoFile; +} + +boolean UsingIso(void) { + return (IsoFile[0] != '\0'); +} + +void SetCdOpenCaseTime(s64 time) { + cdOpenCaseTime = time; +} -- cgit v1.2.3