Getting really close to getting rid of base/logging.h now.

Qt buildfix
This commit is contained in:
Henrik Rydgård committed 2020-08-15 19:09:01 +02:00
1 parent b22083e7a6
commit 80e0f85332
21 files changed
+113 -199

No files matched your search

-1
View File
@@ -17,7 +17,6 @@
#include <memory.h>
#include "base/logging.h"
#include "base/basictypes.h"
#include "Common.h"
#include "CPUDetect.h"
+4
View File
@@ -18,6 +18,7 @@
#include "ppsspp_config.h"
#include <algorithm>
#include <cstring>
#include "util/text/utf8.h"
#include "LogManager.h"
@@ -46,6 +47,9 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char
LogManager *instance = LogManager::GetInstance();
if (instance) {
instance->Log(level, type, file, line, fmt, args);
} else {
// Fall back to printf if we're before the log manager has been initialized.
vprintf(fmt, args);
}
va_end(args);
}
-68
View File
@@ -1,68 +0,0 @@
// Copyright (C) 2003 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <memory.h>
#include "base/logging.h"
#include "base/basictypes.h"
#include "Common.h"
#include "CPUDetect.h"
#include "StringUtils.h"
CPUInfo cpu_info;
CPUInfo::CPUInfo() {
Detect();
}
// Detects the various cpu features
void CPUInfo::Detect()
{
memset(this, 0, sizeof(*this));
num_cores = 3;
strcpy(cpu_string, "Xenon");
strcpy(brand_string, "Microsoft");
memset(cpu_string, 0, sizeof(cpu_string));
HTT = true;
logical_cpu_count = 2;
}
// Turn the cpu info into a string we can show
std::string CPUInfo::Summarize()
{
std::string sum;
if (num_cores == 1)
sum = StringFromFormat("%s, %i core", cpu_string, num_cores);
else
{
sum = StringFromFormat("%s, %i cores", cpu_string, num_cores);
if (HTT) sum += StringFromFormat(" (%i logical threads per physical core)", logical_cpu_count);
}
if (bSSE) sum += ", SSE";
if (bSSE2) sum += ", SSE2";
if (bSSE3) sum += ", SSE3";
if (bSSSE3) sum += ", SSSE3";
if (bSSE4_1) sum += ", SSE4.1";
if (bSSE4_2) sum += ", SSE4.2";
if (HTT) sum += ", HTT";
if (bAVX) sum += ", AVX";
if (bAES) sum += ", AES";
if (bLongMode) sum += ", 64-bit support";
return sum;
}
-1
View File
@@ -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 "Common/Serialize/Serializer.h"
#include "Core/Reporting.h"
#include "Core/Config.h"
-1
View File
@@ -18,7 +18,6 @@
//TODO: Doesn't build, FIXME!
#if 0
#include "base/logging.h"
#include "Common/CPUDetect.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
+15 -15
View File
@@ -71,23 +71,23 @@ static void InitSDLAudioDevice() {
if (!g_Config.sAudioDevice.empty()) {
audioDev = SDL_OpenAudioDevice(g_Config.sAudioDevice.c_str(), 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
if (audioDev <= 0) {
WLOG("Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str());
WARN_LOG(AUDIO, "Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str());
}
}
if (audioDev <= 0) {
audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
}
if (audioDev <= 0) {
ELOG("Failed to open audio: %s", SDL_GetError());
ERROR_LOG(AUDIO, "Failed to open audio: %s", SDL_GetError());
} else {
if (g_retFmt.samples != fmt.samples) // Notify, but still use it
ELOG("Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
ERROR_LOG(AUDIO, "Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
if (g_retFmt.format != fmt.format || g_retFmt.channels != fmt.channels) {
ELOG("Sound buffer format does not match requested format.");
ELOG("Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ELOG("Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ELOG("Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ELOG("Provided output format does not match requirement, turning audio off");
ERROR_LOG(AUDIO, "Sound buffer format does not match requested format.");
ERROR_LOG(AUDIO, "Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ERROR_LOG(AUDIO, "Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ERROR_LOG(AUDIO, "Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ERROR_LOG(AUDIO, "Provided output format does not match requirement, turning audio off");
SDL_CloseAudioDevice(audioDev);
}
SDL_PauseAudioDevice(audioDev, 0);
@@ -343,9 +343,9 @@ MainUI::MainUI(QWidget *parent)
}
MainUI::~MainUI() {
ILOG("MainUI::Destructor");
INFO_LOG(SYSTEM, "MainUI::Destructor");
if (emuThreadState != (int)EmuThreadState::DISABLED) {
ILOG("EmuThreadStop");
INFO_LOG(SYSTEM, "EmuThreadStop");
EmuThreadStop();
while (graphicsContext->ThreadFrame()) {
// Need to keep eating frames to allow the EmuThread to exit correctly.
@@ -525,7 +525,7 @@ bool MainUI::event(QEvent *e) {
void MainUI::initializeGL() {
if (g_Config.iGPUBackend != (int)GPUBackend::OPENGL) {
ILOG("Only GL supported under Qt - switching.");
INFO_LOG(SYSTEM, "Only GL supported under Qt - switching.");
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
}
@@ -545,12 +545,12 @@ void MainUI::initializeGL() {
#endif
if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL) {
// OpenGL uses a background thread to do the main processing and only renders on the gl thread.
ILOG("Initializing GL graphics context");
INFO_LOG(SYSTEM, "Initializing GL graphics context");
graphicsContext = new QtGLGraphicsContext();
ILOG("Using thread, starting emu thread");
INFO_LOG(SYSTEM, "Using thread, starting emu thread");
EmuThreadStart();
} else {
ILOG("Not using thread, backend=%d", (int)g_Config.iGPUBackend);
INFO_LOG(SYSTEM, "Not using thread, backend=%d", (int)g_Config.iGPUBackend);
}
graphicsContext->ThreadStart();
}
@@ -714,7 +714,7 @@ int main(int argc, char *argv[])
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
int ret = mainInternal(a);
ILOG("Left mainInternal here.");
INFO_LOG(SYSTEM, "Left mainInternal here.");
#ifdef SDL
if (audioDev > 0) {
+1 -1
View File
@@ -425,7 +425,7 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, std:
});
renderManager_->SetSwapIntervalFunction([&](int interval) {
ILOG("SDL SwapInterval: %d", interval);
INFO_LOG(G3D, "SDL SwapInterval: %d", interval);
SDL_GL_SetSwapInterval(interval);
});
window_ = window;
+15 -16
View File
@@ -22,7 +22,6 @@ SDLJoystick *joystick = NULL;
#include <locale>
#include "base/display.h"
#include "base/logging.h" // early logging. TODO: Remove.
#include "base/timeutil.h"
#include "ext/glslang/glslang/Public/ShaderLang.h"
#include "image/png_load.h"
@@ -110,24 +109,24 @@ static void InitSDLAudioDevice(const std::string &name = "") {
if (!startDevice.empty()) {
audioDev = SDL_OpenAudioDevice(startDevice.c_str(), 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
if (audioDev <= 0) {
WLOG("Failed to open audio device: %s", startDevice.c_str());
WARN_LOG(AUDIO, "Failed to open audio device: %s", startDevice.c_str());
}
}
if (audioDev <= 0) {
ILOG("SDL: Trying a different audio device");
INFO_LOG(AUDIO, "SDL: Trying a different audio device");
audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
}
if (audioDev <= 0) {
ELOG("Failed to open audio device: %s", SDL_GetError());
ERROR_LOG(AUDIO, "Failed to open audio device: %s", SDL_GetError());
} else {
if (g_retFmt.samples != fmt.samples) // Notify, but still use it
ELOG("Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
ERROR_LOG(AUDIO, "Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
if (g_retFmt.format != fmt.format || g_retFmt.channels != fmt.channels) {
ELOG("Sound buffer format does not match requested format.");
ELOG("Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ELOG("Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ELOG("Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ELOG("Provided output format does not match requirement, turning audio off");
ERROR_LOG(AUDIO, "Sound buffer format does not match requested format.");
ERROR_LOG(AUDIO, "Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ERROR_LOG(AUDIO, "Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ERROR_LOG(AUDIO, "Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ERROR_LOG(AUDIO, "Provided output format does not match requirement, turning audio off");
SDL_CloseAudioDevice(audioDev);
}
SDL_PauseAudioDevice(audioDev, 0);
@@ -206,7 +205,7 @@ void LaunchBrowser(const char *url) {
webWifiCreate(&conf, NULL, url, uuid, 0);
webWifiShow(&conf, NULL);
#elif defined(MOBILE_DEVICE)
ILOG("Would have gone to %s but LaunchBrowser is not implemented on this platform", url);
INFO_LOG(SYSTEM, "Would have gone to %s but LaunchBrowser is not implemented on this platform", url);
#elif defined(_WIN32)
std::wstring wurl = ConvertUTF8ToWString(url);
ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL);
@@ -217,7 +216,7 @@ void LaunchBrowser(const char *url) {
std::string command = std::string("xdg-open ") + url;
int err = system(command.c_str());
if (err) {
ILOG("Would have gone to %s but xdg-utils seems not to be installed", url)
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url);
}
#endif
}
@@ -229,7 +228,7 @@ void LaunchMarket(const char *url) {
webWifiCreate(&conf, NULL, url, uuid, 0);
webWifiShow(&conf, NULL);
#elif defined(MOBILE_DEVICE)
ILOG("Would have gone to %s but LaunchMarket is not implemented on this platform", url);
INFO_LOG(SYSTEM, "Would have gone to %s but LaunchMarket is not implemented on this platform", url);
#elif defined(_WIN32)
std::wstring wurl = ConvertUTF8ToWString(url);
ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL);
@@ -240,14 +239,14 @@ void LaunchMarket(const char *url) {
std::string command = std::string("xdg-open ") + url;
int err = system(command.c_str());
if (err) {
ILOG("Would have gone to %s but xdg-utils seems not to be installed", url)
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url);
}
#endif
}
void LaunchEmail(const char *email_address) {
#if defined(MOBILE_DEVICE)
ILOG("Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address);
INFO_LOG(SYSTEM, "Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address);
#elif defined(_WIN32)
std::wstring mailto = std::wstring(L"mailto:") + ConvertUTF8ToWString(email_address);
ShellExecute(NULL, L"open", mailto.c_str(), NULL, NULL, SW_SHOWNORMAL);
@@ -258,7 +257,7 @@ void LaunchEmail(const char *email_address) {
std::string command = std::string("xdg-email ") + email_address;
int err = system(command.c_str());
if (err) {
ILOG("Would have gone to %s but xdg-utils seems not to be installed", email_address)
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", email_address);
}
#endif
}
+19 -19
View File
@@ -237,7 +237,7 @@ void QtHost::ShutdownSound() { }
std::string NativeQueryConfig(std::string query) {
char temp[128];
if (query == "screenRotation") {
ILOG("g_Config.screenRotation = %d", g_Config.iScreenRotation);
INFO_LOG(G3D, "g_Config.screenRotation = %d", g_Config.iScreenRotation);
snprintf(temp, sizeof(temp), "%d", g_Config.iScreenRotation);
return std::string(temp);
} else if (query == "immersiveMode") {
@@ -357,7 +357,7 @@ static void PostLoadConfig() {
void CreateDirectoriesAndroid() {
// On Android, create a PSP directory tree in the external_dir,
// to hopefully reduce confusion a bit.
ILOG("Creating %s", (g_Config.memStickDirectory + "PSP").c_str());
INFO_LOG(IO, "Creating %s", (g_Config.memStickDirectory + "PSP").c_str());
File::CreateFullPath(g_Config.memStickDirectory + "PSP");
File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVEDATA));
File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVESTATE));
@@ -608,21 +608,21 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
// don't already have one.
if (!gotBootFilename) {
gotBootFilename = true;
ILOG("Boot filename found in args: '%s'", argv[i]);
INFO_LOG(SYSTEM, "Boot filename found in args: '%s'", argv[i]);
bool okToLoad = true;
bool okToCheck = true;
if (System_GetPropertyBool(SYSPROP_SUPPORTS_PERMISSIONS)) {
PermissionStatus status = System_GetPermissionStatus(SYSTEM_PERMISSION_STORAGE);
if (status == PERMISSION_STATUS_DENIED) {
ELOG("Storage permission denied. Launching without argument.");
ERROR_LOG(IO, "Storage permission denied. Launching without argument.");
okToLoad = false;
okToCheck = false;
} else if (status != PERMISSION_STATUS_GRANTED) {
ELOG("Storage permission not granted. Launching without argument check.");
ERROR_LOG(IO, "Storage permission not granted. Launching without argument check.");
okToCheck = false;
} else {
ILOG("Storage permission granted.");
INFO_LOG(IO, "Storage permission granted.");
}
}
if (okToLoad) {
@@ -812,7 +812,7 @@ void RenderOverlays(UIContext *dc, void *userdata);
bool CreateGlobalPipelines();
bool NativeInitGraphics(GraphicsContext *graphicsContext) {
ILOG("NativeInitGraphics");
INFO_LOG(SYSTEM, "NativeInitGraphics");
// We set this now so any resize during init is processed later.
resized = false;
@@ -881,7 +881,7 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
gpu->DeviceRestore();
}
ILOG("NativeInitGraphics completed");
INFO_LOG(SYSTEM, "NativeInitGraphics completed");
return true;
}
@@ -931,7 +931,7 @@ void NativeShutdownGraphics() {
if (gpu)
gpu->DeviceLost();
ILOG("NativeShutdownGraphics");
INFO_LOG(SYSTEM, "NativeShutdownGraphics");
#if PPSSPP_PLATFORM(WINDOWS)
delete winAudioBackend;
@@ -973,7 +973,7 @@ void NativeShutdownGraphics() {
texColorPipeline = nullptr;
}
ILOG("NativeShutdownGraphics done");
INFO_LOG(SYSTEM, "NativeShutdownGraphics done");
}
void TakeScreenshot() {
@@ -1090,7 +1090,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
}
if (resized) {
ILOG("Resized flag set - recalculating bounds");
INFO_LOG(G3D, "Resized flag set - recalculating bounds");
resized = false;
if (uiContext) {
@@ -1119,7 +1119,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
NativeMessageReceived("gpu_resized", "");
#endif
} else {
// ILOG("Polling graphics context");
// INFO_LOG(G3D, "Polling graphics context");
graphicsContext->Poll();
}
@@ -1179,7 +1179,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
// Ideally we should simply reinitialize graphics to the mode from the config, but there are potential issues
// and I can't risk it before 1.9.0.
int gpuBackend = g_Config.iGPUBackend;
ILOG("Reloading config after storage permission grant.");
INFO_LOG(IO, "Reloading config after storage permission grant.");
g_Config.Reload();
PostLoadConfig();
g_Config.iGPUBackend = gpuBackend;
@@ -1218,16 +1218,16 @@ void NativeUpdate() {
bool NativeIsAtTopLevel() {
// This might need some synchronization?
if (!screenManager) {
ELOG("No screen manager active");
ERROR_LOG(SYSTEM, "No screen manager active");
return false;
}
Screen *currentScreen = screenManager->topScreen();
if (currentScreen) {
bool top = currentScreen->isTopLevel();
ILOG("Screen toplevel: %i", (int)top);
INFO_LOG(SYSTEM, "Screen toplevel: %i", (int)top);
return currentScreen->isTopLevel();
} else {
ELOG("No current screen");
ERROR_LOG(SYSTEM, "No current screen");
return false;
}
}
@@ -1246,7 +1246,7 @@ bool NativeTouch(const TouchInput &touch) {
}
bool NativeKey(const KeyInput &key) {
// ILOG("Key code: %i flags: %i", key.keyCode, key.flags);
// INFO_LOG(SYSTEM, "Key code: %i flags: %i", key.keyCode, key.flags);
#if !defined(MOBILE_DEVICE)
if (g_Config.bPauseExitsEmulator) {
static std::vector<int> pspKeys;
@@ -1364,7 +1364,7 @@ void NativeInputBoxReceived(std::function<void(bool, const std::string &)> cb, b
void NativeResized() {
// NativeResized can come from any thread so we just set a flag, then process it later.
ILOG("NativeResized - setting flag");
INFO_LOG(G3D, "NativeResized - setting flag");
resized = true;
}
@@ -1398,7 +1398,7 @@ void NativeShutdown() {
moncleanup();
#endif
ILOG("NativeShutdown called");
INFO_LOG(SYSTEM, "NativeShutdown called");
ShutdownWebServer();
+2 -2
View File
@@ -505,7 +505,7 @@ std::string GetCPUBrandString() {
}
catch (const std::exception & e) {
const char* what = e.what();
ILOG("%s", what);
INFO_LOG(SYSTEM, "%s", what);
}
if (cpu_id != nullptr) {
@@ -527,7 +527,7 @@ std::string GetCPUBrandString() {
}
catch (const std::exception & e) {
const char* what = e.what();
ILOG("%s", what);
INFO_LOG(SYSTEM, "%s", what);
}
}
+4 -4
View File
@@ -43,7 +43,7 @@ void StorageFileLoader::threadfunc() {
operationFailed_ = true;
// TODO: What do we do?
const char *what = e.what();
ILOG("%s", what);
INFO_LOG(SYSTEM, "%s", what);
}
catch (Platform::COMException ^e) {
@@ -57,11 +57,11 @@ void StorageFileLoader::threadfunc() {
}
catch (const std::exception& e) {
const char *what = e.what();
ILOG("%s", what);
INFO_LOG(SYSTEM, "%s", what);
}
catch (Platform::COMException ^e) {
std::string what = FromPlatformString(e->ToString());
ILOG("%s", what.c_str());
INFO_LOG(SYSTEM, "%s", what.c_str());
}
initMutex.unlock();
@@ -85,7 +85,7 @@ void StorageFileLoader::threadfunc() {
} catch (const std::exception& e) {
operationFailed_ = true;
const char *what = e.what();
ILOG("%s", what);
INFO_LOG(SYSTEM, "%s", what);
}
operationRequested_ = false;
std::unique_lock<std::mutex> lock(mutexResponse_);
+12 -13
View File
@@ -1,8 +1,7 @@
#include "base/logging.h"
#include "Common/Arm64Emitter.h"
#include "Common/BitSet.h"
#include "Common/CPUDetect.h"
#include "Common/Log.h"
static bool functionWasCalled;
@@ -67,11 +66,11 @@ void Arm64EmitterTest() {
return;
for (int i = 0; i < 6; i++) {
ILOG("---------------------------");
INFO_LOG(SYSTEM, "---------------------------");
}
ILOG("---------------------------");
ILOG("Running ARM64 emitter test!");
ILOG("---------------------------");
INFO_LOG(SYSTEM, "---------------------------");
INFO_LOG(SYSTEM, "Running ARM64 emitter test!");
INFO_LOG(SYSTEM, "---------------------------");
TestCode gen;
gen.ReserveCodeSpace(0x1000);
@@ -79,15 +78,15 @@ void Arm64EmitterTest() {
gen.Generate();
u32 retval = CallPtr(gen.testCodePtr);
ILOG("Returned %d", retval);
// ILOG("ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval);
INFO_LOG(SYSTEM, "Returned %d", retval);
// INFO_LOG(SYSTEM, "ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval);
/*
ILOG("x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]);
ILOG("y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]);
ILOG("z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]);
ILOG("c: %f %f %f %f", c[0], c[1], c[2], c[3]);*/
INFO_LOG(SYSTEM, "x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]);
INFO_LOG(SYSTEM, "y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]);
INFO_LOG(SYSTEM, "z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]);
INFO_LOG(SYSTEM, "c: %f %f %f %f", c[0], c[1], c[2], c[3]);*/
for (int i = 0; i < 6; i++) {
ILOG("--------------------------");
INFO_LOG(SYSTEM, "--------------------------");
}
// DisassembleArm(codeStart, gen.GetCodePtr()-codeStart);
}
+11 -12
View File
@@ -1,4 +1,3 @@
#include "base/logging.h"
#include "ArmEmitterTest.h"
#include "Common/ArmEmitter.h"
@@ -70,7 +69,7 @@ void TestCode::Generate()
VST1(I_32, D6, R3, 2);
PLD(R1, 32);
u32 word = *(u32 *)(GetCodePtr() - 4);
ILOG("Instruction Word: %08x", word);
INFO_LOG(SYSTEM, "Instruction Word: %08x", word);
// This works!
@@ -122,11 +121,11 @@ void ArmEmitterTest()
return;
for (int i = 0; i < 6; i++) {
ILOG("--------------------------");
INFO_LOG(SYSTEM, "--------------------------");
}
ILOG("--------------------------");
ILOG("Running ARM emitter test!");
ILOG("--------------------------");
INFO_LOG(SYSTEM, "--------------------------");
INFO_LOG(SYSTEM, "Running ARM emitter test!");
INFO_LOG(SYSTEM, "--------------------------");
TestCode gen;
gen.ReserveCodeSpace(0x1000);
@@ -134,13 +133,13 @@ void ArmEmitterTest()
gen.Generate();
u32 retval = CallPtr(gen.testCodePtr);
// ILOG("ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval);
ILOG("x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]);
ILOG("y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]);
ILOG("z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]);
ILOG("c: %f %f %f %f", c[0], c[1], c[2], c[3]);
// INFO_LOG(SYSTEM, "ARM emitter test 1 passed if %f == 3.0! retval = %08x", abc[32 + 31], retval);
INFO_LOG(SYSTEM, "x: %08x %08x %08x %08x", x[0], x[1], x[2], x[3]);
INFO_LOG(SYSTEM, "y: %08x %08x %08x %08x", y[0], y[1], y[2], y[3]);
INFO_LOG(SYSTEM, "z: %08x %08x %08x %08x", z[0], z[1], z[2], z[3]);
INFO_LOG(SYSTEM, "c: %f %f %f %f", c[0], c[1], c[2], c[3]);
for (int i = 0; i < 6; i++) {
ILOG("--------------------------");
INFO_LOG(SYSTEM, "--------------------------");
}
// DisassembleArm(codeStart, gen.GetCodePtr()-codeStart);
}
+9 -9
View File
@@ -28,9 +28,9 @@
#include "ppsspp_config.h"
#include "base/basictypes.h"
#include "base/display.h"
#include "base/logging.h"
#include "Common/FileUtil.h"
#include "Common/Log.h"
#include "Core/Core.h"
#include "Core/System.h"
#include "Core/Config.h"
@@ -112,11 +112,11 @@ bool RunTests() {
coreParam.fileToStart = baseDirectory + "pspautotests/tests/" + testName + ".prx";
std::string expectedFile = baseDirectory + "pspautotests/tests/" + testName + ".expected";
ILOG("Preparing to execute '%s'", testName);
INFO_LOG(SYSTEM, "Preparing to execute '%s'", testName);
std::string error_string;
output = "";
if (!PSP_Init(coreParam, &error_string)) {
ELOG("Failed to init unittest %s : %s", testsToRun[i], error_string.c_str());
ERROR_LOG(SYSTEM, "Failed to init unittest %s : %s", testsToRun[i], error_string.c_str());
PSP_CoreParameter().pixelWidth = pixel_xres;
PSP_CoreParameter().pixelHeight = pixel_yres;
return false;
@@ -125,7 +125,7 @@ bool RunTests() {
PSP_BeginHostFrame();
// Run the emu until the test exits
ILOG("Test: Entering runloop.");
INFO_LOG(SYSTEM, "Test: Entering runloop.");
while (true) {
int blockTicks = usToCycles(1000000 / 10);
while (coreState == CORE_RUNNING) {
@@ -136,7 +136,7 @@ bool RunTests() {
// set back to running for the next frame
coreState = CORE_RUNNING;
} else if (coreState == CORE_POWERDOWN) {
ILOG("Finished running test %s", testName);
INFO_LOG(SYSTEM, "Finished running test %s", testName);
break;
}
}
@@ -144,7 +144,7 @@ bool RunTests() {
std::ifstream expected(expectedFile.c_str(), std::ios_base::in);
if (!expected) {
ELOG("Error opening expectedFile %s", expectedFile.c_str());
ERROR_LOG(SYSTEM, "Error opening expectedFile %s", expectedFile.c_str());
break;
}
@@ -160,9 +160,9 @@ bool RunTests() {
e = TrimNewlines(e);
o = TrimNewlines(o);
if (e != o) {
ELOG("DIFF on line %i!", line);
ELOG("O: %s", o.c_str());
ELOG("E: %s", e.c_str());
ERROR_LOG(SYSTEM, "DIFF on line %i!", line);
ERROR_LOG(SYSTEM, "O: %s", o.c_str());
ERROR_LOG(SYSTEM, "E: %s", e.c_str());
}
if (expected.eof()) {
break;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "base/logging.h"
#include <cstring>
const char *GetFn(const char *fn) {
const char *p = strrchr(fn, '\\');
+3 -3
View File
@@ -301,7 +301,7 @@ uint8_t *VFSReadFile(const char *filename, size_t *size) {
if (prefix_len >= fn_len) continue;
if (0 == memcmp(filename, entries[i].prefix, prefix_len)) {
fileSystemFound = true;
// ILOG("Prefix match: %s (%s) -> %s", entries[i].prefix, filename, filename + prefix_len);
// INFO_LOG(IO, "Prefix match: %s (%s) -> %s", entries[i].prefix, filename, filename + prefix_len);
uint8_t *data = entries[i].reader->ReadAsset(filename + prefix_len, size);
if (data)
return data;
@@ -319,7 +319,7 @@ uint8_t *VFSReadFile(const char *filename, size_t *size) {
bool VFSGetFileListing(const char *path, std::vector<FileInfo> *listing, const char *filter) {
if (IsLocalPath(path)) {
// Local path, not VFS.
// ILOG("Not a VFS path: %s . Reading local directory.", path);
// INFO_LOG(IO, "Not a VFS path: %s . Reading local directory.", path);
getFilesInDir(path, listing, filter);
return true;
}
@@ -346,7 +346,7 @@ bool VFSGetFileListing(const char *path, std::vector<FileInfo> *listing, const c
bool VFSGetFileInfo(const char *path, FileInfo *info) {
if (IsLocalPath(path)) {
// Local path, not VFS.
// ILOG("Not a VFS path: %s . Getting local file info.", path);
// INFO_LOG(IO, "Not a VFS path: %s . Getting local file info.", path);
return getFileInfo(path, info);
}
+1 -1
View File
@@ -134,7 +134,7 @@ void TextDrawerQt::DrawStringBitmap(std::vector<uint8_t> &bitmapData, TextString
}
}
} else {
_assert_msg_("Bad TextDrawer format");
_assert_msg_(false, "Bad TextDrawer format");
}
}
+4 -4
View File
@@ -91,15 +91,15 @@ TextDrawerUWP::TextDrawerUWP(Draw::DrawContext *draw) : TextDrawer(draw), ctx_(n
// Create D2D Device and DeviceContext.
// TODO: We have one sitting right in DX::DeviceResource, there might be a way to use that instead.
hr = m_d2dFactory->CreateDevice(dxgiDevice, &m_d2dDevice);
if (FAILED(hr)) FLOG("D2D CreateDevice failed");
if (FAILED(hr)) _assert_msg_(false, "D2D CreateDevice failed");
hr = m_d2dDevice->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &m_d2dContext);
if (FAILED(hr)) FLOG("D2D CreateDeviceContext failed");
if (FAILED(hr)) _assert_msg_(false, "D2D CreateDeviceContext failed");
// Load the Roboto font
hr = m_dwriteFactory->CreateFontFileReference(L"Content/Roboto-Condensed.ttf", nullptr, &m_fontFile);
if (FAILED(hr)) ELOG("CreateFontFileReference failed");
if (FAILED(hr)) ERROR_LOG(SYSTEM, "CreateFontFileReference failed");
hr = m_dwriteFactory->CreateFontSetBuilder(&m_fontSetBuilder);
if (FAILED(hr)) ELOG("CreateFontSetBuilder failed");
if (FAILED(hr)) ERROR_LOG(SYSTEM, "CreateFontSetBuilder failed");
hr = m_fontSetBuilder->AddFontFile(m_fontFile);
hr = m_fontSetBuilder->CreateFontSet(&m_fontSet);
hr = m_dwriteFactory->CreateFontCollectionFromFontSet(m_fontSet, &m_fontCollection);
-17
View File
@@ -1,17 +0,0 @@
// TODO
#include <stdio.h>
#include "audio/wav_load.h"
#include "base/logging.h"
struct AudioClip {
int length;
};
int main(int argc, char **argv) {
CHECK(argc == 3);
}
+4 -3
View File
@@ -30,6 +30,7 @@
#include "Core/HLE/sceUsbCam.h"
#include "Core/HLE/sceUsbGps.h"
#include "Common/GraphicsContext.h"
#include "Common/Log.h"
#include <sys/types.h>
#include <sys/sysctl.h>
@@ -244,7 +245,7 @@ static LocationHelper *locationHelper;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
NativeInitGraphics(graphicsContext);
ILOG("Emulation thread starting\n");
INFO_LOG(SYSTEM, "Emulation thread starting\n");
while (threadEnabled) {
NativeUpdate();
NativeRender(graphicsContext);
@@ -252,11 +253,11 @@ static LocationHelper *locationHelper;
}
ILOG("Emulation thread shutting down\n");
INFO_LOG(SYSTEM, "Emulation thread shutting down\n");
NativeShutdownGraphics();
// Also ask the main thread to stop, so it doesn't hang waiting for a new frame.
ILOG("Emulation thread stopping\n");
INFO_LOG(SYSTEM, "Emulation thread stopping\n");
graphicsContext->StopThread();
threadStopped = true;
+8 -8
View File
@@ -32,7 +32,6 @@
#include <sstream>
#include "base/NativeApp.h"
#include "base/logging.h"
#include "input/input_state.h"
#include "ext/disarm.h"
#include "math/math_util.h"
@@ -41,6 +40,7 @@
#include "Common/ArmEmitter.h"
#include "Common/BitScan.h"
#include "Common/CPUDetect.h"
#include "Common/Log.h"
#include "Core/Config.h"
#include "Core/FileSystems/ISOFileSystem.h"
#include "Core/MemMap.h"
@@ -326,7 +326,7 @@ bool TestMatrixTranspose() {
}
void TestGetMatrix(int matrix, MatrixSize sz) {
ILOG("Testing matrix %s", GetMatrixNotation(matrix, sz));
INFO_LOG(SYSTEM, "Testing matrix %s", GetMatrixNotation(matrix, sz));
u8 fullMatrix[16];
u8 cols[4];
@@ -344,8 +344,8 @@ void TestGetMatrix(int matrix, MatrixSize sz) {
// int rowName = GetRowName(matrix, sz, i, 0);
int colName = cols[i];
int rowName = rows[i];
ILOG("Column %i: %s", i, GetVectorNotation(colName, vsz));
ILOG("Row %i: %s", i, GetVectorNotation(rowName, vsz));
INFO_LOG(SYSTEM, "Column %i: %s", i, GetVectorNotation(colName, vsz));
INFO_LOG(SYSTEM, "Row %i: %s", i, GetVectorNotation(rowName, vsz));
u8 colRegs[4];
u8 rowRegs[4];
@@ -366,12 +366,12 @@ void TestGetMatrix(int matrix, MatrixSize sz) {
c << (int)fullMatrix[j * 4 + i] << " ";
d << (int)rowRegs[j] << " ";
}
ILOG("Col: %s vs %s", a.str().c_str(), b.str().c_str());
INFO_LOG(SYSTEM, "Col: %s vs %s", a.str().c_str(), b.str().c_str());
if (a.str() != b.str())
ILOG("WRONG!");
ILOG("Row: %s vs %s", c.str().c_str(), d.str().c_str());
INFO_LOG(SYSTEM, "WRONG!");
INFO_LOG(SYSTEM, "Row: %s vs %s", c.str().c_str(), d.str().c_str());
if (c.str() != d.str())
ILOG("WRONG!");
INFO_LOG(SYSTEM, "WRONG!");
}
}