From 60cf0fcf61b20eed515819ecfd302c208ba88e57 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Wed, 22 Sep 2010 01:50:23 +0000 Subject: 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 --- libpcsxcore/misc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libpcsxcore/misc.c') 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: -- cgit v1.2.3