From 130984f52889f26121d54d7b1feecc15700a0f7a Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Fri, 2 Aug 2019 18:51:32 +0800 Subject: Use retro_log for SysPrintf --- frontend/libretro.c | 12 ++++++++++++ frontend/main.c | 2 ++ 2 files changed, 14 insertions(+) diff --git a/frontend/libretro.c b/frontend/libretro.c index e48069a..b8d17ab 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -2286,3 +2286,15 @@ int usleep (unsigned long us) sceKernelDelayThread(us); } #endif + +void SysPrintf(const char *fmt, ...) { + va_list list; + char msg[512]; + + va_start(list, fmt); + vsprintf(msg, fmt, list); + va_end(list); + + if (log_cb) + log_cb(RETRO_LOG_INFO, "%s", msg); +} diff --git a/frontend/main.c b/frontend/main.c index 860dec0..c0bfd0f 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -795,6 +795,7 @@ int emu_load_state(int slot) return LoadState(fname); } +#ifndef HAVE_LIBRETRO #ifndef ANDROID void SysPrintf(const char *fmt, ...) { @@ -819,6 +820,7 @@ void SysPrintf(const char *fmt, ...) { } #endif +#endif /* HAVE_LIBRETRO */ void SysMessage(const char *fmt, ...) { va_list list; -- cgit v1.2.3 From 202b29d49ef4a60bb3d616be9a26685e756dbaa4 Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Fri, 2 Aug 2019 19:02:52 +0800 Subject: Rename PACKAGE_VERSION to PCSX_VERSION - this should silence warning for another PACKAGE_VERSION define used for flac - PACKAGE_VERSION is not used within pcsx other than version logging. Savestate does not check for this and is using another define for savestate version number. --- include/config.h | 2 +- libpcsxcore/debug.c | 2 +- libpcsxcore/misc.c | 2 +- libpcsxcore/r3000a.c | 2 +- libpcsxcore/socket.c | 2 +- maemo/main.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/config.h b/include/config.h index ce2f3ea..362e4a4 100644 --- a/include/config.h +++ b/include/config.h @@ -1,2 +1,2 @@ #define MAXPATHLEN 256 -#define PACKAGE_VERSION "1.9" +#define PCSX_VERSION "1.9" diff --git a/libpcsxcore/debug.c b/libpcsxcore/debug.c index 763dc45..4ba7f57 100644 --- a/libpcsxcore/debug.c +++ b/libpcsxcore/debug.c @@ -445,7 +445,7 @@ static void ProcessCommands() { sprintf(reply, "200 %s\r\n", arguments == NULL ? "OK" : arguments); break; case 0x101: - sprintf(reply, "201 %s\r\n", PACKAGE_VERSION); + sprintf(reply, "201 %s\r\n", PCSX_VERSION); break; case 0x102: sprintf(reply, "202 1.0\r\n"); diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index bb34e5b..433d4be 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -557,7 +557,7 @@ struct PcsxSaveFuncs SaveFuncs = { zlib_open, zlib_read, zlib_write, zlib_seek, zlib_close }; -static const char PcsxHeader[32] = "STv4 PCSX v" PACKAGE_VERSION; +static const char PcsxHeader[32] = "STv4 PCSX v" PCSX_VERSION; // Savestate Versioning! // If you make changes to the savestate version, please increment the value below. diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 22341c5..0433c20 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -30,7 +30,7 @@ R3000Acpu *psxCpu = NULL; psxRegisters psxRegs; int psxInit() { - SysPrintf(_("Running PCSX Version %s (%s).\n"), PACKAGE_VERSION, __DATE__); + SysPrintf(_("Running PCSX Version %s (%s).\n"), PCSX_VERSION, __DATE__); #ifdef PSXREC if (Config.Cpu == CPU_INTERPRETER) { diff --git a/libpcsxcore/socket.c b/libpcsxcore/socket.c index c408bc3..df768e6 100644 --- a/libpcsxcore/socket.c +++ b/libpcsxcore/socket.c @@ -135,7 +135,7 @@ void GetClient() { } #endif - sprintf(hello, "000 PCSX Version %s - Debug console\r\n", PACKAGE_VERSION); + sprintf(hello, "000 PCSX Version %s - Debug console\r\n", PCSX_VERSION); WriteSocket(hello, strlen(hello)); ptr = 0; } diff --git a/maemo/main.c b/maemo/main.c index c382c51..50e129e 100644 --- a/maemo/main.c +++ b/maemo/main.c @@ -54,7 +54,7 @@ static void ChangeWorkingDirectory(char *exe) void PrintHelp() { - printf("PCSX-ReARMed version %s for Maemo\n\n", PACKAGE_VERSION); + printf("PCSX-ReARMed version %s for Maemo\n\n", PCSX_VERSION); printf("Usage:\n"); printf(" pcsx [options] -cdfile FILE\n\n"); -- cgit v1.2.3 From 0f288b5c9f0e792466a2e785e3090cd65f17c2de Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Fri, 2 Aug 2019 19:06:03 +0800 Subject: Silence warning: missing braces around initializer --- frontend/libretro_core_options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h index bdc214f..6513e1c 100644 --- a/frontend/libretro_core_options.h +++ b/frontend/libretro_core_options.h @@ -663,7 +663,7 @@ struct retro_core_option_definition option_defs_us[] = { }, #endif /* DRC_DISABLE */ - { NULL, NULL, NULL, { NULL, NULL }, NULL }, + { NULL, NULL, NULL, { {0} }, NULL }, }; /* RETRO_LANGUAGE_JAPANESE */ @@ -1183,7 +1183,7 @@ struct retro_core_option_definition option_defs_tr[] = { }, #endif /* DRC_DISABLE */ - { NULL, NULL, NULL, { NULL, NULL }, NULL }, + { NULL, NULL, NULL, { {0} }, NULL }, }; -- cgit v1.2.3 From cf4334ed9741d6247673fefa057b71926b2e1cfe Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Fri, 2 Aug 2019 19:37:20 +0800 Subject: Silence warning about misleading indent --- libpcsxcore/plugins.c | 12 ++++++------ plugins/dfxvideo/soft.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index afe3f3b..4f52ed2 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -1141,11 +1141,11 @@ void ReleasePlugins() { if (Config.UseNet && hNETDriver != NULL) NET_shutdown(); - if (hCDRDriver != NULL) SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; - if (hGPUDriver != NULL) SysCloseLibrary(hGPUDriver); hGPUDriver = NULL; - if (hSPUDriver != NULL) SysCloseLibrary(hSPUDriver); hSPUDriver = NULL; - if (hPAD1Driver != NULL) SysCloseLibrary(hPAD1Driver); hPAD1Driver = NULL; - if (hPAD2Driver != NULL) SysCloseLibrary(hPAD2Driver); hPAD2Driver = NULL; + if (hCDRDriver != NULL) { SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; } + if (hGPUDriver != NULL) { SysCloseLibrary(hGPUDriver); hGPUDriver = NULL; } + if (hSPUDriver != NULL) { SysCloseLibrary(hSPUDriver); hSPUDriver = NULL; } + if (hPAD1Driver != NULL) { SysCloseLibrary(hPAD1Driver); hPAD1Driver = NULL; } + if (hPAD2Driver != NULL) { SysCloseLibrary(hPAD2Driver); hPAD2Driver = NULL; } if (Config.UseNet && hNETDriver != NULL) { SysCloseLibrary(hNETDriver); hNETDriver = NULL; @@ -1164,7 +1164,7 @@ void ReleasePlugins() { int ReloadCdromPlugin() { if (hCDRDriver != NULL || cdrIsoActive()) CDR_shutdown(); - if (hCDRDriver != NULL) SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; + if (hCDRDriver != NULL) { SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; } if (UsingIso()) { LoadCDRplugin(NULL); diff --git a/plugins/dfxvideo/soft.c b/plugins/dfxvideo/soft.c index c1c3bef..1b22ed5 100644 --- a/plugins/dfxvideo/soft.c +++ b/plugins/dfxvideo/soft.c @@ -6316,6 +6316,7 @@ static void DrawSoftwareSpriteMirror(unsigned char * baseAddr,int32_t w,int32_t sprtYa=(sprtY<<10); clutP=(clutY0<<10)+clutX0; for (sprCY=0;sprCY>4)&0xf)])); GetTextureTransColG_SPR(&psxVuw[sprA+1],GETLE16(&psxVuw[clutP+(tC&0xf)])); } + } return; case 1: clutP>>=1; for(sprCY=0;sprCY