From f8843a7af4138d2abe1c084008d607c21127eae9 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Sun, 19 Sep 2010 02:46:23 +0000 Subject: load net yaroze library if exists at startup. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@57379 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/psxmem.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 2c47ed06..f46e7261 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -21,8 +21,6 @@ * PSX memory functions. */ -// TODO: Implement caches & cycle penalty. - #include "psxmem.h" #include "r3000a.h" #include "psxhw.h" @@ -113,7 +111,8 @@ void psxMemReset() { memset(psxM, 0, 0x00200000); memset(psxP, 0, 0x00010000); - + + // Load BIOS if (strcmp(Config.Bios, "HLE") != 0) { sprintf(bios, "%s/%s", Config.BiosDir, Config.Bios); f = fopen(bios, "rb"); @@ -127,7 +126,17 @@ void psxMemReset() { fclose(f); Config.HLE = FALSE; } - } else Config.HLE = TRUE; + } else Config.HLE = TRUE; + + // Load Net Yaroze runtime library (if exists) + sprintf(bios, "%s/libps.exe", Config.BiosDir); + f = fopen(bios, "rb"); + + if (f != NULL) { + fseek(f, 0x800, SEEK_SET); + fread(psxM + 0x10000, 0x61000, 1, f); + fclose(f); + } } void psxMemShutdown() { -- cgit v1.2.3