X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxmem.c;h=2f427acfa48f3cfe0381b92284c841d3ef0fa734;hb=4f0c5e3fd702a35b7a2ebc22519f59bbae7b3008;hp=11a01adcae6ca785f07fef1780a8f70232a896bf;hpb=a34093eb63d1645fd2de9b412efe2587df9fdb3f;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 11a01adc..2f427acf 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -31,10 +31,20 @@ #include "memmap.h" +#ifdef USE_LIBRETRO_VFS +#include +#endif + #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif +#ifndef NDEBUG +#include "debug.h" +#else +void DebugCheckBP(u32 address, enum breakpoint_types type) {} +#endif + void *(*psxMapHook)(unsigned long addr, size_t size, int is_fixed, enum psxMapTag tag); void (*psxUnmapHook)(void *ptr, size_t size, enum psxMapTag tag); @@ -215,6 +225,8 @@ void psxMemReset() { memset(psxM, 0, 0x00200000); memset(psxP, 0xff, 0x00010000); + Config.HLE = TRUE; + if (strcmp(Config.Bios, "HLE") != 0) { sprintf(bios, "%s/%s", Config.BiosDir, Config.Bios); f = fopen(bios, "rb"); @@ -222,13 +234,15 @@ void psxMemReset() { if (f == NULL) { SysMessage(_("Could not open BIOS:\"%s\". Enabling HLE Bios!\n"), bios); memset(psxR, 0, 0x80000); - Config.HLE = TRUE; } else { - fread(psxR, 1, 0x80000, f); + if (fread(psxR, 1, 0x80000, f) == 0x80000) { + Config.HLE = FALSE; + } else { + SysMessage(_("The selected BIOS:\"%s\" is of wrong size. Enabling HLE Bios!\n"), bios); + } fclose(f); - Config.HLE = FALSE; } - } else Config.HLE = TRUE; + } } void psxMemShutdown() {