diff --git a/Common/Log.h b/Common/Log.h index ae61798634..5a29e7f676 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -32,10 +32,23 @@ #include -namespace LogTypes -{ +namespace LogTypes { enum LOG_TYPE { + SYSTEM = 0, + BOOT, + COMMON, + CPU, + FILESYS, + G3D, + HLE, // dumping ground that we should get rid of + JIT, + LOADER, + ME, + MEMMAP, + SASMIX, + SAVESTATE, + SCEAUDIO, SCECTRL, SCEDISPLAY, @@ -51,21 +64,6 @@ enum LOG_TYPE { SCEUTILITY, SCEMISC, - SYSTEM, - BOOT, - COMMON, - CPU, - FILESYS, - G3D, - HLE, // dumping ground that we should get rid off - JIT, - LOADER, - ME, - MEMMAP, - TIME, - SASMIX, - SAVESTATE, - NUMBER_OF_LOGS, // Must be last }; diff --git a/Common/LogManager.cpp b/Common/LogManager.cpp index 5dd0c85b5f..e102fed194 100644 --- a/Common/LogManager.cpp +++ b/Common/LogManager.cpp @@ -59,6 +59,20 @@ struct LogNameTableEntry { }; static const LogNameTableEntry logTable[] = { + {LogTypes::SYSTEM, "SYSTEM"}, + {LogTypes::BOOT, "BOOT"}, + {LogTypes::COMMON, "COMMON"}, + {LogTypes::CPU, "CPU"}, + {LogTypes::FILESYS, "FILESYS"}, + {LogTypes::G3D, "G3D"}, + {LogTypes::HLE, "HLE"}, + {LogTypes::JIT, "JIT"}, + {LogTypes::LOADER, "LOADER"}, + {LogTypes::ME, "ME"}, // Media Engine + {LogTypes::MEMMAP, "MEMMAP"}, + {LogTypes::SASMIX, "SASMIX"}, + {LogTypes::SAVESTATE, "SAVESTATE"}, + {LogTypes::SCEAUDIO, "SCEAUDIO"}, {LogTypes::SCECTRL, "SCECTRL"}, {LogTypes::SCEDISPLAY, "SCEDISP"}, @@ -73,21 +87,6 @@ static const LogNameTableEntry logTable[] = { {LogTypes::SCESAS, "SCESAS"}, {LogTypes::SCEUTILITY, "SCEUTIL"}, {LogTypes::SCEMISC, "SCEMISC"}, - - {LogTypes::SYSTEM, "SYSTEM"}, - {LogTypes::BOOT, "BOOT"}, - {LogTypes::COMMON, "COMMON"}, - {LogTypes::CPU, "CPU"}, - {LogTypes::FILESYS, "FILESYS"}, - {LogTypes::G3D, "G3D"}, - {LogTypes::HLE, "HLE"}, - {LogTypes::JIT, "JIT"}, - {LogTypes::LOADER, "LOADER"}, - {LogTypes::ME, "ME"}, - {LogTypes::MEMMAP, "MEMMAP"}, - {LogTypes::TIME, "TIME"}, - {LogTypes::SASMIX, "SASMIX"}, - {LogTypes::SAVESTATE, "SAVESTATE"}, }; LogManager::LogManager() { diff --git a/Core/Core.cpp b/Core/Core.cpp index e7078fe062..ec4da878d4 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -184,7 +184,7 @@ bool UpdateScreenScale(int width, int height) { dp_yres = new_dp_yres; pixel_xres = width; pixel_yres = height; - + INFO_LOG(SYSTEM, "pixel_res: %dx%d", pixel_xres, pixel_yres); NativeResized(); return true; } diff --git a/Core/CoreTiming.cpp b/Core/CoreTiming.cpp index a84e479a51..1c148c86c3 100644 --- a/Core/CoreTiming.cpp +++ b/Core/CoreTiming.cpp @@ -181,7 +181,7 @@ int RegisterEvent(const char *name, TimedCallback callback) void AntiCrashCallback(u64 userdata, int cyclesLate) { - ERROR_LOG(TIME, "Savestate broken: an unregistered event was called."); + ERROR_LOG(SAVESTATE, "Savestate broken: an unregistered event was called."); Core_Halt("invalid timing events"); } @@ -526,7 +526,7 @@ void ProcessFifoWaitEvents() { if (first->time <= (s64)GetTicks()) { -// LOG(TIMER, "[Scheduler] %s (%lld, %lld) ", +// LOG(CPU, "[Scheduler] %s (%lld, %lld) ", // first->name ? first->name : "?", (u64)GetTicks(), (u64)first->time); Event* evt = first; first = first->next; @@ -638,7 +638,7 @@ void Idle(int maxIdle) } } - VERBOSE_LOG(TIME, "Idle for %i cycles! (%f ms)", cyclesDown, cyclesDown / (float)(CPU_HZ * 0.001f)); + // VERBOSE_LOG(CPU, "Idle for %i cycles! (%f ms)", cyclesDown, cyclesDown / (float)(CPU_HZ * 0.001f)); idledCycles += cyclesDown; currentMIPS->downcount -= cyclesDown; diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 54fcfa4277..f209b8c8e4 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -1664,4 +1664,5 @@ void FramebufferManagerCommon::ShowScreenResolution() { messageStream << PSP_CoreParameter().pixelWidth << "x" << PSP_CoreParameter().pixelHeight; host->NotifyUserMessage(messageStream.str(), 2.0f, 0xFFFFFF, "resize"); + INFO_LOG(SYSTEM, "%s", messageStream.str().c_str()); } diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 7b1fc3dbab..c1ea62e1f5 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -223,6 +223,8 @@ void LogConfigScreen::CreateViews() { LinearLayout *topbar = new LinearLayout(ORIENT_HORIZONTAL); topbar->Add(new Choice(di->T("Back")))->OnClick.Handle(this, &UIScreen::OnBack); topbar->Add(new Choice(di->T("Toggle All")))->OnClick.Handle(this, &LogConfigScreen::OnToggleAll); + topbar->Add(new Choice(di->T("Enable All")))->OnClick.Handle(this, &LogConfigScreen::OnEnableAll); + topbar->Add(new Choice(di->T("Disable All")))->OnClick.Handle(this, &LogConfigScreen::OnDisableAll); topbar->Add(new Choice(dev->T("Log Level")))->OnClick.Handle(this, &LogConfigScreen::OnLogLevel); vert->Add(topbar); @@ -250,13 +252,28 @@ void LogConfigScreen::CreateViews() { UI::EventReturn LogConfigScreen::OnToggleAll(UI::EventParams &e) { LogManager *logMan = LogManager::GetInstance(); - for (int i = 0; i < LogManager::GetNumChannels(); i++) { - LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i; - LogChannel *chan = logMan->GetLogChannel(type); + LogChannel *chan = logMan->GetLogChannel((LogTypes::LOG_TYPE)i); chan->enable_ = !chan->enable_; } + return UI::EVENT_DONE; +} +UI::EventReturn LogConfigScreen::OnEnableAll(UI::EventParams &e) { + LogManager *logMan = LogManager::GetInstance(); + for (int i = 0; i < LogManager::GetNumChannels(); i++) { + LogChannel *chan = logMan->GetLogChannel((LogTypes::LOG_TYPE)i); + chan->enable_ = true; + } + return UI::EVENT_DONE; +} + +UI::EventReturn LogConfigScreen::OnDisableAll(UI::EventParams &e) { + LogManager *logMan = LogManager::GetInstance(); + for (int i = 0; i < LogManager::GetNumChannels(); i++) { + LogChannel *chan = logMan->GetLogChannel((LogTypes::LOG_TYPE)i); + chan->enable_ = false; + } return UI::EVENT_DONE; } diff --git a/UI/DevScreens.h b/UI/DevScreens.h index e06a9bdb74..682ae316b8 100644 --- a/UI/DevScreens.h +++ b/UI/DevScreens.h @@ -53,6 +53,8 @@ public: private: UI::EventReturn OnToggleAll(UI::EventParams &e); + UI::EventReturn OnEnableAll(UI::EventParams &e); + UI::EventReturn OnDisableAll(UI::EventParams &e); UI::EventReturn OnLogLevel(UI::EventParams &e); UI::EventReturn OnLogLevelChange(UI::EventParams &e); }; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index cf39b83654..7a5a4ca7a4 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -151,7 +151,7 @@ void EmuScreen::bootGame(const std::string &filename) { invalid_ = true; - CoreParameter coreParam; + CoreParameter coreParam{}; coreParam.cpuCore = (CPUCore)g_Config.iCpuCore; coreParam.gpuCore = GPUCORE_GLES; switch (GetGPUBackend()) { @@ -205,6 +205,8 @@ void EmuScreen::bootGame(const std::string &filename) { coreParam.renderWidth = 480 * g_Config.iInternalResolution; coreParam.renderHeight = 272 * g_Config.iInternalResolution; } + coreParam.pixelWidth = pixel_xres; + coreParam.pixelHeight = pixel_yres; std::string error_string; if (!PSP_InitStart(coreParam, &error_string)) { @@ -792,9 +794,12 @@ void EmuScreen::update(InputState &input) { // Simply forcibly update to the current screen size every frame. Doesn't cost much. // If bounds is set to be smaller than the actual pixel resolution of the display, respect that. // TODO: Should be able to use g_dpi_scale here instead. Might want to store the dpi scale in the UI context too. + +#ifndef _WIN32 const Bounds &bounds = screenManager()->getUIContext()->GetBounds(); PSP_CoreParameter().pixelWidth = pixel_xres * bounds.w / dp_xres; PSP_CoreParameter().pixelHeight = pixel_yres * bounds.h / dp_yres; +#endif if (!invalid_) { UpdateUIState(UISTATE_INGAME); diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index fd17be4879..75f8a9ff85 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -276,6 +276,8 @@ namespace MainWindow PSP_CoreParameter().pixelHeight = height; } + INFO_LOG(SYSTEM, "Pixel width/height: %dx%d", PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight); + if (UpdateScreenScale(width, height)) { NativeMessageReceived("gpu resized", ""); }