From 6f1915110fb549162b354987bf78d25349785711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 15 Aug 2020 15:22:44 +0200 Subject: [PATCH] Remove base/logging from UI and more --- Core/MIPS/ARM/ArmCompVFPUNEON.cpp | 6 ++---- Core/MIPS/ARM/ArmCompVFPUNEONUtil.cpp | 13 ++++++------- Core/MIPS/ARM/ArmJit.cpp | 3 ++- Core/MIPS/ARM/ArmRegCacheFPU.cpp | 12 ++++++------ Core/MIPS/ARM64/Arm64RegCacheFPU.cpp | 2 +- Core/MIPS/MIPS/MipsJit.cpp | 1 - Core/MIPS/MIPSTables.cpp | 1 - GPU/Common/VertexDecoderArm.cpp | 2 +- UI/ControlMappingScreen.cpp | 1 - UI/DisplayLayoutEditor.cpp | 1 + UI/EmuScreen.cpp | 6 +++--- UI/GameInfoCache.cpp | 2 +- UI/InstallZipScreen.cpp | 1 - UI/NativeApp.cpp | 4 +++- UI/TiltEventProcessor.cpp | 7 +++---- android/jni/OpenSLContext.cpp | 23 +++++++++++------------ 16 files changed, 40 insertions(+), 45 deletions(-) diff --git a/Core/MIPS/ARM/ArmCompVFPUNEON.cpp b/Core/MIPS/ARM/ArmCompVFPUNEON.cpp index 41961e944b..990e36e293 100644 --- a/Core/MIPS/ARM/ArmCompVFPUNEON.cpp +++ b/Core/MIPS/ARM/ArmCompVFPUNEON.cpp @@ -30,7 +30,6 @@ #include -#include "base/logging.h" #include "math/math_util.h" #include "Common/CPUDetect.h" @@ -55,8 +54,7 @@ // #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } #define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; } #define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } -#define DISABLE_UNKNOWN_PREFIX { WLOG("DISABLE: Unknown Prefix in %s", __FUNCTION__); fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } - +#define DISABLE_UNKNOWN_PREFIX { WARN_LOG(JIT, "DISABLE: Unknown Prefix in %s", __FUNCTION__); fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; } #define _RS MIPS_GET_RS(op) #define _RT MIPS_GET_RT(op) @@ -864,7 +862,7 @@ void ArmJit::CompNEON_Vmmul(MIPSOpcode op) { bool overlap = GetMatrixOverlap(_VD, _VS, msz) || GetMatrixOverlap(_VD, _VT, msz); if (overlap) { // Later. Fortunately, the VFPU also seems to prohibit overlap for matrix mul. - ILOG("Matrix overlap, ignoring."); + INFO_LOG(JIT, "Matrix overlap, ignoring."); DISABLE; } diff --git a/Core/MIPS/ARM/ArmCompVFPUNEONUtil.cpp b/Core/MIPS/ARM/ArmCompVFPUNEONUtil.cpp index 546c791a46..7fada69a92 100644 --- a/Core/MIPS/ARM/ArmCompVFPUNEONUtil.cpp +++ b/Core/MIPS/ARM/ArmCompVFPUNEONUtil.cpp @@ -30,7 +30,6 @@ #include -#include "base/logging.h" #include "math/math_util.h" #include "Common/CPUDetect.h" @@ -271,7 +270,7 @@ ArmJit::DestARMReg ArmJit::NEONMapPrefixD(int vreg, VectorSize sz, int mapFlags) dest.backingRd = dest.rd; } else { // Allocate a temporary register. - ELOG("PREFIXD: Write mask allocated! %i/%i", writeMask, full_mask); + ERROR_LOG(JIT, "PREFIXD: Write mask allocated! %i/%i", writeMask, full_mask); dest.rd = fpr.QAllocTemp(sz); dest.backingRd = fpr.QMapReg(vreg, sz, mapFlags & ~MAP_NOINIT); // Force initialization of the backing reg. } @@ -295,12 +294,12 @@ void ArmJit::NEONApplyPrefixD(DestARMReg dest) { if (sat1_mask && sat3_mask) { // Why would anyone do this? - ELOG("PREFIXD: Can't have both sat[0-1] and sat[-1-1] at the same time yet"); + ERROR_LOG(JIT, "PREFIXD: Can't have both sat[0-1] and sat[-1-1] at the same time yet"); } if (sat1_mask) { if (sat1_mask != full_mask) { - ELOG("PREFIXD: Can't have partial sat1 mask yet (%i vs %i)", sat1_mask, full_mask); + ERROR_LOG(JIT, "PREFIXD: Can't have partial sat1 mask yet (%i vs %i)", sat1_mask, full_mask); } if (IsD(dest.rd)) { VMOV_immf(D0, 0.0); @@ -317,7 +316,7 @@ void ArmJit::NEONApplyPrefixD(DestARMReg dest) { if (sat3_mask && sat1_mask != full_mask) { if (sat3_mask != full_mask) { - ELOG("PREFIXD: Can't have partial sat3 mask yet (%i vs %i)", sat3_mask, full_mask); + ERROR_LOG(JIT, "PREFIXD: Can't have partial sat3 mask yet (%i vs %i)", sat3_mask, full_mask); } if (IsD(dest.rd)) { VMOV_immf(D0, 0.0); @@ -341,11 +340,11 @@ void ArmJit::NEONApplyPrefixD(DestARMReg dest) { int writeMask = (~(js.prefixD >> 8)) & 0xF; if (writeMask == 3) { - ILOG("Doing writemask = 3"); + INFO_LOG(JIT, "Doing writemask = 3"); VMOV(D_0(dest.rd), D_0(dest.backingRd)); } else { // TODO - ELOG("PREFIXD: Arbitrary write masks not supported (%i / %i)", writeMask, full_mask); + ERROR_LOG(JIT, "PREFIXD: Arbitrary write masks not supported (%i / %i)", writeMask, full_mask); VMOV(dest.backingRd, dest.rd); } } diff --git a/Core/MIPS/ARM/ArmJit.cpp b/Core/MIPS/ARM/ArmJit.cpp index 1ff3c29ee8..829307b419 100644 --- a/Core/MIPS/ARM/ArmJit.cpp +++ b/Core/MIPS/ARM/ArmJit.cpp @@ -18,8 +18,9 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(ARM) -#include "base/logging.h" #include "profiler/profiler.h" + +#include "Common/Log.h" #include "Common/Serialize/Serializer.h" #include "Common/Serialize/SerializeFuncs.h" diff --git a/Core/MIPS/ARM/ArmRegCacheFPU.cpp b/Core/MIPS/ARM/ArmRegCacheFPU.cpp index a1378a67b3..21001b2b58 100644 --- a/Core/MIPS/ARM/ArmRegCacheFPU.cpp +++ b/Core/MIPS/ARM/ArmRegCacheFPU.cpp @@ -17,8 +17,8 @@ #include -#include "base/logging.h" #include "Common/CPUDetect.h" +#include "Common/Log.h" #include "Core/MIPS/MIPS.h" #include "Core/MIPS/ARM/ArmRegCacheFPU.h" #include "Core/MIPS/ARM/ArmJit.h" @@ -463,13 +463,13 @@ void ArmRegCacheFPU::FlushAll() { if (ar[a].isDirty) { if (m == -1) { - ILOG("ARM reg %i is dirty but has no mipsreg", a); + INFO_LOG(JIT, "ARM reg %i is dirty but has no mipsreg", a); continue; } int c = FlushGetSequential(a, GetNumARMFPURegs()); if (c == 1) { - // ILOG("Got single register: %i (%i)", a, m); + // INFO_LOG(JIT, "Got single register: %i (%i)", a, m); emit_->VSTR((ARMReg)(a + S0), CTXREG, GetMipsRegOffset(m)); } else if (c == 2) { // Probably not worth using VSTMIA for two. @@ -477,9 +477,9 @@ void ArmRegCacheFPU::FlushAll() { emit_->VSTR((ARMReg)(a + S0), CTXREG, offset); emit_->VSTR((ARMReg)(a + 1 + S0), CTXREG, offset + 4); } else { - // ILOG("Got sequence: %i at %i (%i)", c, a, m); + // INFO_LOG(JIT, "Got sequence: %i at %i (%i)", c, a, m); emit_->ADDI2R(SCRATCHREG1, CTXREG, GetMipsRegOffset(m), SCRATCHREG2); - // ILOG("VSTMIA R0, %i, %i", a, c); + // INFO_LOG(JIT, "VSTMIA R0, %i, %i", a, c); emit_->VSTMIA(SCRATCHREG1, false, (ARMReg)(S0 + a), c); } @@ -908,7 +908,7 @@ ARMReg ArmRegCacheFPU::QMapReg(int vreg, VectorSize sz, int flags) { // We didn't find the extra register, but we got a list of regs to flush. Flush 'em. // Here we can check for opportunities to do a "transpose-flush" of row vectors, etc. if (!quadsToFlush.empty()) { - ILOG("New mapping %s collided with %i quads, flushing them.", GetVectorNotation(vreg, sz), (int)quadsToFlush.size()); + INFO_LOG(JIT, "New mapping %s collided with %d quads, flushing them.", GetVectorNotation(vreg, sz), (int)quadsToFlush.size()); } for (size_t i = 0; i < quadsToFlush.size(); i++) { QFlush(quadsToFlush[i]); diff --git a/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp b/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp index 3861fb44a1..ebb0d09494 100644 --- a/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp +++ b/Core/MIPS/ARM64/Arm64RegCacheFPU.cpp @@ -400,7 +400,7 @@ void Arm64RegCacheFPU::FlushAll() { if (ar[a].isDirty) { if (m == -1) { - ILOG("ARM reg %i is dirty but has no mipsreg", a); + INFO_LOG(JIT, "ARM reg %i is dirty but has no mipsreg", a); continue; } diff --git a/Core/MIPS/MIPS/MipsJit.cpp b/Core/MIPS/MIPS/MipsJit.cpp index 345ff74018..0874282d50 100644 --- a/Core/MIPS/MIPS/MipsJit.cpp +++ b/Core/MIPS/MIPS/MipsJit.cpp @@ -18,7 +18,6 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(MIPS) -#include "base/logging.h" #include "profiler/profiler.h" #include "Common/Serialize/Serializer.h" #include "Core/Reporting.h" diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index d958c4cd2a..2270fc3630 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -28,7 +28,6 @@ #include "Core/CoreTiming.h" #include "Core/Reporting.h" #include "Core/Debugger/Breakpoints.h" -#include "base/logging.h" #include "JitCommon/JitCommon.h" diff --git a/GPU/Common/VertexDecoderArm.cpp b/GPU/Common/VertexDecoderArm.cpp index 5f9dd3371a..0feb2df100 100644 --- a/GPU/Common/VertexDecoderArm.cpp +++ b/GPU/Common/VertexDecoderArm.cpp @@ -16,6 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "ppsspp_config.h" + #if PPSSPP_ARCH(ARM) // This allows highlighting to work. Yay. @@ -25,7 +26,6 @@ #include -#include "base/logging.h" #include "Common/CPUDetect.h" #include "Core/Config.h" #include "Core/Reporting.h" diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 2008c19f50..3d711eda2f 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -20,7 +20,6 @@ #include #include "base/colorutil.h" -#include "base/logging.h" #include "base/display.h" #include "gfx/texture_atlas.h" #include "i18n/i18n.h" diff --git a/UI/DisplayLayoutEditor.cpp b/UI/DisplayLayoutEditor.cpp index 77da5f407e..6c3e6e1f5a 100644 --- a/UI/DisplayLayoutEditor.cpp +++ b/UI/DisplayLayoutEditor.cpp @@ -16,6 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include + #include "ui/ui_context.h" #include "UI/DisplayLayoutEditor.h" diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 59f5abed66..1d44551622 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -20,7 +20,6 @@ #include #include "base/display.h" -#include "base/logging.h" #include "base/timeutil.h" #include "profiler/profiler.h" @@ -38,6 +37,7 @@ #include "i18n/i18n.h" #include "Common/KeyMap.h" +#include "Common/Log.h" #ifndef MOBILE_DEVICE #include "Core/AVIDump.h" @@ -404,7 +404,7 @@ void EmuScreen::sendMessage(const char *message, const char *value) { std::string resetError; if (!PSP_InitStart(PSP_CoreParameter(), &resetError)) { - ELOG("Error resetting: %s", resetError.c_str()); + ERROR_LOG(LOADER, "Error resetting: %s", resetError.c_str()); stopRender_ = true; screenManager()->switchScreen(new MainScreen()); System_SendMessage("event", "failstartgame"); @@ -856,7 +856,7 @@ void EmuScreen::pspKey(int pspKeyCode, int flags) { onVKeyUp(pspKeyCode); } } else { - // ILOG("pspKey %i %i", pspKeyCode, flags); + // INFO_LOG(SYSTEM, "pspKey %i %i", pspKeyCode, flags); if (flags & KEY_DOWN) __CtrlButtonDown(pspKeyCode); if (flags & KEY_UP) diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 4b1746fb2b..1fa929f5a4 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -22,13 +22,13 @@ #include #include -#include "base/logging.h" #include "base/timeutil.h" #include "base/stringutil.h" #include "file/file_util.h" #include "file/zip_read.h" #include "thin3d/thin3d.h" #include "thread/prioritizedworkqueue.h" + #include "Common/FileUtil.h" #include "Common/StringUtils.h" #include "Core/FileSystems/ISOFileSystem.h" diff --git a/UI/InstallZipScreen.cpp b/UI/InstallZipScreen.cpp index 873ddaf0c5..3a586b776b 100644 --- a/UI/InstallZipScreen.cpp +++ b/UI/InstallZipScreen.cpp @@ -15,7 +15,6 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "base/logging.h" #include "i18n/i18n.h" #include "ui/ui.h" #include "ui/view.h" diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 3db216d802..919d7ce2f6 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -44,7 +44,9 @@ #endif #include "base/display.h" -#include "base/logging.h" + +#include "base/logging.h" // For "AndroidLogger". TODO: Remove. + #include "base/stringutil.h" #include "base/timeutil.h" #include "base/NativeApp.h" diff --git a/UI/TiltEventProcessor.cpp b/UI/TiltEventProcessor.cpp index 97b5bcd90a..2f66906239 100644 --- a/UI/TiltEventProcessor.cpp +++ b/UI/TiltEventProcessor.cpp @@ -1,11 +1,10 @@ #define _USE_MATH_DEFINES + #include -#include "UI/TiltEventProcessor.h" + #include "Core/Config.h" #include "Core/HLE/sceCtrl.h" -#include "math.h" -#include "base/logging.h" - +#include "UI/TiltEventProcessor.h" using namespace TiltEventProcessor; diff --git a/android/jni/OpenSLContext.cpp b/android/jni/OpenSLContext.cpp index 26965a72d5..77ccfde2eb 100644 --- a/android/jni/OpenSLContext.cpp +++ b/android/jni/OpenSLContext.cpp @@ -9,7 +9,6 @@ #include #include -#include "base/logging.h" #include "Common/Log.h" #include "OpenSLContext.h" @@ -24,7 +23,7 @@ void OpenSLContext::bqPlayerCallbackWrap(SLAndroidSimpleBufferQueueItf bq, void void OpenSLContext::BqPlayerCallback(SLAndroidSimpleBufferQueueItf bq) { if (bq != bqPlayerBufferQueue) { - ELOG("OpenSL: Wrong bq!"); + ERROR_LOG(AUDIO, "OpenSL: Wrong bq!"); return; } @@ -41,7 +40,7 @@ void OpenSLContext::BqPlayerCallback(SLAndroidSimpleBufferQueueItf bq) { // the most likely other result is SL_RESULT_BUFFER_INSUFFICIENT, // which for this code example would indicate a programming error if (result != SL_RESULT_SUCCESS) { - ELOG("OpenSL: Failed to enqueue! %i %i", renderedFrames, sizeInBytes); + ERROR_LOG(AUDIO, "OpenSL: Failed to enqueue! %i %i", renderedFrames, sizeInBytes); } curBuffer += 1; // Switch buffer @@ -58,7 +57,7 @@ bool OpenSLContext::Init() { // create engine result = slCreateEngine(&engineObject, 0, NULL, 0, NULL, NULL); if (result != SL_RESULT_SUCCESS) { - ELOG("OpenSL: Failed to create the engine: %d", (int)result); + ERROR_LOG(AUDIO, "OpenSL: Failed to create the engine: %d", (int)result); engineObject = nullptr; return false; } @@ -70,7 +69,7 @@ bool OpenSLContext::Init() { result = (*engineEngine)->CreateOutputMix(engineEngine, &outputMixObject, 0, 0, 0); if (result != SL_RESULT_SUCCESS) { - ELOG("OpenSL: Failed to create output mix: %d", (int)result); + ERROR_LOG(AUDIO, "OpenSL: Failed to create output mix: %d", (int)result); (*engineObject)->Destroy(engineObject); engineEngine = nullptr; engineObject = nullptr; @@ -104,7 +103,7 @@ bool OpenSLContext::Init() { const SLboolean req[2] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE}; result = (*engineEngine)->CreateAudioPlayer(engineEngine, &bqPlayerObject, &audioSrc, &audioSnk, 2, ids, req); if (result != SL_RESULT_SUCCESS) { - ELOG("OpenSL: CreateAudioPlayer failed: %d", (int)result); + ERROR_LOG(AUDIO, "OpenSL: CreateAudioPlayer failed: %d", (int)result); (*outputMixObject)->Destroy(outputMixObject); outputMixObject = nullptr; @@ -149,15 +148,15 @@ bool OpenSLContext::Init() { // shut down the native audio system OpenSLContext::~OpenSLContext() { if (bqPlayerPlay) { - ILOG("OpenSL: Shutdown - stopping playback"); + INFO_LOG(AUDIO, "OpenSL: Shutdown - stopping playback"); SLresult result; result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_STOPPED); if (SL_RESULT_SUCCESS != result) { - ELOG("SetPlayState failed"); + ERROR_LOG(AUDIO, "SetPlayState failed"); } } - ILOG("OpenSL: Shutdown - deleting player object"); + INFO_LOG(AUDIO, "OpenSL: Shutdown - deleting player object"); if (bqPlayerObject) { (*bqPlayerObject)->Destroy(bqPlayerObject); @@ -167,14 +166,14 @@ OpenSLContext::~OpenSLContext() { bqPlayerVolume = nullptr; } - ILOG("OpenSL: Shutdown - deleting mix object"); + INFO_LOG(AUDIO, "OpenSL: Shutdown - deleting mix object"); if (outputMixObject) { (*outputMixObject)->Destroy(outputMixObject); outputMixObject = nullptr; } - ILOG("OpenSL: Shutdown - deleting engine object"); + INFO_LOG(AUDIO, "OpenSL: Shutdown - deleting engine object"); if (engineObject) { (*engineObject)->Destroy(engineObject); @@ -186,6 +185,6 @@ OpenSLContext::~OpenSLContext() { delete[] buffer[i]; buffer[i] = nullptr; } - ILOG("OpenSL: Shutdown - finished"); + INFO_LOG(AUDIO, "OpenSL: Shutdown - finished"); }