X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=fba1112df426f2e50b6d3d2963703c455f43b8dc;hb=24e7afe0f5ce84f651b28a5f3832f8affdb0ee7c;hp=a07ab19ccc2457a223cf71a0edd0a4511ba3de6c;hpb=185a13abc899e25fe7b8048b21a3b1dc1a7259b9;p=pcsx_rearmed.git diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index a07ab19c..fba1112d 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -28,6 +28,7 @@ #include "gpu.h" #include "ppf.h" #include "database.h" +#include "lightrec/plugin.h" #include char CdromId[10] = ""; @@ -254,7 +255,7 @@ int LoadCdrom() { incTime(); READTRACK(); - if (ptr != NULL) memcpy(ptr, buf+12, 2048); + if (ptr != INVALID_PTR) memcpy(ptr, buf+12, 2048); tmpHead.t_size -= 2048; tmpHead.t_addr += 2048; @@ -300,7 +301,7 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head) { READTRACK(); mem = PSXM(addr); - if (mem) + if (mem != INVALID_PTR) memcpy(mem, buf + 12, 2048); size -= 2048; @@ -489,7 +490,7 @@ int Load(const char *ExePath) { section_address = SWAP32(tmpHead.t_addr); section_size = SWAP32(tmpHead.t_size); mem = PSXM(section_address); - if (mem != NULL) { + if (mem != INVALID_PTR) { fseek(tmpFile, 0x800, SEEK_SET); fread_to_ram(mem, section_size, 1, tmpFile); psxCpu->Clear(section_address, section_size / 4); @@ -518,7 +519,7 @@ int Load(const char *ExePath) { EMU_LOG("Loading %08X bytes from %08X to %08X\n", section_size, ftell(tmpFile), section_address); #endif mem = PSXM(section_address); - if (mem != NULL) { + if (mem != INVALID_PTR) { fread_to_ram(mem, section_size, 1, tmpFile); psxCpu->Clear(section_address, section_size / 4); } @@ -603,15 +604,6 @@ static const char PcsxHeader[32] = "STv4 PCSX v" PCSX_VERSION; // If you make changes to the savestate version, please increment the value below. static const u32 SaveVersion = 0x8b410006; -static int drc_is_lightrec(void) -{ -#if defined(LIGHTREC) - return 1; -#else - return 0; -#endif -} - int SaveState(const char *file) { void *f; GPUFreeze_t *gpufP;