mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Merge pull request #6638 from GPUCode/new-log
common: Backport yuzu log improvements
This commit is contained in:
		
						commit
						4ccd9f24fb
					
				
					 48 changed files with 1201 additions and 750 deletions
				
			
		|  | @ -2,6 +2,7 @@ | |||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <exception> | ||||
| #include <memory> | ||||
| #include <stdexcept> | ||||
| #include <utility> | ||||
|  | @ -12,9 +13,9 @@ | |||
| #include "common/arch.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "common/settings.h" | ||||
| #include "common/texture.h" | ||||
| #include "core/arm/arm_interface.h" | ||||
| #include "core/arm/exclusive_monitor.h" | ||||
| #include "core/hle/service/cam/cam.h" | ||||
| #if CITRA_ARCH(x86_64) || CITRA_ARCH(arm64) | ||||
| #include "core/arm/dynarmic/arm_dynarmic.h" | ||||
| #endif | ||||
|  | @ -23,19 +24,22 @@ | |||
| #include "core/core.h" | ||||
| #include "core/core_timing.h" | ||||
| #include "core/dumping/backend.h" | ||||
| #include "core/dumping/ffmpeg_backend.h" | ||||
| #include "core/frontend/image_interface.h" | ||||
| #include "core/gdbstub/gdbstub.h" | ||||
| #include "core/global.h" | ||||
| #include "core/hle/kernel/client_port.h" | ||||
| #include "core/hle/kernel/kernel.h" | ||||
| #include "core/hle/kernel/process.h" | ||||
| #include "core/hle/kernel/thread.h" | ||||
| #include "core/hle/service/apt/applet_manager.h" | ||||
| #include "core/hle/service/apt/apt.h" | ||||
| #include "core/hle/service/cam/cam.h" | ||||
| #include "core/hle/service/fs/archive.h" | ||||
| #include "core/hle/service/gsp/gsp.h" | ||||
| #include "core/hle/service/pm/pm_app.h" | ||||
| #include "core/hle/service/hid/hid.h" | ||||
| #include "core/hle/service/ir/ir_rst.h" | ||||
| #include "core/hle/service/ir/ir_user.h" | ||||
| #include "core/hle/service/mic_u.h" | ||||
| #include "core/hle/service/plgldr/plgldr.h" | ||||
| #include "core/hle/service/service.h" | ||||
| #include "core/hle/service/sm/sm.h" | ||||
| #include "core/hw/gpu.h" | ||||
|  | @ -596,6 +600,64 @@ void System::Reset() { | |||
|     } | ||||
| } | ||||
| 
 | ||||
| void System::ApplySettings() { | ||||
|     GDBStub::SetServerPort(Settings::values.gdbstub_port.GetValue()); | ||||
|     GDBStub::ToggleServer(Settings::values.use_gdbstub.GetValue()); | ||||
| 
 | ||||
|     VideoCore::g_shader_jit_enabled = Settings::values.use_shader_jit.GetValue(); | ||||
|     VideoCore::g_hw_shader_enabled = Settings::values.use_hw_shader.GetValue(); | ||||
|     VideoCore::g_hw_shader_accurate_mul = Settings::values.shaders_accurate_mul.GetValue(); | ||||
| 
 | ||||
| #ifndef ANDROID | ||||
|     if (VideoCore::g_renderer) { | ||||
|         VideoCore::g_renderer->UpdateCurrentFramebufferLayout(); | ||||
|     } | ||||
| #endif | ||||
| 
 | ||||
|     if (VideoCore::g_renderer) { | ||||
|         auto& settings = VideoCore::g_renderer->Settings(); | ||||
|         settings.bg_color_update_requested = true; | ||||
|         settings.sampler_update_requested = true; | ||||
|         settings.shader_update_requested = true; | ||||
|         settings.texture_filter_update_requested = true; | ||||
|     } | ||||
| 
 | ||||
|     if (IsPoweredOn()) { | ||||
|         CoreTiming().UpdateClockSpeed(Settings::values.cpu_clock_percentage.GetValue()); | ||||
|         Core::DSP().SetSink(Settings::values.output_type.GetValue(), | ||||
|                             Settings::values.output_device.GetValue()); | ||||
|         Core::DSP().EnableStretching(Settings::values.enable_audio_stretching.GetValue()); | ||||
| 
 | ||||
|         auto hid = Service::HID::GetModule(*this); | ||||
|         if (hid) { | ||||
|             hid->ReloadInputDevices(); | ||||
|         } | ||||
| 
 | ||||
|         auto apt = Service::APT::GetModule(*this); | ||||
|         if (apt) { | ||||
|             apt->GetAppletManager()->ReloadInputDevices(); | ||||
|         } | ||||
| 
 | ||||
|         auto ir_user = service_manager->GetService<Service::IR::IR_USER>("ir:USER"); | ||||
|         if (ir_user) | ||||
|             ir_user->ReloadInputDevices(); | ||||
|         auto ir_rst = service_manager->GetService<Service::IR::IR_RST>("ir:rst"); | ||||
|         if (ir_rst) | ||||
|             ir_rst->ReloadInputDevices(); | ||||
| 
 | ||||
|         auto cam = Service::CAM::GetModule(*this); | ||||
|         if (cam) { | ||||
|             cam->ReloadCameraDevices(); | ||||
|         } | ||||
| 
 | ||||
|         Service::MIC::ReloadMic(*this); | ||||
|     } | ||||
| 
 | ||||
|     Service::PLGLDR::PLG_LDR::SetEnabled(Settings::values.plugin_loader_enabled.GetValue()); | ||||
|     Service::PLGLDR::PLG_LDR::SetAllowGameChangeState( | ||||
|         Settings::values.allow_plugin_loader.GetValue()); | ||||
| } | ||||
| 
 | ||||
| template <class Archive> | ||||
| void System::serialize(Archive& ar, const unsigned int file_version) { | ||||
| 
 | ||||
|  |  | |||
|  | @ -330,6 +330,9 @@ public: | |||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|     /// Applies any changes to settings to this core instance.
 | ||||
|     void ApplySettings(); | ||||
| 
 | ||||
| private: | ||||
|     /**
 | ||||
|      * Initialize the emulated system. | ||||
|  |  | |||
|  | @ -203,7 +203,7 @@ void Process::Run(s32 main_thread_priority, u32 stack_size) { | |||
| 
 | ||||
|     status = ProcessStatus::Running; | ||||
| 
 | ||||
|     vm_manager.LogLayout(Log::Level::Debug); | ||||
|     vm_manager.LogLayout(Common::Log::Level::Debug); | ||||
|     Kernel::SetupMainThread(kernel, codeset->entrypoint, main_thread_priority, SharedFrom(this)); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -529,7 +529,7 @@ ResultCode SVC::ControlMemory(u32* out_addr, u32 addr0, u32 addr1, u32 size, u32 | |||
|         return ERR_INVALID_COMBINATION; | ||||
|     } | ||||
| 
 | ||||
|     process.vm_manager.LogLayout(Log::Level::Trace); | ||||
|     process.vm_manager.LogLayout(Common::Log::Level::Trace); | ||||
| 
 | ||||
|     return RESULT_SUCCESS; | ||||
| } | ||||
|  |  | |||
|  | @ -239,10 +239,10 @@ ResultCode VMManager::ReprotectRange(VAddr target, u32 size, VMAPermission new_p | |||
|     return RESULT_SUCCESS; | ||||
| } | ||||
| 
 | ||||
| void VMManager::LogLayout(Log::Level log_level) const { | ||||
| void VMManager::LogLayout(Common::Log::Level log_level) const { | ||||
|     for (const auto& p : vma_map) { | ||||
|         const VirtualMemoryArea& vma = p.second; | ||||
|         LOG_GENERIC(::Log::Class::Kernel, log_level, "{:08X} - {:08X}  size: {:8X} {}{}{} {}", | ||||
|         LOG_GENERIC(Common::Log::Class::Kernel, log_level, "{:08X} - {:08X}  size: {:8X} {}{}{} {}", | ||||
|                     vma.base, vma.base + vma.size, vma.size, | ||||
|                     (u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-', | ||||
|                     (u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-', | ||||
|  |  | |||
|  | @ -202,7 +202,7 @@ public: | |||
|     ResultCode ReprotectRange(VAddr target, u32 size, VMAPermission new_perms); | ||||
| 
 | ||||
|     /// Dumps the address space layout to the log, for debugging
 | ||||
|     void LogLayout(Log::Level log_level) const; | ||||
|     void LogLayout(Common::Log::Level log_level) const; | ||||
| 
 | ||||
|     /// Gets a list of backing memory blocks for the specified range
 | ||||
|     ResultVal<std::vector<std::pair<MemoryRef, u32>>> GetBackingBlocksForRange(VAddr address, | ||||
|  |  | |||
|  | @ -9,6 +9,7 @@ | |||
| #include <boost/serialization/unique_ptr.hpp> | ||||
| #include <cryptopp/osrng.h> | ||||
| #include <cryptopp/sha.h> | ||||
| #include <fmt/format.h> | ||||
| #include "common/archives.h" | ||||
| #include "common/file_util.h" | ||||
| #include "common/logging/log.h" | ||||
|  |  | |||
|  | @ -2,6 +2,7 @@ | |||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <fmt/format.h> | ||||
| #include "common/alignment.h" | ||||
| #include "common/settings.h" | ||||
| #include "common/string_util.h" | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ | |||
| #include <boost/serialization/base_object.hpp> | ||||
| #include <boost/serialization/shared_ptr.hpp> | ||||
| #include <boost/serialization/unique_ptr.hpp> | ||||
| #include <fmt/format.h> | ||||
| #include "common/string_util.h" | ||||
| #include "common/swap.h" | ||||
| #include "core/core.h" | ||||
|  |  | |||
|  | @ -10,6 +10,7 @@ | |||
| #include <boost/optional.hpp> | ||||
| #include <cryptopp/hex.h> | ||||
| #include <cryptopp/osrng.h> | ||||
| #include <fmt/format.h> | ||||
| #include "common/bit_field.h" | ||||
| #include "common/common_types.h" | ||||
| #include "common/file_util.h" | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| 
 | ||||
| #include <chrono> | ||||
| #include <cryptopp/hex.h> | ||||
| #include <fmt/format.h> | ||||
| #include "common/archives.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "common/scm_rev.h" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue