summaryrefslogtreecommitdiff
path: root/libpcsxcore/misc.c
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-09-22 01:50:23 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-09-22 01:50:23 +0000
commit60cf0fcf61b20eed515819ecfd302c208ba88e57 (patch)
treec51f44380630819828dad730551c1a38a9e2533a /libpcsxcore/misc.c
parent000f2e2923da84e6b7f1e4d48b9e803a203a4461 (diff)
downloadpcsxr-60cf0fcf61b20eed515819ecfd302c208ba88e57.tar.gz
only load the net yaroze library when running EXE.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@57503 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/misc.c')
-rw-r--r--libpcsxcore/misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c
index 8b9780f6..ef315214 100644
--- a/libpcsxcore/misc.c
+++ b/libpcsxcore/misc.c
@@ -372,6 +372,21 @@ static int PSXGetFileType(FILE *f) {
return INVALID_EXE;
}
+static void LoadLibPS() {
+ char buf[MAXPATHLEN];
+ FILE *f;
+
+ // Load Net Yaroze runtime library (if exists)
+ sprintf(buf, "%s/libps.exe", Config.BiosDir);
+ f = fopen(buf, "rb");
+
+ if (f != NULL) {
+ fseek(f, 0x800, SEEK_SET);
+ fread(psxM + 0x10000, 0x61000, 1, f);
+ fclose(f);
+ }
+}
+
int Load(const char *ExePath) {
FILE *tmpFile;
EXE_HEADER tmpHead;
@@ -388,6 +403,8 @@ int Load(const char *ExePath) {
SysPrintf(_("Error opening file: %s.\n"), ExePath);
retval = -1;
} else {
+ LoadLibPS();
+
type = PSXGetFileType(tmpFile);
switch (type) {
case PSX_EXE: