From fde415968e232ac4151cf1f3dc598c05f342c83c Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 29 Jun 2018 14:02:29 +0300 Subject: [PATCH 1/3] log: remove deprecated log macros --- src/common/logging/backend.cpp | 17 ----------------- src/common/logging/log.h | 34 ---------------------------------- 2 files changed, 51 deletions(-) diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index af1efcf46..6f831b359 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #ifdef _WIN32 @@ -275,22 +274,6 @@ Backend* GetBackend(const std::string& backend_name) { return Impl::Instance().GetBackend(backend_name); } -void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num, - const char* function, const char* format, ...) { - auto filter = Impl::Instance().GetGlobalFilter(); - if (!filter.CheckMessage(log_class, log_level)) - return; - std::array formatting_buffer; - va_list args; - va_start(args, format); - vsnprintf(formatting_buffer.data(), formatting_buffer.size(), format, args); - va_end(args); - Entry entry = CreateEntry(log_class, log_level, filename, line_num, function, - std::string(formatting_buffer.data())); - - Impl::Instance().PushEntry(std::move(entry)); -} - void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename, unsigned int line_num, const char* function, const char* format, const fmt::format_args& args) { diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 83851e5ca..581a0de58 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -98,19 +98,6 @@ enum class Class : ClassType { Count ///< Total number of logging classes }; -/// Logs a message to the global logger. -void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num, - const char* function, -#ifdef _MSC_VER - _Printf_format_string_ -#endif - const char* format, - ...) -#ifdef __GNUC__ - __attribute__((format(printf, 6, 7))) -#endif - ; - /// Logs a message to the global logger, using fmt void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename, unsigned int line_num, const char* function, const char* format, @@ -125,27 +112,6 @@ void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsig } // namespace Log -#define LOG_GENERIC(log_class, log_level, ...) \ - ::Log::LogMessage(log_class, log_level, __FILE__, __LINE__, __func__, __VA_ARGS__) - -#ifdef _DEBUG -#define LOG_TRACE(log_class, ...) \ - LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Trace, __VA_ARGS__) -#else -#define LOG_TRACE(log_class, ...) (void(0)) -#endif - -#define LOG_DEBUG(log_class, ...) \ - LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Debug, __VA_ARGS__) -#define LOG_INFO(log_class, ...) \ - LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Info, __VA_ARGS__) -#define LOG_WARNING(log_class, ...) \ - LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Warning, __VA_ARGS__) -#define LOG_ERROR(log_class, ...) \ - LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Error, __VA_ARGS__) -#define LOG_CRITICAL(log_class, ...) \ - LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Critical, __VA_ARGS__) - // Define the fmt lib macros #define NGLOG_GENERIC(log_class, log_level, ...) \ ::Log::FmtLogMessage(log_class, log_level, __FILE__, __LINE__, __func__, __VA_ARGS__) From 7c5a76e58b868886285ca130bc5fc86772dc682d Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 29 Jun 2018 14:18:07 +0300 Subject: [PATCH 2/3] log: replace all NGLOG with LOG --- src/audio_core/cubeb_sink.cpp | 12 +- src/audio_core/hle/hle.cpp | 22 +-- src/audio_core/hle/mixers.cpp | 16 +-- src/audio_core/hle/source.cpp | 46 +++--- src/audio_core/sdl2_sink.cpp | 4 +- src/audio_core/sink_details.cpp | 2 +- src/audio_core/time_stretch.cpp | 2 +- src/citra/citra.cpp | 46 +++--- src/citra/config.cpp | 6 +- src/citra/emu_window/emu_window_sdl2.cpp | 18 +-- src/citra_qt/camera/qt_camera_base.cpp | 2 +- src/citra_qt/camera/qt_multimedia_camera.cpp | 10 +- src/citra_qt/camera/still_image_camera.cpp | 2 +- src/citra_qt/compatdb.cpp | 4 +- .../configuration/configure_camera.cpp | 4 +- src/citra_qt/game_list.cpp | 8 +- src/citra_qt/game_list_p.h | 2 +- src/citra_qt/main.cpp | 28 ++-- src/citra_qt/multiplayer/chat_room.cpp | 4 +- src/citra_qt/multiplayer/host_room.cpp | 4 +- src/citra_qt/multiplayer/state.cpp | 6 +- src/citra_qt/updater/updater.cpp | 8 +- src/common/assert.h | 6 +- src/common/chunk_file.h | 6 +- src/common/file_util.cpp | 80 +++++------ src/common/logging/filter.cpp | 6 +- src/common/logging/log.h | 16 +-- src/common/memory_util.cpp | 16 +-- src/common/param_package.cpp | 12 +- src/common/string_util.cpp | 10 +- .../arm/dyncom/arm_dyncom_interpreter.cpp | 28 ++-- src/core/arm/dyncom/arm_dyncom_trans.cpp | 2 +- src/core/arm/skyeye_common/armstate.cpp | 4 +- src/core/arm/skyeye_common/vfp/vfp.cpp | 12 +- src/core/arm/skyeye_common/vfp/vfp.h | 2 +- src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 78 +++++----- src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 50 +++---- src/core/core.cpp | 18 +-- src/core/core_timing.h | 16 +-- src/core/file_sys/archive_backend.cpp | 6 +- src/core/file_sys/archive_extsavedata.cpp | 26 ++-- src/core/file_sys/archive_ncch.cpp | 42 +++--- src/core/file_sys/archive_other_savedata.cpp | 18 +-- src/core/file_sys/archive_sdmc.cpp | 84 +++++------ src/core/file_sys/archive_sdmcwriteonly.cpp | 14 +- src/core/file_sys/archive_selfncch.cpp | 52 +++---- .../file_sys/archive_source_sd_savedata.cpp | 4 +- src/core/file_sys/archive_systemsavedata.cpp | 2 +- src/core/file_sys/cia_container.cpp | 24 ++-- src/core/file_sys/disk_archive.cpp | 2 +- src/core/file_sys/file_backend.h | 2 +- src/core/file_sys/ivfc_archive.cpp | 22 +-- src/core/file_sys/ncch_container.cpp | 56 ++++---- src/core/file_sys/savedata_archive.cpp | 78 +++++----- src/core/file_sys/title_metadata.cpp | 14 +- src/core/frontend/camera/factory.cpp | 4 +- src/core/frontend/camera/factory.h | 2 +- src/core/frontend/input.h | 6 +- src/core/gdbstub/gdbstub.cpp | 56 ++++---- src/core/hle/applets/applet.cpp | 4 +- src/core/hle/applets/erreula.cpp | 2 +- src/core/hle/applets/mii_selector.cpp | 2 +- src/core/hle/applets/mint.cpp | 2 +- src/core/hle/applets/swkbd.cpp | 2 +- src/core/hle/kernel/address_arbiter.cpp | 2 +- src/core/hle/kernel/handle_table.cpp | 4 +- src/core/hle/kernel/memory.cpp | 6 +- src/core/hle/kernel/mutex.cpp | 2 +- src/core/hle/kernel/process.cpp | 8 +- src/core/hle/kernel/resource_limit.cpp | 6 +- src/core/hle/kernel/shared_memory.cpp | 10 +- src/core/hle/kernel/svc.cpp | 110 +++++++------- src/core/hle/kernel/thread.cpp | 22 +-- src/core/hle/kernel/timer.cpp | 4 +- src/core/hle/kernel/vm_manager.cpp | 2 +- src/core/hle/service/ac/ac.cpp | 18 +-- src/core/hle/service/am/am.cpp | 66 ++++----- src/core/hle/service/apt/applet_manager.cpp | 10 +- src/core/hle/service/apt/apt.cpp | 72 +++++----- src/core/hle/service/boss/boss.cpp | 112 +++++++-------- src/core/hle/service/cam/cam.cpp | 134 +++++++++--------- src/core/hle/service/cecd/cecd.cpp | 6 +- src/core/hle/service/cfg/cfg.cpp | 16 +-- src/core/hle/service/csnd_snd.cpp | 10 +- src/core/hle/service/dlp/dlp_srvr.cpp | 2 +- src/core/hle/service/dsp_dsp.cpp | 40 +++--- src/core/hle/service/err_f.cpp | 60 ++++---- src/core/hle/service/frd/frd.cpp | 16 +-- src/core/hle/service/fs/archive.cpp | 32 ++--- src/core/hle/service/fs/fs_user.cpp | 76 +++++----- src/core/hle/service/gsp/gsp_gpu.cpp | 42 +++--- src/core/hle/service/hid/hid.cpp | 12 +- src/core/hle/service/ir/extra_hid.cpp | 8 +- src/core/hle/service/ir/ir_rst.cpp | 6 +- src/core/hle/service/ir/ir_user.cpp | 28 ++-- src/core/hle/service/ldr_ro/cro_helper.cpp | 126 ++++++++-------- src/core/hle/service/ldr_ro/ldr_ro.cpp | 110 +++++++------- src/core/hle/service/mic_u.cpp | 32 ++--- src/core/hle/service/ndm/ndm_u.cpp | 40 +++--- src/core/hle/service/news/news_s.cpp | 2 +- src/core/hle/service/nfc/nfc.cpp | 24 ++-- src/core/hle/service/nim/nim_u.cpp | 4 +- src/core/hle/service/ns/ns.cpp | 4 +- src/core/hle/service/nwm/nwm_uds.cpp | 64 ++++----- src/core/hle/service/nwm/uds_data.cpp | 4 +- src/core/hle/service/ptm/ptm.cpp | 18 +-- src/core/hle/service/service.cpp | 12 +- src/core/hle/service/sm/srv.cpp | 22 +-- src/core/hle/service/soc_u.cpp | 2 +- src/core/hle/service/y2r_u.cpp | 92 ++++++------ src/core/hw/aes/ccm.cpp | 10 +- src/core/hw/aes/key.cpp | 10 +- src/core/hw/gpu.cpp | 50 +++---- src/core/hw/hw.cpp | 8 +- src/core/hw/lcd.cpp | 8 +- src/core/loader/3dsx.cpp | 16 +-- src/core/loader/elf.cpp | 16 +-- src/core/loader/loader.cpp | 8 +- src/core/loader/ncch.cpp | 2 +- src/core/memory.cpp | 24 ++-- src/core/movie.cpp | 32 ++--- src/core/telemetry_session.cpp | 6 +- src/core/tracer/recorder.cpp | 2 +- src/input_common/sdl/sdl.cpp | 6 +- src/network/network.cpp | 6 +- src/network/room.cpp | 2 +- src/video_core/command_processor.cpp | 20 +-- src/video_core/debug_utils/debug_utils.cpp | 8 +- src/video_core/gpu_debugger.h | 2 +- src/video_core/primitive_assembly.cpp | 2 +- src/video_core/regs_framebuffer.h | 2 +- .../renderer_opengl/gl_rasterizer.cpp | 8 +- .../renderer_opengl/gl_rasterizer_cache.cpp | 2 +- .../renderer_opengl/gl_shader_decompiler.cpp | 12 +- .../renderer_opengl/gl_shader_gen.cpp | 30 ++-- .../renderer_opengl/gl_shader_util.cpp | 14 +- src/video_core/renderer_opengl/pica_to_gl.h | 20 +-- .../renderer_opengl/renderer_opengl.cpp | 10 +- src/video_core/shader/shader.cpp | 2 +- src/video_core/shader/shader_interpreter.cpp | 8 +- .../shader/shader_jit_x64_compiler.cpp | 6 +- src/video_core/swrasterizer/clipper.cpp | 2 +- src/video_core/swrasterizer/framebuffer.cpp | 16 +-- src/video_core/swrasterizer/lighting.cpp | 4 +- src/video_core/swrasterizer/proctex.cpp | 6 +- src/video_core/swrasterizer/rasterizer.cpp | 6 +- src/video_core/swrasterizer/texturing.cpp | 6 +- src/video_core/texture/texture_decode.cpp | 2 +- src/video_core/vertex_loader.cpp | 6 +- src/video_core/video_core.cpp | 6 +- src/web_service/announce_room_json.cpp | 2 +- src/web_service/web_backend.cpp | 32 ++--- 152 files changed, 1541 insertions(+), 1541 deletions(-) diff --git a/src/audio_core/cubeb_sink.cpp b/src/audio_core/cubeb_sink.cpp index 1e13e177d..231560269 100644 --- a/src/audio_core/cubeb_sink.cpp +++ b/src/audio_core/cubeb_sink.cpp @@ -27,7 +27,7 @@ struct CubebSink::Impl { CubebSink::CubebSink() : impl(std::make_unique()) { if (cubeb_init(&impl->ctx, "Citra", nullptr) != CUBEB_OK) { - NGLOG_CRITICAL(Audio_Sink, "cubeb_init failed"); + LOG_CRITICAL(Audio_Sink, "cubeb_init failed"); return; } @@ -44,11 +44,11 @@ CubebSink::CubebSink() : impl(std::make_unique()) { u32 minimum_latency = 0; if (cubeb_get_min_latency(impl->ctx, ¶ms, &minimum_latency) != CUBEB_OK) - NGLOG_CRITICAL(Audio_Sink, "Error getting minimum latency"); + LOG_CRITICAL(Audio_Sink, "Error getting minimum latency"); cubeb_device_collection collection; if (cubeb_enumerate_devices(impl->ctx, CUBEB_DEVICE_TYPE_OUTPUT, &collection) != CUBEB_OK) { - NGLOG_WARNING(Audio_Sink, "Audio output device enumeration not supported"); + LOG_WARNING(Audio_Sink, "Audio output device enumeration not supported"); } else { if (collection.count >= 1 && Settings::values.audio_device_id != "auto" && !Settings::values.audio_device_id.empty()) { @@ -72,12 +72,12 @@ CubebSink::CubebSink() : impl(std::make_unique()) { if (cubeb_stream_init(impl->ctx, &impl->stream, "Citra Audio Output", nullptr, nullptr, output_device, ¶ms, std::max(512u, minimum_latency), &Impl::DataCallback, &Impl::StateCallback, impl.get()) != CUBEB_OK) { - NGLOG_CRITICAL(Audio_Sink, "Error initializing cubeb stream"); + LOG_CRITICAL(Audio_Sink, "Error initializing cubeb stream"); return; } if (cubeb_stream_start(impl->stream) != CUBEB_OK) { - NGLOG_CRITICAL(Audio_Sink, "Error starting cubeb stream"); + LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream"); return; } } @@ -87,7 +87,7 @@ CubebSink::~CubebSink() { return; if (cubeb_stream_stop(impl->stream) != CUBEB_OK) { - NGLOG_CRITICAL(Audio_Sink, "Error stopping cubeb stream"); + LOG_CRITICAL(Audio_Sink, "Error stopping cubeb stream"); } cubeb_stream_destroy(impl->stream); diff --git a/src/audio_core/hle/hle.cpp b/src/audio_core/hle/hle.cpp index 16f6b2004..476980668 100644 --- a/src/audio_core/hle/hle.cpp +++ b/src/audio_core/hle/hle.cpp @@ -84,19 +84,19 @@ std::vector DspHle::Impl::PipeRead(DspPipe pipe_number, u32 length) { const size_t pipe_index = static_cast(pipe_number); if (pipe_index >= num_dsp_pipe) { - NGLOG_ERROR(Audio_DSP, "pipe_number = {} invalid", pipe_index); + LOG_ERROR(Audio_DSP, "pipe_number = {} invalid", pipe_index); return {}; } if (length > UINT16_MAX) { // Can only read at most UINT16_MAX from the pipe - NGLOG_ERROR(Audio_DSP, "length of {} greater than max of {}", length, UINT16_MAX); + LOG_ERROR(Audio_DSP, "length of {} greater than max of {}", length, UINT16_MAX); return {}; } std::vector& data = pipe_data[pipe_index]; if (length > data.size()) { - NGLOG_WARNING( + LOG_WARNING( Audio_DSP, "pipe_number = {} is out of data, application requested read of {} but {} remain", pipe_index, length, data.size()); @@ -115,7 +115,7 @@ size_t DspHle::Impl::GetPipeReadableSize(DspPipe pipe_number) const { const size_t pipe_index = static_cast(pipe_number); if (pipe_index >= num_dsp_pipe) { - NGLOG_ERROR(Audio_DSP, "pipe_number = {} invalid", pipe_index); + LOG_ERROR(Audio_DSP, "pipe_number = {} invalid", pipe_index); return 0; } @@ -126,7 +126,7 @@ void DspHle::Impl::PipeWrite(DspPipe pipe_number, const std::vector& buffer) switch (pipe_number) { case DspPipe::Audio: { if (buffer.size() != 4) { - NGLOG_ERROR(Audio_DSP, "DspPipe::Audio: Unexpected buffer length {} was written", + LOG_ERROR(Audio_DSP, "DspPipe::Audio: Unexpected buffer length {} was written", buffer.size()); return; } @@ -146,28 +146,28 @@ void DspHle::Impl::PipeWrite(DspPipe pipe_number, const std::vector& buffer) switch (static_cast(buffer[0])) { case StateChange::Initialize: - NGLOG_INFO(Audio_DSP, "Application has requested initialization of DSP hardware"); + LOG_INFO(Audio_DSP, "Application has requested initialization of DSP hardware"); ResetPipes(); AudioPipeWriteStructAddresses(); dsp_state = DspState::On; break; case StateChange::Shutdown: - NGLOG_INFO(Audio_DSP, "Application has requested shutdown of DSP hardware"); + LOG_INFO(Audio_DSP, "Application has requested shutdown of DSP hardware"); dsp_state = DspState::Off; break; case StateChange::Wakeup: - NGLOG_INFO(Audio_DSP, "Application has requested wakeup of DSP hardware"); + LOG_INFO(Audio_DSP, "Application has requested wakeup of DSP hardware"); ResetPipes(); AudioPipeWriteStructAddresses(); dsp_state = DspState::On; break; case StateChange::Sleep: - NGLOG_INFO(Audio_DSP, "Application has requested sleep of DSP hardware"); + LOG_INFO(Audio_DSP, "Application has requested sleep of DSP hardware"); UNIMPLEMENTED(); dsp_state = DspState::Sleeping; break; default: - NGLOG_ERROR(Audio_DSP, + LOG_ERROR(Audio_DSP, "Application has requested unknown state transition of DSP hardware {}", buffer[0]); dsp_state = DspState::Off; @@ -177,7 +177,7 @@ void DspHle::Impl::PipeWrite(DspPipe pipe_number, const std::vector& buffer) return; } default: - NGLOG_CRITICAL(Audio_DSP, "pipe_number = {} unimplemented", + LOG_CRITICAL(Audio_DSP, "pipe_number = {} unimplemented", static_cast(pipe_number)); UNIMPLEMENTED(); return; diff --git a/src/audio_core/hle/mixers.cpp b/src/audio_core/hle/mixers.cpp index f665ee586..c8175d58e 100644 --- a/src/audio_core/hle/mixers.cpp +++ b/src/audio_core/hle/mixers.cpp @@ -38,37 +38,37 @@ void Mixers::ParseConfig(DspConfiguration& config) { if (config.mixer1_enabled_dirty) { config.mixer1_enabled_dirty.Assign(0); state.mixer1_enabled = config.mixer1_enabled != 0; - NGLOG_TRACE(Audio_DSP, "mixers mixer1_enabled = {}", config.mixer1_enabled); + LOG_TRACE(Audio_DSP, "mixers mixer1_enabled = {}", config.mixer1_enabled); } if (config.mixer2_enabled_dirty) { config.mixer2_enabled_dirty.Assign(0); state.mixer2_enabled = config.mixer2_enabled != 0; - NGLOG_TRACE(Audio_DSP, "mixers mixer2_enabled = {}", config.mixer2_enabled); + LOG_TRACE(Audio_DSP, "mixers mixer2_enabled = {}", config.mixer2_enabled); } if (config.volume_0_dirty) { config.volume_0_dirty.Assign(0); state.intermediate_mixer_volume[0] = config.volume[0]; - NGLOG_TRACE(Audio_DSP, "mixers volume[0] = {}", config.volume[0]); + LOG_TRACE(Audio_DSP, "mixers volume[0] = {}", config.volume[0]); } if (config.volume_1_dirty) { config.volume_1_dirty.Assign(0); state.intermediate_mixer_volume[1] = config.volume[1]; - NGLOG_TRACE(Audio_DSP, "mixers volume[1] = {}", config.volume[1]); + LOG_TRACE(Audio_DSP, "mixers volume[1] = {}", config.volume[1]); } if (config.volume_2_dirty) { config.volume_2_dirty.Assign(0); state.intermediate_mixer_volume[2] = config.volume[2]; - NGLOG_TRACE(Audio_DSP, "mixers volume[2] = {}", config.volume[2]); + LOG_TRACE(Audio_DSP, "mixers volume[2] = {}", config.volume[2]); } if (config.output_format_dirty) { config.output_format_dirty.Assign(0); state.output_format = config.output_format; - NGLOG_TRACE(Audio_DSP, "mixers output_format = {}", + LOG_TRACE(Audio_DSP, "mixers output_format = {}", static_cast(config.output_format)); } @@ -76,11 +76,11 @@ void Mixers::ParseConfig(DspConfiguration& config) { config.headphones_connected_dirty.Assign(0); // Do nothing. (Note: Whether headphones are connected does affect coefficients used for // surround sound.) - NGLOG_TRACE(Audio_DSP, "mixers headphones_connected={}", config.headphones_connected); + LOG_TRACE(Audio_DSP, "mixers headphones_connected={}", config.headphones_connected); } if (config.dirty_raw) { - NGLOG_DEBUG(Audio_DSP, "mixers remaining_dirty={:x}", config.dirty_raw); + LOG_DEBUG(Audio_DSP, "mixers remaining_dirty={:x}", config.dirty_raw); } config.dirty_raw = 0; diff --git a/src/audio_core/hle/source.cpp b/src/audio_core/hle/source.cpp index e8435acd8..0930230e8 100644 --- a/src/audio_core/hle/source.cpp +++ b/src/audio_core/hle/source.cpp @@ -54,34 +54,34 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, if (config.reset_flag) { config.reset_flag.Assign(0); Reset(); - NGLOG_TRACE(Audio_DSP, "source_id={} reset", source_id); + LOG_TRACE(Audio_DSP, "source_id={} reset", source_id); } if (config.partial_reset_flag) { config.partial_reset_flag.Assign(0); state.input_queue = std::priority_queue, BufferOrder>{}; - NGLOG_TRACE(Audio_DSP, "source_id={} partial_reset", source_id); + LOG_TRACE(Audio_DSP, "source_id={} partial_reset", source_id); } if (config.enable_dirty) { config.enable_dirty.Assign(0); state.enabled = config.enable != 0; - NGLOG_TRACE(Audio_DSP, "source_id={} enable={}", source_id, state.enabled); + LOG_TRACE(Audio_DSP, "source_id={} enable={}", source_id, state.enabled); } if (config.sync_dirty) { config.sync_dirty.Assign(0); state.sync = config.sync; - NGLOG_TRACE(Audio_DSP, "source_id={} sync={}", source_id, state.sync); + LOG_TRACE(Audio_DSP, "source_id={} sync={}", source_id, state.sync); } if (config.rate_multiplier_dirty) { config.rate_multiplier_dirty.Assign(0); state.rate_multiplier = config.rate_multiplier; - NGLOG_TRACE(Audio_DSP, "source_id={} rate={}", source_id, state.rate_multiplier); + LOG_TRACE(Audio_DSP, "source_id={} rate={}", source_id, state.rate_multiplier); if (state.rate_multiplier <= 0) { - NGLOG_ERROR(Audio_DSP, "Was given an invalid rate multiplier: source_id={} rate={}", + LOG_ERROR(Audio_DSP, "Was given an invalid rate multiplier: source_id={} rate={}", source_id, state.rate_multiplier); state.rate_multiplier = 1.0f; // Note: Actual firmware starts producing garbage if this occurs. @@ -93,68 +93,68 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, std::transform(adpcm_coeffs, adpcm_coeffs + state.adpcm_coeffs.size(), state.adpcm_coeffs.begin(), [](const auto& coeff) { return static_cast(coeff); }); - NGLOG_TRACE(Audio_DSP, "source_id={} adpcm update", source_id); + LOG_TRACE(Audio_DSP, "source_id={} adpcm update", source_id); } if (config.gain_0_dirty) { config.gain_0_dirty.Assign(0); std::transform(config.gain[0], config.gain[0] + state.gain[0].size(), state.gain[0].begin(), [](const auto& coeff) { return static_cast(coeff); }); - NGLOG_TRACE(Audio_DSP, "source_id={} gain 0 update", source_id); + LOG_TRACE(Audio_DSP, "source_id={} gain 0 update", source_id); } if (config.gain_1_dirty) { config.gain_1_dirty.Assign(0); std::transform(config.gain[1], config.gain[1] + state.gain[1].size(), state.gain[1].begin(), [](const auto& coeff) { return static_cast(coeff); }); - NGLOG_TRACE(Audio_DSP, "source_id={} gain 1 update", source_id); + LOG_TRACE(Audio_DSP, "source_id={} gain 1 update", source_id); } if (config.gain_2_dirty) { config.gain_2_dirty.Assign(0); std::transform(config.gain[2], config.gain[2] + state.gain[2].size(), state.gain[2].begin(), [](const auto& coeff) { return static_cast(coeff); }); - NGLOG_TRACE(Audio_DSP, "source_id={} gain 2 update", source_id); + LOG_TRACE(Audio_DSP, "source_id={} gain 2 update", source_id); } if (config.filters_enabled_dirty) { config.filters_enabled_dirty.Assign(0); state.filters.Enable(config.simple_filter_enabled.ToBool(), config.biquad_filter_enabled.ToBool()); - NGLOG_TRACE(Audio_DSP, "source_id={} enable_simple={} enable_biquad={}", source_id, + LOG_TRACE(Audio_DSP, "source_id={} enable_simple={} enable_biquad={}", source_id, config.simple_filter_enabled.Value(), config.biquad_filter_enabled.Value()); } if (config.simple_filter_dirty) { config.simple_filter_dirty.Assign(0); state.filters.Configure(config.simple_filter); - NGLOG_TRACE(Audio_DSP, "source_id={} simple filter update", source_id); + LOG_TRACE(Audio_DSP, "source_id={} simple filter update", source_id); } if (config.biquad_filter_dirty) { config.biquad_filter_dirty.Assign(0); state.filters.Configure(config.biquad_filter); - NGLOG_TRACE(Audio_DSP, "source_id={} biquad filter update", source_id); + LOG_TRACE(Audio_DSP, "source_id={} biquad filter update", source_id); } if (config.interpolation_dirty) { config.interpolation_dirty.Assign(0); state.interpolation_mode = config.interpolation_mode; - NGLOG_TRACE(Audio_DSP, "source_id={} interpolation_mode={}", source_id, + LOG_TRACE(Audio_DSP, "source_id={} interpolation_mode={}", source_id, static_cast(state.interpolation_mode)); } if (config.format_dirty || config.embedded_buffer_dirty) { config.format_dirty.Assign(0); state.format = config.format; - NGLOG_TRACE(Audio_DSP, "source_id={} format={}", source_id, + LOG_TRACE(Audio_DSP, "source_id={} format={}", source_id, static_cast(state.format)); } if (config.mono_or_stereo_dirty || config.embedded_buffer_dirty) { config.mono_or_stereo_dirty.Assign(0); state.mono_or_stereo = config.mono_or_stereo; - NGLOG_TRACE(Audio_DSP, "source_id={} mono_or_stereo={}", source_id, + LOG_TRACE(Audio_DSP, "source_id={} mono_or_stereo={}", source_id, static_cast(state.mono_or_stereo)); } @@ -182,14 +182,14 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, play_position, false, }); - NGLOG_TRACE(Audio_DSP, "enqueuing embedded addr={:#010x} len={} id={} start={}", + LOG_TRACE(Audio_DSP, "enqueuing embedded addr={:#010x} len={} id={} start={}", config.physical_address, config.length, config.buffer_id, static_cast(config.play_position)); } if (config.loop_related_dirty && config.loop_related != 0) { config.loop_related_dirty.Assign(0); - NGLOG_WARNING(Audio_DSP, "Unhandled complex loop with loop_related={:#010x}", + LOG_WARNING(Audio_DSP, "Unhandled complex loop with loop_related={:#010x}", static_cast(config.loop_related)); } @@ -212,7 +212,7 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, {}, // 0 in u32_dsp false, }); - NGLOG_TRACE(Audio_DSP, "enqueuing queued {} addr={:#010x} len={} id={}", i, + LOG_TRACE(Audio_DSP, "enqueuing queued {} addr={:#010x} len={} id={}", i, b.physical_address, b.length, b.buffer_id); } } @@ -220,7 +220,7 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, } if (config.dirty_raw) { - NGLOG_DEBUG(Audio_DSP, "source_id={} remaining_dirty={:x}", source_id, config.dirty_raw); + LOG_DEBUG(Audio_DSP, "source_id={} remaining_dirty={:x}", source_id, config.dirty_raw); } config.dirty_raw = 0; @@ -255,7 +255,7 @@ void Source::GenerateFrame() { break; case InterpolationMode::Polyphase: // TODO(merry): Implement polyphase interpolation - NGLOG_DEBUG(Audio_DSP, "Polyphase interpolation unimplemented; falling back to linear"); + LOG_DEBUG(Audio_DSP, "Polyphase interpolation unimplemented; falling back to linear"); AudioInterp::Linear(state.interp_state, state.current_buffer, state.rate_multiplier, current_frame, frame_position); break; @@ -304,7 +304,7 @@ bool Source::DequeueBuffer() { break; } } else { - NGLOG_WARNING(Audio_DSP, + LOG_WARNING(Audio_DSP, "source_id={} buffer_id={} length={}: Invalid physical address {:#010x}", source_id, buf.buffer_id, buf.length, buf.physical_address); state.current_buffer.clear(); @@ -322,7 +322,7 @@ bool Source::DequeueBuffer() { state.input_queue.push(buf); } - NGLOG_TRACE(Audio_DSP, "source_id={} buffer_id={} from_queue={} current_buffer.size()={}", + LOG_TRACE(Audio_DSP, "source_id={} buffer_id={} from_queue={} current_buffer.size()={}", source_id, buf.buffer_id, buf.from_queue, state.current_buffer.size()); return true; } diff --git a/src/audio_core/sdl2_sink.cpp b/src/audio_core/sdl2_sink.cpp index 61face0da..383dbe00b 100644 --- a/src/audio_core/sdl2_sink.cpp +++ b/src/audio_core/sdl2_sink.cpp @@ -25,7 +25,7 @@ struct SDL2Sink::Impl { SDL2Sink::SDL2Sink() : impl(std::make_unique()) { if (SDL_Init(SDL_INIT_AUDIO) < 0) { - NGLOG_CRITICAL(Audio_Sink, "SDL_Init(SDL_INIT_AUDIO) failed with: {}", SDL_GetError()); + LOG_CRITICAL(Audio_Sink, "SDL_Init(SDL_INIT_AUDIO) failed with: {}", SDL_GetError()); impl->audio_device_id = 0; return; } @@ -58,7 +58,7 @@ SDL2Sink::SDL2Sink() : impl(std::make_unique()) { impl->audio_device_id = SDL_OpenAudioDevice( device, false, &desired_audiospec, &obtained_audiospec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); if (impl->audio_device_id <= 0) { - NGLOG_CRITICAL(Audio_Sink, "SDL_OpenAudioDevice failed with code {} for device \"{}\"", + LOG_CRITICAL(Audio_Sink, "SDL_OpenAudioDevice failed with code {} for device \"{}\"", impl->audio_device_id, Settings::values.audio_device_id); return; } diff --git a/src/audio_core/sink_details.cpp b/src/audio_core/sink_details.cpp index a7e51e5f3..2a51b2b2b 100644 --- a/src/audio_core/sink_details.cpp +++ b/src/audio_core/sink_details.cpp @@ -36,7 +36,7 @@ const SinkDetails& GetSinkDetails(std::string sink_id) { if (sink_id == "auto" || iter == g_sink_details.end()) { if (sink_id != "auto") { - NGLOG_ERROR(Audio, "AudioCore::SelectSink given invalid sink_id {}", sink_id); + LOG_ERROR(Audio, "AudioCore::SelectSink given invalid sink_id {}", sink_id); } // Auto-select. // g_sink_details is ordered in terms of desirability, with the best choice at the front. diff --git a/src/audio_core/time_stretch.cpp b/src/audio_core/time_stretch.cpp index 6ed538351..e21bd932a 100644 --- a/src/audio_core/time_stretch.cpp +++ b/src/audio_core/time_stretch.cpp @@ -55,7 +55,7 @@ std::vector TimeStretcher::Process(size_t samples_in_queue) { std::vector samples = GetSamples(); if (samples_in_queue >= DROP_FRAMES_SAMPLE_DELAY) { samples.clear(); - NGLOG_DEBUG(Audio, "Dropping frames!"); + LOG_DEBUG(Audio, "Dropping frames!"); } return samples; } diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 33d1a25d5..fb6171765 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -69,38 +69,38 @@ static void PrintVersion() { static void OnStateChanged(const Network::RoomMember::State& state) { switch (state) { case Network::RoomMember::State::Idle: - NGLOG_DEBUG(Network, "Network is idle"); + LOG_DEBUG(Network, "Network is idle"); break; case Network::RoomMember::State::Joining: - NGLOG_DEBUG(Network, "Connection sequence to room started"); + LOG_DEBUG(Network, "Connection sequence to room started"); break; case Network::RoomMember::State::Joined: - NGLOG_DEBUG(Network, "Successfully joined to the room"); + LOG_DEBUG(Network, "Successfully joined to the room"); break; case Network::RoomMember::State::LostConnection: - NGLOG_DEBUG(Network, "Lost connection to the room"); + LOG_DEBUG(Network, "Lost connection to the room"); break; case Network::RoomMember::State::CouldNotConnect: - NGLOG_ERROR(Network, "State: CouldNotConnect"); + LOG_ERROR(Network, "State: CouldNotConnect"); exit(1); break; case Network::RoomMember::State::NameCollision: - NGLOG_ERROR( + LOG_ERROR( Network, "You tried to use the same nickname then another user that is connected to the Room"); exit(1); break; case Network::RoomMember::State::MacCollision: - NGLOG_ERROR(Network, "You tried to use the same MAC-Address then another user that is " + LOG_ERROR(Network, "You tried to use the same MAC-Address then another user that is " "connected to the Room"); exit(1); break; case Network::RoomMember::State::WrongPassword: - NGLOG_ERROR(Network, "Room replied with: Wrong password"); + LOG_ERROR(Network, "Room replied with: Wrong password"); exit(1); break; case Network::RoomMember::State::WrongVersion: - NGLOG_ERROR(Network, + LOG_ERROR(Network, "You are using a different version then the room you are trying to connect to"); exit(1); break; @@ -128,7 +128,7 @@ int main(int argc, char** argv) { auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); if (argv_w == nullptr) { - NGLOG_CRITICAL(Frontend, "Failed to get command line arguments"); + LOG_CRITICAL(Frontend, "Failed to get command line arguments"); return -1; } #endif @@ -170,7 +170,7 @@ int main(int argc, char** argv) { break; case 'i': { const auto cia_progress = [](size_t written, size_t total) { - NGLOG_INFO(Frontend, "{:02d}%", (written * 100 / total)); + LOG_INFO(Frontend, "{:02d}%", (written * 100 / total)); }; if (Service::AM::InstallCIA(std::string(optarg), cia_progress) != Service::AM::InstallStatus::Success) @@ -219,7 +219,7 @@ int main(int argc, char** argv) { break; case 'f': fullscreen = true; - NGLOG_INFO(Frontend, "Starting in fullscreen mode..."); + LOG_INFO(Frontend, "Starting in fullscreen mode..."); break; case 'h': PrintHelp(argv[0]); @@ -246,12 +246,12 @@ int main(int argc, char** argv) { SCOPE_EXIT({ MicroProfileShutdown(); }); if (filepath.empty()) { - NGLOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); + LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); return -1; } if (!movie_record.empty() && !movie_play.empty()) { - NGLOG_CRITICAL(Frontend, "Cannot both play and record a movie"); + LOG_CRITICAL(Frontend, "Cannot both play and record a movie"); return -1; } @@ -281,28 +281,28 @@ int main(int argc, char** argv) { switch (load_result) { case Core::System::ResultStatus::ErrorGetLoader: - NGLOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filepath); + LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filepath); return -1; case Core::System::ResultStatus::ErrorLoader: - NGLOG_CRITICAL(Frontend, "Failed to load ROM!"); + LOG_CRITICAL(Frontend, "Failed to load ROM!"); return -1; case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: - NGLOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " + LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " "being used with Citra. \n\n For more information on dumping and " "decrypting games, please refer to: " "https://citra-emu.org/wiki/dumping-game-cartridges/"); return -1; case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: - NGLOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); + LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); return -1; case Core::System::ResultStatus::ErrorNotInitialized: - NGLOG_CRITICAL(Frontend, "CPUCore not initialized"); + LOG_CRITICAL(Frontend, "CPUCore not initialized"); return -1; case Core::System::ResultStatus::ErrorSystemMode: - NGLOG_CRITICAL(Frontend, "Failed to determine system mode!"); + LOG_CRITICAL(Frontend, "Failed to determine system mode!"); return -1; case Core::System::ResultStatus::ErrorVideoCore: - NGLOG_CRITICAL(Frontend, "VideoCore not initialized"); + LOG_CRITICAL(Frontend, "VideoCore not initialized"); return -1; case Core::System::ResultStatus::Success: break; // Expected case @@ -314,11 +314,11 @@ int main(int argc, char** argv) { if (auto member = Network::GetRoomMember().lock()) { member->BindOnChatMessageRecieved(OnMessageReceived); member->BindOnStateChanged(OnStateChanged); - NGLOG_DEBUG(Network, "Start connection to {}:{} with nickname {}", address, port, + LOG_DEBUG(Network, "Start connection to {}:{} with nickname {}", address, port, nickname); member->Join(nickname, address.c_str(), port, 0, Network::NoPreferredMac, password); } else { - NGLOG_ERROR(Network, "Could not access RoomMember"); + LOG_ERROR(Network, "Could not access RoomMember"); return 0; } } diff --git a/src/citra/config.cpp b/src/citra/config.cpp index c296e062e..75f507169 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -27,17 +27,17 @@ bool Config::LoadINI(const std::string& default_contents, bool retry) { const char* location = this->sdl2_config_loc.c_str(); if (sdl2_config->ParseError() < 0) { if (retry) { - NGLOG_WARNING(Config, "Failed to load {}. Creating file from defaults...", location); + LOG_WARNING(Config, "Failed to load {}. Creating file from defaults...", location); FileUtil::CreateFullPath(location); FileUtil::WriteStringToFile(true, default_contents, location); sdl2_config = std::make_unique(location); // Reopen file return LoadINI(default_contents, false); } - NGLOG_ERROR(Config, "Failed."); + LOG_ERROR(Config, "Failed."); return false; } - NGLOG_INFO(Config, "Successfully loaded {}", location); + LOG_INFO(Config, "Successfully loaded {}", location); return true; } diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 5752566b9..60063b6be 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -63,19 +63,19 @@ void EmuWindow_SDL2::Fullscreen() { return; } - NGLOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); + LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); // Try a different fullscreening method - NGLOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); + LOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) { return; } - NGLOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); + LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); // Fallback algorithm: Maximise window. // Works on all systems (unless something is seriously wrong), so no fallback for this one. - NGLOG_INFO(Frontend, "Falling back on a maximised window..."); + LOG_INFO(Frontend, "Falling back on a maximised window..."); SDL_MaximizeWindow(render_window); } @@ -87,7 +87,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { // Initialize the window if (SDL_Init(SDL_INIT_VIDEO) < 0) { - NGLOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting..."); + LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting..."); exit(1); } @@ -110,7 +110,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); if (render_window == nullptr) { - NGLOG_CRITICAL(Frontend, "Failed to create SDL2 window: {}", SDL_GetError()); + LOG_CRITICAL(Frontend, "Failed to create SDL2 window: {}", SDL_GetError()); exit(1); } @@ -121,12 +121,12 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { gl_context = SDL_GL_CreateContext(render_window); if (gl_context == nullptr) { - NGLOG_CRITICAL(Frontend, "Failed to create SDL2 GL context: {}", SDL_GetError()); + LOG_CRITICAL(Frontend, "Failed to create SDL2 GL context: {}", SDL_GetError()); exit(1); } if (!gladLoadGLLoader(static_cast(SDL_GL_GetProcAddress))) { - NGLOG_CRITICAL(Frontend, "Failed to initialize GL functions: {}", SDL_GetError()); + LOG_CRITICAL(Frontend, "Failed to initialize GL functions: {}", SDL_GetError()); exit(1); } @@ -134,7 +134,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); SDL_PumpEvents(); SDL_GL_SetSwapInterval(Settings::values.use_vsync); - NGLOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, + LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc); DoneCurrent(); diff --git a/src/citra_qt/camera/qt_camera_base.cpp b/src/citra_qt/camera/qt_camera_base.cpp index 69593ab51..9eedad3db 100644 --- a/src/citra_qt/camera/qt_camera_base.cpp +++ b/src/citra_qt/camera/qt_camera_base.cpp @@ -31,7 +31,7 @@ void QtCameraInterface::SetFlip(Service::CAM::Flip flip) { void QtCameraInterface::SetEffect(Service::CAM::Effect effect) { if (effect != Service::CAM::Effect::None) { - NGLOG_ERROR(Service_CAM, "Unimplemented effect {}", static_cast(effect)); + LOG_ERROR(Service_CAM, "Unimplemented effect {}", static_cast(effect)); } } diff --git a/src/citra_qt/camera/qt_multimedia_camera.cpp b/src/citra_qt/camera/qt_multimedia_camera.cpp index 76a21453d..e18508c24 100644 --- a/src/citra_qt/camera/qt_multimedia_camera.cpp +++ b/src/citra_qt/camera/qt_multimedia_camera.cpp @@ -133,13 +133,13 @@ std::shared_ptr QtMultimediaCameraHandler::GetHandler } for (int i = 0; i < handlers.size(); i++) { if (!status[i]) { - NGLOG_INFO(Service_CAM, "Successfully got handler {}", i); + LOG_INFO(Service_CAM, "Successfully got handler {}", i); status[i] = true; loaded.emplace(camera_name, handlers[i]); return handlers[i]; } } - NGLOG_CRITICAL(Service_CAM, "All handlers taken up"); + LOG_CRITICAL(Service_CAM, "All handlers taken up"); return nullptr; } @@ -147,7 +147,7 @@ void QtMultimediaCameraHandler::ReleaseHandler( const std::shared_ptr& handler) { for (int i = 0; i < handlers.size(); i++) { if (handlers[i] == handler) { - NGLOG_INFO(Service_CAM, "Successfully released handler {}", i); + LOG_INFO(Service_CAM, "Successfully released handler {}", i); status[i] = false; handlers[i]->started = false; for (auto it = loaded.begin(); it != loaded.end(); it++) { @@ -192,7 +192,7 @@ bool QtMultimediaCameraHandler::CameraAvailable() const { } void QtMultimediaCameraHandler::StopCameras() { - NGLOG_INFO(Service_CAM, "Stopping all cameras"); + LOG_INFO(Service_CAM, "Stopping all cameras"); for (auto& handler : handlers) { if (handler && handler->started) { handler->StopCamera(); @@ -210,7 +210,7 @@ void QtMultimediaCameraHandler::ResumeCameras() { void QtMultimediaCameraHandler::ReleaseHandlers() { StopCameras(); - NGLOG_INFO(Service_CAM, "Releasing all handlers"); + LOG_INFO(Service_CAM, "Releasing all handlers"); for (int i = 0; i < handlers.size(); i++) { status[i] = false; handlers[i]->started = false; diff --git a/src/citra_qt/camera/still_image_camera.cpp b/src/citra_qt/camera/still_image_camera.cpp index e02d0d0d3..15b4de13e 100644 --- a/src/citra_qt/camera/still_image_camera.cpp +++ b/src/citra_qt/camera/still_image_camera.cpp @@ -62,7 +62,7 @@ std::unique_ptr StillImageCameraFactory::Create(const std::stri } QImage image(QString::fromStdString(real_config)); if (image.isNull()) { - NGLOG_ERROR(Service_CAM, "Couldn't load image \"{}\"", real_config.c_str()); + LOG_ERROR(Service_CAM, "Couldn't load image \"{}\"", real_config.c_str()); } return std::make_unique(image, flip); } diff --git a/src/citra_qt/compatdb.cpp b/src/citra_qt/compatdb.cpp index 02cc5cae9..fb0042b3c 100644 --- a/src/citra_qt/compatdb.cpp +++ b/src/citra_qt/compatdb.cpp @@ -42,7 +42,7 @@ void CompatDB::Submit() { } break; case CompatDBPage::Final: - NGLOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId()); + LOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId()); Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", compatibility->checkedId()); // older versions of QT don't support the "NoCancelButtonOnLastPage" option, this is a @@ -50,7 +50,7 @@ void CompatDB::Submit() { button(QWizard::CancelButton)->setVisible(false); break; default: - NGLOG_ERROR(Frontend, "Unexpected page: {}", currentId()); + LOG_ERROR(Frontend, "Unexpected page: {}", currentId()); } } diff --git a/src/citra_qt/configuration/configure_camera.cpp b/src/citra_qt/configuration/configure_camera.cpp index 93c088872..226fb7d0e 100644 --- a/src/citra_qt/configuration/configure_camera.cpp +++ b/src/citra_qt/configuration/configure_camera.cpp @@ -139,7 +139,7 @@ void ConfigureCamera::updateImageSourceUI() { } break; default: - NGLOG_ERROR(Service_CAM, "Unknown image source {}", image_source); + LOG_ERROR(Service_CAM, "Unknown image source {}", image_source); } ui->system_camera_label->setHidden(image_source != 2); ui->system_camera->setHidden(image_source != 2); @@ -302,7 +302,7 @@ ConfigureCamera::CameraPosition ConfigureCamera::getCameraSelection() { : CameraPosition::RearRight; } default: - NGLOG_ERROR(Frontend, "Unknown camera selection"); + LOG_ERROR(Frontend, "Unknown camera selection"); return CameraPosition::Front; } } diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index e01c302b7..080165ad4 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -533,18 +533,18 @@ void GameList::LoadCompatibilityList() { QFile compat_list{":compatibility_list/compatibility_list.json"}; if (!compat_list.open(QFile::ReadOnly | QFile::Text)) { - NGLOG_ERROR(Frontend, "Unable to open game compatibility list"); + LOG_ERROR(Frontend, "Unable to open game compatibility list"); return; } if (compat_list.size() == 0) { - NGLOG_ERROR(Frontend, "Game compatibility list is empty"); + LOG_ERROR(Frontend, "Game compatibility list is empty"); return; } const QByteArray content = compat_list.readAll(); if (content.isEmpty()) { - NGLOG_ERROR(Frontend, "Unable to completely read game compatibility list"); + LOG_ERROR(Frontend, "Unable to completely read game compatibility list"); return; } @@ -624,7 +624,7 @@ static bool HasSupportedFileExtension(const std::string& file_name) { void GameList::RefreshGameDirectory() { if (!UISettings::values.game_dirs.isEmpty() && current_worker != nullptr) { - NGLOG_INFO(Frontend, "Change detected in the games directory. Reloading game list."); + LOG_INFO(Frontend, "Change detected in the games directory. Reloading game list."); PopulateAsync(UISettings::values.game_dirs); } } diff --git a/src/citra_qt/game_list_p.h b/src/citra_qt/game_list_p.h index 8e5298cb3..b842c96a7 100644 --- a/src/citra_qt/game_list_p.h +++ b/src/citra_qt/game_list_p.h @@ -232,7 +232,7 @@ public: auto iterator = status_data.find(compatiblity); if (iterator == status_data.end()) { - NGLOG_WARNING(Frontend, "Invalid compatibility number {}", compatiblity.toStdString()); + LOG_WARNING(Frontend, "Invalid compatibility number {}", compatiblity.toStdString()); return; } CompatStatus status = iterator->second; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index b3d94e1e5..7c3c37e12 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -137,7 +137,7 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { ConnectWidgetEvents(); SetupUIStrings(); - NGLOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, + LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc); show(); @@ -528,20 +528,20 @@ void GMainWindow::OnCheckForUpdates() { void GMainWindow::CheckForUpdates() { if (updater->CheckForUpdates()) { - NGLOG_INFO(Frontend, "Update check started"); + LOG_INFO(Frontend, "Update check started"); } else { - NGLOG_WARNING(Frontend, "Unable to start check for updates"); + LOG_WARNING(Frontend, "Unable to start check for updates"); } } void GMainWindow::OnUpdateFound(bool found, bool error) { if (error) { - NGLOG_WARNING(Frontend, "Update check failed"); + LOG_WARNING(Frontend, "Update check failed"); return; } if (!found) { - NGLOG_INFO(Frontend, "No updates found"); + LOG_INFO(Frontend, "No updates found"); // If the user explicitly clicked the "Check for Updates" button, we are // going to want to show them a prompt anyway. @@ -553,12 +553,12 @@ void GMainWindow::OnUpdateFound(bool found, bool error) { } if (emulation_running && !explicit_update_check) { - NGLOG_INFO(Frontend, "Update found, deferring as game is running"); + LOG_INFO(Frontend, "Update found, deferring as game is running"); defer_update_prompt = true; return; } - NGLOG_INFO(Frontend, "Update found!"); + LOG_INFO(Frontend, "Update found!"); explicit_update_check = false; ShowUpdatePrompt(); @@ -610,13 +610,13 @@ bool GMainWindow::LoadROM(const QString& filename) { if (result != Core::System::ResultStatus::Success) { switch (result) { case Core::System::ResultStatus::ErrorGetLoader: - NGLOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filename.toStdString()); + LOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filename.toStdString()); QMessageBox::critical(this, tr("Error while loading ROM!"), tr("The ROM format is not supported.")); break; case Core::System::ResultStatus::ErrorSystemMode: - NGLOG_CRITICAL(Frontend, "Failed to load ROM!"); + LOG_CRITICAL(Frontend, "Failed to load ROM!"); QMessageBox::critical(this, tr("Error while loading ROM!"), tr("Could not determine the system mode.")); break; @@ -672,7 +672,7 @@ bool GMainWindow::LoadROM(const QString& filename) { } void GMainWindow::BootGame(const QString& filename) { - NGLOG_INFO(Frontend, "Citra starting..."); + LOG_INFO(Frontend, "Citra starting..."); StoreRecentFile(filename); // Put the filename on top of the list if (!LoadROM(filename)) @@ -825,7 +825,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target "content/"; break; default: - NGLOG_ERROR(Frontend, "Unexpected target {}", static_cast(target)); + LOG_ERROR(Frontend, "Unexpected target {}", static_cast(target)); return; } @@ -839,7 +839,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target return; } - NGLOG_INFO(Frontend, "Opening {} path for program_id={:016x}", open_target, program_id); + LOG_INFO(Frontend, "Opening {} path for program_id={:016x}", open_target, program_id); QDesktopServices::openUrl(QUrl::fromLocalFile(qpath)); } @@ -894,7 +894,7 @@ void GMainWindow::OnGameListAddDirectory() { UISettings::values.game_dirs.append(game_dir); game_list->PopulateAsync(UISettings::values.game_dirs); } else { - NGLOG_WARNING(Frontend, "Selected directory is already in the game list"); + LOG_WARNING(Frontend, "Selected directory is already in the game list"); } } @@ -1362,7 +1362,7 @@ void GMainWindow::UpdateUITheme() { QString theme_uri(":" + UISettings::values.theme + "/style.qss"); QFile f(theme_uri); if (!f.exists()) { - NGLOG_ERROR(Frontend, "Unable to set style, stylesheet file not found"); + LOG_ERROR(Frontend, "Unable to set style, stylesheet file not found"); } else { f.open(QFile::ReadOnly | QFile::Text); QTextStream ts(&f); diff --git a/src/citra_qt/multiplayer/chat_room.cpp b/src/citra_qt/multiplayer/chat_room.cpp index 5bb20bc12..de25949db 100644 --- a/src/citra_qt/multiplayer/chat_room.cpp +++ b/src/citra_qt/multiplayer/chat_room.cpp @@ -150,7 +150,7 @@ void ChatRoom::OnChatReceive(const Network::ChatEntry& chat) { return member.nickname == chat.nickname; }); if (it == members.end()) { - NGLOG_INFO(Network, "Chat message received from unknown player. Ignoring it."); + LOG_INFO(Network, "Chat message received from unknown player. Ignoring it."); return; } auto player = std::distance(members.begin(), it); @@ -177,7 +177,7 @@ void ChatRoom::OnSendChat() { return member.nickname == chat.nickname; }); if (it == members.end()) { - NGLOG_INFO(Network, "Cannot find self in the player list when sending a message."); + LOG_INFO(Network, "Cannot find self in the player list when sending a message."); } auto player = std::distance(members.begin(), it); ChatMessage m(chat); diff --git a/src/citra_qt/multiplayer/host_room.cpp b/src/citra_qt/multiplayer/host_room.cpp index 93804b1ee..8366f8747 100644 --- a/src/citra_qt/multiplayer/host_room.cpp +++ b/src/citra_qt/multiplayer/host_room.cpp @@ -103,7 +103,7 @@ void HostRoomWindow::Host() { ui->max_player->value(), game_name.toStdString(), game_id); if (!created) { NetworkMessage::ShowError(NetworkMessage::COULD_NOT_CREATE_ROOM); - NGLOG_ERROR(Network, "Could not create room!"); + LOG_ERROR(Network, "Could not create room!"); ui->host->setEnabled(true); return; } @@ -136,7 +136,7 @@ void HostRoomWindow::OnConnection() { if (auto session = announce_multiplayer_session.lock()) { session->Start(); } else { - NGLOG_ERROR(Network, "Starting announce session failed"); + LOG_ERROR(Network, "Starting announce session failed"); } } close(); diff --git a/src/citra_qt/multiplayer/state.cpp b/src/citra_qt/multiplayer/state.cpp index e6a86e1fa..bfe8255f9 100644 --- a/src/citra_qt/multiplayer/state.cpp +++ b/src/citra_qt/multiplayer/state.cpp @@ -66,7 +66,7 @@ void MultiplayerState::Close() { } void MultiplayerState::OnNetworkStateChanged(const Network::RoomMember::State& state) { - NGLOG_DEBUG(Frontend, "Network State: {}", Network::GetStateStr(state)); + LOG_DEBUG(Frontend, "Network State: {}", Network::GetStateStr(state)); bool is_connected = false; switch (state) { case Network::RoomMember::State::LostConnection: @@ -147,7 +147,7 @@ bool MultiplayerState::OnCloseRoom() { // if you are in a room, leave it if (auto member = Network::GetRoomMember().lock()) { member->Leave(); - NGLOG_DEBUG(Frontend, "Left the room (as a client)"); + LOG_DEBUG(Frontend, "Left the room (as a client)"); } // if you are hosting a room, also stop hosting @@ -156,7 +156,7 @@ bool MultiplayerState::OnCloseRoom() { } room->Destroy(); announce_multiplayer_session->Stop(); - NGLOG_DEBUG(Frontend, "Closed the room (as a server)"); + LOG_DEBUG(Frontend, "Closed the room (as a server)"); } return true; } diff --git a/src/citra_qt/updater/updater.cpp b/src/citra_qt/updater/updater.cpp index 804ae43df..53c81a613 100644 --- a/src/citra_qt/updater/updater.cpp +++ b/src/citra_qt/updater/updater.cpp @@ -211,7 +211,7 @@ XMLParseResult UpdaterPrivate::ParseResult(const QByteArray& output, } if (reader.hasError()) { - NGLOG_ERROR(Frontend, "Cannot read xml for update: {}", reader.errorString().toStdString()); + LOG_ERROR(Frontend, "Cannot read xml for update: {}", reader.errorString().toStdString()); return XMLParseResult::InvalidXML; } @@ -275,18 +275,18 @@ void UpdaterPrivate::LaunchWithArguments(const QStringList& args) { QFileInfo tool_info(QCoreApplication::applicationDirPath(), tool_path); if (!QProcess::startDetached(tool_info.absoluteFilePath(), args, tool_info.absolutePath())) { - NGLOG_WARNING(Frontend, "Unable to start program {}", + LOG_WARNING(Frontend, "Unable to start program {}", tool_info.absoluteFilePath().toStdString()); } } void UpdaterPrivate::LaunchUI() { - NGLOG_INFO(Frontend, "Launching update UI..."); + LOG_INFO(Frontend, "Launching update UI..."); LaunchWithArguments(run_arguments); } void UpdaterPrivate::SilentlyUpdate() { - NGLOG_INFO(Frontend, "Launching silent update..."); + LOG_INFO(Frontend, "Launching silent update..."); LaunchWithArguments(silent_arguments); } diff --git a/src/common/assert.h b/src/common/assert.h index cf8109af8..252a4dfbe 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -30,7 +30,7 @@ __declspec(noinline, noreturn) #define ASSERT(_a_) \ do \ if (!(_a_)) { \ - assert_noinline_call([] { NGLOG_CRITICAL(Debug, "Assertion Failed!"); }); \ + assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ } \ while (0) @@ -38,7 +38,7 @@ __declspec(noinline, noreturn) do \ if (!(_a_)) { \ assert_noinline_call( \ - [&] { NGLOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ + [&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ } \ while (0) @@ -53,5 +53,5 @@ __declspec(noinline, noreturn) #define DEBUG_ASSERT_MSG(_a_, _desc_, ...) #endif -#define UNIMPLEMENTED() NGLOG_CRITICAL(Debug, "Unimplemented code!") +#define UNIMPLEMENTED() LOG_CRITICAL(Debug, "Unimplemented code!") #define UNIMPLEMENTED_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__) diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index 277dfb697..a7bbe9f8a 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -159,7 +159,7 @@ public: Do(foundVersion); if (error == ERROR_FAILURE || foundVersion < minVer || foundVersion > ver) { - NGLOG_ERROR(Common, "Savestate failure: wrong version {} found for {}", foundVersion, + LOG_ERROR(Common, "Savestate failure: wrong version {} found for {}", foundVersion, title); SetError(ERROR_FAILURE); return PointerWrapSection(*this, -1, title); @@ -466,7 +466,7 @@ public: } break; default: - NGLOG_ERROR(Common, "Savestate error: invalid mode {}.", mode); + LOG_ERROR(Common, "Savestate error: invalid mode {}.", mode); } } @@ -607,7 +607,7 @@ public: u32 cookie = arbitraryNumber; Do(cookie); if (mode == PointerWrap::MODE_READ && cookie != arbitraryNumber) { - NGLOG_ERROR(Common, + LOG_ERROR(Common, "After \"{}\", found {} ({:#X}) instead of save marker {} ({:#X}). " "Aborting savestate load...", prevName, cookie, cookie, arbitraryNumber, arbitraryNumber); diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 2168c88f8..f2b967e03 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -118,7 +118,7 @@ bool IsDirectory(const std::string& filename) { #endif if (result < 0) { - NGLOG_DEBUG(Common_Filesystem, "stat failed on {}: {}", filename, GetLastErrorMsg()); + LOG_DEBUG(Common_Filesystem, "stat failed on {}: {}", filename, GetLastErrorMsg()); return false; } @@ -128,29 +128,29 @@ bool IsDirectory(const std::string& filename) { // Deletes a given filename, return true on success // Doesn't supports deleting a directory bool Delete(const std::string& filename) { - NGLOG_TRACE(Common_Filesystem, "file {}", filename); + LOG_TRACE(Common_Filesystem, "file {}", filename); // Return true because we care about the file no // being there, not the actual delete. if (!Exists(filename)) { - NGLOG_DEBUG(Common_Filesystem, "{} does not exist", filename); + LOG_DEBUG(Common_Filesystem, "{} does not exist", filename); return true; } // We can't delete a directory if (IsDirectory(filename)) { - NGLOG_ERROR(Common_Filesystem, "Failed: {} is a directory", filename); + LOG_ERROR(Common_Filesystem, "Failed: {} is a directory", filename); return false; } #ifdef _WIN32 if (!DeleteFileW(Common::UTF8ToUTF16W(filename).c_str())) { - NGLOG_ERROR(Common_Filesystem, "DeleteFile failed on {}: {}", filename, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "DeleteFile failed on {}: {}", filename, GetLastErrorMsg()); return false; } #else if (unlink(filename.c_str()) == -1) { - NGLOG_ERROR(Common_Filesystem, "unlink failed on {}: {}", filename, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "unlink failed on {}: {}", filename, GetLastErrorMsg()); return false; } #endif @@ -160,16 +160,16 @@ bool Delete(const std::string& filename) { // Returns true if successful, or path already exists. bool CreateDir(const std::string& path) { - NGLOG_TRACE(Common_Filesystem, "directory {}", path); + LOG_TRACE(Common_Filesystem, "directory {}", path); #ifdef _WIN32 if (::CreateDirectoryW(Common::UTF8ToUTF16W(path).c_str(), nullptr)) return true; DWORD error = GetLastError(); if (error == ERROR_ALREADY_EXISTS) { - NGLOG_DEBUG(Common_Filesystem, "CreateDirectory failed on {}: already exists", path); + LOG_DEBUG(Common_Filesystem, "CreateDirectory failed on {}: already exists", path); return true; } - NGLOG_ERROR(Common_Filesystem, "CreateDirectory failed on {}: {}", path, error); + LOG_ERROR(Common_Filesystem, "CreateDirectory failed on {}: {}", path, error); return false; #else if (mkdir(path.c_str(), 0755) == 0) @@ -178,11 +178,11 @@ bool CreateDir(const std::string& path) { int err = errno; if (err == EEXIST) { - NGLOG_DEBUG(Common_Filesystem, "mkdir failed on {}: already exists", path); + LOG_DEBUG(Common_Filesystem, "mkdir failed on {}: already exists", path); return true; } - NGLOG_ERROR(Common_Filesystem, "mkdir failed on {}: {}", path, strerror(err)); + LOG_ERROR(Common_Filesystem, "mkdir failed on {}: {}", path, strerror(err)); return false; #endif } @@ -190,10 +190,10 @@ bool CreateDir(const std::string& path) { // Creates the full path of fullPath returns true on success bool CreateFullPath(const std::string& fullPath) { int panicCounter = 100; - NGLOG_TRACE(Common_Filesystem, "path {}", fullPath); + LOG_TRACE(Common_Filesystem, "path {}", fullPath); if (FileUtil::Exists(fullPath)) { - NGLOG_DEBUG(Common_Filesystem, "path exists {}", fullPath); + LOG_DEBUG(Common_Filesystem, "path exists {}", fullPath); return true; } @@ -209,14 +209,14 @@ bool CreateFullPath(const std::string& fullPath) { // Include the '/' so the first call is CreateDir("/") rather than CreateDir("") std::string const subPath(fullPath.substr(0, position + 1)); if (!FileUtil::IsDirectory(subPath) && !FileUtil::CreateDir(subPath)) { - NGLOG_ERROR(Common, "CreateFullPath: directory creation failed"); + LOG_ERROR(Common, "CreateFullPath: directory creation failed"); return false; } // A safety check panicCounter--; if (panicCounter <= 0) { - NGLOG_ERROR(Common, "CreateFullPath: directory structure is too deep"); + LOG_ERROR(Common, "CreateFullPath: directory structure is too deep"); return false; } position++; @@ -225,11 +225,11 @@ bool CreateFullPath(const std::string& fullPath) { // Deletes a directory filename, returns true on success bool DeleteDir(const std::string& filename) { - NGLOG_TRACE(Common_Filesystem, "directory {}", filename); + LOG_TRACE(Common_Filesystem, "directory {}", filename); // check if a directory if (!FileUtil::IsDirectory(filename)) { - NGLOG_ERROR(Common_Filesystem, "Not a directory {}", filename); + LOG_ERROR(Common_Filesystem, "Not a directory {}", filename); return false; } @@ -240,14 +240,14 @@ bool DeleteDir(const std::string& filename) { if (rmdir(filename.c_str()) == 0) return true; #endif - NGLOG_ERROR(Common_Filesystem, "failed {}: {}", filename, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "failed {}: {}", filename, GetLastErrorMsg()); return false; } // renames file srcFilename to destFilename, returns true on success bool Rename(const std::string& srcFilename, const std::string& destFilename) { - NGLOG_TRACE(Common_Filesystem, "{} --> {}", srcFilename, destFilename); + LOG_TRACE(Common_Filesystem, "{} --> {}", srcFilename, destFilename); #ifdef _WIN32 if (_wrename(Common::UTF8ToUTF16W(srcFilename).c_str(), Common::UTF8ToUTF16W(destFilename).c_str()) == 0) @@ -256,20 +256,20 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename) { if (rename(srcFilename.c_str(), destFilename.c_str()) == 0) return true; #endif - NGLOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, + LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, GetLastErrorMsg()); return false; } // copies file srcFilename to destFilename, returns true on success bool Copy(const std::string& srcFilename, const std::string& destFilename) { - NGLOG_TRACE(Common_Filesystem, "{} --> {}", srcFilename, destFilename); + LOG_TRACE(Common_Filesystem, "{} --> {}", srcFilename, destFilename); #ifdef _WIN32 if (CopyFileW(Common::UTF8ToUTF16W(srcFilename).c_str(), Common::UTF8ToUTF16W(destFilename).c_str(), FALSE)) return true; - NGLOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, + LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, GetLastErrorMsg()); return false; #else @@ -282,7 +282,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { // Open input file FILE* input = fopen(srcFilename.c_str(), "rb"); if (!input) { - NGLOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename, + LOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename, destFilename, GetLastErrorMsg()); return false; } @@ -291,7 +291,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { FILE* output = fopen(destFilename.c_str(), "wb"); if (!output) { fclose(input); - NGLOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename, + LOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename, destFilename, GetLastErrorMsg()); return false; } @@ -302,7 +302,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { size_t rnum = fread(buffer, sizeof(char), BSIZE, input); if (rnum != BSIZE) { if (ferror(input) != 0) { - NGLOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}", + LOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}", srcFilename, destFilename, GetLastErrorMsg()); goto bail; } @@ -311,7 +311,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { // write output size_t wnum = fwrite(buffer, sizeof(char), rnum, output); if (wnum != rnum) { - NGLOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename, + LOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename, destFilename, GetLastErrorMsg()); goto bail; } @@ -332,12 +332,12 @@ bail: // Returns the size of filename (64bit) u64 GetSize(const std::string& filename) { if (!Exists(filename)) { - NGLOG_ERROR(Common_Filesystem, "failed {}: No such file", filename); + LOG_ERROR(Common_Filesystem, "failed {}: No such file", filename); return 0; } if (IsDirectory(filename)) { - NGLOG_ERROR(Common_Filesystem, "failed {}: is a directory", filename); + LOG_ERROR(Common_Filesystem, "failed {}: is a directory", filename); return 0; } @@ -348,11 +348,11 @@ u64 GetSize(const std::string& filename) { if (stat(filename.c_str(), &buf) == 0) #endif { - NGLOG_TRACE(Common_Filesystem, "{}: {}", filename, buf.st_size); + LOG_TRACE(Common_Filesystem, "{}: {}", filename, buf.st_size); return buf.st_size; } - NGLOG_ERROR(Common_Filesystem, "Stat failed {}: {}", filename, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "Stat failed {}: {}", filename, GetLastErrorMsg()); return 0; } @@ -360,7 +360,7 @@ u64 GetSize(const std::string& filename) { u64 GetSize(const int fd) { struct stat buf; if (fstat(fd, &buf) != 0) { - NGLOG_ERROR(Common_Filesystem, "GetSize: stat failed {}: {}", fd, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "GetSize: stat failed {}: {}", fd, GetLastErrorMsg()); return 0; } return buf.st_size; @@ -371,12 +371,12 @@ u64 GetSize(FILE* f) { // can't use off_t here because it can be 32-bit u64 pos = ftello(f); if (fseeko(f, 0, SEEK_END) != 0) { - NGLOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", (void*)f, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", (void*)f, GetLastErrorMsg()); return 0; } u64 size = ftello(f); if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) { - NGLOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", (void*)f, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", (void*)f, GetLastErrorMsg()); return 0; } return size; @@ -384,10 +384,10 @@ u64 GetSize(FILE* f) { // creates an empty file filename, returns true on success bool CreateEmptyFile(const std::string& filename) { - NGLOG_TRACE(Common_Filesystem, "{}", filename); + LOG_TRACE(Common_Filesystem, "{}", filename); if (!FileUtil::IOFile(filename, "wb")) { - NGLOG_ERROR(Common_Filesystem, "failed {}: {}", filename, GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "failed {}: {}", filename, GetLastErrorMsg()); return false; } @@ -396,7 +396,7 @@ bool CreateEmptyFile(const std::string& filename) { bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directory, DirectoryEntryCallable callback) { - NGLOG_TRACE(Common_Filesystem, "directory {}", directory); + LOG_TRACE(Common_Filesystem, "directory {}", directory); // How many files + directories we found unsigned found_entries = 0; @@ -554,7 +554,7 @@ std::string GetCurrentDir() { char* dir; if (!(dir = getcwd(nullptr, 0))) { #endif - NGLOG_ERROR(Common_Filesystem, "GetCurrentDirectory failed: {}", GetLastErrorMsg()); + LOG_ERROR(Common_Filesystem, "GetCurrentDirectory failed: {}", GetLastErrorMsg()); return nullptr; } #ifdef _WIN32 @@ -674,7 +674,7 @@ std::string GetSysDirectory() { #endif sysDir += DIR_SEP; - NGLOG_DEBUG(Common_Filesystem, "Setting to {}:", sysDir); + LOG_DEBUG(Common_Filesystem, "Setting to {}:", sysDir); return sysDir; } @@ -690,7 +690,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string& new if (!FileUtil::IsDirectory(paths[D_USER_IDX])) { paths[D_USER_IDX] = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP; } else { - NGLOG_INFO(Common_Filesystem, "Using the local user directory"); + LOG_INFO(Common_Filesystem, "Using the local user directory"); } paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; @@ -719,7 +719,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string& new if (!newPath.empty()) { if (!FileUtil::IsDirectory(newPath)) { - NGLOG_ERROR(Common_Filesystem, "Invalid path specified {}", newPath); + LOG_ERROR(Common_Filesystem, "Invalid path specified {}", newPath); return paths[DirIDX]; } else { paths[DirIDX] = newPath; diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 1ab6c2ee3..47bd3a01d 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -65,14 +65,14 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin, const std::string::const_iterator end) { auto level_separator = std::find(begin, end, ':'); if (level_separator == end) { - NGLOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: {}", + LOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: {}", std::string(begin, end)); return false; } const Level level = GetLevelByName(level_separator + 1, end); if (level == Level::Count) { - NGLOG_ERROR(Log, "Unknown log level in filter: {}", std::string(begin, end)); + LOG_ERROR(Log, "Unknown log level in filter: {}", std::string(begin, end)); return false; } @@ -83,7 +83,7 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin, const Class log_class = GetClassByName(begin, level_separator); if (log_class == Class::Count) { - NGLOG_ERROR(Log, "Unknown log class in filter: {}", std::string(begin, end)); + LOG_ERROR(Log, "Unknown log class in filter: {}", std::string(begin, end)); return false; } diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 581a0de58..4910f5fed 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -113,29 +113,29 @@ void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsig } // namespace Log // Define the fmt lib macros -#define NGLOG_GENERIC(log_class, log_level, ...) \ +#define LOG_GENERIC(log_class, log_level, ...) \ ::Log::FmtLogMessage(log_class, log_level, __FILE__, __LINE__, __func__, __VA_ARGS__) #ifdef _DEBUG -#define NGLOG_TRACE(log_class, ...) \ +#define LOG_TRACE(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Trace, __FILE__, __LINE__, \ __func__, __VA_ARGS__) #else -#define NGLOG_TRACE(log_class, fmt, ...) (void(0)) +#define LOG_TRACE(log_class, fmt, ...) (void(0)) #endif -#define NGLOG_DEBUG(log_class, ...) \ +#define LOG_DEBUG(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Debug, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define NGLOG_INFO(log_class, ...) \ +#define LOG_INFO(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Info, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define NGLOG_WARNING(log_class, ...) \ +#define LOG_WARNING(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Warning, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define NGLOG_ERROR(log_class, ...) \ +#define LOG_ERROR(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Error, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define NGLOG_CRITICAL(log_class, ...) \ +#define LOG_CRITICAL(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Critical, __FILE__, __LINE__, \ __func__, __VA_ARGS__) diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 11d2cb13a..835d9478b 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp @@ -55,7 +55,7 @@ void* AllocateExecutableMemory(size_t size, bool low) { if (ptr == MAP_FAILED) { ptr = nullptr; #endif - NGLOG_ERROR(Common_Memory, "Failed to allocate executable memory"); + LOG_ERROR(Common_Memory, "Failed to allocate executable memory"); } #if !defined(_WIN32) && defined(ARCHITECTURE_x86_64) && !defined(MAP_32BIT) else { @@ -68,7 +68,7 @@ void* AllocateExecutableMemory(size_t size, bool low) { #if EMU_ARCH_BITS == 64 if ((u64)ptr >= 0x80000000 && low == true) - NGLOG_ERROR(Common_Memory, "Executable memory ended up above 2GB!"); + LOG_ERROR(Common_Memory, "Executable memory ended up above 2GB!"); #endif return ptr; @@ -85,7 +85,7 @@ void* AllocateMemoryPages(size_t size) { #endif if (ptr == nullptr) - NGLOG_ERROR(Common_Memory, "Failed to allocate raw memory"); + LOG_ERROR(Common_Memory, "Failed to allocate raw memory"); return ptr; } @@ -99,12 +99,12 @@ void* AllocateAlignedMemory(size_t size, size_t alignment) { ptr = memalign(alignment, size); #else if (posix_memalign(&ptr, alignment, size) != 0) - NGLOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); + LOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); #endif #endif if (ptr == nullptr) - NGLOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); + LOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); return ptr; } @@ -113,7 +113,7 @@ void FreeMemoryPages(void* ptr, size_t size) { if (ptr) { #ifdef _WIN32 if (!VirtualFree(ptr, 0, MEM_RELEASE)) - NGLOG_ERROR(Common_Memory, "FreeMemoryPages failed!\n{}", GetLastErrorMsg()); + LOG_ERROR(Common_Memory, "FreeMemoryPages failed!\n{}", GetLastErrorMsg()); #else munmap(ptr, size); #endif @@ -134,7 +134,7 @@ void WriteProtectMemory(void* ptr, size_t size, bool allowExecute) { #ifdef _WIN32 DWORD oldValue; if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READ : PAGE_READONLY, &oldValue)) - NGLOG_ERROR(Common_Memory, "WriteProtectMemory failed!\n{}", GetLastErrorMsg()); + LOG_ERROR(Common_Memory, "WriteProtectMemory failed!\n{}", GetLastErrorMsg()); #else mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_EXEC) : PROT_READ); #endif @@ -145,7 +145,7 @@ void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute) { DWORD oldValue; if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, &oldValue)) - NGLOG_ERROR(Common_Memory, "UnWriteProtectMemory failed!\n{}", GetLastErrorMsg()); + LOG_ERROR(Common_Memory, "UnWriteProtectMemory failed!\n{}", GetLastErrorMsg()); #else mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_WRITE | PROT_EXEC) : PROT_WRITE | PROT_READ); diff --git a/src/common/param_package.cpp b/src/common/param_package.cpp index 10b16f124..3a4914bcb 100644 --- a/src/common/param_package.cpp +++ b/src/common/param_package.cpp @@ -25,7 +25,7 @@ ParamPackage::ParamPackage(const std::string& serialized) { std::vector key_value; Common::SplitString(pair, KEY_VALUE_SEPARATOR, key_value); if (key_value.size() != 2) { - NGLOG_ERROR(Common, "invalid key pair {}", pair); + LOG_ERROR(Common, "invalid key pair {}", pair); continue; } @@ -64,7 +64,7 @@ std::string ParamPackage::Serialize() const { std::string ParamPackage::Get(const std::string& key, const std::string& default_value) const { auto pair = data.find(key); if (pair == data.end()) { - NGLOG_DEBUG(Common, "key {} not found", key); + LOG_DEBUG(Common, "key {} not found", key); return default_value; } @@ -74,14 +74,14 @@ std::string ParamPackage::Get(const std::string& key, const std::string& default int ParamPackage::Get(const std::string& key, int default_value) const { auto pair = data.find(key); if (pair == data.end()) { - NGLOG_DEBUG(Common, "key {} not found", key); + LOG_DEBUG(Common, "key {} not found", key); return default_value; } try { return std::stoi(pair->second); } catch (const std::logic_error&) { - NGLOG_ERROR(Common, "failed to convert {} to int", pair->second); + LOG_ERROR(Common, "failed to convert {} to int", pair->second); return default_value; } } @@ -89,14 +89,14 @@ int ParamPackage::Get(const std::string& key, int default_value) const { float ParamPackage::Get(const std::string& key, float default_value) const { auto pair = data.find(key); if (pair == data.end()) { - NGLOG_DEBUG(Common, "key {} not found", key); + LOG_DEBUG(Common, "key {} not found", key); return default_value; } try { return std::stof(pair->second); } catch (const std::logic_error&) { - NGLOG_ERROR(Common, "failed to convert {} to float", pair->second); + LOG_ERROR(Common, "failed to convert {} to float", pair->second); return default_value; } } diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index b10889a4c..a31ed3a8d 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -107,7 +107,7 @@ std::string StringFromFormat(const char* format, ...) { #else va_start(args, format); if (vasprintf(&buf, format, args) < 0) - NGLOG_ERROR(Common, "Unable to allocate memory for string"); + LOG_ERROR(Common, "Unable to allocate memory for string"); va_end(args); std::string temp = buf; @@ -347,7 +347,7 @@ static std::string CodeToUTF8(const char* fromcode, const std::basic_string& iconv_t const conv_desc = iconv_open("UTF-8", fromcode); if ((iconv_t)(-1) == conv_desc) { - NGLOG_ERROR(Common, "Iconv initialization failure [{}]: {}", fromcode, strerror(errno)); + LOG_ERROR(Common, "Iconv initialization failure [{}]: {}", fromcode, strerror(errno)); iconv_close(conv_desc); return {}; } @@ -376,7 +376,7 @@ static std::string CodeToUTF8(const char* fromcode, const std::basic_string& ++src_buffer; } } else { - NGLOG_ERROR(Common, "iconv failure [{}]: {}", fromcode, strerror(errno)); + LOG_ERROR(Common, "iconv failure [{}]: {}", fromcode, strerror(errno)); break; } } @@ -395,7 +395,7 @@ std::u16string UTF8ToUTF16(const std::string& input) { iconv_t const conv_desc = iconv_open("UTF-16LE", "UTF-8"); if ((iconv_t)(-1) == conv_desc) { - NGLOG_ERROR(Common, "Iconv initialization failure [UTF-8]: {}", strerror(errno)); + LOG_ERROR(Common, "Iconv initialization failure [UTF-8]: {}", strerror(errno)); iconv_close(conv_desc); return {}; } @@ -424,7 +424,7 @@ std::u16string UTF8ToUTF16(const std::string& input) { ++src_buffer; } } else { - NGLOG_ERROR(Common, "iconv failure [UTF-8]: {}", strerror(errno)); + LOG_ERROR(Common, "iconv failure [UTF-8]: {}", strerror(errno)); break; } } diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 9548d0e16..6b0125292 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -231,7 +231,7 @@ static unsigned int DPO(RotateRightByRegister)(ARMul_State* cpu, unsigned int sh } #define DEBUG_MSG \ - NGLOG_DEBUG(Core_ARM11, "inst is {:x}", inst); \ + LOG_DEBUG(Core_ARM11, "inst is {:x}", inst); \ CITRA_IGNORE_EXIT(0) #define LnSWoUB(s) glue(LnSWoUB, s) @@ -770,7 +770,7 @@ static ThumbDecodeStatus DecodeThumbInstruction(u32 inst, u32 addr, u32* arm_ins inst_index = table_length - 4; *ptr_inst_base = arm_instruction_trans[inst_index](tinstr, inst_index); } else { - NGLOG_ERROR(Core_ARM11, "thumb decoder error"); + LOG_ERROR(Core_ARM11, "thumb decoder error"); } break; case 28: @@ -828,9 +828,9 @@ static unsigned int InterpreterTranslateInstruction(const ARMul_State* cpu, cons int idx; if (DecodeARMInstruction(inst, &idx) == ARMDecodeStatus::FAILURE) { - NGLOG_ERROR(Core_ARM11, "Decode failure.\tPC: [{:#010X}]\tInstruction: {:08X}", phys_addr, + LOG_ERROR(Core_ARM11, "Decode failure.\tPC: [{:#010X}]\tInstruction: {:08X}", phys_addr, inst); - NGLOG_ERROR(Core_ARM11, "cpsr={:#X}, cpu->TFlag={}, r15={:#010X}", cpu->Cpsr, cpu->TFlag, + LOG_ERROR(Core_ARM11, "cpsr={:#X}, cpu->TFlag={}, r15={:#010X}", cpu->Cpsr, cpu->TFlag, cpu->Reg[15]); CITRA_IGNORE_EXIT(-1); } @@ -1802,7 +1802,7 @@ BIC_INST : { BKPT_INST : { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { bkpt_inst* const inst_cream = (bkpt_inst*)inst_base->component; - NGLOG_DEBUG(Core_ARM11, "Breakpoint instruction hit. Immediate: {:#010X}", inst_cream->imm); + LOG_DEBUG(Core_ARM11, "Breakpoint instruction hit. Immediate: {:#010X}", inst_cream->imm); } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(bkpt_inst)); @@ -2017,7 +2017,7 @@ EOR_INST : { } LDC_INST : { // Instruction not implemented - // NGLOG_CRITICAL(Core_ARM11, "unimplemented instruction"); + // LOG_CRITICAL(Core_ARM11, "unimplemented instruction"); cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(ldc_inst)); FETCH_INST; @@ -2368,7 +2368,7 @@ MCRR_INST : { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { mcrr_inst* const inst_cream = (mcrr_inst*)inst_base->component; - NGLOG_ERROR(Core_ARM11, + LOG_ERROR(Core_ARM11, "MCRR executed | Coprocessor: {}, CRm {}, opc1: {}, Rt: {}, Rt2: {}", inst_cream->cp_num, inst_cream->crm, inst_cream->opcode_1, inst_cream->rt, inst_cream->rt2); @@ -2452,7 +2452,7 @@ MRRC_INST : { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { mcrr_inst* const inst_cream = (mcrr_inst*)inst_base->component; - NGLOG_ERROR(Core_ARM11, + LOG_ERROR(Core_ARM11, "MRRC executed | Coprocessor: {}, CRm {}, opc1: {}, Rt: {}, Rt2: {}", inst_cream->cp_num, inst_cream->crm, inst_cream->opcode_1, inst_cream->rt, inst_cream->rt2); @@ -3080,7 +3080,7 @@ SETEND_INST : { else cpu->Cpsr &= ~(1 << 9); - NGLOG_WARNING(Core_ARM11, "SETEND {} executed", big_endian ? "BE" : "LE"); + LOG_WARNING(Core_ARM11, "SETEND {} executed", big_endian ? "BE" : "LE"); cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(setend_inst)); @@ -3091,7 +3091,7 @@ SETEND_INST : { SEV_INST : { // Stubbed, as SEV is a hint instruction. if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { - NGLOG_TRACE(Core_ARM11, "SEV executed."); + LOG_TRACE(Core_ARM11, "SEV executed."); } cpu->Reg[15] += cpu->GetInstructionSize(); @@ -3541,7 +3541,7 @@ SSAT16_INST : { STC_INST : { // Instruction not implemented - // NGLOG_CRITICAL(Core_ARM11, "unimplemented instruction"); + // LOG_CRITICAL(Core_ARM11, "unimplemented instruction"); cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(stc_inst)); FETCH_INST; @@ -4537,7 +4537,7 @@ UXTB16_INST : { WFE_INST : { // Stubbed, as WFE is a hint instruction. if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { - NGLOG_TRACE(Core_ARM11, "WFE executed."); + LOG_TRACE(Core_ARM11, "WFE executed."); } cpu->Reg[15] += cpu->GetInstructionSize(); @@ -4549,7 +4549,7 @@ WFE_INST : { WFI_INST : { // Stubbed, as WFI is a hint instruction. if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { - NGLOG_TRACE(Core_ARM11, "WFI executed."); + LOG_TRACE(Core_ARM11, "WFI executed."); } cpu->Reg[15] += cpu->GetInstructionSize(); @@ -4561,7 +4561,7 @@ WFI_INST : { YIELD_INST : { // Stubbed, as YIELD is a hint instruction. if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { - NGLOG_TRACE(Core_ARM11, "YIELD executed."); + LOG_TRACE(Core_ARM11, "YIELD executed."); } cpu->Reg[15] += cpu->GetInstructionSize(); diff --git a/src/core/arm/dyncom/arm_dyncom_trans.cpp b/src/core/arm/dyncom/arm_dyncom_trans.cpp index 53041af15..d56299e6e 100644 --- a/src/core/arm/dyncom/arm_dyncom_trans.cpp +++ b/src/core/arm/dyncom/arm_dyncom_trans.cpp @@ -184,7 +184,7 @@ static ARM_INST_PTR INTERPRETER_TRANSLATE(cdp)(unsigned int inst, int index) { inst_cream->opcode_1 = BITS(inst, 20, 23); inst_cream->inst = inst; - NGLOG_TRACE(Core_ARM11, "inst {:x} index {:x}", inst, index); + LOG_TRACE(Core_ARM11, "inst {:x} index {:x}", inst, index); return inst_base; } static ARM_INST_PTR INTERPRETER_TRANSLATE(clrex)(unsigned int inst, int index) { diff --git a/src/core/arm/skyeye_common/armstate.cpp b/src/core/arm/skyeye_common/armstate.cpp index f1c3326aa..2283dc4a1 100644 --- a/src/core/arm/skyeye_common/armstate.cpp +++ b/src/core/arm/skyeye_common/armstate.cpp @@ -183,7 +183,7 @@ void ARMul_State::ResetMPCoreCP15Registers() { static void CheckMemoryBreakpoint(u32 address, GDBStub::BreakpointType type) { if (GDBStub::IsServerEnabled() && GDBStub::CheckBreakpoint(address, type)) { - NGLOG_DEBUG(Debug, "Found memory breakpoint @ {:08x}", address); + LOG_DEBUG(Debug, "Found memory breakpoint @ {:08x}", address); GDBStub::Break(true); } } @@ -428,7 +428,7 @@ u32 ARMul_State::ReadCP15Register(u32 crn, u32 opcode_1, u32 crm, u32 opcode_2) } } - NGLOG_ERROR(Core_ARM11, "MRC CRn={}, CRm={}, OP1={} OP2={} is not implemented. Returning zero.", + LOG_ERROR(Core_ARM11, "MRC CRn={}, CRm={}, OP1={} OP2={} is not implemented. Returning zero.", crn, crm, opcode_1, opcode_2); return 0; } diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp index f3922271b..4ce6cd806 100644 --- a/src/core/arm/skyeye_common/vfp/vfp.cpp +++ b/src/core/arm/skyeye_common/vfp/vfp.cpp @@ -90,23 +90,23 @@ void VMOVR(ARMul_State* state, u32 single, u32 d, u32 m) { /* Miscellaneous functions */ s32 vfp_get_float(ARMul_State* state, unsigned int reg) { - NGLOG_TRACE(Core_ARM11, "VFP get float: s{}=[{:08x}]", reg, state->ExtReg[reg]); + LOG_TRACE(Core_ARM11, "VFP get float: s{}=[{:08x}]", reg, state->ExtReg[reg]); return state->ExtReg[reg]; } void vfp_put_float(ARMul_State* state, s32 val, unsigned int reg) { - NGLOG_TRACE(Core_ARM11, "VFP put float: s{} <= [{:08x}]", reg, val); + LOG_TRACE(Core_ARM11, "VFP put float: s{} <= [{:08x}]", reg, val); state->ExtReg[reg] = val; } u64 vfp_get_double(ARMul_State* state, unsigned int reg) { u64 result = ((u64)state->ExtReg[reg * 2 + 1]) << 32 | state->ExtReg[reg * 2]; - NGLOG_TRACE(Core_ARM11, "VFP get double: s[{}-{}]=[{:016llx}]", reg * 2 + 1, reg * 2, result); + LOG_TRACE(Core_ARM11, "VFP get double: s[{}-{}]=[{:016llx}]", reg * 2 + 1, reg * 2, result); return result; } void vfp_put_double(ARMul_State* state, u64 val, unsigned int reg) { - NGLOG_TRACE(Core_ARM11, "VFP put double: s[{}-{}] <= [{:08x}-{:08x}]", reg * 2 + 1, reg * 2, + LOG_TRACE(Core_ARM11, "VFP put double: s[{}-{}] <= [{:08x}-{:08x}]", reg * 2 + 1, reg * 2, (u32)(val >> 32), (u32)(val & 0xffffffff)); state->ExtReg[reg * 2] = (u32)(val & 0xffffffff); state->ExtReg[reg * 2 + 1] = (u32)(val >> 32); @@ -116,10 +116,10 @@ void vfp_put_double(ARMul_State* state, u64 val, unsigned int reg) { * Process bitmask of exception conditions. (from vfpmodule.c) */ void vfp_raise_exceptions(ARMul_State* state, u32 exceptions, u32 inst, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "VFP: raising exceptions {:08x}", exceptions); + LOG_TRACE(Core_ARM11, "VFP: raising exceptions {:08x}", exceptions); if (exceptions == VFP_EXCEPTION_ERROR) { - NGLOG_CRITICAL(Core_ARM11, "unhandled bounce {:x}", inst); + LOG_CRITICAL(Core_ARM11, "unhandled bounce {:x}", inst); Crash(); } diff --git a/src/core/arm/skyeye_common/vfp/vfp.h b/src/core/arm/skyeye_common/vfp/vfp.h index 7be546984..73561cdb6 100644 --- a/src/core/arm/skyeye_common/vfp/vfp.h +++ b/src/core/arm/skyeye_common/vfp/vfp.h @@ -22,7 +22,7 @@ #include "core/arm/skyeye_common/vfp/vfp_helper.h" /* for references to cdp SoftFloat functions */ -#define VFP_DEBUG_UNTESTED(x) NGLOG_TRACE(Core_ARM11, "in func {}, " #x " untested", __FUNCTION__); +#define VFP_DEBUG_UNTESTED(x) LOG_TRACE(Core_ARM11, "in func {}, " #x " untested", __FUNCTION__); #define CHECK_VFP_ENABLED #define CHECK_VFP_CDP_RET vfp_raise_exceptions(cpu, ret, inst_cream->instr, cpu->VFP[VFP_FPSCR]); diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index d036ad0dc..305c7401b 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -64,7 +64,7 @@ static struct vfp_double vfp_double_default_qnan = { }; static void vfp_double_dump(const char* str, struct vfp_double* d) { - NGLOG_TRACE(Core_ARM11, "VFP: {}: sign={} exponent={} significand={:016llx}", str, d->sign != 0, + LOG_TRACE(Core_ARM11, "VFP: {}: sign={} exponent={} significand={:016llx}", str, d->sign != 0, d->exponent, d->significand); } @@ -166,7 +166,7 @@ u32 vfp_double_normaliseround(ARMul_State* state, int dd, struct vfp_double* vd, } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vd->sign != 0)) incr = (1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1; - NGLOG_TRACE(Core_ARM11, "VFP: rounding increment = 0x{:08llx}", incr); + LOG_TRACE(Core_ARM11, "VFP: rounding increment = 0x{:08llx}", incr); /* * Is our rounding going to overflow? @@ -221,7 +221,7 @@ pack: vfp_double_dump("pack: final", vd); { s64 d = vfp_double_pack(vd); - NGLOG_TRACE(Core_ARM11, "VFP: {}: d(d{})={:016llx} exceptions={:08x}", func, dd, d, + LOG_TRACE(Core_ARM11, "VFP: {}: d(d{})={:016llx} exceptions={:08x}", func, dd, d, exceptions); vfp_put_double(state, d, dd); } @@ -275,25 +275,25 @@ static u32 vfp_propagate_nan(struct vfp_double* vdd, struct vfp_double* vdn, str * Extended operations */ static u32 vfp_double_fabs(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); vfp_put_double(state, vfp_double_packed_abs(vfp_get_double(state, dm)), dd); return 0; } static u32 vfp_double_fcpy(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); vfp_put_double(state, vfp_get_double(state, dm), dd); return 0; } static u32 vfp_double_fneg(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); vfp_put_double(state, vfp_double_packed_negate(vfp_get_double(state, dm)), dd); return 0; } static u32 vfp_double_fsqrt(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); vfp_double vdm, vdd, *vdp; int ret, tm; u32 exceptions = 0; @@ -390,7 +390,7 @@ static u32 vfp_compare(ARMul_State* state, int dd, int signal_on_qnan, s64 m, u3 s64 d; u32 ret = 0; - NGLOG_TRACE(Core_ARM11, "In {}, state=0x{}, fpscr=0x{:x}", __FUNCTION__, fmt::ptr(state), + LOG_TRACE(Core_ARM11, "In {}, state=0x{}, fpscr=0x{:x}", __FUNCTION__, fmt::ptr(state), fpscr); if (vfp_double_packed_exponent(m) == 2047 && vfp_double_packed_mantissa(m)) { ret |= FPSCR_CFLAG | FPSCR_VFLAG; @@ -447,28 +447,28 @@ static u32 vfp_compare(ARMul_State* state, int dd, int signal_on_qnan, s64 m, u3 ret |= FPSCR_CFLAG; } } - NGLOG_TRACE(Core_ARM11, "In {}, state=0x{}, ret=0x{:x}", __FUNCTION__, fmt::ptr(state), ret); + LOG_TRACE(Core_ARM11, "In {}, state=0x{}, ret=0x{:x}", __FUNCTION__, fmt::ptr(state), ret); return ret; } static u32 vfp_double_fcmp(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_compare(state, dd, 0, vfp_get_double(state, dm), fpscr); } static u32 vfp_double_fcmpe(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_compare(state, dd, 1, vfp_get_double(state, dm), fpscr); } static u32 vfp_double_fcmpz(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_compare(state, dd, 0, 0, fpscr); } static u32 vfp_double_fcmpez(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_compare(state, dd, 1, 0, fpscr); } @@ -478,7 +478,7 @@ static u32 vfp_double_fcvts(ARMul_State* state, int sd, int unused, int dm, u32 int tm; u32 exceptions = 0; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdm, vfp_get_double(state, dm), fpscr); tm = vfp_double_type(&vdm); @@ -519,7 +519,7 @@ static u32 vfp_double_fuito(ARMul_State* state, int dd, int unused, int dm, u32 struct vfp_double vdm; u32 m = vfp_get_float(state, dm); - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); vdm.sign = 0; vdm.exponent = 1023 + 63 - 1; vdm.significand = (u64)m; @@ -531,7 +531,7 @@ static u32 vfp_double_fsito(ARMul_State* state, int dd, int unused, int dm, u32 struct vfp_double vdm; u32 m = vfp_get_float(state, dm); - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); vdm.sign = (m & 0x80000000) >> 16; vdm.exponent = 1023 + 63 - 1; vdm.significand = vdm.sign ? (~m + 1) : m; @@ -545,7 +545,7 @@ static u32 vfp_double_ftoui(ARMul_State* state, int sd, int unused, int dm, u32 int rmode = fpscr & FPSCR_RMODE_MASK; int tm; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdm, vfp_get_double(state, dm), fpscr); /* @@ -614,7 +614,7 @@ static u32 vfp_double_ftoui(ARMul_State* state, int sd, int unused, int dm, u32 } } - NGLOG_TRACE(Core_ARM11, "VFP: ftoui: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); + LOG_TRACE(Core_ARM11, "VFP: ftoui: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); vfp_put_float(state, d, sd); @@ -622,7 +622,7 @@ static u32 vfp_double_ftoui(ARMul_State* state, int sd, int unused, int dm, u32 } static u32 vfp_double_ftouiz(ARMul_State* state, int sd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_double_ftoui(state, sd, unused, dm, (fpscr & ~FPSCR_RMODE_MASK) | FPSCR_ROUND_TOZERO); } @@ -633,7 +633,7 @@ static u32 vfp_double_ftosi(ARMul_State* state, int sd, int unused, int dm, u32 int rmode = fpscr & FPSCR_RMODE_MASK; int tm; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdm, vfp_get_double(state, dm), fpscr); vfp_double_dump("VDM", &vdm); @@ -697,7 +697,7 @@ static u32 vfp_double_ftosi(ARMul_State* state, int sd, int unused, int dm, u32 } } - NGLOG_TRACE(Core_ARM11, "VFP: ftosi: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); + LOG_TRACE(Core_ARM11, "VFP: ftosi: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); vfp_put_float(state, (s32)d, sd); @@ -705,7 +705,7 @@ static u32 vfp_double_ftosi(ARMul_State* state, int sd, int unused, int dm, u32 } static u32 vfp_double_ftosiz(ARMul_State* state, int dd, int unused, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_double_ftosi(state, dd, unused, dm, (fpscr & ~FPSCR_RMODE_MASK) | FPSCR_ROUND_TOZERO); } @@ -787,7 +787,7 @@ u32 vfp_double_add(struct vfp_double* vdd, struct vfp_double* vdn, struct vfp_do u64 m_sig; if (vdn->significand & (1ULL << 63) || vdm->significand & (1ULL << 63)) { - NGLOG_INFO(Core_ARM11, "VFP: bad FP values in {}", __func__); + LOG_INFO(Core_ARM11, "VFP: bad FP values in {}", __func__); vfp_double_dump("VDN", vdn); vfp_double_dump("VDM", vdm); } @@ -852,7 +852,7 @@ u32 vfp_double_multiply(struct vfp_double* vdd, struct vfp_double* vdn, struct v */ if (vdn->exponent < vdm->exponent) { std::swap(vdm, vdn); - NGLOG_TRACE(Core_ARM11, "VFP: swapping M <-> N"); + LOG_TRACE(Core_ARM11, "VFP: swapping M <-> N"); } vdd->sign = vdn->sign ^ vdm->sign; @@ -934,7 +934,7 @@ static u32 vfp_double_multiply_accumulate(ARMul_State* state, int dd, int dn, in * sd = sd + (sn * sm) */ static u32 vfp_double_fmac(ARMul_State* state, int dd, int dn, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_double_multiply_accumulate(state, dd, dn, dm, fpscr, 0, "fmac"); } @@ -942,7 +942,7 @@ static u32 vfp_double_fmac(ARMul_State* state, int dd, int dn, int dm, u32 fpscr * sd = sd - (sn * sm) */ static u32 vfp_double_fnmac(ARMul_State* state, int dd, int dn, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_double_multiply_accumulate(state, dd, dn, dm, fpscr, NEG_MULTIPLY, "fnmac"); } @@ -950,7 +950,7 @@ static u32 vfp_double_fnmac(ARMul_State* state, int dd, int dn, int dm, u32 fpsc * sd = -sd + (sn * sm) */ static u32 vfp_double_fmsc(ARMul_State* state, int dd, int dn, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_double_multiply_accumulate(state, dd, dn, dm, fpscr, NEG_SUBTRACT, "fmsc"); } @@ -958,7 +958,7 @@ static u32 vfp_double_fmsc(ARMul_State* state, int dd, int dn, int dm, u32 fpscr * sd = -sd - (sn * sm) */ static u32 vfp_double_fnmsc(ARMul_State* state, int dd, int dn, int dm, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); return vfp_double_multiply_accumulate(state, dd, dn, dm, fpscr, NEG_SUBTRACT | NEG_MULTIPLY, "fnmsc"); } @@ -970,7 +970,7 @@ static u32 vfp_double_fmul(ARMul_State* state, int dd, int dn, int dm, u32 fpscr struct vfp_double vdd, vdn, vdm; u32 exceptions = 0; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdn, vfp_get_double(state, dn), fpscr); if (vdn.exponent == 0 && vdn.significand) vfp_double_normalise_denormal(&vdn); @@ -990,7 +990,7 @@ static u32 vfp_double_fnmul(ARMul_State* state, int dd, int dn, int dm, u32 fpsc struct vfp_double vdd, vdn, vdm; u32 exceptions = 0; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdn, vfp_get_double(state, dn), fpscr); if (vdn.exponent == 0 && vdn.significand) vfp_double_normalise_denormal(&vdn); @@ -1012,7 +1012,7 @@ static u32 vfp_double_fadd(ARMul_State* state, int dd, int dn, int dm, u32 fpscr struct vfp_double vdd, vdn, vdm; u32 exceptions = 0; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdn, vfp_get_double(state, dn), fpscr); if (vdn.exponent == 0 && vdn.significand) vfp_double_normalise_denormal(&vdn); @@ -1033,7 +1033,7 @@ static u32 vfp_double_fsub(ARMul_State* state, int dd, int dn, int dm, u32 fpscr struct vfp_double vdd, vdn, vdm; u32 exceptions = 0; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdn, vfp_get_double(state, dn), fpscr); if (vdn.exponent == 0 && vdn.significand) vfp_double_normalise_denormal(&vdn); @@ -1060,7 +1060,7 @@ static u32 vfp_double_fdiv(ARMul_State* state, int dd, int dn, int dm, u32 fpscr u32 exceptions = 0; int tm, tn; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); exceptions |= vfp_double_unpack(&vdn, vfp_get_double(state, dn), fpscr); exceptions |= vfp_double_unpack(&vdm, vfp_get_double(state, dm), fpscr); @@ -1178,7 +1178,7 @@ u32 vfp_double_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { unsigned int vecitr, veclen, vecstride; struct op* fop; - NGLOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); + LOG_TRACE(Core_ARM11, "In {}", __FUNCTION__); vecstride = (1 + ((fpscr & FPSCR_STRIDE_MASK) == FPSCR_STRIDE_MASK)); fop = (op == FOP_EXT) ? &fops_ext[FEXT_TO_IDX(inst)] : &fops[FOP_TO_IDX(op)]; @@ -1209,11 +1209,11 @@ u32 vfp_double_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { else veclen = fpscr & FPSCR_LENGTH_MASK; - NGLOG_TRACE(Core_ARM11, "VFP: vecstride={} veclen={}", vecstride, + LOG_TRACE(Core_ARM11, "VFP: vecstride={} veclen={}", vecstride, (veclen >> FPSCR_LENGTH_BIT) + 1); if (!fop->fn) { - NGLOG_TRACE(Core_ARM11, "VFP: could not find double op {}", FEXT_TO_IDX(inst)); + LOG_TRACE(Core_ARM11, "VFP: could not find double op {}", FEXT_TO_IDX(inst)); goto invalid; } @@ -1223,14 +1223,14 @@ u32 vfp_double_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { type = (fop->flags & OP_SD) ? 's' : 'd'; if (op == FOP_EXT) - NGLOG_TRACE(Core_ARM11, "VFP: itr{} ({}{}) = op[{}] (d{})", vecitr >> FPSCR_LENGTH_BIT, + LOG_TRACE(Core_ARM11, "VFP: itr{} ({}{}) = op[{}] (d{})", vecitr >> FPSCR_LENGTH_BIT, type, dest, dn, dm); else - NGLOG_TRACE(Core_ARM11, "VFP: itr{} ({}{}) = (d{}) op[{}] (d{})", + LOG_TRACE(Core_ARM11, "VFP: itr{} ({}{}) = (d{}) op[{}] (d{})", vecitr >> FPSCR_LENGTH_BIT, type, dest, dn, FOP_TO_IDX(op), dm); except = fop->fn(state, dest, dn, dm, fpscr); - NGLOG_TRACE(Core_ARM11, "VFP: itr{}: exceptions={:08x}", vecitr >> FPSCR_LENGTH_BIT, + LOG_TRACE(Core_ARM11, "VFP: itr{}: exceptions={:08x}", vecitr >> FPSCR_LENGTH_BIT, except); exceptions |= except & ~VFP_NAN_FLAG; diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index c20a5b445..abbb0771e 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -66,7 +66,7 @@ static struct vfp_single vfp_single_default_qnan = { }; static void vfp_single_dump(const char* str, struct vfp_single* s) { - NGLOG_TRACE(Core_ARM11, "{}: sign={} exponent={} significand={:08x}", str, s->sign != 0, + LOG_TRACE(Core_ARM11, "{}: sign={} exponent={} significand={:08x}", str, s->sign != 0, s->exponent, s->significand); } @@ -168,7 +168,7 @@ u32 vfp_single_normaliseround(ARMul_State* state, int sd, struct vfp_single* vs, } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vs->sign != 0)) incr = (1 << (VFP_SINGLE_LOW_BITS + 1)) - 1; - NGLOG_TRACE(Core_ARM11, "rounding increment = 0x{:08x}", incr); + LOG_TRACE(Core_ARM11, "rounding increment = 0x{:08x}", incr); /* * Is our rounding going to overflow? @@ -223,7 +223,7 @@ pack: vfp_single_dump("pack: final", vs); { s32 d = vfp_single_pack(vs); - NGLOG_TRACE(Core_ARM11, "{}: d(s{})={:08x} exceptions={:08x}", func, sd, d, exceptions); + LOG_TRACE(Core_ARM11, "{}: d(s{})={:08x} exceptions={:08x}", func, sd, d, exceptions); vfp_put_float(state, d, sd); } @@ -306,7 +306,7 @@ u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand) { u32 z, a; if ((significand & 0xc0000000) != 0x40000000) { - NGLOG_TRACE(Core_ARM11, "invalid significand"); + LOG_TRACE(Core_ARM11, "invalid significand"); } a = significand << 1; @@ -396,7 +396,7 @@ static u32 vfp_single_fsqrt(ARMul_State* state, int sd, int unused, s32 m, u32 f term = (u64)vsd.significand * vsd.significand; rem = ((u64)vsm.significand << 32) - term; - NGLOG_TRACE(Core_ARM11, "term={} rem={}", term, rem); + LOG_TRACE(Core_ARM11, "term={} rem={}", term, rem); while (rem < 0) { vsd.significand -= 1; @@ -635,7 +635,7 @@ static u32 vfp_single_ftoui(ARMul_State* state, int sd, int unused, s32 m, u32 f } } - NGLOG_TRACE(Core_ARM11, "ftoui: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); + LOG_TRACE(Core_ARM11, "ftoui: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); vfp_put_float(state, d, sd); @@ -716,7 +716,7 @@ static u32 vfp_single_ftosi(ARMul_State* state, int sd, int unused, s32 m, u32 f } } - NGLOG_TRACE(Core_ARM11, "ftosi: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); + LOG_TRACE(Core_ARM11, "ftosi: d(s{})={:08x} exceptions={:08x}", sd, d, exceptions); vfp_put_float(state, (s32)d, sd); @@ -803,7 +803,7 @@ static u32 vfp_single_add(struct vfp_single* vsd, struct vfp_single* vsn, struct u32 exp_diff, m_sig; if (vsn->significand & 0x80000000 || vsm->significand & 0x80000000) { - NGLOG_WARNING(Core_ARM11, "bad FP values"); + LOG_WARNING(Core_ARM11, "bad FP values"); vfp_single_dump("VSN", vsn); vfp_single_dump("VSM", vsm); } @@ -868,7 +868,7 @@ static u32 vfp_single_multiply(struct vfp_single* vsd, struct vfp_single* vsn, */ if (vsn->exponent < vsm->exponent) { std::swap(vsm, vsn); - NGLOG_TRACE(Core_ARM11, "swapping M <-> N"); + LOG_TRACE(Core_ARM11, "swapping M <-> N"); } vsd->sign = vsn->sign ^ vsm->sign; @@ -920,7 +920,7 @@ static u32 vfp_single_multiply_accumulate(ARMul_State* state, int sd, int sn, s3 s32 v; v = vfp_get_float(state, sn); - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, v); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, v); exceptions |= vfp_single_unpack(&vsn, v, fpscr); if (vsn.exponent == 0 && vsn.significand) vfp_single_normalise_denormal(&vsn); @@ -935,7 +935,7 @@ static u32 vfp_single_multiply_accumulate(ARMul_State* state, int sd, int sn, s3 vsp.sign = vfp_sign_negate(vsp.sign); v = vfp_get_float(state, sd); - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sd, v); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sd, v); exceptions |= vfp_single_unpack(&vsn, v, fpscr); if (vsn.exponent == 0 && vsn.significand != 0) vfp_single_normalise_denormal(&vsn); @@ -956,7 +956,7 @@ static u32 vfp_single_multiply_accumulate(ARMul_State* state, int sd, int sn, s3 * sd = sd + (sn * sm) */ static u32 vfp_single_fmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, 0, "fmac"); } @@ -965,7 +965,7 @@ static u32 vfp_single_fmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) */ static u32 vfp_single_fnmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { // TODO: this one has its arguments inverted, investigate. - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sd, sn); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sd, sn); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, NEG_MULTIPLY, "fnmac"); } @@ -973,7 +973,7 @@ static u32 vfp_single_fnmac(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr * sd = -sd + (sn * sm) */ static u32 vfp_single_fmsc(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, NEG_SUBTRACT, "fmsc"); } @@ -981,7 +981,7 @@ static u32 vfp_single_fmsc(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) * sd = -sd - (sn * sm) */ static u32 vfp_single_fnmsc(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); return vfp_single_multiply_accumulate(state, sd, sn, m, fpscr, NEG_SUBTRACT | NEG_MULTIPLY, "fnmsc"); } @@ -994,7 +994,7 @@ static u32 vfp_single_fmul(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) u32 exceptions = 0; s32 n = vfp_get_float(state, sn); - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); exceptions |= vfp_single_unpack(&vsn, n, fpscr); if (vsn.exponent == 0 && vsn.significand) @@ -1016,7 +1016,7 @@ static u32 vfp_single_fnmul(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr u32 exceptions = 0; s32 n = vfp_get_float(state, sn); - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); exceptions |= vfp_single_unpack(&vsn, n, fpscr); if (vsn.exponent == 0 && vsn.significand) @@ -1039,7 +1039,7 @@ static u32 vfp_single_fadd(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) u32 exceptions = 0; s32 n = vfp_get_float(state, sn); - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); /* * Unpack and normalise denormals. @@ -1061,7 +1061,7 @@ static u32 vfp_single_fadd(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) * sd = sn - sm */ static u32 vfp_single_fsub(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) { - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, sd); /* * Subtraction is addition with one sign inverted. Unpack the second operand to perform FTZ if * necessary, we can't let fadd do this because a denormal in m might get flushed to +0 in FTZ @@ -1090,7 +1090,7 @@ static u32 vfp_single_fdiv(ARMul_State* state, int sd, int sn, s32 m, u32 fpscr) s32 n = vfp_get_float(state, sn); int tm, tn; - NGLOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); + LOG_TRACE(Core_ARM11, "s{} = {:08x}", sn, n); exceptions |= vfp_single_unpack(&vsn, n, fpscr); exceptions |= vfp_single_unpack(&vsm, m, fpscr); @@ -1230,10 +1230,10 @@ u32 vfp_single_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { else veclen = fpscr & FPSCR_LENGTH_MASK; - NGLOG_TRACE(Core_ARM11, "vecstride={} veclen={}", vecstride, (veclen >> FPSCR_LENGTH_BIT) + 1); + LOG_TRACE(Core_ARM11, "vecstride={} veclen={}", vecstride, (veclen >> FPSCR_LENGTH_BIT) + 1); if (!fop->fn) { - NGLOG_CRITICAL(Core_ARM11, "could not find single op {}, inst=0x{:x}@0x{:x}", + LOG_CRITICAL(Core_ARM11, "could not find single op {}, inst=0x{:x}@0x{:x}", FEXT_TO_IDX(inst), inst, state->Reg[15]); Crash(); goto invalid; @@ -1246,14 +1246,14 @@ u32 vfp_single_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { type = (fop->flags & OP_DD) ? 'd' : 's'; if (op == FOP_EXT) - NGLOG_TRACE(Core_ARM11, "itr{} ({}{}) = op[{}] (s{}={:08x})", + LOG_TRACE(Core_ARM11, "itr{} ({}{}) = op[{}] (s{}={:08x})", vecitr >> FPSCR_LENGTH_BIT, type, dest, sn, sm, m); else - NGLOG_TRACE(Core_ARM11, "itr{} ({}{}) = (s{}) op[{}] (s{}={:08x})", + LOG_TRACE(Core_ARM11, "itr{} ({}{}) = (s{}) op[{}] (s{}={:08x})", vecitr >> FPSCR_LENGTH_BIT, type, dest, sn, FOP_TO_IDX(op), sm, m); except = fop->fn(state, dest, sn, m, fpscr); - NGLOG_TRACE(Core_ARM11, "itr{}: exceptions={:08x}", vecitr >> FPSCR_LENGTH_BIT, except); + LOG_TRACE(Core_ARM11, "itr{}: exceptions={:08x}", vecitr >> FPSCR_LENGTH_BIT, except); exceptions |= except & ~VFP_NAN_FLAG; diff --git a/src/core/core.cpp b/src/core/core.cpp index 09470d6e0..bfe15f443 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -57,7 +57,7 @@ System::ResultStatus System::RunLoop(bool tight_loop) { // If we don't have a currently active thread then don't execute instructions, // instead advance to the next event and try to yield to the next thread if (Kernel::GetCurrentThread() == nullptr) { - NGLOG_TRACE(Core_ARM11, "Idling"); + LOG_TRACE(Core_ARM11, "Idling"); CoreTiming::Idle(); CoreTiming::Advance(); PrepareReschedule(); @@ -84,14 +84,14 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file app_loader = Loader::GetLoader(filepath); if (!app_loader) { - NGLOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); + LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); return ResultStatus::ErrorGetLoader; } std::pair, Loader::ResultStatus> system_mode = app_loader->LoadKernelSystemMode(); if (system_mode.second != Loader::ResultStatus::Success) { - NGLOG_CRITICAL(Core, "Failed to determine system mode (Error {})!", + LOG_CRITICAL(Core, "Failed to determine system mode (Error {})!", static_cast(system_mode.second)); switch (system_mode.second) { @@ -106,7 +106,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file ResultStatus init_result{Init(emu_window, system_mode.first.get())}; if (init_result != ResultStatus::Success) { - NGLOG_CRITICAL(Core, "Failed to initialize system (Error {})!", + LOG_CRITICAL(Core, "Failed to initialize system (Error {})!", static_cast(init_result)); System::Shutdown(); return init_result; @@ -114,7 +114,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file const Loader::ResultStatus load_result{app_loader->Load(Kernel::g_current_process)}; if (Loader::ResultStatus::Success != load_result) { - NGLOG_CRITICAL(Core, "Failed to load ROM (Error {})!", static_cast(load_result)); + LOG_CRITICAL(Core, "Failed to load ROM (Error {})!", static_cast(load_result)); System::Shutdown(); switch (load_result) { @@ -150,7 +150,7 @@ void System::Reschedule() { } System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { - NGLOG_DEBUG(HW_Memory, "initialized OK"); + LOG_DEBUG(HW_Memory, "initialized OK"); CoreTiming::Init(); @@ -159,7 +159,7 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { cpu_core = std::make_unique(USER32MODE); #else cpu_core = std::make_unique(USER32MODE); - NGLOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); + LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); #endif } else { cpu_core = std::make_unique(USER32MODE); @@ -182,7 +182,7 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { return ResultStatus::ErrorVideoCore; } - NGLOG_DEBUG(Core, "Initialized OK"); + LOG_DEBUG(Core, "Initialized OK"); // Reset counters and set time origin to current frame GetAndResetPerfStats(); @@ -228,7 +228,7 @@ void System::Shutdown() { room_member->SendGameInfo(game_info); } - NGLOG_DEBUG(Core, "Shutdown OK"); + LOG_DEBUG(Core, "Shutdown OK"); } } // namespace Core diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 96fd0c959..0510d12a9 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -53,11 +53,11 @@ inline s64 usToCycles(int us) { inline s64 usToCycles(s64 us) { if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { - NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); + LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits::max(); } if (us > MAX_VALUE_TO_MULTIPLY) { - NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); + LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE_ARM11 * (us / 1000000); } return (BASE_CLOCK_RATE_ARM11 * us) / 1000000; @@ -65,11 +65,11 @@ inline s64 usToCycles(s64 us) { inline s64 usToCycles(u64 us) { if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { - NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); + LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits::max(); } if (us > MAX_VALUE_TO_MULTIPLY) { - NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); + LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE_ARM11 * static_cast(us / 1000000); } return (BASE_CLOCK_RATE_ARM11 * static_cast(us)) / 1000000; @@ -85,11 +85,11 @@ inline s64 nsToCycles(int ns) { inline s64 nsToCycles(s64 ns) { if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { - NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); + LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits::max(); } if (ns > MAX_VALUE_TO_MULTIPLY) { - NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); + LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE_ARM11 * (ns / 1000000000); } return (BASE_CLOCK_RATE_ARM11 * ns) / 1000000000; @@ -97,11 +97,11 @@ inline s64 nsToCycles(s64 ns) { inline s64 nsToCycles(u64 ns) { if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { - NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); + LOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits::max(); } if (ns > MAX_VALUE_TO_MULTIPLY) { - NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); + LOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE_ARM11 * (static_cast(ns) / 1000000000); } return (BASE_CLOCK_RATE_ARM11 * static_cast(ns)) / 1000000000; diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp index e8ffd2754..9ace371fe 100644 --- a/src/core/file_sys/archive_backend.cpp +++ b/src/core/file_sys/archive_backend.cpp @@ -70,7 +70,7 @@ std::string Path::AsString() const { case LowPathType::Binary: default: // TODO(yuriks): Add assert - NGLOG_ERROR(Service_FS, "LowPathType cannot be converted to string!"); + LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!"); return {}; } } @@ -86,7 +86,7 @@ std::u16string Path::AsU16Str() const { case LowPathType::Invalid: case LowPathType::Binary: // TODO(yuriks): Add assert - NGLOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!"); + LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!"); return {}; } @@ -114,7 +114,7 @@ std::vector Path::AsBinary() const { case LowPathType::Invalid: default: // TODO(yuriks): Add assert - NGLOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!"); + LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!"); return {}; } } diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 4fdcd3506..21374014d 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -87,22 +87,22 @@ public: ResultVal> OpenFile(const Path& path, const Mode& mode) const override { - NGLOG_DEBUG(Service_FS, "called path={} mode={:01X}", path.DebugStr(), mode.hex); + LOG_DEBUG(Service_FS, "called path={} mode={:01X}", path.DebugStr(), mode.hex); const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } if (mode.hex == 0) { - NGLOG_ERROR(Service_FS, "Empty open mode"); + LOG_ERROR(Service_FS, "Empty open mode"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } if (mode.create_flag) { - NGLOG_ERROR(Service_FS, "Create flag is not supported"); + LOG_ERROR(Service_FS, "Create flag is not supported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } @@ -110,17 +110,17 @@ public: switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_FILE_NOT_FOUND; case PathParser::PathNotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_PATH_NOT_FOUND; case PathParser::FileInPath: case PathParser::DirectoryFound: - NGLOG_ERROR(Service_FS, "Unexpected file or directory in {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file or directory in {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; case PathParser::NotFound: - NGLOG_ERROR(Service_FS, "{} not found", full_path); + LOG_ERROR(Service_FS, "{} not found", full_path); return ERROR_FILE_NOT_FOUND; case PathParser::FileFound: break; // Expected 'success' case @@ -128,7 +128,7 @@ public: FileUtil::IOFile file(full_path, "r+b"); if (!file.IsOpen()) { - NGLOG_CRITICAL(Service_FS, "(unreachable) Unknown error opening {}", full_path); + LOG_CRITICAL(Service_FS, "(unreachable) Unknown error opening {}", full_path); return ERROR_FILE_NOT_FOUND; } @@ -144,7 +144,7 @@ public: ResultCode CreateFile(const Path& path, u64 size) const override { if (size == 0) { - NGLOG_ERROR(Service_FS, "Zero-size file is not supported"); + LOG_ERROR(Service_FS, "Zero-size file is not supported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } return SaveDataArchive::CreateFile(path, size); @@ -192,12 +192,12 @@ Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low) { ArchiveFactory_ExtSaveData::ArchiveFactory_ExtSaveData(const std::string& mount_location, bool shared) : shared(shared), mount_point(GetExtDataContainerPath(mount_location, shared)) { - NGLOG_DEBUG(Service_FS, "Directory {} set as base for ExtSaveData.", mount_point); + LOG_DEBUG(Service_FS, "Directory {} set as base for ExtSaveData.", mount_point); } bool ArchiveFactory_ExtSaveData::Initialize() { if (!FileUtil::CreateFullPath(mount_point)) { - NGLOG_ERROR(Service_FS, "Unable to create ExtSaveData base path."); + LOG_ERROR(Service_FS, "Unable to create ExtSaveData base path."); return false; } @@ -266,7 +266,7 @@ ResultVal ArchiveFactory_ExtSaveData::GetFormatInfo(const Pat FileUtil::IOFile file(metadata_path, "rb"); if (!file.IsOpen()) { - NGLOG_ERROR(Service_FS, "Could not open metadata information for archive"); + LOG_ERROR(Service_FS, "Could not open metadata information for archive"); // TODO(Subv): Verify error code return ERR_NOT_FORMATTED; } diff --git a/src/core/file_sys/archive_ncch.cpp b/src/core/file_sys/archive_ncch.cpp index fc974ba13..c8e6e7ca2 100644 --- a/src/core/file_sys/archive_ncch.cpp +++ b/src/core/file_sys/archive_ncch.cpp @@ -49,13 +49,13 @@ static_assert(sizeof(NCCHFilePath) == 0x14, "NCCHFilePath has wrong size!"); ResultVal> NCCHArchive::OpenFile(const Path& path, const Mode& mode) const { if (path.GetType() != LowPathType::Binary) { - NGLOG_ERROR(Service_FS, "Path need to be Binary"); + LOG_ERROR(Service_FS, "Path need to be Binary"); return ERROR_INVALID_PATH; } std::vector binary = path.AsBinary(); if (binary.size() != sizeof(NCCHFilePath)) { - NGLOG_ERROR(Service_FS, "Wrong path size {}", binary.size()); + LOG_ERROR(Service_FS, "Wrong path size {}", binary.size()); return ERROR_INVALID_PATH; } @@ -89,7 +89,7 @@ ResultVal> NCCHArchive::OpenFile(const Path& path, std::unique_ptr delay_generator = std::make_unique(); file = std::make_unique(std::move(buffer), std::move(delay_generator)); } else { - NGLOG_ERROR(Service_FS, "Unknown NCCH archive type {}!", openfile_path.filepath_type); + LOG_ERROR(Service_FS, "Unknown NCCH archive type {}!", openfile_path.filepath_type); result = Loader::ResultStatus::Error; } @@ -106,7 +106,7 @@ ResultVal> NCCHArchive::OpenFile(const Path& path, u32 high = static_cast(title_id >> 32); u32 low = static_cast(title_id & 0xFFFFFFFF); - NGLOG_DEBUG(Service_FS, "Full Path: {}. Category: 0x{:X}. Path: 0x{:X}.", path.DebugStr(), + LOG_DEBUG(Service_FS, "Full Path: {}. Category: 0x{:X}. Path: 0x{:X}.", path.DebugStr(), high, low); std::string archive_name; @@ -121,7 +121,7 @@ ResultVal> NCCHArchive::OpenFile(const Path& path, } if (!archive_name.empty()) { - NGLOG_ERROR(Service_FS, "Failed to get a handle for shared data archive: {}. ", + LOG_ERROR(Service_FS, "Failed to get a handle for shared data archive: {}. ", archive_name); Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorSystemFiles, archive_name.c_str()); @@ -133,63 +133,63 @@ ResultVal> NCCHArchive::OpenFile(const Path& path, } ResultCode NCCHArchive::DeleteFile(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to delete a file from an NCCH archive ({}).", GetName()); + LOG_CRITICAL(Service_FS, "Attempted to delete a file from an NCCH archive ({}).", GetName()); // TODO(Subv): Verify error code return ResultCode(ErrorDescription::NoData, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status); } ResultCode NCCHArchive::RenameFile(const Path& src_path, const Path& dest_path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode NCCHArchive::DeleteDirectory(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to delete a directory from an NCCH archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode NCCHArchive::DeleteDirectoryRecursively(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to delete a directory from an NCCH archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode NCCHArchive::CreateFile(const Path& path, u64 size) const { - NGLOG_CRITICAL(Service_FS, "Attempted to create a file in an NCCH archive ({}).", GetName()); + LOG_CRITICAL(Service_FS, "Attempted to create a file in an NCCH archive ({}).", GetName()); // TODO: Verify error code return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, ErrorLevel::Permanent); } ResultCode NCCHArchive::CreateDirectory(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to create a directory in an NCCH archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to create a directory in an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode NCCHArchive::RenameDirectory(const Path& src_path, const Path& dest_path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultVal> NCCHArchive::OpenDirectory(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to open a directory within an NCCH archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to open a directory within an NCCH archive ({}).", GetName().c_str()); // TODO(shinyquagsire23): Use correct error code return ResultCode(-1); } u64 NCCHArchive::GetFreeBytes() const { - NGLOG_WARNING(Service_FS, "Attempted to get the free space in an NCCH archive"); + LOG_WARNING(Service_FS, "Attempted to get the free space in an NCCH archive"); return 0; } @@ -201,7 +201,7 @@ NCCHFile::NCCHFile(std::vector buffer, std::unique_ptr delay } ResultVal NCCHFile::Read(const u64 offset, const size_t length, u8* buffer) const { - NGLOG_TRACE(Service_FS, "called offset={}, length={}", offset, length); + LOG_TRACE(Service_FS, "called offset={}, length={}", offset, length); size_t length_left = static_cast(data_size - offset); size_t read_length = static_cast(std::min(length, length_left)); @@ -214,7 +214,7 @@ ResultVal NCCHFile::Read(const u64 offset, const size_t length, u8* buff ResultVal NCCHFile::Write(const u64 offset, const size_t length, const bool flush, const u8* buffer) { - NGLOG_ERROR(Service_FS, "Attempted to write to NCCH file"); + LOG_ERROR(Service_FS, "Attempted to write to NCCH file"); // TODO(shinyquagsire23): Find error code return MakeResult(0); } @@ -224,7 +224,7 @@ u64 NCCHFile::GetSize() const { } bool NCCHFile::SetSize(const u64 size) const { - NGLOG_ERROR(Service_FS, "Attempted to set the size of an NCCH file"); + LOG_ERROR(Service_FS, "Attempted to set the size of an NCCH file"); return false; } @@ -234,13 +234,13 @@ ArchiveFactory_NCCH::ArchiveFactory_NCCH() {} ResultVal> ArchiveFactory_NCCH::Open(const Path& path) { if (path.GetType() != LowPathType::Binary) { - NGLOG_ERROR(Service_FS, "Path need to be Binary"); + LOG_ERROR(Service_FS, "Path need to be Binary"); return ERROR_INVALID_PATH; } std::vector binary = path.AsBinary(); if (binary.size() != sizeof(NCCHArchivePath)) { - NGLOG_ERROR(Service_FS, "Wrong path size {}", binary.size()); + LOG_ERROR(Service_FS, "Wrong path size {}", binary.size()); return ERROR_INVALID_PATH; } @@ -254,7 +254,7 @@ ResultVal> ArchiveFactory_NCCH::Open(const Path& ResultCode ArchiveFactory_NCCH::Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) { - NGLOG_ERROR(Service_FS, "Attempted to format a NCCH archive."); + LOG_ERROR(Service_FS, "Attempted to format a NCCH archive."); // TODO: Verify error code return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, ErrorLevel::Permanent); @@ -262,7 +262,7 @@ ResultCode ArchiveFactory_NCCH::Format(const Path& path, ResultVal ArchiveFactory_NCCH::GetFormatInfo(const Path& path) const { // TODO(Subv): Implement - NGLOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); + LOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); return ResultCode(-1); } diff --git a/src/core/file_sys/archive_other_savedata.cpp b/src/core/file_sys/archive_other_savedata.cpp index de1ba6ac3..9655c6650 100644 --- a/src/core/file_sys/archive_other_savedata.cpp +++ b/src/core/file_sys/archive_other_savedata.cpp @@ -23,14 +23,14 @@ namespace { template ResultVal> ParsePath(const Path& path, T program_id_reader) { if (path.GetType() != LowPathType::Binary) { - NGLOG_ERROR(Service_FS, "Wrong path type {}", static_cast(path.GetType())); + LOG_ERROR(Service_FS, "Wrong path type {}", static_cast(path.GetType())); return ERROR_INVALID_PATH; } std::vector vec_data = path.AsBinary(); if (vec_data.size() != 12) { - NGLOG_ERROR(Service_FS, "Wrong path length {}", vec_data.size()); + LOG_ERROR(Service_FS, "Wrong path length {}", vec_data.size()); return ERROR_INVALID_PATH; } @@ -38,7 +38,7 @@ ResultVal> ParsePath(const Path& path, T program_id_r auto media_type = static_cast(data[0]); if (media_type != MediaType::SDMC && media_type != MediaType::GameCard) { - NGLOG_ERROR(Service_FS, "Unsupported media type {}", static_cast(media_type)); + LOG_ERROR(Service_FS, "Unsupported media type {}", static_cast(media_type)); // Note: this is strange, but the error code was verified with a real 3DS return ERROR_UNSUPPORTED_OPEN_FLAGS; @@ -70,7 +70,7 @@ ResultVal> ArchiveFactory_OtherSaveDataPermitted CASCADE_RESULT(std::tie(media_type, program_id), ParsePathPermitted(path)); if (media_type == MediaType::GameCard) { - NGLOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); + LOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); return ERROR_GAMECARD_NOT_INSERTED; } @@ -79,7 +79,7 @@ ResultVal> ArchiveFactory_OtherSaveDataPermitted ResultCode ArchiveFactory_OtherSaveDataPermitted::Format( const Path& path, const FileSys::ArchiveFormatInfo& format_info) { - NGLOG_ERROR(Service_FS, "Attempted to format a OtherSaveDataPermitted archive."); + LOG_ERROR(Service_FS, "Attempted to format a OtherSaveDataPermitted archive."); return ERROR_INVALID_PATH; } @@ -90,7 +90,7 @@ ResultVal ArchiveFactory_OtherSaveDataPermitted::GetFormatInf CASCADE_RESULT(std::tie(media_type, program_id), ParsePathPermitted(path)); if (media_type == MediaType::GameCard) { - NGLOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); + LOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); return ERROR_GAMECARD_NOT_INSERTED; } @@ -108,7 +108,7 @@ ResultVal> ArchiveFactory_OtherSaveDataGeneral:: CASCADE_RESULT(std::tie(media_type, program_id), ParsePathGeneral(path)); if (media_type == MediaType::GameCard) { - NGLOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); + LOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); return ERROR_GAMECARD_NOT_INSERTED; } @@ -122,7 +122,7 @@ ResultCode ArchiveFactory_OtherSaveDataGeneral::Format( CASCADE_RESULT(std::tie(media_type, program_id), ParsePathGeneral(path)); if (media_type == MediaType::GameCard) { - NGLOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); + LOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); return ERROR_GAMECARD_NOT_INSERTED; } @@ -136,7 +136,7 @@ ResultVal ArchiveFactory_OtherSaveDataGeneral::GetFormatInfo( CASCADE_RESULT(std::tie(media_type, program_id), ParsePathGeneral(path)); if (media_type == MediaType::GameCard) { - NGLOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); + LOG_WARNING(Service_FS, "(stubbed) Unimplemented media type GameCard"); return ERROR_GAMECARD_NOT_INSERTED; } diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 851ff8bcb..638ccf2d5 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -44,22 +44,22 @@ ResultVal> SDMCArchive::OpenFile(const Path& path, ResultVal> SDMCArchive::OpenFileBase(const Path& path, const Mode& mode) const { - NGLOG_DEBUG(Service_FS, "called path={} mode={:01X}", path.DebugStr(), mode.hex); + LOG_DEBUG(Service_FS, "called path={} mode={:01X}", path.DebugStr(), mode.hex); const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } if (mode.hex == 0) { - NGLOG_ERROR(Service_FS, "Empty open mode"); + LOG_ERROR(Service_FS, "Empty open mode"); return ERROR_INVALID_OPEN_FLAGS; } if (mode.create_flag && !mode.write_flag) { - NGLOG_ERROR(Service_FS, "Create flag set but write flag not set"); + LOG_ERROR(Service_FS, "Create flag set but write flag not set"); return ERROR_INVALID_OPEN_FLAGS; } @@ -67,18 +67,18 @@ ResultVal> SDMCArchive::OpenFileBase(const Path& pa switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_NOT_FOUND; case PathParser::PathNotFound: case PathParser::FileInPath: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_NOT_FOUND; case PathParser::DirectoryFound: - NGLOG_ERROR(Service_FS, "{} is not a file", full_path); + LOG_ERROR(Service_FS, "{} is not a file", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; case PathParser::NotFound: if (!mode.create_flag) { - NGLOG_ERROR(Service_FS, "Non-existing file {} can't be open without mode create.", + LOG_ERROR(Service_FS, "Non-existing file {} can't be open without mode create.", full_path); return ERROR_NOT_FOUND; } else { @@ -92,7 +92,7 @@ ResultVal> SDMCArchive::OpenFileBase(const Path& pa FileUtil::IOFile file(full_path, mode.write_flag ? "r+b" : "rb"); if (!file.IsOpen()) { - NGLOG_CRITICAL(Service_FS, "(unreachable) Unknown error opening {}", full_path); + LOG_CRITICAL(Service_FS, "(unreachable) Unknown error opening {}", full_path); return ERROR_NOT_FOUND; } @@ -105,7 +105,7 @@ ResultCode SDMCArchive::DeleteFile(const Path& path) const { const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -113,15 +113,15 @@ ResultCode SDMCArchive::DeleteFile(const Path& path) const { switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_NOT_FOUND; case PathParser::PathNotFound: case PathParser::FileInPath: case PathParser::NotFound: - NGLOG_ERROR(Service_FS, "{} not found", full_path); + LOG_ERROR(Service_FS, "{} not found", full_path); return ERROR_NOT_FOUND; case PathParser::DirectoryFound: - NGLOG_ERROR(Service_FS, "{} is not a file", full_path); + LOG_ERROR(Service_FS, "{} is not a file", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; case PathParser::FileFound: break; // Expected 'success' case @@ -131,7 +131,7 @@ ResultCode SDMCArchive::DeleteFile(const Path& path) const { return RESULT_SUCCESS; } - NGLOG_CRITICAL(Service_FS, "(unreachable) Unknown error deleting {}", full_path); + LOG_CRITICAL(Service_FS, "(unreachable) Unknown error deleting {}", full_path); return ERROR_NOT_FOUND; } @@ -140,14 +140,14 @@ ResultCode SDMCArchive::RenameFile(const Path& src_path, const Path& dest_path) // TODO: Verify these return codes with HW if (!path_parser_src.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); return ERROR_INVALID_PATH; } const PathParser path_parser_dest(dest_path); if (!path_parser_dest.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); return ERROR_INVALID_PATH; } @@ -170,7 +170,7 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -181,15 +181,15 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_NOT_FOUND; case PathParser::PathNotFound: case PathParser::NotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_NOT_FOUND; case PathParser::FileInPath: case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; case PathParser::DirectoryFound: break; // Expected 'success' case @@ -199,7 +199,7 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou return RESULT_SUCCESS; } - NGLOG_ERROR(Service_FS, "Directory not empty {}", full_path); + LOG_ERROR(Service_FS, "Directory not empty {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; } @@ -216,7 +216,7 @@ ResultCode SDMCArchive::CreateFile(const FileSys::Path& path, u64 size) const { const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -224,17 +224,17 @@ ResultCode SDMCArchive::CreateFile(const FileSys::Path& path, u64 size) const { switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_NOT_FOUND; case PathParser::PathNotFound: case PathParser::FileInPath: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_NOT_FOUND; case PathParser::DirectoryFound: - NGLOG_ERROR(Service_FS, "{} already exists", full_path); + LOG_ERROR(Service_FS, "{} already exists", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "{} already exists", full_path); + LOG_ERROR(Service_FS, "{} already exists", full_path); return ERROR_ALREADY_EXISTS; case PathParser::NotFound: break; // Expected 'success' case @@ -252,7 +252,7 @@ ResultCode SDMCArchive::CreateFile(const FileSys::Path& path, u64 size) const { return RESULT_SUCCESS; } - NGLOG_ERROR(Service_FS, "Too large file"); + LOG_ERROR(Service_FS, "Too large file"); return ResultCode(ErrorDescription::TooLarge, ErrorModule::FS, ErrorSummary::OutOfResource, ErrorLevel::Info); } @@ -261,7 +261,7 @@ ResultCode SDMCArchive::CreateDirectory(const Path& path) const { const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -269,15 +269,15 @@ ResultCode SDMCArchive::CreateDirectory(const Path& path) const { switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_NOT_FOUND; case PathParser::PathNotFound: case PathParser::FileInPath: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_NOT_FOUND; case PathParser::DirectoryFound: case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "{} already exists", full_path); + LOG_ERROR(Service_FS, "{} already exists", full_path); return ERROR_ALREADY_EXISTS; case PathParser::NotFound: break; // Expected 'success' case @@ -287,7 +287,7 @@ ResultCode SDMCArchive::CreateDirectory(const Path& path) const { return RESULT_SUCCESS; } - NGLOG_CRITICAL(Service_FS, "(unreachable) Unknown error creating {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Unknown error creating {}", mount_point); return ResultCode(ErrorDescription::NoData, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status); } @@ -297,14 +297,14 @@ ResultCode SDMCArchive::RenameDirectory(const Path& src_path, const Path& dest_p // TODO: Verify these return codes with HW if (!path_parser_src.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); return ERROR_INVALID_PATH; } const PathParser path_parser_dest(dest_path); if (!path_parser_dest.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); return ERROR_INVALID_PATH; } @@ -325,7 +325,7 @@ ResultVal> SDMCArchive::OpenDirectory(const Pa const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -333,15 +333,15 @@ ResultVal> SDMCArchive::OpenDirectory(const Pa switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_NOT_FOUND; case PathParser::PathNotFound: case PathParser::NotFound: case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "{} not found", full_path); + LOG_ERROR(Service_FS, "{} not found", full_path); return ERROR_NOT_FOUND; case PathParser::FileInPath: - NGLOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY_SDMC; case PathParser::DirectoryFound: break; // Expected 'success' case @@ -359,17 +359,17 @@ u64 SDMCArchive::GetFreeBytes() const { ArchiveFactory_SDMC::ArchiveFactory_SDMC(const std::string& sdmc_directory) : sdmc_directory(sdmc_directory) { - NGLOG_DEBUG(Service_FS, "Directory {} set as SDMC.", sdmc_directory); + LOG_DEBUG(Service_FS, "Directory {} set as SDMC.", sdmc_directory); } bool ArchiveFactory_SDMC::Initialize() { if (!Settings::values.use_virtual_sd) { - NGLOG_WARNING(Service_FS, "SDMC disabled by config."); + LOG_WARNING(Service_FS, "SDMC disabled by config."); return false; } if (!FileUtil::CreateFullPath(sdmc_directory)) { - NGLOG_ERROR(Service_FS, "Unable to create SDMC path."); + LOG_ERROR(Service_FS, "Unable to create SDMC path."); return false; } @@ -389,7 +389,7 @@ ResultCode ArchiveFactory_SDMC::Format(const Path& path, ResultVal ArchiveFactory_SDMC::GetFormatInfo(const Path& path) const { // TODO(Subv): Implement - NGLOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); + LOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); return ResultCode(-1); } } // namespace FileSys diff --git a/src/core/file_sys/archive_sdmcwriteonly.cpp b/src/core/file_sys/archive_sdmcwriteonly.cpp index 516c93114..a1f5a416c 100644 --- a/src/core/file_sys/archive_sdmcwriteonly.cpp +++ b/src/core/file_sys/archive_sdmcwriteonly.cpp @@ -18,7 +18,7 @@ namespace FileSys { ResultVal> SDMCWriteOnlyArchive::OpenFile(const Path& path, const Mode& mode) const { if (mode.read_flag) { - NGLOG_ERROR(Service_FS, "Read flag is not supported"); + LOG_ERROR(Service_FS, "Read flag is not supported"); return ERROR_INVALID_READ_FLAG; } return SDMCArchive::OpenFileBase(path, mode); @@ -26,23 +26,23 @@ ResultVal> SDMCWriteOnlyArchive::OpenFile(const Pat ResultVal> SDMCWriteOnlyArchive::OpenDirectory( const Path& path) const { - NGLOG_ERROR(Service_FS, "Not supported"); + LOG_ERROR(Service_FS, "Not supported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ArchiveFactory_SDMCWriteOnly::ArchiveFactory_SDMCWriteOnly(const std::string& mount_point) : sdmc_directory(mount_point) { - NGLOG_DEBUG(Service_FS, "Directory {} set as SDMCWriteOnly.", sdmc_directory); + LOG_DEBUG(Service_FS, "Directory {} set as SDMCWriteOnly.", sdmc_directory); } bool ArchiveFactory_SDMCWriteOnly::Initialize() { if (!Settings::values.use_virtual_sd) { - NGLOG_WARNING(Service_FS, "SDMC disabled by config."); + LOG_WARNING(Service_FS, "SDMC disabled by config."); return false; } if (!FileUtil::CreateFullPath(sdmc_directory)) { - NGLOG_ERROR(Service_FS, "Unable to create SDMC path."); + LOG_ERROR(Service_FS, "Unable to create SDMC path."); return false; } @@ -57,13 +57,13 @@ ResultVal> ArchiveFactory_SDMCWriteOnly::Open(co ResultCode ArchiveFactory_SDMCWriteOnly::Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info) { // TODO(wwylele): hwtest this - NGLOG_ERROR(Service_FS, "Attempted to format a SDMC write-only archive."); + LOG_ERROR(Service_FS, "Attempted to format a SDMC write-only archive."); return ResultCode(-1); } ResultVal ArchiveFactory_SDMCWriteOnly::GetFormatInfo(const Path& path) const { // TODO(Subv): Implement - NGLOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); + LOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); return ResultCode(-1); } diff --git a/src/core/file_sys/archive_selfncch.cpp b/src/core/file_sys/archive_selfncch.cpp index 5feb4e27a..f62b69bb7 100644 --- a/src/core/file_sys/archive_selfncch.cpp +++ b/src/core/file_sys/archive_selfncch.cpp @@ -38,12 +38,12 @@ public: ResultVal Read(u64 offset, size_t length, u8* buffer) const override { if (offset != 0) { - NGLOG_ERROR(Service_FS, "offset must be zero!"); + LOG_ERROR(Service_FS, "offset must be zero!"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } if (length != data->size()) { - NGLOG_ERROR(Service_FS, "size must match the file size!"); + LOG_ERROR(Service_FS, "size must match the file size!"); return ERROR_INCORRECT_EXEFS_READ_SIZE; } @@ -52,7 +52,7 @@ public: } ResultVal Write(u64 offset, size_t length, bool flush, const u8* buffer) override { - NGLOG_ERROR(Service_FS, "The file is read-only!"); + LOG_ERROR(Service_FS, "The file is read-only!"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } @@ -88,13 +88,13 @@ public: // Note: SelfNCCHArchive doesn't check the open mode. if (path.GetType() != LowPathType::Binary) { - NGLOG_ERROR(Service_FS, "Path need to be Binary"); + LOG_ERROR(Service_FS, "Path need to be Binary"); return ERROR_INVALID_PATH; } std::vector binary = path.AsBinary(); if (binary.size() != sizeof(SelfNCCHFilePath)) { - NGLOG_ERROR(Service_FS, "Wrong path size {}", binary.size()); + LOG_ERROR(Service_FS, "Wrong path size {}", binary.size()); return ERROR_INVALID_PATH; } @@ -109,7 +109,7 @@ public: return OpenRomFS(); case SelfNCCHFilePathType::Code: - NGLOG_ERROR(Service_FS, "Reading the code section is not supported!"); + LOG_ERROR(Service_FS, "Reading the code section is not supported!"); return ERROR_COMMAND_NOT_ALLOWED; case SelfNCCHFilePathType::ExeFS: { @@ -119,48 +119,48 @@ public: return OpenExeFS(filename); } default: - NGLOG_ERROR(Service_FS, "Unknown file type {}!", static_cast(file_path.type)); + LOG_ERROR(Service_FS, "Unknown file type {}!", static_cast(file_path.type)); return ERROR_INVALID_PATH; } } ResultCode DeleteFile(const Path& path) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ResultCode RenameFile(const Path& src_path, const Path& dest_path) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ResultCode DeleteDirectory(const Path& path) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ResultCode DeleteDirectoryRecursively(const Path& path) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ResultCode CreateFile(const Path& path, u64 size) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ResultCode CreateDirectory(const Path& path) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ResultCode RenameDirectory(const Path& src_path, const Path& dest_path) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } ResultVal> OpenDirectory(const Path& path) const override { - NGLOG_ERROR(Service_FS, "Unsupported"); + LOG_ERROR(Service_FS, "Unsupported"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } @@ -177,7 +177,7 @@ private: std::make_unique(ncch_data.romfs_file, ncch_data.romfs_offset, ncch_data.romfs_size, std::move(delay_generator))); } else { - NGLOG_INFO(Service_FS, "Unable to read RomFS"); + LOG_INFO(Service_FS, "Unable to read RomFS"); return ERROR_ROMFS_NOT_FOUND; } } @@ -190,7 +190,7 @@ private: ncch_data.update_romfs_file, ncch_data.update_romfs_offset, ncch_data.update_romfs_size, std::move(delay_generator))); } else { - NGLOG_INFO(Service_FS, "Unable to read update RomFS"); + LOG_INFO(Service_FS, "Unable to read update RomFS"); return ERROR_ROMFS_NOT_FOUND; } } @@ -202,7 +202,7 @@ private: std::make_unique(ncch_data.icon)); } - NGLOG_WARNING(Service_FS, "Unable to read icon"); + LOG_WARNING(Service_FS, "Unable to read icon"); return ERROR_EXEFS_SECTION_NOT_FOUND; } @@ -212,7 +212,7 @@ private: std::make_unique(ncch_data.logo)); } - NGLOG_WARNING(Service_FS, "Unable to read logo"); + LOG_WARNING(Service_FS, "Unable to read logo"); return ERROR_EXEFS_SECTION_NOT_FOUND; } @@ -222,11 +222,11 @@ private: std::make_unique(ncch_data.banner)); } - NGLOG_WARNING(Service_FS, "Unable to read banner"); + LOG_WARNING(Service_FS, "Unable to read banner"); return ERROR_EXEFS_SECTION_NOT_FOUND; } - NGLOG_ERROR(Service_FS, "Unknown ExeFS section {}!", filename); + LOG_ERROR(Service_FS, "Unknown ExeFS section {}!", filename); return ERROR_INVALID_PATH; } @@ -236,16 +236,16 @@ private: void ArchiveFactory_SelfNCCH::Register(Loader::AppLoader& app_loader) { u64 program_id = 0; if (app_loader.ReadProgramId(program_id) != Loader::ResultStatus::Success) { - NGLOG_WARNING( + LOG_WARNING( Service_FS, "Could not read program id when registering with SelfNCCH, this might be a 3dsx file"); } - NGLOG_DEBUG(Service_FS, "Registering program {:016X} with the SelfNCCH archive factory", + LOG_DEBUG(Service_FS, "Registering program {:016X} with the SelfNCCH archive factory", program_id); if (ncch_data.find(program_id) != ncch_data.end()) { - NGLOG_WARNING(Service_FS, + LOG_WARNING(Service_FS, "Registering program {:016X} with SelfNCCH will override existing mapping", program_id); } @@ -288,12 +288,12 @@ ResultVal> ArchiveFactory_SelfNCCH::Open(const P } ResultCode ArchiveFactory_SelfNCCH::Format(const Path&, const FileSys::ArchiveFormatInfo&) { - NGLOG_ERROR(Service_FS, "Attempted to format a SelfNCCH archive."); + LOG_ERROR(Service_FS, "Attempted to format a SelfNCCH archive."); return ERROR_INVALID_PATH; } ResultVal ArchiveFactory_SelfNCCH::GetFormatInfo(const Path&) const { - NGLOG_ERROR(Service_FS, "Attempted to get format info of a SelfNCCH archive"); + LOG_ERROR(Service_FS, "Attempted to get format info of a SelfNCCH archive"); return ERROR_INVALID_PATH; } diff --git a/src/core/file_sys/archive_source_sd_savedata.cpp b/src/core/file_sys/archive_source_sd_savedata.cpp index 6c127a499..e072d0650 100644 --- a/src/core/file_sys/archive_source_sd_savedata.cpp +++ b/src/core/file_sys/archive_source_sd_savedata.cpp @@ -40,7 +40,7 @@ std::string GetSaveDataMetadataPath(const std::string& mount_location, u64 progr ArchiveSource_SDSaveData::ArchiveSource_SDSaveData(const std::string& sdmc_directory) : mount_point(GetSaveDataContainerPath(sdmc_directory)) { - NGLOG_DEBUG(Service_FS, "Directory {} set as SaveData.", mount_point); + LOG_DEBUG(Service_FS, "Directory {} set as SaveData.", mount_point); } ResultVal> ArchiveSource_SDSaveData::Open(u64 program_id) { @@ -79,7 +79,7 @@ ResultVal ArchiveSource_SDSaveData::GetFormatInfo(u64 program FileUtil::IOFile file(metadata_path, "rb"); if (!file.IsOpen()) { - NGLOG_ERROR(Service_FS, "Could not open metadata information for archive"); + LOG_ERROR(Service_FS, "Could not open metadata information for archive"); // TODO(Subv): Verify error code return ERR_NOT_FORMATTED; } diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index 45a25d673..463ff2a68 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -72,7 +72,7 @@ ResultCode ArchiveFactory_SystemSaveData::Format(const Path& path, ResultVal ArchiveFactory_SystemSaveData::GetFormatInfo(const Path& path) const { // TODO(Subv): Implement - NGLOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); + LOG_ERROR(Service_FS, "Unimplemented GetFormatInfo archive {}", GetName()); return ResultCode(-1); } diff --git a/src/core/file_sys/cia_container.cpp b/src/core/file_sys/cia_container.cpp index 5774a0a6f..69abbff23 100644 --- a/src/core/file_sys/cia_container.cpp +++ b/src/core/file_sys/cia_container.cpp @@ -208,21 +208,21 @@ u64 CIAContainer::GetContentSize(u16 index) const { } void CIAContainer::Print() const { - NGLOG_DEBUG(Service_FS, "Type: {}", static_cast(cia_header.type)); - NGLOG_DEBUG(Service_FS, "Version: {}\n", static_cast(cia_header.version)); + LOG_DEBUG(Service_FS, "Type: {}", static_cast(cia_header.type)); + LOG_DEBUG(Service_FS, "Version: {}\n", static_cast(cia_header.version)); - NGLOG_DEBUG(Service_FS, "Certificate Size: 0x{:08x} bytes", GetCertificateSize()); - NGLOG_DEBUG(Service_FS, "Ticket Size: 0x{:08x} bytes", GetTicketSize()); - NGLOG_DEBUG(Service_FS, "TMD Size: 0x{:08x} bytes", GetTitleMetadataSize()); - NGLOG_DEBUG(Service_FS, "Meta Size: 0x{:08x} bytes", GetMetadataSize()); - NGLOG_DEBUG(Service_FS, "Content Size: 0x{:08x} bytes\n", GetTotalContentSize()); + LOG_DEBUG(Service_FS, "Certificate Size: 0x{:08x} bytes", GetCertificateSize()); + LOG_DEBUG(Service_FS, "Ticket Size: 0x{:08x} bytes", GetTicketSize()); + LOG_DEBUG(Service_FS, "TMD Size: 0x{:08x} bytes", GetTitleMetadataSize()); + LOG_DEBUG(Service_FS, "Meta Size: 0x{:08x} bytes", GetMetadataSize()); + LOG_DEBUG(Service_FS, "Content Size: 0x{:08x} bytes\n", GetTotalContentSize()); - NGLOG_DEBUG(Service_FS, "Certificate Offset: 0x{:08x} bytes", GetCertificateOffset()); - NGLOG_DEBUG(Service_FS, "Ticket Offset: 0x{:08x} bytes", GetTicketOffset()); - NGLOG_DEBUG(Service_FS, "TMD Offset: 0x{:08x} bytes", GetTitleMetadataOffset()); - NGLOG_DEBUG(Service_FS, "Meta Offset: 0x{:08x} bytes", GetMetadataOffset()); + LOG_DEBUG(Service_FS, "Certificate Offset: 0x{:08x} bytes", GetCertificateOffset()); + LOG_DEBUG(Service_FS, "Ticket Offset: 0x{:08x} bytes", GetTicketOffset()); + LOG_DEBUG(Service_FS, "TMD Offset: 0x{:08x} bytes", GetTitleMetadataOffset()); + LOG_DEBUG(Service_FS, "Meta Offset: 0x{:08x} bytes", GetMetadataOffset()); for (u16 i = 0; i < cia_tmd.GetContentCount(); i++) { - NGLOG_DEBUG(Service_FS, "Content {:x} Offset: 0x{:08x} bytes", i, GetContentOffset(i)); + LOG_DEBUG(Service_FS, "Content {:x} Offset: 0x{:08x} bytes", i, GetContentOffset(i)); } } } // namespace FileSys diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index 7d8e9c2e3..817601ebf 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp @@ -67,7 +67,7 @@ u32 DiskDirectory::Read(const u32 count, Entry* entries) { const std::string& filename = file.virtualName; Entry& entry = entries[entries_read]; - NGLOG_TRACE(Service_FS, "File {}: size={} dir={}", filename, file.size, file.isDirectory); + LOG_TRACE(Service_FS, "File {}: size={} dir={}", filename, file.size, file.isDirectory); // TODO(Link Mauve): use a proper conversion to UTF-16. for (size_t j = 0; j < FILENAME_LENGTH; ++j) { diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h index 92035111b..0f2a8c730 100644 --- a/src/core/file_sys/file_backend.h +++ b/src/core/file_sys/file_backend.h @@ -49,7 +49,7 @@ public: if (delay_generator != nullptr) { return delay_generator->GetReadDelayNs(length); } - NGLOG_ERROR(Service_FS, "Delay generator was not initalized. Using default"); + LOG_ERROR(Service_FS, "Delay generator was not initalized. Using default"); delay_generator = std::make_unique(); return delay_generator->GetReadDelayNs(length); } diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 0f49df0cb..a82c18618 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -29,49 +29,49 @@ ResultVal> IVFCArchive::OpenFile(const Path& path, } ResultCode IVFCArchive::DeleteFile(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to delete a file from an IVFC archive ({}).", GetName()); + LOG_CRITICAL(Service_FS, "Attempted to delete a file from an IVFC archive ({}).", GetName()); // TODO(Subv): Verify error code return ResultCode(ErrorDescription::NoData, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status); } ResultCode IVFCArchive::RenameFile(const Path& src_path, const Path& dest_path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode IVFCArchive::DeleteDirectory(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode IVFCArchive::DeleteDirectoryRecursively(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const { - NGLOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive ({}).", GetName()); + LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive ({}).", GetName()); // TODO: Verify error code return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported, ErrorLevel::Permanent); } ResultCode IVFCArchive::CreateDirectory(const Path& path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to create a directory in an IVFC archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to create a directory in an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode IVFCArchive::RenameDirectory(const Path& src_path, const Path& dest_path) const { - NGLOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); @@ -82,7 +82,7 @@ ResultVal> IVFCArchive::OpenDirectory(const Pa } u64 IVFCArchive::GetFreeBytes() const { - NGLOG_WARNING(Service_FS, "Attempted to get the free space in an IVFC archive"); + LOG_WARNING(Service_FS, "Attempted to get the free space in an IVFC archive"); return 0; } @@ -95,7 +95,7 @@ IVFCFile::IVFCFile(std::shared_ptr file, u64 offset, u64 size, } ResultVal IVFCFile::Read(const u64 offset, const size_t length, u8* buffer) const { - NGLOG_TRACE(Service_FS, "called offset={}, length={}", offset, length); + LOG_TRACE(Service_FS, "called offset={}, length={}", offset, length); romfs_file->Seek(data_offset + offset, SEEK_SET); size_t read_length = (size_t)std::min((u64)length, data_size - offset); @@ -104,7 +104,7 @@ ResultVal IVFCFile::Read(const u64 offset, const size_t length, u8* buff ResultVal IVFCFile::Write(const u64 offset, const size_t length, const bool flush, const u8* buffer) { - NGLOG_ERROR(Service_FS, "Attempted to write to IVFC file"); + LOG_ERROR(Service_FS, "Attempted to write to IVFC file"); // TODO(Subv): Find error code return MakeResult(0); } @@ -114,7 +114,7 @@ u64 IVFCFile::GetSize() const { } bool IVFCFile::SetSize(const u64 size) const { - NGLOG_ERROR(Service_FS, "Attempted to set the size of an IVFC file"); + LOG_ERROR(Service_FS, "Attempted to set the size of an IVFC file"); return false; } diff --git a/src/core/file_sys/ncch_container.cpp b/src/core/file_sys/ncch_container.cpp index 9108f9ea1..d3c07568b 100644 --- a/src/core/file_sys/ncch_container.cpp +++ b/src/core/file_sys/ncch_container.cpp @@ -110,11 +110,11 @@ Loader::ResultStatus NCCHContainer::OpenFile(const std::string& filepath, u32 nc file = FileUtil::IOFile(filepath, "rb"); if (!file.IsOpen()) { - NGLOG_WARNING(Service_FS, "Failed to open {}", filepath); + LOG_WARNING(Service_FS, "Failed to open {}", filepath); return Loader::ResultStatus::Error; } - NGLOG_DEBUG(Service_FS, "Opened {}", filepath); + LOG_DEBUG(Service_FS, "Opened {}", filepath); return Loader::ResultStatus::Success; } @@ -131,7 +131,7 @@ Loader::ResultStatus NCCHContainer::Load() { // Skip NCSD header and load first NCCH (NCSD is just a container of NCCH files)... if (Loader::MakeMagic('N', 'C', 'S', 'D') == ncch_header.magic) { - NGLOG_DEBUG(Service_FS, "Only loading the first (bootable) NCCH within the NCSD file!"); + LOG_DEBUG(Service_FS, "Only loading the first (bootable) NCCH within the NCSD file!"); ncch_offset += 0x4000; file.Seek(ncch_offset, SEEK_SET); file.ReadBytes(&ncch_header, sizeof(NCCH_Header)); @@ -159,23 +159,23 @@ Loader::ResultStatus NCCHContainer::Load() { u8 resource_limit_category = exheader_header.arm11_system_local_caps.resource_limit_category; - NGLOG_DEBUG(Service_FS, "Name: {}", + LOG_DEBUG(Service_FS, "Name: {}", exheader_header.codeset_info.name); - NGLOG_DEBUG(Service_FS, "Program ID: {:016X}", ncch_header.program_id); - NGLOG_DEBUG(Service_FS, "Code compressed: {}", + LOG_DEBUG(Service_FS, "Program ID: {:016X}", ncch_header.program_id); + LOG_DEBUG(Service_FS, "Code compressed: {}", is_compressed ? "yes" : "no"); - NGLOG_DEBUG(Service_FS, "Entry point: 0x{:08X}", entry_point); - NGLOG_DEBUG(Service_FS, "Code size: 0x{:08X}", code_size); - NGLOG_DEBUG(Service_FS, "Stack size: 0x{:08X}", stack_size); - NGLOG_DEBUG(Service_FS, "Bss size: 0x{:08X}", bss_size); - NGLOG_DEBUG(Service_FS, "Core version: {}", core_version); - NGLOG_DEBUG(Service_FS, "Thread priority: 0x{:X}", priority); - NGLOG_DEBUG(Service_FS, "Resource limit category: {}", resource_limit_category); - NGLOG_DEBUG(Service_FS, "System Mode: {}", + LOG_DEBUG(Service_FS, "Entry point: 0x{:08X}", entry_point); + LOG_DEBUG(Service_FS, "Code size: 0x{:08X}", code_size); + LOG_DEBUG(Service_FS, "Stack size: 0x{:08X}", stack_size); + LOG_DEBUG(Service_FS, "Bss size: 0x{:08X}", bss_size); + LOG_DEBUG(Service_FS, "Core version: {}", core_version); + LOG_DEBUG(Service_FS, "Thread priority: 0x{:X}", priority); + LOG_DEBUG(Service_FS, "Resource limit category: {}", resource_limit_category); + LOG_DEBUG(Service_FS, "System Mode: {}", static_cast(exheader_header.arm11_system_local_caps.system_mode)); if (exheader_header.system_info.jump_id != ncch_header.program_id) { - NGLOG_ERROR(Service_FS, + LOG_ERROR(Service_FS, "ExHeader Program ID mismatch: the ROM is probably encrypted."); return Loader::ResultStatus::ErrorEncrypted; } @@ -188,8 +188,8 @@ Loader::ResultStatus NCCHContainer::Load() { exefs_offset = ncch_header.exefs_offset * kBlockSize; u32 exefs_size = ncch_header.exefs_size * kBlockSize; - NGLOG_DEBUG(Service_FS, "ExeFS offset: 0x{:08X}", exefs_offset); - NGLOG_DEBUG(Service_FS, "ExeFS size: 0x{:08X}", exefs_size); + LOG_DEBUG(Service_FS, "ExeFS offset: 0x{:08X}", exefs_offset); + LOG_DEBUG(Service_FS, "ExeFS size: 0x{:08X}", exefs_size); file.Seek(exefs_offset + ncch_offset, SEEK_SET); if (file.ReadBytes(&exefs_header, sizeof(ExeFs_Header)) != sizeof(ExeFs_Header)) @@ -227,7 +227,7 @@ Loader::ResultStatus NCCHContainer::LoadOverrides() { exefs_file = FileUtil::IOFile(exefs_override, "rb"); if (exefs_file.ReadBytes(&exefs_header, sizeof(ExeFs_Header)) == sizeof(ExeFs_Header)) { - NGLOG_DEBUG(Service_FS, "Loading ExeFS section from {}", exefs_override); + LOG_DEBUG(Service_FS, "Loading ExeFS section from {}", exefs_override); exefs_offset = 0; is_tainted = true; has_exefs = true; @@ -239,7 +239,7 @@ Loader::ResultStatus NCCHContainer::LoadOverrides() { } if (is_tainted) - NGLOG_WARNING(Service_FS, + LOG_WARNING(Service_FS, "Loaded NCCH {} is tainted, application behavior may not be as expected!", filepath); @@ -267,12 +267,12 @@ Loader::ResultStatus NCCHContainer::LoadSectionExeFS(const char* name, std::vect file.Seek(ncch_offset + logo_offset, SEEK_SET); if (file.ReadBytes(buffer.data(), logo_size) != logo_size) { - NGLOG_ERROR(Service_FS, "Could not read NCCH logo"); + LOG_ERROR(Service_FS, "Could not read NCCH logo"); return Loader::ResultStatus::Error; } return Loader::ResultStatus::Success; } else { - NGLOG_INFO(Service_FS, "Attempting to load logo from the ExeFS"); + LOG_INFO(Service_FS, "Attempting to load logo from the ExeFS"); } } @@ -280,14 +280,14 @@ Loader::ResultStatus NCCHContainer::LoadSectionExeFS(const char* name, std::vect if (!exefs_file.IsOpen()) return Loader::ResultStatus::Error; - NGLOG_DEBUG(Service_FS, "{} sections:", kMaxSections); + LOG_DEBUG(Service_FS, "{} sections:", kMaxSections); // Iterate through the ExeFs archive until we find a section with the specified name... for (unsigned section_number = 0; section_number < kMaxSections; section_number++) { const auto& section = exefs_header.section[section_number]; // Load the specified section... if (strcmp(section.name, name) == 0) { - NGLOG_DEBUG(Service_FS, "{} - offset: 0x{:08X}, size: 0x{:08X}, name: {}", + LOG_DEBUG(Service_FS, "{} - offset: 0x{:08X}, size: 0x{:08X}, name: {}", section_number, section.offset, section.size, section.name); s64 section_offset = @@ -348,7 +348,7 @@ Loader::ResultStatus NCCHContainer::LoadOverrideExeFSSection(const char* name, section_file.Seek(0, SEEK_SET); if (section_file.ReadBytes(&buffer[0], section_size) == section_size) { - NGLOG_WARNING(Service_FS, "File {} overriding built-in ExeFS file", section_override); + LOG_WARNING(Service_FS, "File {} overriding built-in ExeFS file", section_override); return Loader::ResultStatus::Success; } } @@ -365,7 +365,7 @@ Loader::ResultStatus NCCHContainer::ReadRomFS(std::shared_ptr& return Loader::ResultStatus::Success; if (!has_romfs) { - NGLOG_DEBUG(Service_FS, "RomFS requested from NCCH which has no RomFS"); + LOG_DEBUG(Service_FS, "RomFS requested from NCCH which has no RomFS"); return Loader::ResultStatus::ErrorNotUsed; } @@ -375,8 +375,8 @@ Loader::ResultStatus NCCHContainer::ReadRomFS(std::shared_ptr& u32 romfs_offset = ncch_offset + (ncch_header.romfs_offset * kBlockSize) + 0x1000; u32 romfs_size = (ncch_header.romfs_size * kBlockSize) - 0x1000; - NGLOG_DEBUG(Service_FS, "RomFS offset: 0x{:08X}", romfs_offset); - NGLOG_DEBUG(Service_FS, "RomFS size: 0x{:08X}", romfs_size); + LOG_DEBUG(Service_FS, "RomFS offset: 0x{:08X}", romfs_offset); + LOG_DEBUG(Service_FS, "RomFS size: 0x{:08X}", romfs_size); if (file.GetSize() < romfs_offset + romfs_size) return Loader::ResultStatus::Error; @@ -399,7 +399,7 @@ Loader::ResultStatus NCCHContainer::ReadOverrideRomFS(std::shared_ptr(split_filepath, "rb"); if (romfs_file->IsOpen()) { - NGLOG_WARNING(Service_FS, "File {} overriding built-in RomFS", split_filepath); + LOG_WARNING(Service_FS, "File {} overriding built-in RomFS", split_filepath); offset = 0; size = romfs_file->GetSize(); return Loader::ResultStatus::Success; diff --git a/src/core/file_sys/savedata_archive.cpp b/src/core/file_sys/savedata_archive.cpp index 96e811e92..2367b15ce 100644 --- a/src/core/file_sys/savedata_archive.cpp +++ b/src/core/file_sys/savedata_archive.cpp @@ -29,22 +29,22 @@ public: ResultVal> SaveDataArchive::OpenFile(const Path& path, const Mode& mode) const { - NGLOG_DEBUG(Service_FS, "called path={} mode={:01X}", path.DebugStr(), mode.hex); + LOG_DEBUG(Service_FS, "called path={} mode={:01X}", path.DebugStr(), mode.hex); const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } if (mode.hex == 0) { - NGLOG_ERROR(Service_FS, "Empty open mode"); + LOG_ERROR(Service_FS, "Empty open mode"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } if (mode.create_flag && !mode.write_flag) { - NGLOG_ERROR(Service_FS, "Create flag set but write flag not set"); + LOG_ERROR(Service_FS, "Create flag set but write flag not set"); return ERROR_UNSUPPORTED_OPEN_FLAGS; } @@ -52,18 +52,18 @@ ResultVal> SaveDataArchive::OpenFile(const Path& pa switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_FILE_NOT_FOUND; case PathParser::PathNotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_PATH_NOT_FOUND; case PathParser::FileInPath: case PathParser::DirectoryFound: - NGLOG_ERROR(Service_FS, "Unexpected file or directory in {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file or directory in {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; case PathParser::NotFound: if (!mode.create_flag) { - NGLOG_ERROR(Service_FS, "Non-existing file {} can't be open without mode create.", + LOG_ERROR(Service_FS, "Non-existing file {} can't be open without mode create.", full_path); return ERROR_FILE_NOT_FOUND; } else { @@ -77,7 +77,7 @@ ResultVal> SaveDataArchive::OpenFile(const Path& pa FileUtil::IOFile file(full_path, mode.write_flag ? "r+b" : "rb"); if (!file.IsOpen()) { - NGLOG_CRITICAL(Service_FS, "(unreachable) Unknown error opening {}", full_path); + LOG_CRITICAL(Service_FS, "(unreachable) Unknown error opening {}", full_path); return ERROR_FILE_NOT_FOUND; } @@ -90,7 +90,7 @@ ResultCode SaveDataArchive::DeleteFile(const Path& path) const { const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -98,15 +98,15 @@ ResultCode SaveDataArchive::DeleteFile(const Path& path) const { switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_FILE_NOT_FOUND; case PathParser::PathNotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_PATH_NOT_FOUND; case PathParser::FileInPath: case PathParser::DirectoryFound: case PathParser::NotFound: - NGLOG_ERROR(Service_FS, "File not found {}", full_path); + LOG_ERROR(Service_FS, "File not found {}", full_path); return ERROR_FILE_NOT_FOUND; case PathParser::FileFound: break; // Expected 'success' case @@ -116,7 +116,7 @@ ResultCode SaveDataArchive::DeleteFile(const Path& path) const { return RESULT_SUCCESS; } - NGLOG_CRITICAL(Service_FS, "(unreachable) Unknown error deleting {}", full_path); + LOG_CRITICAL(Service_FS, "(unreachable) Unknown error deleting {}", full_path); return ERROR_FILE_NOT_FOUND; } @@ -125,14 +125,14 @@ ResultCode SaveDataArchive::RenameFile(const Path& src_path, const Path& dest_pa // TODO: Verify these return codes with HW if (!path_parser_src.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); return ERROR_INVALID_PATH; } const PathParser path_parser_dest(dest_path); if (!path_parser_dest.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); return ERROR_INVALID_PATH; } @@ -155,7 +155,7 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -166,15 +166,15 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_PATH_NOT_FOUND; case PathParser::PathNotFound: case PathParser::NotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_PATH_NOT_FOUND; case PathParser::FileInPath: case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "Unexpected file or directory {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file or directory {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; case PathParser::DirectoryFound: break; // Expected 'success' case @@ -184,7 +184,7 @@ static ResultCode DeleteDirectoryHelper(const Path& path, const std::string& mou return RESULT_SUCCESS; } - NGLOG_ERROR(Service_FS, "Directory not empty {}", full_path); + LOG_ERROR(Service_FS, "Directory not empty {}", full_path); return ERROR_DIRECTORY_NOT_EMPTY; } @@ -201,7 +201,7 @@ ResultCode SaveDataArchive::CreateFile(const FileSys::Path& path, u64 size) cons const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -209,17 +209,17 @@ ResultCode SaveDataArchive::CreateFile(const FileSys::Path& path, u64 size) cons switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_FILE_NOT_FOUND; case PathParser::PathNotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_PATH_NOT_FOUND; case PathParser::FileInPath: - NGLOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; case PathParser::DirectoryFound: case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "{} already exists", full_path); + LOG_ERROR(Service_FS, "{} already exists", full_path); return ERROR_FILE_ALREADY_EXISTS; case PathParser::NotFound: break; // Expected 'success' case @@ -237,7 +237,7 @@ ResultCode SaveDataArchive::CreateFile(const FileSys::Path& path, u64 size) cons return RESULT_SUCCESS; } - NGLOG_ERROR(Service_FS, "Too large file"); + LOG_ERROR(Service_FS, "Too large file"); return ResultCode(ErrorDescription::TooLarge, ErrorModule::FS, ErrorSummary::OutOfResource, ErrorLevel::Info); } @@ -246,7 +246,7 @@ ResultCode SaveDataArchive::CreateDirectory(const Path& path) const { const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -254,17 +254,17 @@ ResultCode SaveDataArchive::CreateDirectory(const Path& path) const { switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_FILE_NOT_FOUND; case PathParser::PathNotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_PATH_NOT_FOUND; case PathParser::FileInPath: - NGLOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; case PathParser::DirectoryFound: case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "{} already exists", full_path); + LOG_ERROR(Service_FS, "{} already exists", full_path); return ERROR_DIRECTORY_ALREADY_EXISTS; case PathParser::NotFound: break; // Expected 'success' case @@ -274,7 +274,7 @@ ResultCode SaveDataArchive::CreateDirectory(const Path& path) const { return RESULT_SUCCESS; } - NGLOG_CRITICAL(Service_FS, "(unreachable) Unknown error creating {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Unknown error creating {}", mount_point); return ResultCode(ErrorDescription::NoData, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status); } @@ -284,14 +284,14 @@ ResultCode SaveDataArchive::RenameDirectory(const Path& src_path, const Path& de // TODO: Verify these return codes with HW if (!path_parser_src.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid src path {}", src_path.DebugStr()); return ERROR_INVALID_PATH; } const PathParser path_parser_dest(dest_path); if (!path_parser_dest.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid dest path {}", dest_path.DebugStr()); return ERROR_INVALID_PATH; } @@ -313,7 +313,7 @@ ResultVal> SaveDataArchive::OpenDirectory( const PathParser path_parser(path); if (!path_parser.IsValid()) { - NGLOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); + LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr()); return ERROR_INVALID_PATH; } @@ -321,15 +321,15 @@ ResultVal> SaveDataArchive::OpenDirectory( switch (path_parser.GetHostStatus(mount_point)) { case PathParser::InvalidMountPoint: - NGLOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); + LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point); return ERROR_FILE_NOT_FOUND; case PathParser::PathNotFound: case PathParser::NotFound: - NGLOG_ERROR(Service_FS, "Path not found {}", full_path); + LOG_ERROR(Service_FS, "Path not found {}", full_path); return ERROR_PATH_NOT_FOUND; case PathParser::FileInPath: case PathParser::FileFound: - NGLOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); + LOG_ERROR(Service_FS, "Unexpected file in path {}", full_path); return ERROR_UNEXPECTED_FILE_OR_DIRECTORY; case PathParser::DirectoryFound: break; // Expected 'success' case diff --git a/src/core/file_sys/title_metadata.cpp b/src/core/file_sys/title_metadata.cpp index 7701a44b1..77a693734 100644 --- a/src/core/file_sys/title_metadata.cpp +++ b/src/core/file_sys/title_metadata.cpp @@ -45,7 +45,7 @@ Loader::ResultStatus TitleMetadata::Load(const std::string& file_path) { Loader::ResultStatus result = Load(file_data); if (result != Loader::ResultStatus::Success) - NGLOG_ERROR(Service_FS, "Failed to load TMD from file {}!", file_path); + LOG_ERROR(Service_FS, "Failed to load TMD from file {}!", file_path); return result; } @@ -75,7 +75,7 @@ Loader::ResultStatus TitleMetadata::Load(const std::vector file_data, size_t size_t expected_size = body_start + sizeof(Body) + tmd_body.content_count * sizeof(ContentChunk); if (total_size < expected_size) { - NGLOG_ERROR(Service_FS, "Malformed TMD, expected size 0x{:x}, got 0x{:x}!", expected_size, + LOG_ERROR(Service_FS, "Malformed TMD, expected size 0x{:x}, got 0x{:x}!", expected_size, total_size); return Loader::ResultStatus::ErrorInvalidFormat; } @@ -209,15 +209,15 @@ void TitleMetadata::AddContentChunk(const ContentChunk& chunk) { } void TitleMetadata::Print() const { - NGLOG_DEBUG(Service_FS, "{} chunks", static_cast(tmd_body.content_count)); + LOG_DEBUG(Service_FS, "{} chunks", static_cast(tmd_body.content_count)); // Content info describes ranges of content chunks - NGLOG_DEBUG(Service_FS, "Content info:"); + LOG_DEBUG(Service_FS, "Content info:"); for (size_t i = 0; i < tmd_body.contentinfo.size(); i++) { if (tmd_body.contentinfo[i].command_count == 0) break; - NGLOG_DEBUG(Service_FS, " Index {:04X}, Command Count {:04X}", + LOG_DEBUG(Service_FS, " Index {:04X}, Command Count {:04X}", static_cast(tmd_body.contentinfo[i].index), static_cast(tmd_body.contentinfo[i].command_count)); } @@ -230,14 +230,14 @@ void TitleMetadata::Print() const { if (count == 0) continue; - NGLOG_DEBUG(Service_FS, "Content chunks for content info index {}:", i); + LOG_DEBUG(Service_FS, "Content chunks for content info index {}:", i); for (u16 j = index; j < index + count; j++) { // Don't attempt to print content we don't have if (j > tmd_body.content_count) break; const ContentChunk& chunk = tmd_chunks[j]; - NGLOG_DEBUG(Service_FS, " ID {:08X}, Index {:04X}, Type {:04x}, Size {:016X}", + LOG_DEBUG(Service_FS, " ID {:08X}, Index {:04X}, Type {:04x}, Size {:016X}", static_cast(chunk.id), static_cast(chunk.index), static_cast(chunk.type), static_cast(chunk.size)); } diff --git a/src/core/frontend/camera/factory.cpp b/src/core/frontend/camera/factory.cpp index 619fa3974..3e0701da4 100644 --- a/src/core/frontend/camera/factory.cpp +++ b/src/core/frontend/camera/factory.cpp @@ -25,7 +25,7 @@ std::unique_ptr CreateCamera(const std::string& name, const std } if (name != "blank") { - NGLOG_ERROR(Service_CAM, "Unknown camera {}", name); + LOG_ERROR(Service_CAM, "Unknown camera {}", name); } return std::make_unique(); } @@ -39,7 +39,7 @@ std::unique_ptr CreateCameraPreview(const std::string& name, } if (name != "blank") { - NGLOG_ERROR(Service_CAM, "Unknown camera {}", name); + LOG_ERROR(Service_CAM, "Unknown camera {}", name); } return std::make_unique(); } diff --git a/src/core/frontend/camera/factory.h b/src/core/frontend/camera/factory.h index 0fe9f314f..ca1ea2a09 100644 --- a/src/core/frontend/camera/factory.h +++ b/src/core/frontend/camera/factory.h @@ -31,7 +31,7 @@ public: * @param flip The image flip to apply * @returns a unique_ptr to the created camera object. * Note: The default implementation for this is to call Create(). Derived classes may have other - * Implementations. For example, A dialog may be used instead of NGLOG_ERROR when error + * Implementations. For example, A dialog may be used instead of LOG_ERROR when error * occurs. */ virtual std::unique_ptr CreatePreview(const std::string& config, int width, diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 26e9f6597..dc32551e7 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -59,7 +59,7 @@ template void RegisterFactory(const std::string& name, std::shared_ptr> factory) { auto pair = std::make_pair(name, std::move(factory)); if (!Impl::FactoryList::list.insert(std::move(pair)).second) { - NGLOG_ERROR(Input, "Factory {} already registered", name); + LOG_ERROR(Input, "Factory {} already registered", name); } } @@ -71,7 +71,7 @@ void RegisterFactory(const std::string& name, std::shared_ptr void UnregisterFactory(const std::string& name) { if (Impl::FactoryList::list.erase(name) == 0) { - NGLOG_ERROR(Input, "Factory {} not registered", name); + LOG_ERROR(Input, "Factory {} not registered", name); } } @@ -88,7 +88,7 @@ std::unique_ptr CreateDevice(const std::string& params) { const auto pair = factory_list.find(engine); if (pair == factory_list.end()) { if (engine != "null") { - NGLOG_ERROR(Input, "Unknown engine name: {}", engine); + LOG_ERROR(Input, "Unknown engine name: {}", engine); } return std::make_unique(); } diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 645af19e7..0872ffab0 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -164,7 +164,7 @@ static u8 HexCharToValue(u8 hex) { return hex - 'A' + 0xA; } - NGLOG_ERROR(Debug_GDBStub, "Invalid nibble: {:c} {:02x}\n", hex, hex); + LOG_ERROR(Debug_GDBStub, "Invalid nibble: {:c} {:02x}\n", hex, hex); return 0; } @@ -260,7 +260,7 @@ static u8 ReadByte() { u8 c; size_t received_size = recv(gdbserver_socket, reinterpret_cast(&c), 1, MSG_WAITALL); if (received_size != 1) { - NGLOG_ERROR(Debug_GDBStub, "recv failed : {}", received_size); + LOG_ERROR(Debug_GDBStub, "recv failed : {}", received_size); Shutdown(); } @@ -301,7 +301,7 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) { auto bp = p.find(addr); if (bp != p.end()) { - NGLOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:08x} bytes at {:08x} of type {}\n", + LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:08x} bytes at {:08x} of type {}\n", bp->second.len, bp->second.addr, static_cast(type)); p.erase(addr); } @@ -347,7 +347,7 @@ bool CheckBreakpoint(PAddr addr, BreakpointType type) { } if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) { - NGLOG_DEBUG(Debug_GDBStub, + LOG_DEBUG(Debug_GDBStub, "Found breakpoint type {} @ {:08x}, range: {:08x} - {:08x} ({} bytes)\n", static_cast(type), addr, bp->second.addr, bp->second.addr + len, len); return true; @@ -365,7 +365,7 @@ bool CheckBreakpoint(PAddr addr, BreakpointType type) { static void SendPacket(const char packet) { size_t sent_size = send(gdbserver_socket, &packet, 1, 0); if (sent_size != 1) { - NGLOG_ERROR(Debug_GDBStub, "send failed"); + LOG_ERROR(Debug_GDBStub, "send failed"); } } @@ -383,7 +383,7 @@ static void SendReply(const char* reply) { command_length = static_cast(strlen(reply)); if (command_length + 4 > sizeof(command_buffer)) { - NGLOG_ERROR(Debug_GDBStub, "command_buffer overflow in SendReply"); + LOG_ERROR(Debug_GDBStub, "command_buffer overflow in SendReply"); return; } @@ -400,7 +400,7 @@ static void SendReply(const char* reply) { while (left > 0) { int sent_size = send(gdbserver_socket, reinterpret_cast(ptr), left, 0); if (sent_size < 0) { - NGLOG_ERROR(Debug_GDBStub, "gdb: send failed"); + LOG_ERROR(Debug_GDBStub, "gdb: send failed"); return Shutdown(); } @@ -411,7 +411,7 @@ static void SendReply(const char* reply) { /// Handle query command from gdb client. static void HandleQuery() { - NGLOG_DEBUG(Debug_GDBStub, "gdb: query '{}'\n", command_buffer + 1); + LOG_DEBUG(Debug_GDBStub, "gdb: query '{}'\n", command_buffer + 1); const char* query = reinterpret_cast(command_buffer + 1); @@ -453,7 +453,7 @@ static void SendSignal(u32 signal) { std::string buffer = Common::StringFromFormat("T%02x%02x:%08x;%02x:%08x;", latest_signal, 15, htonl(Core::CPU().GetPC()), 13, htonl(Core::CPU().GetReg(13))); - NGLOG_DEBUG(Debug_GDBStub, "Response: {}", buffer); + LOG_DEBUG(Debug_GDBStub, "Response: {}", buffer); SendReply(buffer.c_str()); } @@ -467,18 +467,18 @@ static void ReadCommand() { // ignore ack return; } else if (c == 0x03) { - NGLOG_INFO(Debug_GDBStub, "gdb: found break command\n"); + LOG_INFO(Debug_GDBStub, "gdb: found break command\n"); halt_loop = true; SendSignal(SIGTRAP); return; } else if (c != GDB_STUB_START) { - NGLOG_DEBUG(Debug_GDBStub, "gdb: read invalid byte {:02x}\n", c); + LOG_DEBUG(Debug_GDBStub, "gdb: read invalid byte {:02x}\n", c); return; } while ((c = ReadByte()) != GDB_STUB_END) { if (command_length >= sizeof(command_buffer)) { - NGLOG_ERROR(Debug_GDBStub, "gdb: command_buffer overflow\n"); + LOG_ERROR(Debug_GDBStub, "gdb: command_buffer overflow\n"); SendPacket(GDB_STUB_NACK); return; } @@ -491,7 +491,7 @@ static void ReadCommand() { u8 checksum_calculated = CalculateChecksum(command_buffer, command_length); if (checksum_received != checksum_calculated) { - NGLOG_ERROR( + LOG_ERROR( Debug_GDBStub, "gdb: invalid checksum: calculated {:02x} and read {:02x} for ${}# (length: {})\n", checksum_calculated, checksum_received, command_buffer, command_length); @@ -521,7 +521,7 @@ static bool IsDataAvailable() { t.tv_usec = 0; if (select(gdbserver_socket + 1, &fd_socket, nullptr, nullptr, &t) < 0) { - NGLOG_ERROR(Debug_GDBStub, "select failed"); + LOG_ERROR(Debug_GDBStub, "select failed"); return false; } @@ -651,7 +651,7 @@ static void ReadMemory() { u32 len = HexToInt(start_offset, static_cast((command_buffer + command_length) - start_offset)); - NGLOG_DEBUG(Debug_GDBStub, "gdb: addr: {:08x} len: {:08x}\n", addr, len); + LOG_DEBUG(Debug_GDBStub, "gdb: addr: {:08x} len: {:08x}\n", addr, len); if (len * 2 > sizeof(reply)) { SendReply("E01"); @@ -739,7 +739,7 @@ static bool CommitBreakpoint(BreakpointType type, PAddr addr, u32 len) { breakpoint.len = len; p.insert({addr, breakpoint}); - NGLOG_DEBUG(Debug_GDBStub, "gdb: added {} breakpoint: {:08x} bytes at {:08x}\n", + LOG_DEBUG(Debug_GDBStub, "gdb: added {} breakpoint: {:08x} bytes at {:08x}\n", static_cast(type), breakpoint.len, breakpoint.addr); return true; @@ -847,7 +847,7 @@ void HandlePacket() { return; } - NGLOG_DEBUG(Debug_GDBStub, "Packet: {}", command_buffer); + LOG_DEBUG(Debug_GDBStub, "Packet: {}", command_buffer); switch (command_buffer[0]) { case 'q': @@ -861,7 +861,7 @@ void HandlePacket() { break; case 'k': Shutdown(); - NGLOG_INFO(Debug_GDBStub, "killed by gdb"); + LOG_INFO(Debug_GDBStub, "killed by gdb"); return; case 'g': ReadRegisters(); @@ -940,7 +940,7 @@ static void Init(u16 port) { breakpoints_write.clear(); // Start gdb server - NGLOG_INFO(Debug_GDBStub, "Starting GDB server on port {}...", port); + LOG_INFO(Debug_GDBStub, "Starting GDB server on port {}...", port); sockaddr_in saddr_server = {}; saddr_server.sin_family = AF_INET; @@ -953,28 +953,28 @@ static void Init(u16 port) { int tmpsock = static_cast(socket(PF_INET, SOCK_STREAM, 0)); if (tmpsock == -1) { - NGLOG_ERROR(Debug_GDBStub, "Failed to create gdb socket"); + LOG_ERROR(Debug_GDBStub, "Failed to create gdb socket"); } // Set socket to SO_REUSEADDR so it can always bind on the same port int reuse_enabled = 1; if (setsockopt(tmpsock, SOL_SOCKET, SO_REUSEADDR, (const char*)&reuse_enabled, sizeof(reuse_enabled)) < 0) { - NGLOG_ERROR(Debug_GDBStub, "Failed to set gdb socket option"); + LOG_ERROR(Debug_GDBStub, "Failed to set gdb socket option"); } const sockaddr* server_addr = reinterpret_cast(&saddr_server); socklen_t server_addrlen = sizeof(saddr_server); if (bind(tmpsock, server_addr, server_addrlen) < 0) { - NGLOG_ERROR(Debug_GDBStub, "Failed to bind gdb socket"); + LOG_ERROR(Debug_GDBStub, "Failed to bind gdb socket"); } if (listen(tmpsock, 1) < 0) { - NGLOG_ERROR(Debug_GDBStub, "Failed to listen to gdb socket"); + LOG_ERROR(Debug_GDBStub, "Failed to listen to gdb socket"); } // Wait for gdb to connect - NGLOG_INFO(Debug_GDBStub, "Waiting for gdb to connect...\n"); + LOG_INFO(Debug_GDBStub, "Waiting for gdb to connect...\n"); sockaddr_in saddr_client; sockaddr* client_addr = reinterpret_cast(&saddr_client); socklen_t client_addrlen = sizeof(saddr_client); @@ -985,9 +985,9 @@ static void Init(u16 port) { halt_loop = false; step_loop = false; - NGLOG_ERROR(Debug_GDBStub, "Failed to accept gdb client"); + LOG_ERROR(Debug_GDBStub, "Failed to accept gdb client"); } else { - NGLOG_INFO(Debug_GDBStub, "Client connected.\n"); + LOG_INFO(Debug_GDBStub, "Client connected.\n"); saddr_client.sin_addr.s_addr = ntohl(saddr_client.sin_addr.s_addr); } @@ -1006,7 +1006,7 @@ void Shutdown() { return; } - NGLOG_INFO(Debug_GDBStub, "Stopping GDB ..."); + LOG_INFO(Debug_GDBStub, "Stopping GDB ..."); if (gdbserver_socket != -1) { shutdown(gdbserver_socket, SHUT_RDWR); gdbserver_socket = -1; @@ -1016,7 +1016,7 @@ void Shutdown() { WSACleanup(); #endif - NGLOG_INFO(Debug_GDBStub, "GDB stopped."); + LOG_INFO(Debug_GDBStub, "GDB stopped."); } bool IsServerEnabled() { diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index b0db67f89..805bdf8f8 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -62,7 +62,7 @@ ResultCode Applet::Create(Service::APT::AppletId id, applets[id] = std::make_shared(id, std::move(manager)); break; default: - NGLOG_ERROR(Service_APT, "Could not create applet {}", static_cast(id)); + LOG_ERROR(Service_APT, "Could not create applet {}", static_cast(id)); // TODO(Subv): Find the right error code return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotSupported, ErrorLevel::Permanent); @@ -114,7 +114,7 @@ void Applet::SendParameter(const Service::APT::MessageParameter& parameter) { if (auto locked = manager.lock()) { locked->CancelAndSendParameter(parameter); } else { - NGLOG_ERROR(Service_APT, "called after destructing applet manager"); + LOG_ERROR(Service_APT, "called after destructing applet manager"); } } diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp index 3c94794d0..a8135a2ae 100644 --- a/src/core/hle/applets/erreula.cpp +++ b/src/core/hle/applets/erreula.cpp @@ -11,7 +11,7 @@ namespace Applets { ResultCode ErrEula::ReceiveParameter(const Service::APT::MessageParameter& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { - NGLOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); + LOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); UNIMPLEMENTED(); // TODO(Subv): Find the right error code return ResultCode(-1); diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index 6903d002f..cfe25b11d 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -19,7 +19,7 @@ namespace Applets { ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { - NGLOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); + LOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); UNIMPLEMENTED(); // TODO(Subv): Find the right error code return ResultCode(-1); diff --git a/src/core/hle/applets/mint.cpp b/src/core/hle/applets/mint.cpp index 1d975753f..d71cd7001 100644 --- a/src/core/hle/applets/mint.cpp +++ b/src/core/hle/applets/mint.cpp @@ -11,7 +11,7 @@ namespace Applets { ResultCode Mint::ReceiveParameter(const Service::APT::MessageParameter& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { - NGLOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); + LOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); UNIMPLEMENTED(); // TODO(Subv): Find the right error code return ResultCode(-1); diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index 241f4e845..6b181de06 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp @@ -22,7 +22,7 @@ namespace Applets { ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter const& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { - NGLOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); + LOG_ERROR(Service_APT, "unsupported signal {}", static_cast(parameter.signal)); UNIMPLEMENTED(); // TODO(Subv): Find the right error code return ResultCode(-1); diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 9c13c64df..7baad55b1 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -135,7 +135,7 @@ ResultCode AddressArbiter::ArbitrateAddress(SharedPtr thread, Arbitratio } default: - NGLOG_ERROR(Kernel, "unknown type={}", static_cast(type)); + LOG_ERROR(Kernel, "unknown type={}", static_cast(type)); return ERR_INVALID_ENUM_VALUE_FND; } diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp index 4d6a8ef20..3aec18bb3 100644 --- a/src/core/hle/kernel/handle_table.cpp +++ b/src/core/hle/kernel/handle_table.cpp @@ -25,7 +25,7 @@ ResultVal HandleTable::Create(SharedPtr obj) { u16 slot = next_free_slot; if (slot >= generations.size()) { - NGLOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); + LOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); return ERR_OUT_OF_HANDLES; } next_free_slot = generations[slot]; @@ -47,7 +47,7 @@ ResultVal HandleTable::Create(SharedPtr obj) { ResultVal HandleTable::Duplicate(Handle handle) { SharedPtr object = GetGeneric(handle); if (object == nullptr) { - NGLOG_ERROR(Kernel, "Tried to duplicate invalid handle: {:08X}", handle); + LOG_ERROR(Kernel, "Tried to duplicate invalid handle: {:08X}", handle); return ERR_INVALID_HANDLE; } return Create(std::move(object)); diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp index f96015b67..65f995218 100644 --- a/src/core/hle/kernel/memory.cpp +++ b/src/core/hle/kernel/memory.cpp @@ -115,7 +115,7 @@ void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mappin VAddr mapping_limit = mapping.address + mapping.size; if (mapping_limit < mapping.address) { - NGLOG_CRITICAL(Loader, "Mapping size overflowed: address=0x{:08X} size=0x{:X}", + LOG_CRITICAL(Loader, "Mapping size overflowed: address=0x{:08X} size=0x{:X}", mapping.address, mapping.size); return; } @@ -126,7 +126,7 @@ void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mappin mapping_limit <= area.vaddr_base + area.size; }); if (area == std::end(memory_areas)) { - NGLOG_ERROR(Loader, + LOG_ERROR(Loader, "Unhandled special mapping: address=0x{:08X} size=0x{:X}" " read_only={} unk_flag={}", mapping.address, mapping.size, mapping.read_only, mapping.unk_flag); @@ -135,7 +135,7 @@ void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mappin u32 offset_into_region = mapping.address - area->vaddr_base; if (area->paddr_base == IO_AREA_PADDR) { - NGLOG_ERROR(Loader, "MMIO mappings are not supported yet. phys_addr=0x{:08X}", + LOG_ERROR(Loader, "MMIO mappings are not supported yet. phys_addr=0x{:08X}", area->paddr_base + offset_into_region); return; } diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index fa13dba67..4f35aa5ef 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -63,7 +63,7 @@ ResultCode Mutex::Release(Thread* thread) { // We can only release the mutex if it's held by the calling thread. if (thread != holding_thread) { if (holding_thread) { - NGLOG_ERROR( + LOG_ERROR( Kernel, "Tried to release a mutex (owned by thread id {}) from a different thread id {}", holding_thread->thread_id, thread->thread_id); diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 386be1d81..de8bd0f96 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -56,7 +56,7 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) { continue; } else if ((type & 0xF00) == 0xE00) { // 0x0FFF // Allowed interrupts list - NGLOG_WARNING(Loader, "ExHeader allowed interrupts list ignored"); + LOG_WARNING(Loader, "ExHeader allowed interrupts list ignored"); } else if ((type & 0xF80) == 0xF00) { // 0x07FF // Allowed syscalls mask unsigned int index = ((descriptor >> 24) & 7) * 24; @@ -76,7 +76,7 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) { } else if ((type & 0xFFE) == 0xFF8) { // 0x001F // Mapped memory range if (i + 1 >= len || ((kernel_caps[i + 1] >> 20) & 0xFFE) != 0xFF8) { - NGLOG_WARNING(Loader, "Incomplete exheader memory range descriptor ignored."); + LOG_WARNING(Loader, "Incomplete exheader memory range descriptor ignored."); continue; } u32 end_desc = kernel_caps[i + 1]; @@ -111,9 +111,9 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) { int minor = kernel_version & 0xFF; int major = (kernel_version >> 8) & 0xFF; - NGLOG_INFO(Loader, "ExHeader kernel version: {}.{}", major, minor); + LOG_INFO(Loader, "ExHeader kernel version: {}.{}", major, minor); } else { - NGLOG_ERROR(Loader, "Unhandled kernel caps descriptor: 0x{:08X}", descriptor); + LOG_ERROR(Loader, "Unhandled kernel caps descriptor: 0x{:08X}", descriptor); } } } diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp index c55d2445b..ffe9f5108 100644 --- a/src/core/hle/kernel/resource_limit.cpp +++ b/src/core/hle/kernel/resource_limit.cpp @@ -29,7 +29,7 @@ SharedPtr ResourceLimit::GetForCategory(ResourceLimitCategory cat case ResourceLimitCategory::OTHER: return resource_limits[static_cast(category)]; default: - NGLOG_CRITICAL(Kernel, "Unknown resource limit category"); + LOG_CRITICAL(Kernel, "Unknown resource limit category"); UNREACHABLE(); } } @@ -55,7 +55,7 @@ s32 ResourceLimit::GetCurrentResourceValue(u32 resource) const { case CPU_TIME: return current_cpu_time; default: - NGLOG_ERROR(Kernel, "Unknown resource type={:08X}", resource); + LOG_ERROR(Kernel, "Unknown resource type={:08X}", resource); UNIMPLEMENTED(); return 0; } @@ -84,7 +84,7 @@ u32 ResourceLimit::GetMaxResourceValue(u32 resource) const { case CPU_TIME: return max_cpu_time; default: - NGLOG_ERROR(Kernel, "Unknown resource type={:08X}", resource); + LOG_ERROR(Kernel, "Unknown resource type={:08X}", resource); UNIMPLEMENTED(); return 0; } diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 9df1b681a..5deef1c79 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -106,14 +106,14 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the requested permissions don't match what the creator process allows. if (static_cast(permissions) & ~static_cast(own_other_permissions)) { - NGLOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, permissions don't match", + LOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, permissions don't match", GetObjectId(), address, name); return ERR_INVALID_COMBINATION; } // Heap-backed memory blocks can not be mapped with other_permissions = DontCare if (base_address != 0 && other_permissions == MemoryPermission::DontCare) { - NGLOG_ERROR(Kernel, "cannot map id={}, address=0x{08X} name={}, permissions don't match", + LOG_ERROR(Kernel, "cannot map id={}, address=0x{08X} name={}, permissions don't match", GetObjectId(), address, name); return ERR_INVALID_COMBINATION; } @@ -121,7 +121,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the provided permissions are not compatible with what the creator process needs. if (other_permissions != MemoryPermission::DontCare && static_cast(this->permissions) & ~static_cast(other_permissions)) { - NGLOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, permissions don't match", + LOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, permissions don't match", GetObjectId(), address, name); return ERR_WRONG_PERMISSION; } @@ -137,7 +137,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi if (address != 0) { if (address < Memory::HEAP_VADDR || address + size >= Memory::SHARED_MEMORY_VADDR_END) { - NGLOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, invalid address", + LOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, invalid address", GetObjectId(), address, name); return ERR_INVALID_ADDRESS; } @@ -154,7 +154,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi auto result = target_process->vm_manager.MapMemoryBlock( target_address, backing_block, backing_block_offset, size, MemoryState::Shared); if (result.Failed()) { - NGLOG_ERROR( + LOG_ERROR( Kernel, "cannot map id={}, target_address=0x{:08X} name={}, error mapping to virtual memory", GetObjectId(), target_address, name); diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 7c0796cea..0843b5f58 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -58,7 +58,7 @@ enum ControlMemoryOperation { /// Map application or GSP heap memory static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { - NGLOG_DEBUG(Kernel_SVC, + LOG_DEBUG(Kernel_SVC, "called operation=0x{:08X}, addr0=0x{:08X}, addr1=0x{:08X}, " "size=0x{:X}, permissions=0x{:08X}", operation, addr0, addr1, size, permissions); @@ -74,7 +74,7 @@ static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 add operation &= ~MEMOP_REGION_MASK; if (region != 0) { - NGLOG_WARNING(Kernel_SVC, "ControlMemory with specified region not supported, region={:X}", + LOG_WARNING(Kernel_SVC, "ControlMemory with specified region not supported, region={:X}", region); } @@ -135,7 +135,7 @@ static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 add } default: - NGLOG_ERROR(Kernel_SVC, "unknown operation=0x{:08X}", operation); + LOG_ERROR(Kernel_SVC, "unknown operation=0x{:08X}", operation); return ERR_INVALID_COMBINATION; } @@ -145,7 +145,7 @@ static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 add } static void ExitProcess() { - NGLOG_INFO(Kernel_SVC, "Process {} exiting", g_current_process->process_id); + LOG_INFO(Kernel_SVC, "Process {} exiting", g_current_process->process_id); ASSERT_MSG(g_current_process->status == ProcessStatus::Running, "Process has already exited"); @@ -176,7 +176,7 @@ static void ExitProcess() { /// Maps a memory block to specified address static ResultCode MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { - NGLOG_TRACE(Kernel_SVC, + LOG_TRACE(Kernel_SVC, "called memblock=0x{:08X}, addr=0x{:08X}, mypermissions=0x{:08X}, " "otherpermission={}", handle, addr, permissions, other_permissions); @@ -198,14 +198,14 @@ static ResultCode MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 o return shared_memory->Map(g_current_process.get(), addr, permissions_type, static_cast(other_permissions)); default: - NGLOG_ERROR(Kernel_SVC, "unknown permissions=0x{:08X}", permissions); + LOG_ERROR(Kernel_SVC, "unknown permissions=0x{:08X}", permissions); } return ERR_INVALID_COMBINATION; } static ResultCode UnmapMemoryBlock(Handle handle, u32 addr) { - NGLOG_TRACE(Kernel_SVC, "called memblock=0x{:08X}, addr=0x{:08X}", handle, addr); + LOG_TRACE(Kernel_SVC, "called memblock=0x{:08X}, addr=0x{:08X}", handle, addr); // TODO(Subv): Return E0A01BF5 if the address is not in the application's heap @@ -227,11 +227,11 @@ static ResultCode ConnectToPort(Handle* out_handle, VAddr port_name_address) { if (port_name.size() > PortNameMaxLength) return ERR_PORT_NAME_TOO_LONG; - NGLOG_TRACE(Kernel_SVC, "called port_name={}", port_name); + LOG_TRACE(Kernel_SVC, "called port_name={}", port_name); auto it = Service::g_kernel_named_ports.find(port_name); if (it == Service::g_kernel_named_ports.end()) { - NGLOG_WARNING(Kernel_SVC, "tried to connect to unknown port: {}", port_name); + LOG_WARNING(Kernel_SVC, "tried to connect to unknown port: {}", port_name); return ERR_NOT_FOUND; } @@ -252,7 +252,7 @@ static ResultCode SendSyncRequest(Handle handle) { return ERR_INVALID_HANDLE; } - NGLOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); + LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); Core::System::GetInstance().PrepareReschedule(); @@ -261,7 +261,7 @@ static ResultCode SendSyncRequest(Handle handle) { /// Close a handle static ResultCode CloseHandle(Handle handle) { - NGLOG_TRACE(Kernel_SVC, "Closing handle 0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "Closing handle 0x{:08X}", handle); return g_handle_table.Close(handle); } @@ -273,7 +273,7 @@ static ResultCode WaitSynchronization1(Handle handle, s64 nano_seconds) { if (object == nullptr) return ERR_INVALID_HANDLE; - NGLOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({}:{}), nanoseconds={}", handle, + LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({}:{}), nanoseconds={}", handle, object->GetTypeName(), object->GetName(), nano_seconds); if (object->ShouldWait(thread)) { @@ -617,14 +617,14 @@ static ResultCode ReplyAndReceive(s32* index, VAddr handles_address, s32 handle_ static ResultCode CreateAddressArbiter(Handle* out_handle) { SharedPtr arbiter = AddressArbiter::Create(); CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(arbiter))); - NGLOG_TRACE(Kernel_SVC, "returned handle=0x{:08X}", *out_handle); + LOG_TRACE(Kernel_SVC, "returned handle=0x{:08X}", *out_handle); return RESULT_SUCCESS; } /// Arbitrate address static ResultCode ArbitrateAddress(Handle handle, u32 address, u32 type, u32 value, s64 nanoseconds) { - NGLOG_TRACE(Kernel_SVC, + LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}, address=0x{:08X}, type=0x{:08X}, value=0x{:08X}", handle, address, type, value); @@ -642,7 +642,7 @@ static ResultCode ArbitrateAddress(Handle handle, u32 address, u32 type, u32 val } static void Break(u8 break_reason) { - NGLOG_CRITICAL(Debug_Emulated, "Emulated program broke execution!"); + LOG_CRITICAL(Debug_Emulated, "Emulated program broke execution!"); std::string reason_str; switch (break_reason) { case 0: @@ -658,19 +658,19 @@ static void Break(u8 break_reason) { reason_str = "UNKNOWN"; break; } - NGLOG_CRITICAL(Debug_Emulated, "Break reason: {}", reason_str); + LOG_CRITICAL(Debug_Emulated, "Break reason: {}", reason_str); } /// Used to output a message on a debug hardware unit - does nothing on a retail unit static void OutputDebugString(VAddr address, int len) { std::string string(len, ' '); Memory::ReadBlock(address, string.data(), len); - NGLOG_DEBUG(Debug_Emulated, "{}", string); + LOG_DEBUG(Debug_Emulated, "{}", string); } /// Get resource limit static ResultCode GetResourceLimit(Handle* resource_limit, Handle process_handle) { - NGLOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle); + LOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle); SharedPtr process = g_handle_table.Get(process_handle); if (process == nullptr) @@ -684,7 +684,7 @@ static ResultCode GetResourceLimit(Handle* resource_limit, Handle process_handle /// Get resource limit current values static ResultCode GetResourceLimitCurrentValues(VAddr values, Handle resource_limit_handle, VAddr names, u32 name_count) { - NGLOG_TRACE(Kernel_SVC, "called resource_limit={:08X}, names={:08X}, name_count={}", + LOG_TRACE(Kernel_SVC, "called resource_limit={:08X}, names={:08X}, name_count={}", resource_limit_handle, names, name_count); SharedPtr resource_limit = @@ -704,7 +704,7 @@ static ResultCode GetResourceLimitCurrentValues(VAddr values, Handle resource_li /// Get resource limit max values static ResultCode GetResourceLimitLimitValues(VAddr values, Handle resource_limit_handle, VAddr names, u32 name_count) { - NGLOG_TRACE(Kernel_SVC, "called resource_limit={:08X}, names={:08X}, name_count={}", + LOG_TRACE(Kernel_SVC, "called resource_limit={:08X}, names={:08X}, name_count={}", resource_limit_handle, names, name_count); SharedPtr resource_limit = @@ -745,11 +745,11 @@ static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point case THREADPROCESSORID_0: break; case THREADPROCESSORID_ALL: - NGLOG_INFO(Kernel_SVC, + LOG_INFO(Kernel_SVC, "Newly created thread is allowed to be run in any Core, unimplemented."); break; case THREADPROCESSORID_1: - NGLOG_ERROR(Kernel_SVC, + LOG_ERROR(Kernel_SVC, "Newly created thread must run in the SysCore (Core1), unimplemented."); break; default: @@ -769,7 +769,7 @@ static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point Core::System::GetInstance().PrepareReschedule(); - NGLOG_TRACE(Kernel_SVC, + LOG_TRACE(Kernel_SVC, "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, " "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}", entry_point, name, arg, stack_top, priority, processor_id, *out_handle); @@ -779,7 +779,7 @@ static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point /// Called when a thread exits static void ExitThread() { - NGLOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", Core::CPU().GetPC()); + LOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", Core::CPU().GetPC()); ExitCurrentThread(); Core::System::GetInstance().PrepareReschedule(); @@ -829,7 +829,7 @@ static ResultCode CreateMutex(Handle* out_handle, u32 initial_locked) { mutex->name = Common::StringFromFormat("mutex-%08x", Core::CPU().GetReg(14)); CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(mutex))); - NGLOG_TRACE(Kernel_SVC, "called initial_locked={} : created handle=0x{:08X}", + LOG_TRACE(Kernel_SVC, "called initial_locked={} : created handle=0x{:08X}", initial_locked ? "true" : "false", *out_handle); return RESULT_SUCCESS; @@ -837,7 +837,7 @@ static ResultCode CreateMutex(Handle* out_handle, u32 initial_locked) { /// Release a mutex static ResultCode ReleaseMutex(Handle handle) { - NGLOG_TRACE(Kernel_SVC, "called handle=0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}", handle); SharedPtr mutex = g_handle_table.Get(handle); if (mutex == nullptr) @@ -848,7 +848,7 @@ static ResultCode ReleaseMutex(Handle handle) { /// Get the ID of the specified process static ResultCode GetProcessId(u32* process_id, Handle process_handle) { - NGLOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle); + LOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle); const SharedPtr process = g_handle_table.Get(process_handle); if (process == nullptr) @@ -860,7 +860,7 @@ static ResultCode GetProcessId(u32* process_id, Handle process_handle) { /// Get the ID of the process that owns the specified thread static ResultCode GetProcessIdOfThread(u32* process_id, Handle thread_handle) { - NGLOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", thread_handle); + LOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", thread_handle); const SharedPtr thread = g_handle_table.Get(thread_handle); if (thread == nullptr) @@ -876,7 +876,7 @@ static ResultCode GetProcessIdOfThread(u32* process_id, Handle thread_handle) { /// Get the ID for the specified thread. static ResultCode GetThreadId(u32* thread_id, Handle handle) { - NGLOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", handle); const SharedPtr thread = g_handle_table.Get(handle); if (thread == nullptr) @@ -892,14 +892,14 @@ static ResultCode CreateSemaphore(Handle* out_handle, s32 initial_count, s32 max semaphore->name = Common::StringFromFormat("semaphore-%08x", Core::CPU().GetReg(14)); CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(semaphore))); - NGLOG_TRACE(Kernel_SVC, "called initial_count={}, max_count={}, created handle=0x{:08X}", + LOG_TRACE(Kernel_SVC, "called initial_count={}, max_count={}, created handle=0x{:08X}", initial_count, max_count, *out_handle); return RESULT_SUCCESS; } /// Releases a certain number of slots in a semaphore static ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) { - NGLOG_TRACE(Kernel_SVC, "called release_count={}, handle=0x{:08X}", release_count, handle); + LOG_TRACE(Kernel_SVC, "called release_count={}, handle=0x{:08X}", release_count, handle); SharedPtr semaphore = g_handle_table.Get(handle); if (semaphore == nullptr) @@ -928,7 +928,7 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* page_inf memory_info->state = static_cast(vma->second.meminfo_state); page_info->flags = 0; - NGLOG_TRACE(Kernel_SVC, "called process=0x{:08X} addr=0x{:08X}", process_handle, addr); + LOG_TRACE(Kernel_SVC, "called process=0x{:08X} addr=0x{:08X}", process_handle, addr); return RESULT_SUCCESS; } @@ -943,7 +943,7 @@ static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) { evt->name = Common::StringFromFormat("event-%08x", Core::CPU().GetReg(14)); CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(evt))); - NGLOG_TRACE(Kernel_SVC, "called reset_type=0x{:08X} : created handle=0x{:08X}", reset_type, + LOG_TRACE(Kernel_SVC, "called reset_type=0x{:08X} : created handle=0x{:08X}", reset_type, *out_handle); return RESULT_SUCCESS; } @@ -951,13 +951,13 @@ static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) { /// Duplicates a kernel handle static ResultCode DuplicateHandle(Handle* out, Handle handle) { CASCADE_RESULT(*out, g_handle_table.Duplicate(handle)); - NGLOG_TRACE(Kernel_SVC, "duplicated 0x{:08X} to 0x{:08X}", handle, *out); + LOG_TRACE(Kernel_SVC, "duplicated 0x{:08X} to 0x{:08X}", handle, *out); return RESULT_SUCCESS; } /// Signals an event static ResultCode SignalEvent(Handle handle) { - NGLOG_TRACE(Kernel_SVC, "called event=0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "called event=0x{:08X}", handle); SharedPtr evt = g_handle_table.Get(handle); if (evt == nullptr) @@ -970,7 +970,7 @@ static ResultCode SignalEvent(Handle handle) { /// Clears an event static ResultCode ClearEvent(Handle handle) { - NGLOG_TRACE(Kernel_SVC, "called event=0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "called event=0x{:08X}", handle); SharedPtr evt = g_handle_table.Get(handle); if (evt == nullptr) @@ -986,14 +986,14 @@ static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) { timer->name = Common::StringFromFormat("timer-%08x", Core::CPU().GetReg(14)); CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(timer))); - NGLOG_TRACE(Kernel_SVC, "called reset_type=0x{:08X} : created handle=0x{:08X}", reset_type, + LOG_TRACE(Kernel_SVC, "called reset_type=0x{:08X} : created handle=0x{:08X}", reset_type, *out_handle); return RESULT_SUCCESS; } /// Clears a timer static ResultCode ClearTimer(Handle handle) { - NGLOG_TRACE(Kernel_SVC, "called timer=0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "called timer=0x{:08X}", handle); SharedPtr timer = g_handle_table.Get(handle); if (timer == nullptr) @@ -1005,7 +1005,7 @@ static ResultCode ClearTimer(Handle handle) { /// Starts a timer static ResultCode SetTimer(Handle handle, s64 initial, s64 interval) { - NGLOG_TRACE(Kernel_SVC, "called timer=0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "called timer=0x{:08X}", handle); if (initial < 0 || interval < 0) { return ERR_OUT_OF_RANGE_KERNEL; @@ -1022,7 +1022,7 @@ static ResultCode SetTimer(Handle handle, s64 initial, s64 interval) { /// Cancels a timer static ResultCode CancelTimer(Handle handle) { - NGLOG_TRACE(Kernel_SVC, "called timer=0x{:08X}", handle); + LOG_TRACE(Kernel_SVC, "called timer=0x{:08X}", handle); SharedPtr timer = g_handle_table.Get(handle); if (timer == nullptr) @@ -1035,7 +1035,7 @@ static ResultCode CancelTimer(Handle handle) { /// Sleep the current thread static void SleepThread(s64 nanoseconds) { - NGLOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds); + LOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds); // Don't attempt to yield execution if there are no available threads to run, // this way we avoid a useless reschedule to the idle thread. @@ -1106,7 +1106,7 @@ static ResultCode CreateMemoryBlock(Handle* out_handle, u32 addr, u32 size, u32 static_cast(other_permission), addr, region); CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(shared_memory))); - NGLOG_WARNING(Kernel_SVC, "called addr=0x{:08X}", addr); + LOG_WARNING(Kernel_SVC, "called addr=0x{:08X}", addr); return RESULT_SUCCESS; } @@ -1123,7 +1123,7 @@ static ResultCode CreatePort(Handle* server_port, Handle* client_port, VAddr nam CASCADE_RESULT(*server_port, g_handle_table.Create(std::move(std::get>(ports)))); - NGLOG_TRACE(Kernel_SVC, "called max_sessions={}", max_sessions); + LOG_TRACE(Kernel_SVC, "called max_sessions={}", max_sessions); return RESULT_SUCCESS; } @@ -1146,7 +1146,7 @@ static ResultCode CreateSession(Handle* server_session, Handle* client_session) auto& client = std::get>(sessions); CASCADE_RESULT(*client_session, g_handle_table.Create(std::move(client))); - NGLOG_TRACE(Kernel_SVC, "called"); + LOG_TRACE(Kernel_SVC, "called"); return RESULT_SUCCESS; } @@ -1161,7 +1161,7 @@ static ResultCode AcceptSession(Handle* out_server_session, Handle server_port_h } static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) { - NGLOG_TRACE(Kernel_SVC, "called type={} param={}", type, param); + LOG_TRACE(Kernel_SVC, "called type={} param={}", type, param); switch ((SystemInfoType)type) { case SystemInfoType::REGION_MEMORY_USAGE: @@ -1181,20 +1181,20 @@ static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) { *out = GetMemoryRegion(MemoryRegion::BASE)->used; break; default: - NGLOG_ERROR(Kernel_SVC, "unknown GetSystemInfo type=0 region: param={}", param); + LOG_ERROR(Kernel_SVC, "unknown GetSystemInfo type=0 region: param={}", param); *out = 0; break; } break; case SystemInfoType::KERNEL_ALLOCATED_PAGES: - NGLOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param={}", param); + LOG_ERROR(Kernel_SVC, "unimplemented GetSystemInfo type=2 param={}", param); *out = 0; break; case SystemInfoType::KERNEL_SPAWNED_PIDS: *out = 5; break; default: - NGLOG_ERROR(Kernel_SVC, "unknown GetSystemInfo type={} param={}", type, param); + LOG_ERROR(Kernel_SVC, "unknown GetSystemInfo type={} param={}", type, param); *out = 0; break; } @@ -1204,7 +1204,7 @@ static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) { } static ResultCode GetProcessInfo(s64* out, Handle process_handle, u32 type) { - NGLOG_TRACE(Kernel_SVC, "called process=0x{:08X} type={}", process_handle, type); + LOG_TRACE(Kernel_SVC, "called process=0x{:08X} type={}", process_handle, type); SharedPtr process = g_handle_table.Get(process_handle); if (process == nullptr) @@ -1217,7 +1217,7 @@ static ResultCode GetProcessInfo(s64* out, Handle process_handle, u32 type) { // what's the difference between them. *out = process->heap_used + process->linear_heap_used + process->misc_memory_used; if (*out % Memory::PAGE_SIZE != 0) { - NGLOG_ERROR(Kernel_SVC, "called, memory size not page-aligned"); + LOG_ERROR(Kernel_SVC, "called, memory size not page-aligned"); return ERR_MISALIGNED_SIZE; } break; @@ -1229,7 +1229,7 @@ static ResultCode GetProcessInfo(s64* out, Handle process_handle, u32 type) { case 7: case 8: // These are valid, but not implemented yet - NGLOG_ERROR(Kernel_SVC, "unimplemented GetProcessInfo type={}", type); + LOG_ERROR(Kernel_SVC, "unimplemented GetProcessInfo type={}", type); break; case 20: *out = Memory::FCRAM_PADDR - process->GetLinearHeapAreaAddress(); @@ -1238,10 +1238,10 @@ static ResultCode GetProcessInfo(s64* out, Handle process_handle, u32 type) { case 22: case 23: // These return a different error value than higher invalid values - NGLOG_ERROR(Kernel_SVC, "unknown GetProcessInfo type={}", type); + LOG_ERROR(Kernel_SVC, "unknown GetProcessInfo type={}", type); return ERR_NOT_IMPLEMENTED; default: - NGLOG_ERROR(Kernel_SVC, "unknown GetProcessInfo type={}", type); + LOG_ERROR(Kernel_SVC, "unknown GetProcessInfo type={}", type); return ERR_INVALID_ENUM_VALUE; } @@ -1389,7 +1389,7 @@ static const FunctionDef SVC_Table[] = { static const FunctionDef* GetSVCInfo(u32 func_num) { if (func_num >= ARRAY_SIZE(SVC_Table)) { - NGLOG_ERROR(Kernel_SVC, "unknown svc=0x{:02X}", func_num); + LOG_ERROR(Kernel_SVC, "unknown svc=0x{:02X}", func_num); return nullptr; } return &SVC_Table[func_num]; @@ -1411,7 +1411,7 @@ void CallSVC(u32 immediate) { if (info->func) { info->func(); } else { - NGLOG_ERROR(Kernel_SVC, "unimplemented SVC function {}(..)", info->name); + LOG_ERROR(Kernel_SVC, "unimplemented SVC function {}(..)", info->name); } } } diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 2dadbde61..7154a1876 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -191,7 +191,7 @@ void ExitCurrentThread() { static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) { SharedPtr thread = wakeup_callback_handle_table.Get((Handle)thread_handle); if (thread == nullptr) { - NGLOG_CRITICAL(Kernel, "Callback fired for invalid thread {:08X}", (Handle)thread_handle); + LOG_CRITICAL(Kernel, "Callback fired for invalid thread {:08X}", (Handle)thread_handle); return; } @@ -264,16 +264,16 @@ void Thread::ResumeFromWait() { static void DebugThreadQueue() { Thread* thread = GetCurrentThread(); if (!thread) { - NGLOG_DEBUG(Kernel, "Current: NO CURRENT THREAD"); + LOG_DEBUG(Kernel, "Current: NO CURRENT THREAD"); } else { - NGLOG_DEBUG(Kernel, "0x{:02X} {} (current)", thread->current_priority, + LOG_DEBUG(Kernel, "0x{:02X} {} (current)", thread->current_priority, GetCurrentThread()->GetObjectId()); } for (auto& t : thread_list) { u32 priority = ready_queue.contains(t.get()); if (priority != -1) { - NGLOG_DEBUG(Kernel, "0x{:02X} {}", priority, t->GetObjectId()); + LOG_DEBUG(Kernel, "0x{:02X} {}", priority, t->GetObjectId()); } } } @@ -324,19 +324,19 @@ ResultVal> Thread::Create(std::string name, VAddr entry_point, SharedPtr owner_process) { // Check if priority is in ranged. Lowest priority -> highest priority id. if (priority > THREADPRIO_LOWEST) { - NGLOG_ERROR(Kernel_SVC, "Invalid thread priority: {}", priority); + LOG_ERROR(Kernel_SVC, "Invalid thread priority: {}", priority); return ERR_OUT_OF_RANGE; } if (processor_id > THREADPROCESSORID_MAX) { - NGLOG_ERROR(Kernel_SVC, "Invalid processor id: {}", processor_id); + LOG_ERROR(Kernel_SVC, "Invalid processor id: {}", processor_id); return ERR_OUT_OF_RANGE_KERNEL; } // TODO(yuriks): Other checks, returning 0xD9001BEA if (!Memory::IsValidVirtualAddress(*owner_process, entry_point)) { - NGLOG_ERROR(Kernel_SVC, "(name={}): invalid entry {:08x}", name, entry_point); + LOG_ERROR(Kernel_SVC, "(name={}): invalid entry {:08x}", name, entry_point); // TODO: Verify error return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::Kernel, ErrorSummary::InvalidArgument, ErrorLevel::Permanent); @@ -375,7 +375,7 @@ ResultVal> Thread::Create(std::string name, VAddr entry_point, auto& linheap_memory = memory_region->linear_heap_memory; if (linheap_memory->size() + Memory::PAGE_SIZE > memory_region->size) { - NGLOG_ERROR(Kernel_SVC, + LOG_ERROR(Kernel_SVC, "Not enough space in region to allocate a new TLS page for thread"); return ERR_OUT_OF_MEMORY; } @@ -469,11 +469,11 @@ void Reschedule() { Thread* next = PopNextReadyThread(); if (cur && next) { - NGLOG_TRACE(Kernel, "context switch {} -> {}", cur->GetObjectId(), next->GetObjectId()); + LOG_TRACE(Kernel, "context switch {} -> {}", cur->GetObjectId(), next->GetObjectId()); } else if (cur) { - NGLOG_TRACE(Kernel, "context switch {} -> idle", cur->GetObjectId()); + LOG_TRACE(Kernel, "context switch {} -> idle", cur->GetObjectId()); } else if (next) { - NGLOG_TRACE(Kernel, "context switch idle -> {}", next->GetObjectId()); + LOG_TRACE(Kernel, "context switch idle -> {}", next->GetObjectId()); } SwitchContext(next); diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index a8a2c40f8..b31017cb5 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -77,7 +77,7 @@ void Timer::WakeupAllWaitingThreads() { } void Timer::Signal(int cycles_late) { - NGLOG_TRACE(Kernel, "Timer {} fired", GetObjectId()); + LOG_TRACE(Kernel, "Timer {} fired", GetObjectId()); signaled = true; @@ -97,7 +97,7 @@ static void TimerCallback(u64 timer_handle, int cycles_late) { timer_callback_handle_table.Get(static_cast(timer_handle)); if (timer == nullptr) { - NGLOG_CRITICAL(Kernel, "Callback fired for invalid timer {:08x}", timer_handle); + LOG_CRITICAL(Kernel, "Callback fired for invalid timer {:08x}", timer_handle); return; } diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index df6173807..24301f53c 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -260,7 +260,7 @@ void VMManager::RefreshMemoryBlockMappings(const std::vector* block) { void VMManager::LogLayout(Log::Level log_level) const { for (const auto& p : vma_map) { const VirtualMemoryArea& vma = p.second; - NGLOG_GENERIC(::Log::Class::Kernel, log_level, "{:08X} - {:08X} size: {:8X} {}{}{} {}", + LOG_GENERIC(::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' : '-', diff --git a/src/core/hle/service/ac/ac.cpp b/src/core/hle/service/ac/ac.cpp index 25bd1dc37..d616135ee 100644 --- a/src/core/hle/service/ac/ac.cpp +++ b/src/core/hle/service/ac/ac.cpp @@ -27,7 +27,7 @@ void Module::Interface::CreateDefaultConfig(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushStaticBuffer(std::move(buffer), 0); - NGLOG_WARNING(Service_AC, "(STUBBED) called"); + LOG_WARNING(Service_AC, "(STUBBED) called"); } void Module::Interface::ConnectAsync(Kernel::HLERequestContext& ctx) { @@ -45,7 +45,7 @@ void Module::Interface::ConnectAsync(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_AC, "(STUBBED) called"); + LOG_WARNING(Service_AC, "(STUBBED) called"); } void Module::Interface::GetConnectResult(Kernel::HLERequestContext& ctx) { @@ -84,7 +84,7 @@ void Module::Interface::GetCloseResult(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_AC, "(STUBBED) called"); + LOG_WARNING(Service_AC, "(STUBBED) called"); } void Module::Interface::GetWifiStatus(Kernel::HLERequestContext& ctx) { @@ -97,7 +97,7 @@ void Module::Interface::GetWifiStatus(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(0); // Connection type set to none - NGLOG_WARNING(Service_AC, "(STUBBED) called"); + LOG_WARNING(Service_AC, "(STUBBED) called"); } void Module::Interface::GetInfraPriority(Kernel::HLERequestContext& ctx) { @@ -108,7 +108,7 @@ void Module::Interface::GetInfraPriority(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(0); // Infra Priority, default 0 - NGLOG_WARNING(Service_AC, "(STUBBED) called"); + LOG_WARNING(Service_AC, "(STUBBED) called"); } void Module::Interface::SetRequestEulaVersion(Kernel::HLERequestContext& ctx) { @@ -125,7 +125,7 @@ void Module::Interface::SetRequestEulaVersion(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushStaticBuffer(std::move(ac_config), 0); - NGLOG_WARNING(Service_AC, "(STUBBED) called, major={}, minor={}", major, minor); + LOG_WARNING(Service_AC, "(STUBBED) called, major={}, minor={}", major, minor); } void Module::Interface::RegisterDisconnectEvent(Kernel::HLERequestContext& ctx) { @@ -140,7 +140,7 @@ void Module::Interface::RegisterDisconnectEvent(Kernel::HLERequestContext& ctx) IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_AC, "(STUBBED) called"); + LOG_WARNING(Service_AC, "(STUBBED) called"); } void Module::Interface::IsConnected(Kernel::HLERequestContext& ctx) { @@ -153,7 +153,7 @@ void Module::Interface::IsConnected(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(ac->ac_connected); - NGLOG_WARNING(Service_AC, "(STUBBED) called unk=0x{:08X} descriptor=0x{:08X} param=0x{:08X}", + LOG_WARNING(Service_AC, "(STUBBED) called unk=0x{:08X} descriptor=0x{:08X} param=0x{:08X}", unk, unk_descriptor, unk_param); } @@ -163,7 +163,7 @@ void Module::Interface::SetClientVersion(Kernel::HLERequestContext& ctx) { u32 version = rp.Pop(); rp.Skip(2, false); // ProcessId descriptor - NGLOG_WARNING(Service_AC, "(STUBBED) called, version: 0x{:08X}", version); + LOG_WARNING(Service_AC, "(STUBBED) called, version: 0x{:08X}", version); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index a23f6b839..520628a92 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -143,7 +143,7 @@ ResultVal CIAFile::WriteContentData(u64 offset, size_t length, const u8* // Keep tabs on how much of this content ID has been written so new range_min // values can be calculated. content_written[i] += available_to_write; - NGLOG_DEBUG(Service_AM, "Wrote {:x} to content {}, total {:x}", available_to_write, i, + LOG_DEBUG(Service_AM, "Wrote {:x} to content {}, total {:x}", available_to_write, i, content_written[i]); } } @@ -234,7 +234,7 @@ bool CIAFile::Close() const { // Install aborted if (!complete) { - NGLOG_ERROR(Service_AM, "CIAFile closed prematurely, aborting install..."); + LOG_ERROR(Service_AM, "CIAFile closed prematurely, aborting install..."); FileUtil::DeleteDir(GetTitlePath(media_type, container.GetTitleMetadata().GetTitleID())); return true; } @@ -277,10 +277,10 @@ void CIAFile::Flush() const {} InstallStatus InstallCIA(const std::string& path, std::function&& update_callback) { - NGLOG_INFO(Service_AM, "Installing {}...", path); + LOG_INFO(Service_AM, "Installing {}...", path); if (!FileUtil::Exists(path)) { - NGLOG_ERROR(Service_AM, "File {} does not exist!", path); + LOG_ERROR(Service_AM, "File {} does not exist!", path); return InstallStatus::ErrorFileNotFound; } @@ -292,7 +292,7 @@ InstallStatus InstallCIA(const std::string& path, for (size_t i = 0; i < container.GetTitleMetadata().GetContentCount(); i++) { if (container.GetTitleMetadata().GetContentTypeByIndex(i) & FileSys::TMDContentTypeFlag::Encrypted) { - NGLOG_ERROR(Service_AM, "File {} is encrypted! Aborting...", path); + LOG_ERROR(Service_AM, "File {} is encrypted! Aborting...", path); return InstallStatus::ErrorEncrypted; } } @@ -311,7 +311,7 @@ InstallStatus InstallCIA(const std::string& path, if (update_callback) update_callback(total_bytes_read, file.GetSize()); if (result.Failed()) { - NGLOG_ERROR(Service_AM, "CIA file installation aborted with error code {:08x}", + LOG_ERROR(Service_AM, "CIA file installation aborted with error code {:08x}", result.Code().raw); return InstallStatus::ErrorAborted; } @@ -319,11 +319,11 @@ InstallStatus InstallCIA(const std::string& path, } installFile.Close(); - NGLOG_INFO(Service_AM, "Installed {} successfully.", path); + LOG_INFO(Service_AM, "Installed {} successfully.", path); return InstallStatus::Success; } - NGLOG_ERROR(Service_AM, "CIA file {} is invalid!", path); + LOG_ERROR(Service_AM, "CIA file {} is invalid!", path); return InstallStatus::ErrorInvalid; } @@ -345,7 +345,7 @@ std::string GetTitleMetadataPath(Service::FS::MediaType media_type, u64 tid, boo std::string content_path = GetTitlePath(media_type, tid) + "content/"; if (media_type == Service::FS::MediaType::GameCard) { - NGLOG_ERROR(Service_AM, "Invalid request for nonexistent gamecard title metadata!"); + LOG_ERROR(Service_AM, "Invalid request for nonexistent gamecard title metadata!"); return ""; } @@ -385,7 +385,7 @@ std::string GetTitleContentPath(Service::FS::MediaType media_type, u64 tid, u16 if (media_type == Service::FS::MediaType::GameCard) { // TODO(shinyquagsire23): get current app file if TID matches? - NGLOG_ERROR(Service_AM, "Request for gamecard partition {} content path unimplemented!", + LOG_ERROR(Service_AM, "Request for gamecard partition {} content path unimplemented!", static_cast(index)); return ""; } @@ -420,7 +420,7 @@ std::string GetTitlePath(Service::FS::MediaType media_type, u64 tid) { if (media_type == Service::FS::MediaType::GameCard) { // TODO(shinyquagsire23): get current app path if TID matches? - NGLOG_ERROR(Service_AM, "Request for gamecard title path unimplemented!"); + LOG_ERROR(Service_AM, "Request for gamecard title path unimplemented!"); return ""; } @@ -439,7 +439,7 @@ std::string GetMediaTitlePath(Service::FS::MediaType media_type) { if (media_type == Service::FS::MediaType::GameCard) { // TODO(shinyquagsire23): get current app parent folder if TID matches? - NGLOG_ERROR(Service_AM, "Request for gamecard parent path unimplemented!"); + LOG_ERROR(Service_AM, "Request for gamecard parent path unimplemented!"); return ""; } @@ -607,7 +607,7 @@ void Module::Interface::DeleteContents(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushMappedBuffer(content_ids_in); - NGLOG_WARNING(Service_AM, "(STUBBED) media_type={}, title_id=0x{:016x}, content_count={}", + LOG_WARNING(Service_AM, "(STUBBED) media_type={}, title_id=0x{:016x}, content_count={}", media_type, title_id, content_count); } @@ -692,24 +692,24 @@ void Module::Interface::DeleteUserProgram(Kernel::HLERequestContext& ctx) { u16 category = static_cast((title_id >> 32) & 0xFFFF); u8 variation = static_cast(title_id & 0xFF); if (category & CATEGORY_SYSTEM || category & CATEGORY_DLP || variation & VARIATION_SYSTEM) { - NGLOG_ERROR(Service_AM, "Trying to uninstall system app"); + LOG_ERROR(Service_AM, "Trying to uninstall system app"); rb.Push(ResultCode(ErrCodes::TryingToUninstallSystemApp, ErrorModule::AM, ErrorSummary::InvalidArgument, ErrorLevel::Usage)); return; } - NGLOG_INFO(Service_AM, "Deleting title 0x{:016x}", title_id); + LOG_INFO(Service_AM, "Deleting title 0x{:016x}", title_id); std::string path = GetTitlePath(media_type, title_id); if (!FileUtil::Exists(path)) { rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::AM, ErrorSummary::InvalidState, ErrorLevel::Permanent)); - NGLOG_ERROR(Service_AM, "Title not found"); + LOG_ERROR(Service_AM, "Title not found"); return; } bool success = FileUtil::DeleteDirRecursively(path); am->ScanForAllTitles(); rb.Push(RESULT_SUCCESS); if (!success) - NGLOG_ERROR(Service_AM, "FileUtil::DeleteDirRecursively unexpectedly failed"); + LOG_ERROR(Service_AM, "FileUtil::DeleteDirRecursively unexpectedly failed"); } void Module::Interface::GetProductCode(Kernel::HLERequestContext& ctx) { @@ -827,7 +827,7 @@ void Module::Interface::ListDataTitleTicketInfos(Kernel::HLERequestContext& ctx) rb.Push(ticket_count); rb.PushMappedBuffer(ticket_info_out); - NGLOG_WARNING(Service_AM, + LOG_WARNING(Service_AM, "(STUBBED) ticket_count=0x{:08X}, title_id=0x{:016x}, start_index=0x{:08X}", ticket_count, title_id, start_index); } @@ -857,7 +857,7 @@ void Module::Interface::GetDLCContentInfoCount(Kernel::HLERequestContext& ctx) { rb.Push(tmd.GetContentCount()); } else { rb.Push(1); // Number of content infos plus one - NGLOG_WARNING(Service_AM, "(STUBBED) called media_type={}, title_id=0x{:016x}", + LOG_WARNING(Service_AM, "(STUBBED) called media_type={}, title_id=0x{:016x}", static_cast(media_type), title_id); } } @@ -868,7 +868,7 @@ void Module::Interface::DeleteTicket(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_AM, "(STUBBED) called title_id=0x{:016x}", title_id); + LOG_WARNING(Service_AM, "(STUBBED) called title_id=0x{:016x}", title_id); } void Module::Interface::GetNumTickets(Kernel::HLERequestContext& ctx) { @@ -878,7 +878,7 @@ void Module::Interface::GetNumTickets(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(ticket_count); - NGLOG_WARNING(Service_AM, "(STUBBED) called ticket_count=0x{:08x}", ticket_count); + LOG_WARNING(Service_AM, "(STUBBED) called ticket_count=0x{:08x}", ticket_count); } void Module::Interface::GetTicketList(Kernel::HLERequestContext& ctx) { @@ -891,7 +891,7 @@ void Module::Interface::GetTicketList(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(ticket_list_count); rb.PushMappedBuffer(ticket_tids_out); - NGLOG_WARNING(Service_AM, "(STUBBED) ticket_list_count=0x{:08x}, ticket_index=0x{:08x}", + LOG_WARNING(Service_AM, "(STUBBED) ticket_list_count=0x{:08x}, ticket_index=0x{:08x}", ticket_list_count, ticket_index); } @@ -903,7 +903,7 @@ void Module::Interface::QueryAvailableTitleDatabase(Kernel::HLERequestContext& c rb.Push(RESULT_SUCCESS); // No error rb.Push(true); - NGLOG_WARNING(Service_AM, "(STUBBED) media_type={}", media_type); + LOG_WARNING(Service_AM, "(STUBBED) media_type={}", media_type); } void Module::Interface::CheckContentRights(Kernel::HLERequestContext& ctx) { @@ -919,7 +919,7 @@ void Module::Interface::CheckContentRights(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error rb.Push(has_rights); - NGLOG_WARNING(Service_AM, "(STUBBED) tid={:016x}, content_index={}", tid, content_index); + LOG_WARNING(Service_AM, "(STUBBED) tid={:016x}, content_index={}", tid, content_index); } void Module::Interface::CheckContentRightsIgnorePlatform(Kernel::HLERequestContext& ctx) { @@ -935,7 +935,7 @@ void Module::Interface::CheckContentRightsIgnorePlatform(Kernel::HLERequestConte rb.Push(RESULT_SUCCESS); // No error rb.Push(has_rights); - NGLOG_WARNING(Service_AM, "(STUBBED) tid={:016x}, content_index={}", tid, content_index); + LOG_WARNING(Service_AM, "(STUBBED) tid={:016x}, content_index={}", tid, content_index); } void Module::Interface::BeginImportProgram(Kernel::HLERequestContext& ctx) { @@ -961,7 +961,7 @@ void Module::Interface::BeginImportProgram(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error rb.PushCopyObjects(file->Connect()); - NGLOG_WARNING(Service_AM, "(STUBBED) media_type={}", static_cast(media_type)); + LOG_WARNING(Service_AM, "(STUBBED) media_type={}", static_cast(media_type)); } void Module::Interface::EndImportProgram(Kernel::HLERequestContext& ctx) { @@ -981,13 +981,13 @@ ResultVal> GetFileFromSession( // cast to File. For AM on 3DS, invalid handles actually hang the system. if (file_session->parent == nullptr) { - NGLOG_WARNING(Service_AM, "Invalid file handle!"); + LOG_WARNING(Service_AM, "Invalid file handle!"); return Kernel::ERR_INVALID_HANDLE; } Kernel::SharedPtr server = file_session->parent->server; if (server == nullptr) { - NGLOG_WARNING(Service_AM, "File handle ServerSession disconnected!"); + LOG_WARNING(Service_AM, "File handle ServerSession disconnected!"); return Kernel::ERR_SESSION_CLOSED_BY_REMOTE; } @@ -998,13 +998,13 @@ ResultVal> GetFileFromSession( if (file != nullptr) return MakeResult>(file); - NGLOG_ERROR(Service_AM, "Failed to cast handle to FSFile!"); + LOG_ERROR(Service_AM, "Failed to cast handle to FSFile!"); return Kernel::ERR_INVALID_HANDLE; } // Probably the best bet if someone is LLEing the fs service is to just have them LLE AM // while they're at it, so not implemented. - NGLOG_ERROR(Service_AM, "Given file handle does not have an HLE handler!"); + LOG_ERROR(Service_AM, "Given file handle does not have an HLE handler!"); return Kernel::ERR_NOT_IMPLEMENTED; } @@ -1201,20 +1201,20 @@ void Module::Interface::DeleteProgram(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x0410, 3, 0); auto media_type = rp.PopEnum(); u64 title_id = rp.Pop(); - NGLOG_INFO(Service_AM, "Deleting title 0x{:016x}", title_id); + LOG_INFO(Service_AM, "Deleting title 0x{:016x}", title_id); std::string path = GetTitlePath(media_type, title_id); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); if (!FileUtil::Exists(path)) { rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::AM, ErrorSummary::InvalidState, ErrorLevel::Permanent)); - NGLOG_ERROR(Service_AM, "Title not found"); + LOG_ERROR(Service_AM, "Title not found"); return; } bool success = FileUtil::DeleteDirRecursively(path); am->ScanForAllTitles(); rb.Push(RESULT_SUCCESS); if (!success) - NGLOG_ERROR(Service_AM, "FileUtil::DeleteDirRecursively unexpectedly failed"); + LOG_ERROR(Service_AM, "FileUtil::DeleteDirRecursively unexpectedly failed"); } void Module::Interface::GetMetaSizeFromCia(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/apt/applet_manager.cpp b/src/core/hle/service/apt/applet_manager.cpp index 6eb1902b8..06d2fd44f 100644 --- a/src/core/hle/service/apt/applet_manager.cpp +++ b/src/core/hle/service/apt/applet_manager.cpp @@ -170,7 +170,7 @@ void AppletManager::CancelAndSendParameter(const MessageParameter& parameter) { // Signal the event to let the receiver know that a new parameter is ready to be read auto* const slot_data = GetAppletSlotData(static_cast(parameter.destination_id)); if (slot_data == nullptr) { - NGLOG_DEBUG(Service_APT, "No applet was registered with the id {:03X}", + LOG_DEBUG(Service_APT, "No applet was registered with the id {:03X}", static_cast(parameter.destination_id)); return; } @@ -329,7 +329,7 @@ ResultCode AppletManager::PrepareToStartLibraryApplet(AppletId applet_id) { // If we weren't able to load the native applet title, try to fallback to an HLE implementation. auto applet = HLE::Applets::Applet::Get(applet_id); if (applet) { - NGLOG_WARNING(Service_APT, "applet has already been started id={:08X}", + LOG_WARNING(Service_APT, "applet has already been started id={:08X}", static_cast(applet_id)); return RESULT_SUCCESS; } else { @@ -353,7 +353,7 @@ ResultCode AppletManager::PreloadLibraryApplet(AppletId applet_id) { // If we weren't able to load the native applet title, try to fallback to an HLE implementation. auto applet = HLE::Applets::Applet::Get(applet_id); if (applet) { - NGLOG_WARNING(Service_APT, "applet has already been started id={:08X}", + LOG_WARNING(Service_APT, "applet has already been started id={:08X}", static_cast(applet_id)); return RESULT_SUCCESS; } else { @@ -400,7 +400,7 @@ ResultVal AppletManager::GetAppletInfo(AppletId app_i return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, ErrorLevel::Status); } - NGLOG_WARNING(Service_APT, "Using HLE applet info for applet {:03X}", + LOG_WARNING(Service_APT, "Using HLE applet info for applet {:03X}", static_cast(app_id)); // TODO(Subv): Get the title id for the current applet and write it in the response[2-3] return MakeResult({0, Service::FS::MediaType::NAND, true, true, 0}); @@ -408,7 +408,7 @@ ResultVal AppletManager::GetAppletInfo(AppletId app_i if (app_id == AppletId::Application) { // TODO(Subv): Implement this once Application launching is implemented - NGLOG_ERROR(Service_APT, "Unimplemented GetAppletInfo(Application)"); + LOG_ERROR(Service_APT, "Unimplemented GetAppletInfo(Application)"); return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, ErrorLevel::Status); } diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 07a0d16c7..e80aac8b7 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -32,7 +32,7 @@ void Module::Interface::Initialize(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 attributes = rp.Pop(); - NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", + LOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", static_cast(app_id), attributes); auto result = apt->applet_manager->Initialize(app_id, attributes); @@ -197,10 +197,10 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) { if (apt->LoadSharedFont()) { apt->shared_font_loaded = true; } else if (apt->LoadLegacySharedFont()) { - NGLOG_WARNING(Service_APT, "Loaded shared font by legacy method"); + LOG_WARNING(Service_APT, "Loaded shared font by legacy method"); apt->shared_font_loaded = true; } else { - NGLOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds"); + LOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds"); rb.Push(-1); // TODO: Find the right error code rb.Push(0); rb.PushCopyObjects(nullptr); @@ -231,7 +231,7 @@ void Module::Interface::NotifyToWait(Kernel::HLERequestContext& ctx) { u32 app_id = rp.Pop(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING(Service_APT, "(STUBBED) app_id={}", app_id); + LOG_WARNING(Service_APT, "(STUBBED) app_id={}", app_id); } void Module::Interface::GetLockHandle(Kernel::HLERequestContext& ctx) { @@ -252,14 +252,14 @@ void Module::Interface::GetLockHandle(Kernel::HLERequestContext& ctx) { rb.Push(0); // Least significant bit = power button state rb.PushCopyObjects(apt->lock); - NGLOG_WARNING(Service_APT, "(STUBBED) called applet_attributes={:#010X}", applet_attributes); + LOG_WARNING(Service_APT, "(STUBBED) called applet_attributes={:#010X}", applet_attributes); } void Module::Interface::Enable(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x3, 1, 0); // 0x30040 u32 attributes = rp.Pop(); - NGLOG_DEBUG(Service_APT, "called attributes={:#010X}", attributes); + LOG_DEBUG(Service_APT, "called attributes={:#010X}", attributes); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->Enable(attributes)); @@ -275,7 +275,7 @@ void Module::Interface::GetAppletManInfo(Kernel::HLERequestContext& ctx) { rb.Push(static_cast(AppletId::HomeMenu)); // Home menu AppID rb.Push(static_cast(AppletId::Application)); // TODO(purpasmart96): Do this correctly - NGLOG_WARNING(Service_APT, "(STUBBED) called unk={:#010X}", unk); + LOG_WARNING(Service_APT, "(STUBBED) called unk={:#010X}", unk); } void Module::Interface::IsRegistered(Kernel::HLERequestContext& ctx) { @@ -285,7 +285,7 @@ void Module::Interface::IsRegistered(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error rb.Push(apt->applet_manager->IsRegistered(app_id)); - NGLOG_DEBUG(Service_APT, "called app_id={:#010X}", static_cast(app_id)); + LOG_DEBUG(Service_APT, "called app_id={:#010X}", static_cast(app_id)); } void Module::Interface::InquireNotification(Kernel::HLERequestContext& ctx) { @@ -294,7 +294,7 @@ void Module::Interface::InquireNotification(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); // No error rb.Push(static_cast(SignalType::None)); // Signal type - NGLOG_WARNING(Service_APT, "(STUBBED) called app_id={:#010X}", app_id); + LOG_WARNING(Service_APT, "(STUBBED) called app_id={:#010X}", app_id); } void Module::Interface::SendParameter(Kernel::HLERequestContext& ctx) { @@ -306,7 +306,7 @@ void Module::Interface::SendParameter(Kernel::HLERequestContext& ctx) { Kernel::SharedPtr object = rp.PopGenericObject(); std::vector buffer = rp.PopStaticBuffer(); - NGLOG_DEBUG(Service_APT, + LOG_DEBUG(Service_APT, "called src_app_id={:#010X}, dst_app_id={:#010X}, signal_type={:#010X}," "buffer_size={:#010X}", static_cast(src_app_id), static_cast(dst_app_id), @@ -329,7 +329,7 @@ void Module::Interface::ReceiveParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", + LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), buffer_size); auto next_parameter = apt->applet_manager->ReceiveParameter(app_id); @@ -357,7 +357,7 @@ void Module::Interface::GlanceParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", + LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), buffer_size); auto next_parameter = apt->applet_manager->GlanceParameter(app_id); @@ -393,7 +393,7 @@ void Module::Interface::CancelParameter(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->CancelParameter(check_sender, sender_appid, check_receiver, receiver_appid)); - NGLOG_DEBUG(Service_APT, + LOG_DEBUG(Service_APT, "called check_sender={}, sender_appid={:#010X}, " "check_receiver={}, receiver_appid={:#010X}", check_sender, static_cast(sender_appid), check_receiver, @@ -415,7 +415,7 @@ void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING( + LOG_WARNING( Service_APT, "(STUBBED) called title_info1={:#010X}, title_info2={:#010X}, title_info3={:#010X}," "title_info4={:#010X}, flags={:#010X}", @@ -433,7 +433,7 @@ void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING(Service_APT, + LOG_WARNING(Service_APT, "(STUBBED) called buffer1_size={:#010X}, buffer2_size={:#010X}, flag={:#010X}", buffer1_size, buffer2_size, flag); } @@ -450,7 +450,7 @@ void Module::Interface::AppletUtility(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING(Service_APT, + LOG_WARNING(Service_APT, "(STUBBED) called command={:#010X}, input_size={:#010X}, output_size={:#010X}", utility_command, input_size, output_size); } @@ -461,13 +461,13 @@ void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { apt->cpu_percent = rp.Pop(); if (value != 1) { - NGLOG_ERROR(Service_APT, "This value should be one, but is actually {}!", value); + LOG_ERROR(Service_APT, "This value should be one, but is actually {}!", value); } IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, + LOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, value); } @@ -476,21 +476,21 @@ void Module::Interface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { u32 value = rp.Pop(); if (value != 1) { - NGLOG_ERROR(Service_APT, "This value should be one, but is actually {}!", value); + LOG_ERROR(Service_APT, "This value should be one, but is actually {}!", value); } IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); // No error rb.Push(apt->cpu_percent); - NGLOG_WARNING(Service_APT, "(STUBBED) called, value={}", value); + LOG_WARNING(Service_APT, "(STUBBED) called, value={}", value); } void Module::Interface::PrepareToStartLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x18, 1, 0); // 0x180040 AppletId applet_id = rp.PopEnum(); - NGLOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); + LOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->PrepareToStartLibraryApplet(applet_id)); @@ -507,14 +507,14 @@ void Module::Interface::PrepareToStartNewestHomeMenu(Kernel::HLERequestContext& rb.Push(ResultCode(ErrorDescription::AlreadyExists, ErrorModule::Applet, ErrorSummary::InvalidState, ErrorLevel::Status)); - NGLOG_DEBUG(Service_APT, "called"); + LOG_DEBUG(Service_APT, "called"); } void Module::Interface::PreloadLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x16, 1, 0); // 0x160040 AppletId applet_id = rp.PopEnum(); - NGLOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); + LOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->PreloadLibraryApplet(applet_id)); @@ -527,7 +527,7 @@ void Module::Interface::FinishPreloadingLibraryApplet(Kernel::HLERequestContext& IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->FinishPreloadingLibraryApplet(applet_id)); - NGLOG_WARNING(Service_APT, "(STUBBED) called, applet_id={:#05X}", static_cast(applet_id)); + LOG_WARNING(Service_APT, "(STUBBED) called, applet_id={:#05X}", static_cast(applet_id)); } void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { @@ -538,7 +538,7 @@ void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { Kernel::SharedPtr object = rp.PopGenericObject(); std::vector buffer = rp.PopStaticBuffer(); - NGLOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); + LOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->StartLibraryApplet(applet_id, object, buffer)); @@ -551,7 +551,7 @@ void Module::Interface::CancelLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(1); // TODO: Find the return code meaning - NGLOG_WARNING(Service_APT, "(STUBBED) called exiting={}", exiting); + LOG_WARNING(Service_APT, "(STUBBED) called exiting={}", exiting); } void Module::Interface::SendCaptureBufferInfo(Kernel::HLERequestContext& ctx) { @@ -582,7 +582,7 @@ void Module::Interface::SetScreenCapPostPermission(Kernel::HLERequestContext& ct IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", + LOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", static_cast(apt->screen_capture_post_permission)); } @@ -592,7 +592,7 @@ void Module::Interface::GetScreenCapPostPermission(Kernel::HLERequestContext& ct IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); // No error rb.Push(static_cast(apt->screen_capture_post_permission)); - NGLOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", + LOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", static_cast(apt->screen_capture_post_permission)); } @@ -600,7 +600,7 @@ void Module::Interface::GetAppletInfo(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x6, 1, 0); // 0x60040 auto app_id = rp.PopEnum(); - NGLOG_DEBUG(Service_APT, "called, app_id={}", static_cast(app_id)); + LOG_DEBUG(Service_APT, "called, app_id={}", static_cast(app_id)); auto info = apt->applet_manager->GetAppletInfo(app_id); if (info.Failed()) { @@ -623,7 +623,7 @@ void Module::Interface::GetStartupArgument(Kernel::HLERequestContext& ctx) { StartupArgumentType startup_argument_type = static_cast(rp.Pop()); if (parameter_size >= 0x300) { - NGLOG_ERROR( + LOG_ERROR( Service_APT, "Parameter size is outside the valid range (capped to 0x300): parameter_size={:#010X}", parameter_size); @@ -632,7 +632,7 @@ void Module::Interface::GetStartupArgument(Kernel::HLERequestContext& ctx) { std::vector parameter(parameter_size, 0); - NGLOG_WARNING(Service_APT, + LOG_WARNING(Service_APT, "(STUBBED) called, startup_argument_type={}, parameter_size={:#010X}", static_cast(startup_argument_type), parameter_size); @@ -658,7 +658,7 @@ void Module::Interface::Wrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size + HW::AES::CCM_MAC_SIZE, "input_size ({}) doesn't match to output_size ({})", input_size, output_size); - NGLOG_DEBUG(Service_APT, + LOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", output_size, input_size, nonce_offset, nonce_size); @@ -704,7 +704,7 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size - HW::AES::CCM_MAC_SIZE, "input_size ({}) doesn't match to output_size ({})", input_size, output_size); - NGLOG_DEBUG(Service_APT, + LOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", output_size, input_size, nonce_offset, nonce_size); @@ -730,7 +730,7 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { pdata.size() - nonce_offset); rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_APT, "Failed to decrypt data"); + LOG_ERROR(Service_APT, "Failed to decrypt data"); rb.Push(ResultCode(static_cast(1), ErrorModule::PS, ErrorSummary::WrongArgument, ErrorLevel::Status)); } @@ -751,7 +751,7 @@ void Module::Interface::CheckNew3DSApp(Kernel::HLERequestContext& ctx) { PTM::CheckNew3DS(rb); } - NGLOG_WARNING(Service_APT, "(STUBBED) called"); + LOG_WARNING(Service_APT, "(STUBBED) called"); } void Module::Interface::CheckNew3DS(Kernel::HLERequestContext& ctx) { @@ -760,7 +760,7 @@ void Module::Interface::CheckNew3DS(Kernel::HLERequestContext& ctx) { PTM::CheckNew3DS(rb); - NGLOG_WARNING(Service_APT, "(STUBBED) called"); + LOG_WARNING(Service_APT, "(STUBBED) called"); } Module::Interface::Interface(std::shared_ptr apt, const char* name, u32 max_session) diff --git a/src/core/hle/service/boss/boss.cpp b/src/core/hle/service/boss/boss.cpp index 974b5ed29..eba337f75 100644 --- a/src/core/hle/service/boss/boss.cpp +++ b/src/core/hle/service/boss/boss.cpp @@ -28,14 +28,14 @@ void InitializeSession(Service::Interface* self) { if (translation != IPC::CallingPidDesc()) { cmd_buff[0] = IPC::MakeHeader(0, 0x1, 0); // 0x40 cmd_buff[1] = IPC::ERR_INVALID_BUFFER_DESCRIPTOR.raw; - NGLOG_ERROR(Service_BOSS, "The translation was invalid, translation={:#010X}", translation); + LOG_ERROR(Service_BOSS, "The translation was invalid, translation={:#010X}", translation); return; } cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param={:#018X}, translation={:#010X}, unk_param4={:#010X}", unk_param, translation, unk_param4); } @@ -51,7 +51,7 @@ void RegisterStorage(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x2, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "unk_flag={:#010X}", unk_param1, unk_param2, unk_param3, unk_flag); @@ -63,7 +63,7 @@ void UnregisterStorage(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x3, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, "(STUBBED) called"); + LOG_WARNING(Service_BOSS, "(STUBBED) called"); } void GetStorageInfo(Service::Interface* self) { @@ -73,7 +73,7 @@ void GetStorageInfo(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 0; // stub 0 - NGLOG_WARNING(Service_BOSS, "(STUBBED) called"); + LOG_WARNING(Service_BOSS, "(STUBBED) called"); } void RegisterPrivateRootCa(Service::Interface* self) { @@ -88,7 +88,7 @@ void RegisterPrivateRootCa(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) translation={:#010X}, buff_addr{:#010X}, buff_size={:#010X}", translation, buff_addr, buff_size); } @@ -112,7 +112,7 @@ void RegisterPrivateClientCert(Service::Interface* self) { cmd_buff[2] = (buff2_size << 4 | 0xA); cmd_buff[3] = buff2_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", @@ -127,7 +127,7 @@ void GetNewArrivalFlag(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = new_arrival_flag; - NGLOG_WARNING(Service_BOSS, "(STUBBED) new_arrival_flag={}", new_arrival_flag); + LOG_WARNING(Service_BOSS, "(STUBBED) new_arrival_flag={}", new_arrival_flag); } void RegisterNewArrivalEvent(Service::Interface* self) { @@ -139,7 +139,7 @@ void RegisterNewArrivalEvent(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x8, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}", unk_param1, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}", unk_param1, unk_param2); } @@ -151,7 +151,7 @@ void SetOptoutFlag(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x9, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, "output_flag={}", output_flag); + LOG_WARNING(Service_BOSS, "output_flag={}", output_flag); } void GetOptoutFlag(Service::Interface* self) { @@ -161,7 +161,7 @@ void GetOptoutFlag(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = output_flag; - NGLOG_WARNING(Service_BOSS, "output_flag={}", output_flag); + LOG_WARNING(Service_BOSS, "output_flag={}", output_flag); } void RegisterTask(Service::Interface* self) { @@ -179,7 +179,7 @@ void RegisterTask(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); @@ -199,7 +199,7 @@ void UnregisterTask(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, translation, buff_addr, buff_size); @@ -219,7 +219,7 @@ void ReconfigureTask(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, translation, buff_addr, buff_size); @@ -231,7 +231,7 @@ void GetTaskIdList(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0xE, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, "(STUBBED) called"); + LOG_WARNING(Service_BOSS, "(STUBBED) called"); } void GetStepIdList(Service::Interface* self) { @@ -246,7 +246,7 @@ void GetStepIdList(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", translation, buff_addr, buff_size); } @@ -269,7 +269,7 @@ void GetNsDataIdList(Service::Interface* self) { cmd_buff[4] = (buff_size << 4 | 0xC); cmd_buff[5] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "unk_param4={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", @@ -295,7 +295,7 @@ void GetOwnNsDataIdList(Service::Interface* self) { cmd_buff[4] = (buff_size << 4 | 0xC); cmd_buff[5] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "unk_param4={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", @@ -321,7 +321,7 @@ void GetNewDataNsDataIdList(Service::Interface* self) { cmd_buff[4] = (buff_size << 4 | 0xC); cmd_buff[5] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "unk_param4={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", @@ -347,7 +347,7 @@ void GetOwnNewDataNsDataIdList(Service::Interface* self) { cmd_buff[4] = (buff_size << 4 | 0xC); cmd_buff[5] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "unk_param4={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", @@ -369,7 +369,7 @@ void SendProperty(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, translation, buff_addr, buff_size); @@ -388,7 +388,7 @@ void SendPropertyHandle(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -408,7 +408,7 @@ void ReceiveProperty(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xC); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, buff_size={:#010X}, " "translation={:#010X}, buff_addr={:#010X}", unk_param1, buff_size, translation, buff_addr); @@ -428,7 +428,7 @@ void UpdateTaskInterval(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, translation, buff_addr, buff_size); @@ -447,7 +447,7 @@ void UpdateTaskCount(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " "translation={:#010X}, buff_addr={:#010X}", buff_size, unk_param2, translation, buff_addr); @@ -467,7 +467,7 @@ void GetTaskInterval(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xA); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -487,7 +487,7 @@ void GetTaskCount(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xA); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -507,7 +507,7 @@ void GetTaskServiceStatus(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xA); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -526,7 +526,7 @@ void StartTask(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -545,7 +545,7 @@ void StartTaskImmediate(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -564,7 +564,7 @@ void CancelTask(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -578,7 +578,7 @@ void GetTaskFinishHandle(Service::Interface* self) { cmd_buff[2] = 0; cmd_buff[3] = 0; // stub 0(This should be a handle of task_finish ?) - NGLOG_WARNING(Service_BOSS, "(STUBBED) called"); + LOG_WARNING(Service_BOSS, "(STUBBED) called"); } void GetTaskState(Service::Interface* self) { @@ -597,7 +597,7 @@ void GetTaskState(Service::Interface* self) { cmd_buff[5] = (buff_size << 4 | 0xA); cmd_buff[6] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " "translation={:#010X}, buff_addr={:#010X}", buff_size, unk_param2, translation, buff_addr); @@ -619,7 +619,7 @@ void GetTaskResult(Service::Interface* self) { cmd_buff[5] = (buff_size << 4 | 0xA); cmd_buff[6] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -641,7 +641,7 @@ void GetTaskCommErrorCode(Service::Interface* self) { cmd_buff[5] = (buff_size << 4 | 0xA); cmd_buff[6] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -663,7 +663,7 @@ void GetTaskStatus(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xA); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); @@ -684,7 +684,7 @@ void GetTaskError(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xA); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, translation, buff_addr, buff_size); @@ -704,7 +704,7 @@ void GetTaskInfo(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, translation, buff_addr, buff_size); @@ -718,7 +718,7 @@ void DeleteNsData(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x26, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); } void GetNsDataHeaderInfo(Service::Interface* self) { @@ -736,7 +736,7 @@ void GetNsDataHeaderInfo(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xC); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); @@ -760,7 +760,7 @@ void ReadNsData(Service::Interface* self) { cmd_buff[4] = (buff_size << 4 | 0xC); cmd_buff[5] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "unk_param4={:#010X}, translation={:#010X}, " "buff_addr={:#010X}, buff_size={:#010X}", @@ -777,7 +777,7 @@ void SetNsDataAdditionalInfo(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x29, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}", unk_param1, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}", unk_param1, unk_param2); } @@ -790,7 +790,7 @@ void GetNsDataAdditionalInfo(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 0; // stub 0 (32bit value) - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); } void SetNsDataNewFlag(Service::Interface* self) { @@ -802,7 +802,7 @@ void SetNsDataNewFlag(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x2B, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, ns_data_new_flag={:#010X}", + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, ns_data_new_flag={:#010X}", unk_param1, ns_data_new_flag); } @@ -815,7 +815,7 @@ void GetNsDataNewFlag(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = ns_data_new_flag; - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, ns_data_new_flag={:#010X}", + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, ns_data_new_flag={:#010X}", unk_param1, ns_data_new_flag); } @@ -829,7 +829,7 @@ void GetNsDataLastUpdate(Service::Interface* self) { cmd_buff[2] = 0; // stub 0 (32bit value) cmd_buff[3] = 0; // stub 0 (32bit value) - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); } void GetErrorCode(Service::Interface* self) { @@ -841,7 +841,7 @@ void GetErrorCode(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 0; // stub 0 (32bit value) - NGLOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}", unk_param1); } void RegisterStorageEntry(Service::Interface* self) { @@ -856,7 +856,7 @@ void RegisterStorageEntry(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x2F, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "unk_param4={:#010X}, unk_param5={:#010X}", unk_param1, unk_param2, unk_param3, unk_param4, unk_param5); @@ -870,7 +870,7 @@ void GetStorageEntryInfo(Service::Interface* self) { cmd_buff[2] = 0; // stub 0 (32bit value) cmd_buff[3] = 0; // stub 0 (16bit value) - NGLOG_WARNING(Service_BOSS, "(STUBBED) called"); + LOG_WARNING(Service_BOSS, "(STUBBED) called"); } void SetStorageOption(Service::Interface* self) { @@ -884,7 +884,7 @@ void SetStorageOption(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x31, 0x1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " "unk_param3={:#010X}, unk_param4={:#010X}", unk_param1, unk_param2, unk_param3, unk_param4); @@ -900,7 +900,7 @@ void GetStorageOption(Service::Interface* self) { cmd_buff[4] = 0; // stub 0 (16bit value) cmd_buff[5] = 0; // stub 0 (16bit value) - NGLOG_WARNING(Service_BOSS, "(STUBBED) called"); + LOG_WARNING(Service_BOSS, "(STUBBED) called"); } void StartBgImmediate(Service::Interface* self) { @@ -916,7 +916,7 @@ void StartBgImmediate(Service::Interface* self) { cmd_buff[2] = (buff_size << 4 | 0xA); cmd_buff[3] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " "translation={:#010X}, buff_addr={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -936,7 +936,7 @@ void GetTaskActivePriority(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xA); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " "translation={:#010X}, buff_addr={:#010X}", unk_param1, translation, buff_addr, buff_size); @@ -957,7 +957,7 @@ void RegisterImmediateTask(Service::Interface* self) { cmd_buff[3] = (buff_size << 4 | 0xA); cmd_buff[4] = buff_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); @@ -982,7 +982,7 @@ void SetTaskQuery(Service::Interface* self) { cmd_buff[2] = (buff2_size << 4 | 0xA); cmd_buff[3] = buff2_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", @@ -1009,7 +1009,7 @@ void GetTaskQuery(Service::Interface* self) { cmd_buff[2] = (buff2_size << 4 | 0xC); cmd_buff[3] = buff2_addr; - NGLOG_WARNING(Service_BOSS, + LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp index 66631911d..c0c8f78d8 100644 --- a/src/core/hle/service/cam/cam.cpp +++ b/src/core/hle/service/cam/cam.cpp @@ -86,7 +86,7 @@ void Module::CompletionEventCallBack(u64 port_id, int) { const int original_height = camera.contexts[camera.current_context].resolution.height; if (port.x1 <= port.x0 || port.y1 <= port.y0 || port.x1 > original_width || port.y1 > original_height) { - NGLOG_ERROR(Service_CAM, "Invalid trimming coordinates x0={}, y0={}, x1={}, y1={}", + LOG_ERROR(Service_CAM, "Invalid trimming coordinates x0={}, y0={}, x1={}, y1={}", port.x0, port.y0, port.x1, port.y1); trim_width = 0; trim_height = 0; @@ -97,7 +97,7 @@ void Module::CompletionEventCallBack(u64 port_id, int) { u32 trim_size = (port.x1 - port.x0) * (port.y1 - port.y0) * 2; if (port.dest_size != trim_size) { - NGLOG_ERROR(Service_CAM, "The destination size ({}) doesn't match the source ({})!", + LOG_ERROR(Service_CAM, "The destination size ({}) doesn't match the source ({})!", port.dest_size, trim_size); } @@ -124,7 +124,7 @@ void Module::CompletionEventCallBack(u64 port_id, int) { } else { std::size_t buffer_size = buffer.size() * sizeof(u16); if (port.dest_size != buffer_size) { - NGLOG_ERROR(Service_CAM, "The destination size ({}) doesn't match the source ({})!", + LOG_ERROR(Service_CAM, "The destination size ({}) doesn't match the source ({})!", port.dest_size, buffer_size); } Memory::WriteBlock(*port.dest_process, port.dest, buffer.data(), @@ -161,7 +161,7 @@ void Module::StartReceiving(int port_id) { void Module::CancelReceiving(int port_id) { if (!ports[port_id].is_receiving) return; - NGLOG_WARNING(Service_CAM, "tries to cancel an ongoing receiving process."); + LOG_WARNING(Service_CAM, "tries to cancel an ongoing receiving process."); CoreTiming::UnscheduleEvent(completion_event_callback, port_id); ports[port_id].capture_result.wait(); ports[port_id].is_receiving = false; @@ -212,7 +212,7 @@ void Module::Interface::StartCapture(Kernel::HLERequestContext& ctx) { if (!cam->ports[i].is_active) { // This doesn't return an error, but seems to put the camera in an undefined // state - NGLOG_ERROR(Service_CAM, "port {} hasn't been activated", i); + LOG_ERROR(Service_CAM, "port {} hasn't been activated", i); } else { cam->cameras[cam->ports[i].camera_id].impl->StartCapture(); cam->ports[i].is_busy = true; @@ -222,16 +222,16 @@ void Module::Interface::StartCapture(Kernel::HLERequestContext& ctx) { } } } else { - NGLOG_WARNING(Service_CAM, "port {} already started", i); + LOG_WARNING(Service_CAM, "port {} already started", i); } } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); + LOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); } void Module::Interface::StopCapture(Kernel::HLERequestContext& ctx) { @@ -247,16 +247,16 @@ void Module::Interface::StopCapture(Kernel::HLERequestContext& ctx) { cam->cameras[cam->ports[i].camera_id].impl->StopCapture(); cam->ports[i].is_busy = false; } else { - NGLOG_WARNING(Service_CAM, "port {} already stopped", i); + LOG_WARNING(Service_CAM, "port {} already stopped", i); } } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); + LOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); } void Module::Interface::IsBusy(Kernel::HLERequestContext& ctx) { @@ -274,12 +274,12 @@ void Module::Interface::IsBusy(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(is_busy); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.Skip(1, false); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); + LOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); } void Module::Interface::ClearBuffer(Kernel::HLERequestContext& ctx) { @@ -289,7 +289,7 @@ void Module::Interface::ClearBuffer(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}", port_select.m_val); + LOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}", port_select.m_val); } void Module::Interface::GetVsyncInterruptEvent(Kernel::HLERequestContext& ctx) { @@ -302,12 +302,12 @@ void Module::Interface::GetVsyncInterruptEvent(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(cam->ports[port].vsync_interrupt_event); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.PushCopyObjects(nullptr); } - NGLOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}", port_select.m_val); + LOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}", port_select.m_val); } void Module::Interface::GetBufferErrorInterruptEvent(Kernel::HLERequestContext& ctx) { @@ -320,12 +320,12 @@ void Module::Interface::GetBufferErrorInterruptEvent(Kernel::HLERequestContext& rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(cam->ports[port].buffer_error_interrupt_event); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.PushCopyObjects(nullptr); } - NGLOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}", port_select.m_val); + LOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}", port_select.m_val); } void Module::Interface::SetReceiving(Kernel::HLERequestContext& ctx) { @@ -355,12 +355,12 @@ void Module::Interface::SetReceiving(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(port.completion_event); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.PushCopyObjects(nullptr); } - NGLOG_DEBUG(Service_CAM, "called, addr=0x{:X}, port_select={}, image_size={}, trans_unit={}", + LOG_DEBUG(Service_CAM, "called, addr=0x{:X}, port_select={}, image_size={}, trans_unit={}", dest, port_select.m_val, image_size, trans_unit); } @@ -375,12 +375,12 @@ void Module::Interface::IsFinishedReceiving(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(!is_busy); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.Skip(1, false); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); + LOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); } void Module::Interface::SetTransferLines(Kernel::HLERequestContext& ctx) { @@ -397,11 +397,11 @@ void Module::Interface::SetTransferLines(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}, lines={}, width={}, height={}", + LOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}, lines={}, width={}, height={}", port_select.m_val, transfer_lines, width, height); } @@ -435,7 +435,7 @@ void Module::Interface::GetMaxLines(Kernel::HLERequestContext& ctx) { rb.Push(lines); } - NGLOG_DEBUG(Service_CAM, "called, width={}, height={}", width, height); + LOG_DEBUG(Service_CAM, "called, width={}, height={}", width, height); } void Module::Interface::SetTransferBytes(Kernel::HLERequestContext& ctx) { @@ -452,11 +452,11 @@ void Module::Interface::SetTransferBytes(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_WARNING(Service_CAM, "(STUBBED)called, port_select={}, bytes={}, width={}, height={}", + LOG_WARNING(Service_CAM, "(STUBBED)called, port_select={}, bytes={}, width={}, height={}", port_select.m_val, transfer_bytes, width, height); } @@ -470,12 +470,12 @@ void Module::Interface::GetTransferBytes(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(cam->ports[port].transfer_bytes); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.Skip(1, false); } - NGLOG_WARNING(Service_CAM, "(STUBBED)called, port_select={}", port_select.m_val); + LOG_WARNING(Service_CAM, "(STUBBED)called, port_select={}", port_select.m_val); } void Module::Interface::GetMaxBytes(Kernel::HLERequestContext& ctx) { @@ -502,7 +502,7 @@ void Module::Interface::GetMaxBytes(Kernel::HLERequestContext& ctx) { rb.Push(bytes); } - NGLOG_DEBUG(Service_CAM, "called, width={}, height={}", width, height); + LOG_DEBUG(Service_CAM, "called, width={}, height={}", width, height); } void Module::Interface::SetTrimming(Kernel::HLERequestContext& ctx) { @@ -517,11 +517,11 @@ void Module::Interface::SetTrimming(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}, trim={}", port_select.m_val, trim); + LOG_DEBUG(Service_CAM, "called, port_select={}, trim={}", port_select.m_val, trim); } void Module::Interface::IsTrimming(Kernel::HLERequestContext& ctx) { @@ -534,12 +534,12 @@ void Module::Interface::IsTrimming(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(cam->ports[port].is_trimming); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.Skip(1, false); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); + LOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); } void Module::Interface::SetTrimmingParams(Kernel::HLERequestContext& ctx) { @@ -560,11 +560,11 @@ void Module::Interface::SetTrimmingParams(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}, x0={}, y0={}, x1={}, y1={}", + LOG_DEBUG(Service_CAM, "called, port_select={}, x0={}, y0={}, x1={}, y1={}", port_select.m_val, x0, y0, x1, y1); } @@ -581,12 +581,12 @@ void Module::Interface::GetTrimmingParams(Kernel::HLERequestContext& ctx) { rb.Push(cam->ports[port].x1); rb.Push(cam->ports[port].y1); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); rb.Skip(4, false); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); + LOG_DEBUG(Service_CAM, "called, port_select={}", port_select.m_val); } void Module::Interface::SetTrimmingParamsCenter(Kernel::HLERequestContext& ctx) { @@ -607,11 +607,11 @@ void Module::Interface::SetTrimmingParamsCenter(Kernel::HLERequestContext& ctx) } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); + LOG_ERROR(Service_CAM, "invalid port_select={}", port_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, port_select={}, trim_w={}, trim_h={}, cam_w={}, cam_h={}", + LOG_DEBUG(Service_CAM, "called, port_select={}, trim_w={}, trim_h={}, cam_w={}, cam_h={}", port_select.m_val, trim_w, trim_h, cam_w, cam_h); } @@ -632,7 +632,7 @@ void Module::Interface::Activate(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else if (camera_select[0] && camera_select[1]) { - NGLOG_ERROR(Service_CAM, "camera 0 and 1 can't be both activated"); + LOG_ERROR(Service_CAM, "camera 0 and 1 can't be both activated"); rb.Push(ERROR_INVALID_ENUM_VALUE); } else { if (camera_select[0]) { @@ -647,11 +647,11 @@ void Module::Interface::Activate(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}", camera_select.m_val); + LOG_ERROR(Service_CAM, "invalid camera_select={}", camera_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, camera_select={}", camera_select.m_val); + LOG_DEBUG(Service_CAM, "called, camera_select={}", camera_select.m_val); } void Module::Interface::SwitchContext(Kernel::HLERequestContext& ctx) { @@ -672,12 +672,12 @@ void Module::Interface::SwitchContext(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, camera_select={}, context_select={}", camera_select.m_val, + LOG_DEBUG(Service_CAM, "called, camera_select={}, context_select={}", camera_select.m_val, context_select.m_val); } @@ -699,12 +699,12 @@ void Module::Interface::FlipImage(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, camera_select={}, flip={}, context_select={}", + LOG_DEBUG(Service_CAM, "called, camera_select={}, flip={}, context_select={}", camera_select.m_val, static_cast(flip), context_select.m_val); } @@ -732,12 +732,12 @@ void Module::Interface::SetDetailSize(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, + LOG_DEBUG(Service_CAM, "called, camera_select={}, width={}, height={}, crop_x0={}, crop_y0={}, " "crop_x1={}, crop_y1={}, context_select={}", camera_select.m_val, resolution.width, resolution.height, resolution.crop_x0, @@ -762,12 +762,12 @@ void Module::Interface::SetSize(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, camera_select={}, size={}, context_select={}", + LOG_DEBUG(Service_CAM, "called, camera_select={}, size={}, context_select={}", camera_select.m_val, size, context_select.m_val); } @@ -784,11 +784,11 @@ void Module::Interface::SetFrameRate(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}", camera_select.m_val); + LOG_ERROR(Service_CAM, "invalid camera_select={}", camera_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_WARNING(Service_CAM, "(STUBBED) called, camera_select={}, frame_rate={}", + LOG_WARNING(Service_CAM, "(STUBBED) called, camera_select={}, frame_rate={}", camera_select.m_val, static_cast(frame_rate)); } @@ -810,12 +810,12 @@ void Module::Interface::SetEffect(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, camera_select={}, effect={}, context_select={}", + LOG_DEBUG(Service_CAM, "called, camera_select={}, effect={}, context_select={}", camera_select.m_val, static_cast(effect), context_select.m_val); } @@ -837,12 +837,12 @@ void Module::Interface::SetOutputFormat(Kernel::HLERequestContext& ctx) { } rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } - NGLOG_DEBUG(Service_CAM, "called, camera_select={}, format={}, context_select={}", + LOG_DEBUG(Service_CAM, "called, camera_select={}, format={}, context_select={}", camera_select.m_val, static_cast(format), context_select.m_val); } @@ -854,7 +854,7 @@ void Module::Interface::SynchronizeVsyncTiming(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_CAM, "(STUBBED) called, camera_select1={}, camera_select2={}", + LOG_WARNING(Service_CAM, "(STUBBED) called, camera_select1={}, camera_select2={}", camera_select1, camera_select2); } @@ -881,7 +881,7 @@ void Module::Interface::GetStereoCameraCalibrationData(Kernel::HLERequestContext rb.Push(RESULT_SUCCESS); rb.PushRaw(data); - NGLOG_TRACE(Service_CAM, "called"); + LOG_TRACE(Service_CAM, "called"); } void Module::Interface::SetPackageParameterWithoutContext(Kernel::HLERequestContext& ctx) { @@ -893,7 +893,7 @@ void Module::Interface::SetPackageParameterWithoutContext(Kernel::HLERequestCont IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_CAM, "(STUBBED) called"); + LOG_WARNING(Service_CAM, "(STUBBED) called"); } template @@ -918,7 +918,7 @@ ResultCode Module::SetPackageParameter(const PackageParameterType& package) { } return RESULT_SUCCESS; } else { - NGLOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", package.camera_select, package.context_select); return ERROR_INVALID_ENUM_VALUE; } @@ -938,7 +938,7 @@ void Module::Interface::SetPackageParameterWithContext(Kernel::HLERequestContext ResultCode result = cam->SetPackageParameter(package); rb.Push(result); - NGLOG_DEBUG(Service_CAM, "called"); + LOG_DEBUG(Service_CAM, "called"); } void Module::Interface::SetPackageParameterWithContextDetail(Kernel::HLERequestContext& ctx) { @@ -951,7 +951,7 @@ void Module::Interface::SetPackageParameterWithContextDetail(Kernel::HLERequestC ResultCode result = cam->SetPackageParameter(package); rb.Push(result); - NGLOG_DEBUG(Service_CAM, "called"); + LOG_DEBUG(Service_CAM, "called"); } void Module::Interface::GetSuitableY2rStandardCoefficient(Kernel::HLERequestContext& ctx) { @@ -960,7 +960,7 @@ void Module::Interface::GetSuitableY2rStandardCoefficient(Kernel::HLERequestCont rb.Push(RESULT_SUCCESS); rb.Push(0); - NGLOG_WARNING(Service_CAM, "(STUBBED) called"); + LOG_WARNING(Service_CAM, "(STUBBED) called"); } void Module::Interface::PlayShutterSound(Kernel::HLERequestContext& ctx) { @@ -970,7 +970,7 @@ void Module::Interface::PlayShutterSound(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_CAM, "(STUBBED) called, sound_id={}", sound_id); + LOG_WARNING(Service_CAM, "(STUBBED) called, sound_id={}", sound_id); } void Module::Interface::DriverInitialize(Kernel::HLERequestContext& ctx) { @@ -998,7 +998,7 @@ void Module::Interface::DriverInitialize(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_CAM, "called"); + LOG_DEBUG(Service_CAM, "called"); } void Module::Interface::DriverFinalize(Kernel::HLERequestContext& ctx) { @@ -1014,7 +1014,7 @@ void Module::Interface::DriverFinalize(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_CAM, "called"); + LOG_DEBUG(Service_CAM, "called"); } Module::Module() { diff --git a/src/core/hle/service/cecd/cecd.cpp b/src/core/hle/service/cecd/cecd.cpp index d91db873a..421006a9e 100644 --- a/src/core/hle/service/cecd/cecd.cpp +++ b/src/core/hle/service/cecd/cecd.cpp @@ -25,7 +25,7 @@ void GetCecStateAbbreviated(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = static_cast(CecStateAbbreviated::CEC_STATE_ABBREV_IDLE); - NGLOG_WARNING(Service_CECD, "(STUBBED) called"); + LOG_WARNING(Service_CECD, "(STUBBED) called"); } void GetCecInfoEventHandle(Service::Interface* self) { @@ -34,7 +34,7 @@ void GetCecInfoEventHandle(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[3] = Kernel::g_handle_table.Create(cecinfo_event).Unwrap(); // Event handle - NGLOG_WARNING(Service_CECD, "(STUBBED) called"); + LOG_WARNING(Service_CECD, "(STUBBED) called"); } void GetChangeStateEventHandle(Service::Interface* self) { @@ -43,7 +43,7 @@ void GetChangeStateEventHandle(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[3] = Kernel::g_handle_table.Create(change_state_event).Unwrap(); // Event handle - NGLOG_WARNING(Service_CECD, "(STUBBED) called"); + LOG_WARNING(Service_CECD, "(STUBBED) called"); } void Init() { diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 0352c985b..9b7278a48 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -131,7 +131,7 @@ void Module::Interface::GetCountryCodeString(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); if (country_code_id >= country_codes.size() || 0 == country_codes[country_code_id]) { - NGLOG_ERROR(Service_CFG, "requested country code id={} is invalid", country_code_id); + LOG_ERROR(Service_CFG, "requested country code id={} is invalid", country_code_id); rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent)); rb.Skip(1, false); @@ -160,7 +160,7 @@ void Module::Interface::GetCountryCodeID(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); if (0 == country_code_id) { - NGLOG_ERROR(Service_CFG, "requested country code name={}{} is invalid", + LOG_ERROR(Service_CFG, "requested country code name={}{} is invalid", static_cast(country_code & 0xff), static_cast(country_code >> 8)); rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent)); @@ -210,7 +210,7 @@ void Module::Interface::GenHashConsoleUnique(Kernel::HLERequestContext& ctx) { rb.Push(0); } - NGLOG_DEBUG(Service_CFG, "called app_id_salt=0x{:X}", app_id_salt); + LOG_DEBUG(Service_CFG, "called app_id_salt=0x{:X}", app_id_salt); } void Module::Interface::GetRegionCanadaUSA(Kernel::HLERequestContext& ctx) { @@ -309,21 +309,21 @@ ResultVal Module::GetConfigInfoBlockPointer(u32 block_id, u32 size, u32 f [&](const SaveConfigBlockEntry& entry) { return entry.block_id == block_id; }); if (itr == std::end(config->block_entries)) { - NGLOG_ERROR(Service_CFG, "Config block 0x{:X} with flags {} and size {} was not found", + LOG_ERROR(Service_CFG, "Config block 0x{:X} with flags {} and size {} was not found", block_id, flag, size); return ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); } if ((itr->flags & flag) == 0) { - NGLOG_ERROR(Service_CFG, "Invalid flag {} for config block 0x{:X} with size {}", flag, + LOG_ERROR(Service_CFG, "Invalid flag {} for config block 0x{:X} with size {}", flag, block_id, size); return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); } if (itr->size != size) { - NGLOG_ERROR(Service_CFG, "Invalid size {} for config block 0x{:X} with flags {}", size, + LOG_ERROR(Service_CFG, "Invalid size {} for config block 0x{:X} with flags {}", size, block_id, flag); return ResultCode(ErrorDescription::InvalidSize, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); @@ -599,14 +599,14 @@ static SystemLanguage AdjustLanguageInfoBlock(u32 region, SystemLanguage languag void Module::SetPreferredRegionCode(u32 region_code) { preferred_region_code = region_code; - NGLOG_INFO(Service_CFG, "Preferred region code set to {}", preferred_region_code); + LOG_INFO(Service_CFG, "Preferred region code set to {}", preferred_region_code); if (Settings::values.region_value == Settings::REGION_VALUE_AUTO_SELECT) { const SystemLanguage current_language = GetSystemLanguage(); const SystemLanguage adjusted_language = AdjustLanguageInfoBlock(region_code, current_language); if (current_language != adjusted_language) { - NGLOG_WARNING(Service_CFG, "System language {} does not fit the region. Adjusted to {}", + LOG_WARNING(Service_CFG, "System language {} does not fit the region. Adjusted to {}", static_cast(current_language), static_cast(adjusted_language)); SetSystemLanguage(adjusted_language); } diff --git a/src/core/hle/service/csnd_snd.cpp b/src/core/hle/service/csnd_snd.cpp index b409a7f45..df5a33d7c 100644 --- a/src/core/hle/service/csnd_snd.cpp +++ b/src/core/hle/service/csnd_snd.cpp @@ -54,7 +54,7 @@ static void Initialize(Interface* self) { cmd_buff[3] = Kernel::g_handle_table.Create(mutex).Unwrap(); cmd_buff[4] = Kernel::g_handle_table.Create(shared_memory).Unwrap(); - NGLOG_WARNING(Service_CSND, "(STUBBED) called"); + LOG_WARNING(Service_CSND, "(STUBBED) called"); } /** @@ -71,7 +71,7 @@ static void Shutdown(Interface* self) { mutex = nullptr; cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_CSND, "(STUBBED) called"); + LOG_WARNING(Service_CSND, "(STUBBED) called"); } /** @@ -88,7 +88,7 @@ static void ExecuteCommands(Interface* self) { if (shared_memory == nullptr) { cmd_buff[1] = 1; - NGLOG_ERROR(Service_CSND, "called, shared memory not allocated"); + LOG_ERROR(Service_CSND, "called, shared memory not allocated"); return; } @@ -102,7 +102,7 @@ static void ExecuteCommands(Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; - NGLOG_WARNING(Service_CSND, "(STUBBED) called, addr=0x{:08X}", addr); + LOG_WARNING(Service_CSND, "(STUBBED) called, addr=0x{:08X}", addr); } /** @@ -117,7 +117,7 @@ static void AcquireSoundChannels(Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 0xFFFFFF00; - NGLOG_WARNING(Service_CSND, "(STUBBED) called"); + LOG_WARNING(Service_CSND, "(STUBBED) called"); } const Interface::FunctionInfo FunctionTable[] = { diff --git a/src/core/hle/service/dlp/dlp_srvr.cpp b/src/core/hle/service/dlp/dlp_srvr.cpp index 514585df4..1bcea43d3 100644 --- a/src/core/hle/service/dlp/dlp_srvr.cpp +++ b/src/core/hle/service/dlp/dlp_srvr.cpp @@ -17,7 +17,7 @@ static void IsChild(Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 0; - NGLOG_WARNING(Service_DLP, "(STUBBED) called"); + LOG_WARNING(Service_DLP, "(STUBBED) called"); } const Interface::FunctionInfo FunctionTable[] = { diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index 7557ef991..53e59d5d7 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -109,7 +109,7 @@ static void ConvertProcessAddressFromDspDram(Service::Interface* self) { // always zero). cmd_buff[2] = (addr << 1) + (Memory::DSP_RAM_VADDR + 0x40000); - NGLOG_DEBUG(Service_DSP, "addr=0x{:08X}", addr); + LOG_DEBUG(Service_DSP, "addr=0x{:08X}", addr); } /** @@ -146,14 +146,14 @@ static void LoadComponent(Service::Interface* self) { std::vector component_data(size); Memory::ReadBlock(buffer, component_data.data(), component_data.size()); - NGLOG_INFO(Service_DSP, "Firmware hash: {:#018x}", + LOG_INFO(Service_DSP, "Firmware hash: {:#018x}", Common::ComputeHash64(component_data.data(), component_data.size())); // Some versions of the firmware have the location of DSP structures listed here. if (size > 0x37C) { - NGLOG_INFO(Service_DSP, "Structures hash: {:#018x}", + LOG_INFO(Service_DSP, "Structures hash: {:#018x}", Common::ComputeHash64(component_data.data() + 0x340, 60)); } - NGLOG_WARNING( + LOG_WARNING( Service_DSP, "(STUBBED) called size=0x{:X}, prog_mask=0x{:08X}, data_mask=0x{:08X}, buffer=0x{:08X}", size, prog_mask, data_mask, buffer); @@ -173,7 +173,7 @@ static void GetSemaphoreEventHandle(Service::Interface* self) { // cmd_buff[2] not set cmd_buff[3] = Kernel::g_handle_table.Create(semaphore_event).Unwrap(); // Event handle - NGLOG_WARNING(Service_DSP, "(STUBBED) called"); + LOG_WARNING(Service_DSP, "(STUBBED) called"); } /** @@ -198,7 +198,7 @@ static void FlushDataCache(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x13, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - NGLOG_TRACE(Service_DSP, "called address=0x{:08X}, size=0x{:X}, process=0x{:08X}", address, + LOG_TRACE(Service_DSP, "called address=0x{:08X}, size=0x{:X}, process=0x{:08X}", address, size, process); } @@ -230,13 +230,13 @@ static void RegisterInterruptEvents(Service::Interface* self) { auto evt = Kernel::g_handle_table.Get(cmd_buff[4]); if (!evt) { - NGLOG_INFO(Service_DSP, "Invalid event handle! type={}, pipe={}, event_handle=0x{:08X}", + LOG_INFO(Service_DSP, "Invalid event handle! type={}, pipe={}, event_handle=0x{:08X}", type_index, pipe_index, event_handle); ASSERT(false); // TODO: This should really be handled at an IPC translation layer. } if (interrupt_events.HasTooManyEventsRegistered()) { - NGLOG_INFO(Service_DSP, + LOG_INFO(Service_DSP, "Ran out of space to register interrupts (Attempted to register " "type={}, pipe={}, event_handle=0x{:08X})", type_index, pipe_index, event_handle); @@ -247,12 +247,12 @@ static void RegisterInterruptEvents(Service::Interface* self) { } interrupt_events.Get(type, pipe) = evt; - NGLOG_INFO(Service_DSP, "Registered type={}, pipe={}, event_handle=0x{:08X}", type_index, + LOG_INFO(Service_DSP, "Registered type={}, pipe={}, event_handle=0x{:08X}", type_index, pipe_index, event_handle); cmd_buff[1] = RESULT_SUCCESS.raw; } else { interrupt_events.Get(type, pipe) = nullptr; - NGLOG_INFO(Service_DSP, "Unregistered interrupt={}, channel={}, event_handle=0x{:08X}", + LOG_INFO(Service_DSP, "Unregistered interrupt={}, channel={}, event_handle=0x{:08X}", type_index, pipe_index, event_handle); cmd_buff[1] = RESULT_SUCCESS.raw; } @@ -271,7 +271,7 @@ static void SetSemaphore(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x7, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - NGLOG_WARNING(Service_DSP, "(STUBBED) called"); + LOG_WARNING(Service_DSP, "(STUBBED) called"); } /** @@ -295,7 +295,7 @@ static void WriteProcessPipe(Service::Interface* self) { AudioCore::DspPipe pipe = static_cast(pipe_index); if (IPC::StaticBufferDesc(size, 1) != cmd_buff[3]) { - NGLOG_ERROR(Service_DSP, + LOG_ERROR(Service_DSP, "IPC static buffer descriptor failed validation (0x{:X}). pipe={}, " "size=0x{:X}, buffer=0x{:08X}", cmd_buff[3], pipe_index, size, buffer); @@ -335,7 +335,7 @@ static void WriteProcessPipe(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0xD, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - NGLOG_DEBUG(Service_DSP, "pipe={}, size=0x{:X}, buffer=0x{:08X}", pipe_index, size, buffer); + LOG_DEBUG(Service_DSP, "pipe={}, size=0x{:X}, buffer=0x{:08X}", pipe_index, size, buffer); } /** @@ -380,7 +380,7 @@ static void ReadPipeIfPossible(Service::Interface* self) { cmd_buff[3] = IPC::StaticBufferDesc(size, 0); cmd_buff[4] = addr; - NGLOG_DEBUG( + LOG_DEBUG( Service_DSP, "pipe={}, unknown=0x{:08X}, size=0x{:X}, buffer=0x{:08X}, return cmd_buff[2]=0x{:08X}", pipe_index, unknown, size, addr, cmd_buff[2]); @@ -426,7 +426,7 @@ static void ReadPipe(Service::Interface* self) { UNREACHABLE(); } - NGLOG_DEBUG( + LOG_DEBUG( Service_DSP, "pipe={}, unknown=0x{:08X}, size=0x{:X}, buffer=0x{:08X}, return cmd_buff[2]=0x{:08X}", pipe_index, unknown, size, addr, cmd_buff[2]); @@ -453,7 +453,7 @@ static void GetPipeReadableSize(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = static_cast(Core::DSP().GetPipeReadableSize(pipe)); - NGLOG_DEBUG(Service_DSP, "pipe={}, unknown=0x{:08X}, return cmd_buff[2]=0x{:08X}", pipe_index, + LOG_DEBUG(Service_DSP, "pipe={}, unknown=0x{:08X}, return cmd_buff[2]=0x{:08X}", pipe_index, unknown, cmd_buff[2]); } @@ -472,7 +472,7 @@ static void SetSemaphoreMask(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x17, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - NGLOG_WARNING(Service_DSP, "(STUBBED) called mask=0x{:08X}", mask); + LOG_WARNING(Service_DSP, "(STUBBED) called mask=0x{:08X}", mask); } /** @@ -491,7 +491,7 @@ static void GetHeadphoneStatus(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = 0; // Not using headphones - NGLOG_DEBUG(Service_DSP, "called"); + LOG_DEBUG(Service_DSP, "called"); } /** @@ -530,7 +530,7 @@ static void RecvData(Service::Interface* self) { break; } - NGLOG_DEBUG(Service_DSP, "register_number={}", register_number); + LOG_DEBUG(Service_DSP, "register_number={}", register_number); } /** @@ -555,7 +555,7 @@ static void RecvDataIsReady(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 1; // Ready to read - NGLOG_DEBUG(Service_DSP, "register_number={}", register_number); + LOG_DEBUG(Service_DSP, "register_number={}", register_number); } const Interface::FunctionInfo FunctionTable[] = { diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index 4a6b37965..51348d261 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -132,29 +132,29 @@ static std::string GetCurrentSystemTime() { } static void LogGenericInfo(const ErrInfo::ErrInfoCommon& errinfo_common) { - NGLOG_CRITICAL(Service_ERR, "PID: 0x{:08X}", errinfo_common.pid); - NGLOG_CRITICAL(Service_ERR, "REV: 0x{:08X}_0x{:08X}", errinfo_common.rev_high, + LOG_CRITICAL(Service_ERR, "PID: 0x{:08X}", errinfo_common.pid); + LOG_CRITICAL(Service_ERR, "REV: 0x{:08X}_0x{:08X}", errinfo_common.rev_high, errinfo_common.rev_low); - NGLOG_CRITICAL(Service_ERR, "TID: 0x{:08X}_0x{:08X}", errinfo_common.title_id_high, + LOG_CRITICAL(Service_ERR, "TID: 0x{:08X}_0x{:08X}", errinfo_common.title_id_high, errinfo_common.title_id_low); - NGLOG_CRITICAL(Service_ERR, "AID: 0x{:08X}_0x{:08X}", errinfo_common.app_title_id_high, + LOG_CRITICAL(Service_ERR, "AID: 0x{:08X}_0x{:08X}", errinfo_common.app_title_id_high, errinfo_common.app_title_id_low); - NGLOG_CRITICAL(Service_ERR, "ADR: 0x{:08X}", errinfo_common.pc_address); + LOG_CRITICAL(Service_ERR, "ADR: 0x{:08X}", errinfo_common.pc_address); ResultCode result_code{errinfo_common.result_code}; - NGLOG_CRITICAL(Service_ERR, "RSL: 0x{:08X}", result_code.raw); - NGLOG_CRITICAL(Service_ERR, " Level: {}", static_cast(result_code.level.Value())); - NGLOG_CRITICAL(Service_ERR, " Summary: {}", static_cast(result_code.summary.Value())); - NGLOG_CRITICAL(Service_ERR, " Module: {}", static_cast(result_code.module.Value())); - NGLOG_CRITICAL(Service_ERR, " Desc: {}", static_cast(result_code.description.Value())); + LOG_CRITICAL(Service_ERR, "RSL: 0x{:08X}", result_code.raw); + LOG_CRITICAL(Service_ERR, " Level: {}", static_cast(result_code.level.Value())); + LOG_CRITICAL(Service_ERR, " Summary: {}", static_cast(result_code.summary.Value())); + LOG_CRITICAL(Service_ERR, " Module: {}", static_cast(result_code.module.Value())); + LOG_CRITICAL(Service_ERR, " Desc: {}", static_cast(result_code.description.Value())); } void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 1, 32, 0); - NGLOG_CRITICAL(Service_ERR, "Fatal error"); + LOG_CRITICAL(Service_ERR, "Fatal error"); const ErrInfo errinfo = rp.PopRaw(); - NGLOG_CRITICAL(Service_ERR, "Fatal error type: {}", + LOG_CRITICAL(Service_ERR, "Fatal error type: {}", GetErrType(errinfo.errinfo_common.specifier)); Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorUnknown); @@ -166,56 +166,56 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) { case FatalErrType::Corrupted: case FatalErrType::CardRemoved: case FatalErrType::Logged: { - NGLOG_CRITICAL(Service_ERR, "Datetime: {}", GetCurrentSystemTime()); + LOG_CRITICAL(Service_ERR, "Datetime: {}", GetCurrentSystemTime()); break; } case FatalErrType::Exception: { const auto& errtype = errinfo.exception; // Register Info - NGLOG_CRITICAL(Service_ERR, "ARM Registers:"); + LOG_CRITICAL(Service_ERR, "ARM Registers:"); for (u32 index = 0; index < errtype.exception_data.exception_context.arm_regs.size(); ++index) { if (index < 13) { - NGLOG_DEBUG(Service_ERR, "r{}=0x{:08X}", index, + LOG_DEBUG(Service_ERR, "r{}=0x{:08X}", index, errtype.exception_data.exception_context.arm_regs.at(index)); } else if (index == 13) { - NGLOG_CRITICAL(Service_ERR, "SP=0x{:08X}", + LOG_CRITICAL(Service_ERR, "SP=0x{:08X}", errtype.exception_data.exception_context.arm_regs.at(index)); } else if (index == 14) { - NGLOG_CRITICAL(Service_ERR, "LR=0x{:08X}", + LOG_CRITICAL(Service_ERR, "LR=0x{:08X}", errtype.exception_data.exception_context.arm_regs.at(index)); } else if (index == 15) { - NGLOG_CRITICAL(Service_ERR, "PC=0x{:08X}", + LOG_CRITICAL(Service_ERR, "PC=0x{:08X}", errtype.exception_data.exception_context.arm_regs.at(index)); } } - NGLOG_CRITICAL(Service_ERR, "CPSR=0x{:08X}", errtype.exception_data.exception_context.cpsr); + LOG_CRITICAL(Service_ERR, "CPSR=0x{:08X}", errtype.exception_data.exception_context.cpsr); // Exception Info - NGLOG_CRITICAL(Service_ERR, "EXCEPTION TYPE: {}", + LOG_CRITICAL(Service_ERR, "EXCEPTION TYPE: {}", GetExceptionType(errtype.exception_data.exception_info.exception_type)); switch (static_cast(errtype.exception_data.exception_info.exception_type)) { case ExceptionType::PrefetchAbort: - NGLOG_CRITICAL(Service_ERR, "IFSR: 0x{:08X}", errtype.exception_data.exception_info.sr); - NGLOG_CRITICAL(Service_ERR, "r15: 0x{:08X}", errtype.exception_data.exception_info.ar); + LOG_CRITICAL(Service_ERR, "IFSR: 0x{:08X}", errtype.exception_data.exception_info.sr); + LOG_CRITICAL(Service_ERR, "r15: 0x{:08X}", errtype.exception_data.exception_info.ar); break; case ExceptionType::DataAbort: - NGLOG_CRITICAL(Service_ERR, "DFSR: 0x{:08X}", errtype.exception_data.exception_info.sr); - NGLOG_CRITICAL(Service_ERR, "DFAR: 0x{:08X}", errtype.exception_data.exception_info.ar); + LOG_CRITICAL(Service_ERR, "DFSR: 0x{:08X}", errtype.exception_data.exception_info.sr); + LOG_CRITICAL(Service_ERR, "DFAR: 0x{:08X}", errtype.exception_data.exception_info.ar); break; case ExceptionType::VectorFP: - NGLOG_CRITICAL(Service_ERR, "FPEXC: 0x{:08X}", + LOG_CRITICAL(Service_ERR, "FPEXC: 0x{:08X}", errtype.exception_data.exception_info.fpinst); - NGLOG_CRITICAL(Service_ERR, "FINST: 0x{:08X}", + LOG_CRITICAL(Service_ERR, "FINST: 0x{:08X}", errtype.exception_data.exception_info.fpinst); - NGLOG_CRITICAL(Service_ERR, "FINST2: 0x{:08X}", + LOG_CRITICAL(Service_ERR, "FINST2: 0x{:08X}", errtype.exception_data.exception_info.fpinst2); break; case ExceptionType::Undefined: break; // Not logging exception_info for this case } - NGLOG_CRITICAL(Service_ERR, "Datetime: {}", GetCurrentSystemTime()); + LOG_CRITICAL(Service_ERR, "Datetime: {}", GetCurrentSystemTime()); break; } @@ -223,8 +223,8 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) { const auto& errtype = errinfo.result_failure; // Failure Message - NGLOG_CRITICAL(Service_ERR, "Failure Message: {}", errtype.message); - NGLOG_CRITICAL(Service_ERR, "Datetime: {}", GetCurrentSystemTime()); + LOG_CRITICAL(Service_ERR, "Failure Message: {}", errtype.message); + LOG_CRITICAL(Service_ERR, "Datetime: {}", GetCurrentSystemTime()); break; } diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp index d645ffb9c..04bb16e41 100644 --- a/src/core/hle/service/frd/frd.cpp +++ b/src/core/hle/service/frd/frd.cpp @@ -31,7 +31,7 @@ void Module::Interface::GetMyPresence(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushStaticBuffer(buffer, 0); - NGLOG_WARNING(Service_FRD, "(STUBBED) called"); + LOG_WARNING(Service_FRD, "(STUBBED) called"); } void Module::Interface::GetFriendKeyList(Kernel::HLERequestContext& ctx) { @@ -46,7 +46,7 @@ void Module::Interface::GetFriendKeyList(Kernel::HLERequestContext& ctx) { rb.Push(0); // 0 friends rb.PushStaticBuffer(buffer, 0); - NGLOG_WARNING(Service_FRD, "(STUBBED) called, unknown={}, frd_count={}", unknown, frd_count); + LOG_WARNING(Service_FRD, "(STUBBED) called, unknown={}, frd_count={}", unknown, frd_count); } void Module::Interface::GetFriendProfile(Kernel::HLERequestContext& ctx) { @@ -61,7 +61,7 @@ void Module::Interface::GetFriendProfile(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushStaticBuffer(buffer, 0); - NGLOG_WARNING(Service_FRD, "(STUBBED) called, count={}", count); + LOG_WARNING(Service_FRD, "(STUBBED) called, count={}", count); } void Module::Interface::GetFriendAttributeFlags(Kernel::HLERequestContext& ctx) { @@ -76,7 +76,7 @@ void Module::Interface::GetFriendAttributeFlags(Kernel::HLERequestContext& ctx) rb.Push(RESULT_SUCCESS); rb.PushStaticBuffer(buffer, 0); - NGLOG_WARNING(Service_FRD, "(STUBBED) called, count={}", count); + LOG_WARNING(Service_FRD, "(STUBBED) called, count={}", count); } void Module::Interface::GetMyFriendKey(Kernel::HLERequestContext& ctx) { @@ -85,7 +85,7 @@ void Module::Interface::GetMyFriendKey(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushRaw(frd->my_friend_key); - NGLOG_WARNING(Service_FRD, "(STUBBED) called"); + LOG_WARNING(Service_FRD, "(STUBBED) called"); } void Module::Interface::GetMyScreenName(Kernel::HLERequestContext& ctx) { @@ -102,7 +102,7 @@ void Module::Interface::GetMyScreenName(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushRaw(screen_name); - NGLOG_WARNING(Service_FRD, "(STUBBED) called"); + LOG_WARNING(Service_FRD, "(STUBBED) called"); } void Module::Interface::UnscrambleLocalFriendCode(Kernel::HLERequestContext& ctx) { @@ -130,7 +130,7 @@ void Module::Interface::UnscrambleLocalFriendCode(Kernel::HLERequestContext& ctx // scambled_friend_code[5]; unscrambled_friend_code[3] = scambled_friend_code[3] ^ // scambled_friend_code[5]; - NGLOG_WARNING(Service_FRD, "(STUBBED) called"); + LOG_WARNING(Service_FRD, "(STUBBED) called"); IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushStaticBuffer(unscrambled_friend_codes, 0); @@ -144,7 +144,7 @@ void Module::Interface::SetClientSdkVersion(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_FRD, "(STUBBED) called, version: 0x{:08X}", version); + LOG_WARNING(Service_FRD, "(STUBBED) called, version: 0x{:08X}", version); } Module::Module() = default; diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 20f26968e..af8400087 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -73,12 +73,12 @@ void File::Read(Kernel::HLERequestContext& ctx) { u64 offset = rp.Pop(); u32 length = rp.Pop(); auto& buffer = rp.PopMappedBuffer(); - NGLOG_TRACE(Service_FS, "Read {}: offset=0x{:x} length=0x{:08X}", GetName(), offset, length); + LOG_TRACE(Service_FS, "Read {}: offset=0x{:x} length=0x{:08X}", GetName(), offset, length); const FileSessionSlot* file = GetSessionData(ctx.Session()); if (file->subfile && length > file->size) { - NGLOG_WARNING(Service_FS, "Trying to read beyond the subfile size, truncating"); + LOG_WARNING(Service_FS, "Trying to read beyond the subfile size, truncating"); length = file->size; } @@ -86,7 +86,7 @@ void File::Read(Kernel::HLERequestContext& ctx) { offset += file->offset; if (offset + length > backend->GetSize()) { - NGLOG_ERROR(Service_FS, + LOG_ERROR(Service_FS, "Reading from out of bounds offset=0x{:x} length=0x{:08X} file_size=0x{:x}", offset, length, backend->GetSize()); } @@ -119,7 +119,7 @@ void File::Write(Kernel::HLERequestContext& ctx) { u32 length = rp.Pop(); u32 flush = rp.Pop(); auto& buffer = rp.PopMappedBuffer(); - NGLOG_TRACE(Service_FS, "Write {}: offset=0x{:x} length={}, flush=0x{:x}", GetName(), offset, + LOG_TRACE(Service_FS, "Write {}: offset=0x{:x} length={}, flush=0x{:x}", GetName(), offset, length, flush); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); @@ -181,7 +181,7 @@ void File::Close(Kernel::HLERequestContext& ctx) { // TODO(Subv): Only close the backend if this client is the only one left. if (connected_sessions.size() > 1) - NGLOG_WARNING(Service_FS, "Closing File backend but {} clients still connected", + LOG_WARNING(Service_FS, "Closing File backend but {} clients still connected", connected_sessions.size()); backend->Close(); @@ -226,7 +226,7 @@ void File::GetPriority(Kernel::HLERequestContext& ctx) { } void File::OpenLinkFile(Kernel::HLERequestContext& ctx) { - NGLOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile {}", GetName()); + LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile {}", GetName()); using Kernel::ClientSession; using Kernel::ServerSession; using Kernel::SharedPtr; @@ -327,7 +327,7 @@ void Directory::Read(Kernel::HLERequestContext& ctx) { u32 count = rp.Pop(); auto& buffer = rp.PopMappedBuffer(); std::vector entries(count); - NGLOG_TRACE(Service_FS, "Read {}: count={}", GetName(), count); + LOG_TRACE(Service_FS, "Read {}: count={}", GetName(), count); // Number of entries actually read u32 read = backend->Read(static_cast(entries.size()), entries.data()); buffer.Write(entries.data(), 0, read * sizeof(FileSys::Entry)); @@ -340,7 +340,7 @@ void Directory::Read(Kernel::HLERequestContext& ctx) { void Directory::Close(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x0802, 0, 0); - NGLOG_TRACE(Service_FS, "Close {}", GetName()); + LOG_TRACE(Service_FS, "Close {}", GetName()); backend->Close(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -370,7 +370,7 @@ static ArchiveBackend* GetArchive(ArchiveHandle handle) { } ResultVal OpenArchive(ArchiveIdCode id_code, FileSys::Path& archive_path) { - NGLOG_TRACE(Service_FS, "Opening archive with id code 0x{:08X}", static_cast(id_code)); + LOG_TRACE(Service_FS, "Opening archive with id code 0x{:08X}", static_cast(id_code)); auto itr = id_code_map.find(id_code); if (itr == id_code_map.end()) { @@ -404,7 +404,7 @@ ResultCode RegisterArchiveType(std::unique_ptr&& factor ASSERT_MSG(inserted, "Tried to register more than one archive with same id code"); auto& archive = result.first->second; - NGLOG_DEBUG(Service_FS, "Registered archive {} with id code 0x{:08X}", archive->GetName(), + LOG_DEBUG(Service_FS, "Registered archive {} with id code 0x{:08X}", archive->GetName(), static_cast(id_code)); return RESULT_SUCCESS; } @@ -576,7 +576,7 @@ ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) { } else if (media_type == MediaType::SDMC) { media_type_directory = FileUtil::GetUserPath(D_SDMC_IDX); } else { - NGLOG_ERROR(Service_FS, "Unsupported media type {}", static_cast(media_type)); + LOG_ERROR(Service_FS, "Unsupported media type {}", static_cast(media_type)); return ResultCode(-1); // TODO(Subv): Find the right error code } @@ -623,13 +623,13 @@ void RegisterArchiveTypes() { if (sdmc_factory->Initialize()) RegisterArchiveType(std::move(sdmc_factory), ArchiveIdCode::SDMC); else - NGLOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path {}", sdmc_directory); + LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path {}", sdmc_directory); auto sdmcwo_factory = std::make_unique(sdmc_directory); if (sdmcwo_factory->Initialize()) RegisterArchiveType(std::move(sdmcwo_factory), ArchiveIdCode::SDMCWriteOnly); else - NGLOG_ERROR(Service_FS, "Can't instantiate SDMCWriteOnly archive with path {}", + LOG_ERROR(Service_FS, "Can't instantiate SDMCWriteOnly archive with path {}", sdmc_directory); // Create the SaveData archive @@ -650,7 +650,7 @@ void RegisterArchiveTypes() { if (extsavedata_factory->Initialize()) RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData); else - NGLOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path {}", + LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path {}", extsavedata_factory->GetMountPoint()); auto sharedextsavedata_factory = @@ -658,7 +658,7 @@ void RegisterArchiveTypes() { if (sharedextsavedata_factory->Initialize()) RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData); else - NGLOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path {}", + LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path {}", sharedextsavedata_factory->GetMountPoint()); // Create the NCCH archive, basically a small variation of the RomFS archive @@ -676,7 +676,7 @@ void RegisterArchiveTypes() { void RegisterSelfNCCH(Loader::AppLoader& app_loader) { auto itr = id_code_map.find(ArchiveIdCode::SelfNCCH); if (itr == id_code_map.end()) { - NGLOG_ERROR( + LOG_ERROR( Service_FS, "Could not register a new NCCH because the SelfNCCH archive hasn't been created"); return; diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index bc5fafc2e..1b48685fc 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -54,7 +54,7 @@ void FS_USER::OpenFile(Kernel::HLERequestContext& ctx) { ASSERT(filename.size() == filename_size); FileSys::Path file_path(filename_type, filename); - NGLOG_DEBUG(Service_FS, "path={}, mode={} attrs={}", file_path.DebugStr(), mode.hex, + LOG_DEBUG(Service_FS, "path={}, mode={} attrs={}", file_path.DebugStr(), mode.hex, attributes); ResultVal> file_res = @@ -66,7 +66,7 @@ void FS_USER::OpenFile(Kernel::HLERequestContext& ctx) { rb.PushMoveObjects(file->Connect()); } else { rb.PushMoveObjects(nullptr); - NGLOG_ERROR(Service_FS, "failed to get a handle for file {}", file_path.DebugStr()); + LOG_ERROR(Service_FS, "failed to get a handle for file {}", file_path.DebugStr()); } } @@ -88,7 +88,7 @@ void FS_USER::OpenFileDirectly(Kernel::HLERequestContext& ctx) { FileSys::Path archive_path(archivename_type, archivename); FileSys::Path file_path(filename_type, filename); - NGLOG_DEBUG(Service_FS, + LOG_DEBUG(Service_FS, "archive_id=0x{:08X} archive_path={} file_path={}, mode={} attributes={}", static_cast(archive_id), archive_path.DebugStr(), file_path.DebugStr(), mode.hex, attributes); @@ -97,7 +97,7 @@ void FS_USER::OpenFileDirectly(Kernel::HLERequestContext& ctx) { ResultVal archive_handle = Service::FS::OpenArchive(archive_id, archive_path); if (archive_handle.Failed()) { - NGLOG_ERROR(Service_FS, + LOG_ERROR(Service_FS, "Failed to get a handle for archive archive_id=0x{:08X} archive_path={}", static_cast(archive_id), archive_path.DebugStr()); rb.Push(archive_handle.Code()); @@ -114,7 +114,7 @@ void FS_USER::OpenFileDirectly(Kernel::HLERequestContext& ctx) { rb.PushMoveObjects(file->Connect()); } else { rb.PushMoveObjects(nullptr); - NGLOG_ERROR(Service_FS, "failed to get a handle for file {} mode={} attributes={}", + LOG_ERROR(Service_FS, "failed to get a handle for file {} mode={} attributes={}", file_path.DebugStr(), mode.hex, attributes); } } @@ -130,7 +130,7 @@ void FS_USER::DeleteFile(Kernel::HLERequestContext& ctx) { FileSys::Path file_path(filename_type, filename); - NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(filename_type), + LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(filename_type), filename_size, file_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -155,7 +155,7 @@ void FS_USER::RenameFile(Kernel::HLERequestContext& ctx) { FileSys::Path src_file_path(src_filename_type, src_filename); FileSys::Path dest_file_path(dest_filename_type, dest_filename); - NGLOG_DEBUG( + LOG_DEBUG( Service_FS, "src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}", static_cast(src_filename_type), src_filename_size, src_file_path.DebugStr(), static_cast(dest_filename_type), dest_filename_size, dest_file_path.DebugStr()); @@ -177,7 +177,7 @@ void FS_USER::DeleteDirectory(Kernel::HLERequestContext& ctx) { FileSys::Path dir_path(dirname_type, dirname); - NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, + LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -196,7 +196,7 @@ void FS_USER::DeleteDirectoryRecursively(Kernel::HLERequestContext& ctx) { FileSys::Path dir_path(dirname_type, dirname); - NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, + LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -217,7 +217,7 @@ void FS_USER::CreateFile(Kernel::HLERequestContext& ctx) { FileSys::Path file_path(filename_type, filename); - NGLOG_DEBUG(Service_FS, "type={} attributes={} size={:x} data={}", + LOG_DEBUG(Service_FS, "type={} attributes={} size={:x} data={}", static_cast(filename_type), attributes, file_size, file_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -235,7 +235,7 @@ void FS_USER::CreateDirectory(Kernel::HLERequestContext& ctx) { ASSERT(dirname.size() == dirname_size); FileSys::Path dir_path(dirname_type, dirname); - NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, + LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -259,7 +259,7 @@ void FS_USER::RenameDirectory(Kernel::HLERequestContext& ctx) { FileSys::Path src_dir_path(src_dirname_type, src_dirname); FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname); - NGLOG_DEBUG(Service_FS, + LOG_DEBUG(Service_FS, "src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}", static_cast(src_dirname_type), src_dirname_size, src_dir_path.DebugStr(), static_cast(dest_dirname_type), dest_dirname_size, dest_dir_path.DebugStr()); @@ -279,7 +279,7 @@ void FS_USER::OpenDirectory(Kernel::HLERequestContext& ctx) { FileSys::Path dir_path(dirname_type, dirname); - NGLOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, + LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); @@ -292,7 +292,7 @@ void FS_USER::OpenDirectory(Kernel::HLERequestContext& ctx) { directory->ClientConnected(std::get>(sessions)); rb.PushMoveObjects(std::get>(sessions)); } else { - NGLOG_ERROR(Service_FS, "failed to get a handle for directory type={} size={} data={}", + LOG_ERROR(Service_FS, "failed to get a handle for directory type={} size={} data={}", static_cast(dirname_type), dirname_size, dir_path.DebugStr()); rb.PushMoveObjects(nullptr); } @@ -307,7 +307,7 @@ void FS_USER::OpenArchive(Kernel::HLERequestContext& ctx) { ASSERT(archivename.size() == archivename_size); FileSys::Path archive_path(archivename_type, archivename); - NGLOG_DEBUG(Service_FS, "archive_id=0x{:08X} archive_path={}", static_cast(archive_id), + LOG_DEBUG(Service_FS, "archive_id=0x{:08X} archive_path={}", static_cast(archive_id), archive_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(3, 0); @@ -317,7 +317,7 @@ void FS_USER::OpenArchive(Kernel::HLERequestContext& ctx) { rb.PushRaw(*handle); } else { rb.Push(0); - NGLOG_ERROR(Service_FS, + LOG_ERROR(Service_FS, "failed to get a handle for archive archive_id=0x{:08X} archive_path={}", static_cast(archive_id), archive_path.DebugStr()); } @@ -344,11 +344,11 @@ void FS_USER::IsSdmcWriteable(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // If the SD isn't enabled, it can't be writeable...else, stubbed true rb.Push(Settings::values.use_virtual_sd); - NGLOG_DEBUG(Service_FS, " (STUBBED)"); + LOG_DEBUG(Service_FS, " (STUBBED)"); } void FS_USER::FormatSaveData(Kernel::HLERequestContext& ctx) { - NGLOG_WARNING(Service_FS, "(STUBBED)"); + LOG_WARNING(Service_FS, "(STUBBED)"); IPC::RequestParser rp(ctx, 0x84C, 9, 2); auto archive_id = rp.PopEnum(); @@ -364,11 +364,11 @@ void FS_USER::FormatSaveData(Kernel::HLERequestContext& ctx) { ASSERT(archivename.size() == archivename_size); FileSys::Path archive_path(archivename_type, archivename); - NGLOG_DEBUG(Service_FS, "archive_path={}", archive_path.DebugStr()); + LOG_DEBUG(Service_FS, "archive_path={}", archive_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); if (archive_id != FS::ArchiveIdCode::SaveData) { - NGLOG_ERROR(Service_FS, "tried to format an archive different than SaveData, {}", + LOG_ERROR(Service_FS, "tried to format an archive different than SaveData, {}", static_cast(archive_id)); rb.Push(FileSys::ERROR_INVALID_PATH); return; @@ -376,7 +376,7 @@ void FS_USER::FormatSaveData(Kernel::HLERequestContext& ctx) { if (archive_path.GetType() != FileSys::LowPathType::Empty) { // TODO(Subv): Implement formatting the SaveData of other games - NGLOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported"); + LOG_ERROR(Service_FS, "archive LowPath type other than empty is currently unsupported"); rb.Push(UnimplementedFunction(ErrorModule::FS)); return; } @@ -408,7 +408,7 @@ void FS_USER::FormatThisUserSaveData(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(FormatArchive(ArchiveIdCode::SaveData, format_info)); - NGLOG_TRACE(Service_FS, "called"); + LOG_TRACE(Service_FS, "called"); } void FS_USER::GetFreeBytes(Kernel::HLERequestContext& ctx) { @@ -438,7 +438,7 @@ void FS_USER::CreateExtSaveData(Kernel::HLERequestContext& ctx) { u32 icon_size = rp.Pop(); auto icon_buffer = rp.PopMappedBuffer(); - NGLOG_WARNING(Service_FS, + LOG_WARNING(Service_FS, "(STUBBED) savedata_high={:08X} savedata_low={:08X} unknown={:08X} " "files={:08X} directories={:08X} size_limit={:016x} icon_size={:08X}", save_high, save_low, unknown, directories, files, size_limit, icon_size); @@ -464,7 +464,7 @@ void FS_USER::DeleteExtSaveData(Kernel::HLERequestContext& ctx) { u32 save_high = rp.Pop(); u32 unknown = rp.Pop(); // TODO(Subv): Figure out what this is - NGLOG_WARNING(Service_FS, + LOG_WARNING(Service_FS, "(STUBBED) save_low={:08X} save_high={:08X} media_type={:08X} unknown={:08X}", save_low, save_high, static_cast(media_type), unknown); @@ -477,7 +477,7 @@ void FS_USER::CardSlotIsInserted(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(false); - NGLOG_WARNING(Service_FS, "(STUBBED) called"); + LOG_WARNING(Service_FS, "(STUBBED) called"); } void FS_USER::DeleteSystemSaveData(Kernel::HLERequestContext& ctx) { @@ -501,7 +501,7 @@ void FS_USER::CreateSystemSaveData(Kernel::HLERequestContext& ctx) { u32 file_buckets = rp.Pop(); bool duplicate = rp.Pop(); - NGLOG_WARNING( + LOG_WARNING( Service_FS, "(STUBBED) savedata_high={:08X} savedata_low={:08X} total_size={:08X} block_size={:08X} " "directories={} files={} directory_buckets={} file_buckets={} duplicate={}", @@ -523,7 +523,7 @@ void FS_USER::CreateLegacySystemSaveData(Kernel::HLERequestContext& ctx) { u32 file_buckets = rp.Pop(); bool duplicate = rp.Pop(); - NGLOG_WARNING(Service_FS, + LOG_WARNING(Service_FS, "(STUBBED) savedata_id={:08X} total_size={:08X} block_size={:08X} directories={} " "files={} directory_buckets={} file_buckets={} duplicate={}", savedata_id, total_size, block_size, directories, files, directory_buckets, @@ -539,7 +539,7 @@ void FS_USER::InitializeWithSdkVersion(Kernel::HLERequestContext& ctx) { const u32 version = rp.Pop(); rp.PopPID(); - NGLOG_WARNING(Service_FS, "(STUBBED) called, version: 0x{:08X}", version); + LOG_WARNING(Service_FS, "(STUBBED) called, version: 0x{:08X}", version); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); @@ -553,28 +553,28 @@ void FS_USER::SetPriority(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_FS, "called priority=0x{:X}", priority); + LOG_DEBUG(Service_FS, "called priority=0x{:X}", priority); } void FS_USER::GetPriority(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x863, 0, 0); if (priority == -1) { - NGLOG_INFO(Service_FS, "priority was not set, priority=0x{:X}", priority); + LOG_INFO(Service_FS, "priority was not set, priority=0x{:X}", priority); } IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(priority); - NGLOG_DEBUG(Service_FS, "called priority=0x{:X}", priority); + LOG_DEBUG(Service_FS, "called priority=0x{:X}", priority); } void FS_USER::GetArchiveResource(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x849, 1, 0); u32 system_media_type = rp.Pop(); - NGLOG_WARNING(Service_FS, "(STUBBED) called Media type=0x{:08X}", system_media_type); + LOG_WARNING(Service_FS, "(STUBBED) called Media type=0x{:08X}", system_media_type); IPC::RequestBuilder rb = rp.MakeBuilder(5, 0); rb.Push(RESULT_SUCCESS); @@ -594,14 +594,14 @@ void FS_USER::GetFormatInfo(Kernel::HLERequestContext& ctx) { FileSys::Path archive_path(archivename_type, archivename); - NGLOG_DEBUG(Service_FS, "archive_path={}", archive_path.DebugStr()); + LOG_DEBUG(Service_FS, "archive_path={}", archive_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(5, 0); auto format_info = GetArchiveFormatInfo(archive_id, archive_path); rb.Push(format_info.Code()); if (format_info.Failed()) { - NGLOG_ERROR(Service_FS, "Failed to retrieve the format info"); + LOG_ERROR(Service_FS, "Failed to retrieve the format info"); rb.Skip(4, true); return; } @@ -617,7 +617,7 @@ void FS_USER::GetProgramLaunchInfo(Kernel::HLERequestContext& ctx) { u32 process_id = rp.Pop(); - NGLOG_DEBUG(Service_FS, "process_id={}", process_id); + LOG_DEBUG(Service_FS, "process_id={}", process_id); // TODO(Subv): The real FS service manages its own process list and only checks the processes // that were registered with the 'fs:REG' service. @@ -649,7 +649,7 @@ void FS_USER::GetProgramLaunchInfo(Kernel::HLERequestContext& ctx) { void FS_USER::GetNumSeeds(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x87D, 0, 0); - NGLOG_WARNING(Service_FS, "(STUBBED) called"); + LOG_WARNING(Service_FS, "(STUBBED) called"); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); @@ -666,7 +666,7 @@ void FS_USER::SetSaveDataSecureValue(Kernel::HLERequestContext& ctx) { // TODO: Generate and Save the Secure Value - NGLOG_WARNING(Service_FS, + LOG_WARNING(Service_FS, "(STUBBED) called, value=0x{:016x} secure_value_slot=0x{:08X} " "unqiue_id=0x{:08X} title_variation=0x{:02X}", value, secure_value_slot, unique_id, title_variation); @@ -683,7 +683,7 @@ void FS_USER::GetSaveDataSecureValue(Kernel::HLERequestContext& ctx) { u32 unique_id = rp.Pop(); u8 title_variation = rp.Pop(); - NGLOG_WARNING( + LOG_WARNING( Service_FS, "(STUBBED) called secure_value_slot=0x{:08X} unqiue_id=0x{:08X} title_variation=0x{:02X}", secure_value_slot, unique_id, title_variation); diff --git a/src/core/hle/service/gsp/gsp_gpu.cpp b/src/core/hle/service/gsp/gsp_gpu.cpp index 73b4bc109..4e4ce399f 100644 --- a/src/core/hle/service/gsp/gsp_gpu.cpp +++ b/src/core/hle/service/gsp/gsp_gpu.cpp @@ -120,14 +120,14 @@ static ResultCode WriteHWRegs(u32 base_address, u32 size_in_bytes, const std::ve const u32 max_size_in_bytes = 0x80; if (base_address & 3 || base_address >= 0x420000) { - NGLOG_ERROR( + LOG_ERROR( Service_GSP, "Write address was out of range or misaligned! (address=0x{:08x}, size=0x{:08x})", base_address, size_in_bytes); return ERR_REGS_OUTOFRANGE_OR_MISALIGNED; } else if (size_in_bytes <= max_size_in_bytes) { if (size_in_bytes & 3) { - NGLOG_ERROR(Service_GSP, "Misaligned size 0x{:08x}", size_in_bytes); + LOG_ERROR(Service_GSP, "Misaligned size 0x{:08x}", size_in_bytes); return ERR_REGS_MISALIGNED; } else { size_t offset = 0; @@ -144,7 +144,7 @@ static ResultCode WriteHWRegs(u32 base_address, u32 size_in_bytes, const std::ve } } else { - NGLOG_ERROR(Service_GSP, "Out of range size 0x{:08x}", size_in_bytes); + LOG_ERROR(Service_GSP, "Out of range size 0x{:08x}", size_in_bytes); return ERR_REGS_INVALID_SIZE; } } @@ -165,14 +165,14 @@ static ResultCode WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, const u32 max_size_in_bytes = 0x80; if (base_address & 3 || base_address >= 0x420000) { - NGLOG_ERROR( + LOG_ERROR( Service_GSP, "Write address was out of range or misaligned! (address=0x{:08x}, size=0x{:08x})", base_address, size_in_bytes); return ERR_REGS_OUTOFRANGE_OR_MISALIGNED; } else if (size_in_bytes <= max_size_in_bytes) { if (size_in_bytes & 3) { - NGLOG_ERROR(Service_GSP, "Misaligned size 0x{:08x}", size_in_bytes); + LOG_ERROR(Service_GSP, "Misaligned size 0x{:08x}", size_in_bytes); return ERR_REGS_MISALIGNED; } else { size_t offset = 0; @@ -199,7 +199,7 @@ static ResultCode WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, } } else { - NGLOG_ERROR(Service_GSP, "Out of range size 0x{:08x}", size_in_bytes); + LOG_ERROR(Service_GSP, "Out of range size 0x{:08x}", size_in_bytes); return ERR_REGS_INVALID_SIZE; } } @@ -237,7 +237,7 @@ void GSP_GPU::ReadHWRegs(Kernel::HLERequestContext& ctx) { if ((reg_addr % 4) != 0 || reg_addr >= 0x420000) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ERR_REGS_OUTOFRANGE_OR_MISALIGNED); - NGLOG_ERROR(Service_GSP, "Invalid address 0x{:08x}", reg_addr); + LOG_ERROR(Service_GSP, "Invalid address 0x{:08x}", reg_addr); return; } @@ -245,7 +245,7 @@ void GSP_GPU::ReadHWRegs(Kernel::HLERequestContext& ctx) { if ((size % 4) != 0) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ERR_REGS_MISALIGNED); - NGLOG_ERROR(Service_GSP, "Invalid size 0x{:08x}", size); + LOG_ERROR(Service_GSP, "Invalid size 0x{:08x}", size); return; } @@ -319,7 +319,7 @@ void GSP_GPU::FlushDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", + LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address, size, process->process_id); } @@ -334,7 +334,7 @@ void GSP_GPU::InvalidateDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", + LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address, size, process->process_id); } @@ -345,7 +345,7 @@ void GSP_GPU::SetAxiConfigQoSMode(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_GSP, "(STUBBED) called mode=0x{:08X}", mode); + LOG_DEBUG(Service_GSP, "(STUBBED) called mode=0x{:08X}", mode); } void GSP_GPU::RegisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) { @@ -375,7 +375,7 @@ void GSP_GPU::RegisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) { rb.Push(session_data->thread_id); rb.PushCopyObjects(shared_memory); - NGLOG_DEBUG(Service_GSP, "called, flags=0x{:08X}", flags); + LOG_DEBUG(Service_GSP, "called, flags=0x{:08X}", flags); } void GSP_GPU::UnregisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) { @@ -388,7 +388,7 @@ void GSP_GPU::UnregisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_GSP, "called"); + LOG_DEBUG(Service_GSP, "called"); } void GSP_GPU::SignalInterruptForThread(InterruptId interrupt_id, u32 thread_id) { @@ -398,7 +398,7 @@ void GSP_GPU::SignalInterruptForThread(InterruptId interrupt_id, u32 thread_id) auto interrupt_event = session_data->interrupt_event; if (interrupt_event == nullptr) { - NGLOG_WARNING(Service_GSP, "cannot synchronize until GSP event has been created!"); + LOG_WARNING(Service_GSP, "cannot synchronize until GSP event has been created!"); return; } InterruptRelayQueue* interrupt_relay_queue = GetInterruptRelayQueue(shared_memory, thread_id); @@ -436,7 +436,7 @@ void GSP_GPU::SignalInterruptForThread(InterruptId interrupt_id, u32 thread_id) */ void GSP_GPU::SignalInterrupt(InterruptId interrupt_id) { if (nullptr == shared_memory) { - NGLOG_WARNING(Service_GSP, "cannot synchronize until GSP shared memory has been created!"); + LOG_WARNING(Service_GSP, "cannot synchronize until GSP shared memory has been created!"); return; } @@ -583,7 +583,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { } default: - NGLOG_ERROR(Service_GSP, "unknown command 0x{:08X}", (int)command.id.Value()); + LOG_ERROR(Service_GSP, "unknown command 0x{:08X}", (int)command.id.Value()); } if (Pica::g_debug_context) @@ -668,7 +668,7 @@ void GSP_GPU::ImportDisplayCaptureInfo(Kernel::HLERequestContext& ctx) { rb.PushRaw(top_entry); rb.PushRaw(bottom_entry); - NGLOG_WARNING(Service_GSP, "called"); + LOG_WARNING(Service_GSP, "called"); } void GSP_GPU::AcquireRight(Kernel::HLERequestContext& ctx) { @@ -679,7 +679,7 @@ void GSP_GPU::AcquireRight(Kernel::HLERequestContext& ctx) { SessionData* session_data = GetSessionData(ctx.Session()); - NGLOG_WARNING(Service_GSP, "called flag={:08X} process={} thread_id={}", flag, + LOG_WARNING(Service_GSP, "called flag={:08X} process={} thread_id={}", flag, process->process_id, session_data->thread_id); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -713,7 +713,7 @@ void GSP_GPU::ReleaseRight(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_GSP, "called"); + LOG_WARNING(Service_GSP, "called"); } void GSP_GPU::StoreDataCache(Kernel::HLERequestContext& ctx) { @@ -726,7 +726,7 @@ void GSP_GPU::StoreDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", + LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address, size, process->process_id); } @@ -738,7 +738,7 @@ void GSP_GPU::SetLedForceOff(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_GSP, "(STUBBED) called"); + LOG_DEBUG(Service_GSP, "(STUBBED) called"); } SessionData* GSP_GPU::FindRegisteredThreadData(u32 thread_id) { diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 4fe807b3b..f436568a8 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -266,7 +266,7 @@ void Module::Interface::EnableAccelerometer(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_HID, "called"); + LOG_DEBUG(Service_HID, "called"); } void Module::Interface::DisableAccelerometer(Kernel::HLERequestContext& ctx) { @@ -282,7 +282,7 @@ void Module::Interface::DisableAccelerometer(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_HID, "called"); + LOG_DEBUG(Service_HID, "called"); } void Module::Interface::EnableGyroscopeLow(Kernel::HLERequestContext& ctx) { @@ -298,7 +298,7 @@ void Module::Interface::EnableGyroscopeLow(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_HID, "called"); + LOG_DEBUG(Service_HID, "called"); } void Module::Interface::DisableGyroscopeLow(Kernel::HLERequestContext& ctx) { @@ -314,7 +314,7 @@ void Module::Interface::DisableGyroscopeLow(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_HID, "called"); + LOG_DEBUG(Service_HID, "called"); } void Module::Interface::GetGyroscopeLowRawToDpsCoefficient(Kernel::HLERequestContext& ctx) { @@ -339,7 +339,7 @@ void Module::Interface::GetGyroscopeLowCalibrateParam(Kernel::HLERequestContext& }; rb.PushRaw(param); - NGLOG_WARNING(Service_HID, "(STUBBED) called"); + LOG_WARNING(Service_HID, "(STUBBED) called"); } void Module::Interface::GetSoundVolume(Kernel::HLERequestContext& ctx) { @@ -351,7 +351,7 @@ void Module::Interface::GetSoundVolume(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(volume); - NGLOG_WARNING(Service_HID, "(STUBBED) called"); + LOG_WARNING(Service_HID, "(STUBBED) called"); } Module::Interface::Interface(std::shared_ptr hid, const char* name, u32 max_session) diff --git a/src/core/hle/service/ir/extra_hid.cpp b/src/core/hle/service/ir/extra_hid.cpp index 39ffca87a..56008c3ae 100644 --- a/src/core/hle/service/ir/extra_hid.cpp +++ b/src/core/hle/service/ir/extra_hid.cpp @@ -165,7 +165,7 @@ void ExtraHID::OnDisconnect() { void ExtraHID::HandleConfigureHIDPollingRequest(const std::vector& request) { if (request.size() != 3) { - NGLOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(), + LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(), Common::ArrayToString(request.data(), request.size())); return; } @@ -187,7 +187,7 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector& request_b "ReadCalibrationDataRequest has wrong size"); if (request_buf.size() != sizeof(ReadCalibrationDataRequest)) { - NGLOG_ERROR(Service_IR, "Wrong request size ({}): {}", request_buf.size(), + LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request_buf.size(), Common::ArrayToString(request_buf.data(), request_buf.size())); return; } @@ -199,7 +199,7 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector& request_b const u16 size = Common::AlignDown(request.size, 16); if (offset + size > calibration_data.size()) { - NGLOG_ERROR(Service_IR, "Read beyond the end of calibration data! (offset={}, size={})", + LOG_ERROR(Service_IR, "Read beyond the end of calibration data! (offset={}, size={})", offset, size); return; } @@ -222,7 +222,7 @@ void ExtraHID::OnReceive(const std::vector& data) { HandleReadCalibrationDataRequest(data); break; default: - NGLOG_ERROR(Service_IR, "Unknown request: {}", + LOG_ERROR(Service_IR, "Unknown request: {}", Common::ArrayToString(data.data(), data.size())); break; } diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp index 8d08a69cc..c6ed0d3be 100644 --- a/src/core/hle/service/ir/ir_rst.cpp +++ b/src/core/hle/service/ir/ir_rst.cpp @@ -122,7 +122,7 @@ void IR_RST::Initialize(Kernel::HLERequestContext& ctx) { raw_c_stick = rp.Pop(); if (raw_c_stick) - NGLOG_ERROR(Service_IR, "raw C-stick data is not implemented!"); + LOG_ERROR(Service_IR, "raw C-stick data is not implemented!"); next_pad_index = 0; is_device_reload_pending.store(true); @@ -131,7 +131,7 @@ void IR_RST::Initialize(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_IR, "called. update_period={}, raw_c_stick={}", update_period, raw_c_stick); + LOG_DEBUG(Service_IR, "called. update_period={}, raw_c_stick={}", update_period, raw_c_stick); } void IR_RST::Shutdown(Kernel::HLERequestContext& ctx) { @@ -142,7 +142,7 @@ void IR_RST::Shutdown(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_IR, "called"); + LOG_DEBUG(Service_IR, "called"); } IR_RST::IR_RST() : ServiceFramework("ir:rst", 1) { diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp index 7f1a28ce7..d8ad6ab06 100644 --- a/src/core/hle/service/ir/ir_user.cpp +++ b/src/core/hle/service/ir/ir_user.cpp @@ -183,7 +183,7 @@ private: /// Wraps the payload into packet and puts it to the receive buffer void IR_USER::PutToReceive(const std::vector& payload) { - NGLOG_TRACE(Service_IR, "called, data={}", + LOG_TRACE(Service_IR, "called, data={}", Common::ArrayToString(payload.data(), payload.size())); size_t size = payload.size(); @@ -225,7 +225,7 @@ void IR_USER::PutToReceive(const std::vector& payload) { if (receive_buffer->Put(packet)) { receive_event->Signal(); } else { - NGLOG_ERROR(Service_IR, "receive buffer is full!"); + LOG_ERROR(Service_IR, "receive buffer is full!"); } } @@ -251,7 +251,7 @@ void IR_USER::InitializeIrNopShared(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); - NGLOG_INFO(Service_IR, + LOG_INFO(Service_IR, "called, shared_buff_size={}, recv_buff_size={}, " "recv_buff_packet_count={}, send_buff_size={}, " "send_buff_packet_count={}, baud_rate={}", @@ -275,7 +275,7 @@ void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) { connected_device->OnConnect(); conn_status_event->Signal(); } else { - NGLOG_WARNING(Service_IR, "unknown device id {}. Won't connect.", device_id); + LOG_WARNING(Service_IR, "unknown device id {}. Won't connect.", device_id); shared_memory_ptr[offsetof(SharedMemoryHeader, connection_status)] = 1; shared_memory_ptr[offsetof(SharedMemoryHeader, trying_to_connect_status)] = 2; } @@ -283,7 +283,7 @@ void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_INFO(Service_IR, "called, device_id = {}", device_id); + LOG_INFO(Service_IR, "called, device_id = {}", device_id); } void IR_USER::GetReceiveEvent(Kernel::HLERequestContext& ctx) { @@ -292,7 +292,7 @@ void IR_USER::GetReceiveEvent(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(receive_event); - NGLOG_INFO(Service_IR, "called"); + LOG_INFO(Service_IR, "called"); } void IR_USER::GetSendEvent(Kernel::HLERequestContext& ctx) { @@ -301,7 +301,7 @@ void IR_USER::GetSendEvent(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(send_event); - NGLOG_INFO(Service_IR, "called"); + LOG_INFO(Service_IR, "called"); } void IR_USER::Disconnect(Kernel::HLERequestContext& ctx) { @@ -318,7 +318,7 @@ void IR_USER::Disconnect(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb(ctx, 0x09, 1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_INFO(Service_IR, "called"); + LOG_INFO(Service_IR, "called"); } void IR_USER::GetConnectionStatusEvent(Kernel::HLERequestContext& ctx) { @@ -327,7 +327,7 @@ void IR_USER::GetConnectionStatusEvent(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(conn_status_event); - NGLOG_INFO(Service_IR, "called"); + LOG_INFO(Service_IR, "called"); } void IR_USER::FinalizeIrNop(Kernel::HLERequestContext& ctx) { @@ -342,7 +342,7 @@ void IR_USER::FinalizeIrNop(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb(ctx, 0x02, 1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_INFO(Service_IR, "called"); + LOG_INFO(Service_IR, "called"); } void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) { @@ -357,12 +357,12 @@ void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) { send_event->Signal(); rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_IR, "not connected"); + LOG_ERROR(Service_IR, "not connected"); rb.Push(ResultCode(static_cast(13), ErrorModule::IR, ErrorSummary::InvalidState, ErrorLevel::Status)); } - NGLOG_TRACE(Service_IR, "called, data={}", Common::ArrayToString(buffer.data(), size)); + LOG_TRACE(Service_IR, "called, data={}", Common::ArrayToString(buffer.data(), size)); } void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) { @@ -374,12 +374,12 @@ void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) { if (receive_buffer->Release(count)) { rb.Push(RESULT_SUCCESS); } else { - NGLOG_ERROR(Service_IR, "failed to release {} packets", count); + LOG_ERROR(Service_IR, "failed to release {} packets", count); rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::IR, ErrorSummary::NotFound, ErrorLevel::Status)); } - NGLOG_TRACE(Service_IR, "called, count={}", count); + LOG_TRACE(Service_IR, "called, count={}", count); } IR_USER::IR_USER() : ServiceFramework("ir:USER", 1) { diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp index 46c265a5d..903b25c55 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.cpp +++ b/src/core/hle/service/ldr_ro/cro_helper.cpp @@ -131,7 +131,7 @@ ResultCode CROHelper::ApplyRelocationBatch(VAddr batch, u32 symbol_address, bool ResultCode result = ApplyRelocation(relocation_target, relocation.type, relocation.addend, symbol_address, relocation_target); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation {:08X}", result.raw); return result; } @@ -493,7 +493,7 @@ ResultCode CROHelper::ResetExternalRelocations() { ResultCode result = ApplyRelocation(relocation_target, relocation.type, relocation.addend, unresolved_symbol, relocation_target); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation {:08X}", result.raw); return result; } @@ -525,7 +525,7 @@ ResultCode CROHelper::ClearExternalRelocations() { ResultCode result = ClearRelocation(relocation_target, relocation.type); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error clearing relocation {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error clearing relocation {:08X}", result.raw); return result; } @@ -550,7 +550,7 @@ ResultCode CROHelper::ApplyStaticAnonymousSymbolToCRS(VAddr crs_address) { CROHelper crs(crs_address); u32 offset_export_num = GetField(StaticAnonymousSymbolNum); - NGLOG_INFO(Service_LDR, "CRO \"{}\" exports {} static anonymous symbols", ModuleName(), + LOG_INFO(Service_LDR, "CRO \"{}\" exports {} static anonymous symbols", ModuleName(), offset_export_num); for (u32 i = 0; i < offset_export_num; ++i) { StaticAnonymousSymbolEntry entry; @@ -563,11 +563,11 @@ ResultCode CROHelper::ApplyStaticAnonymousSymbolToCRS(VAddr crs_address) { } u32 symbol_address = SegmentTagToAddress(entry.symbol_position); - NGLOG_TRACE(Service_LDR, "CRO \"{}\" exports 0x{:08X} to the static module", ModuleName(), + LOG_TRACE(Service_LDR, "CRO \"{}\" exports 0x{:08X} to the static module", ModuleName(), symbol_address); ResultCode result = crs.ApplyRelocationBatch(batch_address, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } @@ -603,12 +603,12 @@ ResultCode CROHelper::ApplyInternalRelocations(u32 old_data_segment_address) { SegmentEntry symbol_segment; GetEntry(relocation.symbol_segment, symbol_segment); - NGLOG_TRACE(Service_LDR, "Internally relocates 0x{:08X} with 0x{:08X}", target_address, + LOG_TRACE(Service_LDR, "Internally relocates 0x{:08X} with 0x{:08X}", target_address, symbol_segment.offset); ResultCode result = ApplyRelocation(target_address, relocation.type, relocation.addend, symbol_segment.offset, target_addressB); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation {:08X}", result.raw); return result; } } @@ -628,7 +628,7 @@ ResultCode CROHelper::ClearInternalRelocations() { ResultCode result = ClearRelocation(target_address, relocation.type); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error clearing relocation {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error clearing relocation {:08X}", result.raw); return result; } } @@ -764,12 +764,12 @@ ResultCode CROHelper::ApplyImportNamedSymbol(VAddr crs_address) { u32 symbol_address = source.FindExportNamedSymbol(symbol_name); if (symbol_address != 0) { - NGLOG_TRACE(Service_LDR, "CRO \"{}\" imports \"{}\" from \"{}\"", + LOG_TRACE(Service_LDR, "CRO \"{}\" imports \"{}\" from \"{}\"", ModuleName(), symbol_name, source.ModuleName()); ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } @@ -800,7 +800,7 @@ ResultCode CROHelper::ResetImportNamedSymbol() { ResultCode result = ApplyRelocationBatch(relocation_addr, unresolved_symbol, true); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error reseting relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error reseting relocation batch {:08X}", result.raw); return result; } } @@ -820,7 +820,7 @@ ResultCode CROHelper::ResetImportIndexedSymbol() { ResultCode result = ApplyRelocationBatch(relocation_addr, unresolved_symbol, true); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error reseting relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error reseting relocation batch {:08X}", result.raw); return result; } } @@ -840,7 +840,7 @@ ResultCode CROHelper::ResetImportAnonymousSymbol() { ResultCode result = ApplyRelocationBatch(relocation_addr, unresolved_symbol, true); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error reseting relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error reseting relocation batch {:08X}", result.raw); return result; } } @@ -859,7 +859,7 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { ResultCode result = ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { if (want_cro_name == source.ModuleName()) { - NGLOG_INFO(Service_LDR, "CRO \"{}\" imports {} indexed symbols from \"{}\"", + LOG_INFO(Service_LDR, "CRO \"{}\" imports {} indexed symbols from \"{}\"", ModuleName(), entry.import_indexed_symbol_num, source.ModuleName()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; @@ -867,27 +867,27 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { ExportIndexedSymbolEntry ex; source.GetEntry(im.index, ex); u32 symbol_address = source.SegmentTagToAddress(ex.symbol_position); - NGLOG_TRACE(Service_LDR, " Imports 0x{:08X}", symbol_address); + LOG_TRACE(Service_LDR, " Imports 0x{:08X}", symbol_address); ResultCode result = ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } - NGLOG_INFO(Service_LDR, "CRO \"{}\" imports {} anonymous symbols from \"{}\"", + LOG_INFO(Service_LDR, "CRO \"{}\" imports {} anonymous symbols from \"{}\"", ModuleName(), entry.import_anonymous_symbol_num, source.ModuleName()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; entry.GetImportAnonymousSymbolEntry(j, im); u32 symbol_address = source.SegmentTagToAddress(im.symbol_position); - NGLOG_TRACE(Service_LDR, " Imports 0x{:08X}", symbol_address); + LOG_TRACE(Service_LDR, " Imports 0x{:08X}", symbol_address); ResultCode result = ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } @@ -904,7 +904,7 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { } ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { - NGLOG_DEBUG(Service_LDR, "CRO \"{}\" exports named symbols to \"{}\"", ModuleName(), + LOG_DEBUG(Service_LDR, "CRO \"{}\" exports named symbols to \"{}\"", ModuleName(), target.ModuleName()); u32 target_import_strings_size = target.GetField(ImportStringsSize); u32 target_symbol_import_num = target.GetField(ImportNamedSymbolNum); @@ -920,10 +920,10 @@ ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { Memory::ReadCString(entry.name_offset, target_import_strings_size); u32 symbol_address = FindExportNamedSymbol(symbol_name); if (symbol_address != 0) { - NGLOG_TRACE(Service_LDR, " exports symbol \"{}\"", symbol_name); + LOG_TRACE(Service_LDR, " exports symbol \"{}\"", symbol_name); ResultCode result = target.ApplyRelocationBatch(relocation_addr, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } @@ -933,7 +933,7 @@ ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { } ResultCode CROHelper::ResetExportNamedSymbol(CROHelper target) { - NGLOG_DEBUG(Service_LDR, "CRO \"{}\" unexports named symbols to \"{}\"", ModuleName(), + LOG_DEBUG(Service_LDR, "CRO \"{}\" unexports named symbols to \"{}\"", ModuleName(), target.ModuleName()); u32 unresolved_symbol = target.GetOnUnresolvedAddress(); u32 target_import_strings_size = target.GetField(ImportStringsSize); @@ -950,11 +950,11 @@ ResultCode CROHelper::ResetExportNamedSymbol(CROHelper target) { Memory::ReadCString(entry.name_offset, target_import_strings_size); u32 symbol_address = FindExportNamedSymbol(symbol_name); if (symbol_address != 0) { - NGLOG_TRACE(Service_LDR, " unexports symbol \"{}\"", symbol_name); + LOG_TRACE(Service_LDR, " unexports symbol \"{}\"", symbol_name); ResultCode result = target.ApplyRelocationBatch(relocation_addr, unresolved_symbol, true); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } @@ -974,7 +974,7 @@ ResultCode CROHelper::ApplyModuleExport(CROHelper target) { if (Memory::ReadCString(entry.name_offset, target_import_string_size) != module_name) continue; - NGLOG_INFO(Service_LDR, "CRO \"{}\" exports {} indexed symbols to \"{}\"", module_name, + LOG_INFO(Service_LDR, "CRO \"{}\" exports {} indexed symbols to \"{}\"", module_name, entry.import_indexed_symbol_num, target.ModuleName()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; @@ -982,26 +982,26 @@ ResultCode CROHelper::ApplyModuleExport(CROHelper target) { ExportIndexedSymbolEntry ex; GetEntry(im.index, ex); u32 symbol_address = SegmentTagToAddress(ex.symbol_position); - NGLOG_TRACE(Service_LDR, " exports symbol 0x{:08X}", symbol_address); + LOG_TRACE(Service_LDR, " exports symbol 0x{:08X}", symbol_address); ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } - NGLOG_INFO(Service_LDR, "CRO \"{}\" exports {} anonymous symbols to \"{}\"", module_name, + LOG_INFO(Service_LDR, "CRO \"{}\" exports {} anonymous symbols to \"{}\"", module_name, entry.import_anonymous_symbol_num, target.ModuleName()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; entry.GetImportAnonymousSymbolEntry(j, im); u32 symbol_address = SegmentTagToAddress(im.symbol_position); - NGLOG_TRACE(Service_LDR, " exports symbol 0x{:08X}", symbol_address); + LOG_TRACE(Service_LDR, " exports symbol 0x{:08X}", symbol_address); ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } @@ -1023,7 +1023,7 @@ ResultCode CROHelper::ResetModuleExport(CROHelper target) { if (Memory::ReadCString(entry.name_offset, target_import_string_size) != module_name) continue; - NGLOG_DEBUG(Service_LDR, "CRO \"{}\" unexports indexed symbols to \"{}\"", module_name, + LOG_DEBUG(Service_LDR, "CRO \"{}\" unexports indexed symbols to \"{}\"", module_name, target.ModuleName()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; @@ -1031,12 +1031,12 @@ ResultCode CROHelper::ResetModuleExport(CROHelper target) { ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, unresolved_symbol, true); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } - NGLOG_DEBUG(Service_LDR, "CRO \"{}\" unexports anonymous symbols to \"{}\"", module_name, + LOG_DEBUG(Service_LDR, "CRO \"{}\" unexports anonymous symbols to \"{}\"", module_name, target.ModuleName()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; @@ -1044,7 +1044,7 @@ ResultCode CROHelper::ResetModuleExport(CROHelper target) { ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, unresolved_symbol, true); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } } @@ -1069,12 +1069,12 @@ ResultCode CROHelper::ApplyExitRelocations(VAddr crs_address) { u32 symbol_address = source.FindExportNamedSymbol("nnroAeabiAtexit_"); if (symbol_address != 0) { - NGLOG_DEBUG(Service_LDR, "CRO \"{}\" import exit function from \"{}\"", + LOG_DEBUG(Service_LDR, "CRO \"{}\" import exit function from \"{}\"", ModuleName(), source.ModuleName()); ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", + LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); return result; } @@ -1085,7 +1085,7 @@ ResultCode CROHelper::ApplyExitRelocations(VAddr crs_address) { return MakeResult(true); }); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying exit relocation {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying exit relocation {:08X}", result.raw); return result; } } @@ -1116,13 +1116,13 @@ ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size, VAddr data_segment ResultCode result = RebaseHeader(cro_size); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing header {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing header {:08X}", result.raw); return result; } result = VerifyStringTableLength(GetField(ModuleNameOffset), GetField(ModuleNameSize)); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error verifying module name {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error verifying module name {:08X}", result.raw); return result; } @@ -1131,7 +1131,7 @@ ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size, VAddr data_segment auto result_val = RebaseSegmentTable(cro_size, data_segment_addresss, data_segment_size, bss_segment_address, bss_segment_size); if (result_val.Failed()) { - NGLOG_ERROR(Service_LDR, "Error rebasing segment table {:08X}", result_val.Code().raw); + LOG_ERROR(Service_LDR, "Error rebasing segment table {:08X}", result_val.Code().raw); return result_val.Code(); } prev_data_segment_address = *result_val; @@ -1139,76 +1139,76 @@ ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size, VAddr data_segment result = RebaseExportNamedSymbolTable(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing symbol export table {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing symbol export table {:08X}", result.raw); return result; } result = VerifyExportTreeTable(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error verifying export tree {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error verifying export tree {:08X}", result.raw); return result; } result = VerifyStringTableLength(GetField(ExportStringsOffset), GetField(ExportStringsSize)); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error verifying export strings {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error verifying export strings {:08X}", result.raw); return result; } result = RebaseImportModuleTable(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing object table {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing object table {:08X}", result.raw); return result; } result = ResetExternalRelocations(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error resetting all external relocations {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error resetting all external relocations {:08X}", result.raw); return result; } result = RebaseImportNamedSymbolTable(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing symbol import table {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing symbol import table {:08X}", result.raw); return result; } result = RebaseImportIndexedSymbolTable(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing index import table {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing index import table {:08X}", result.raw); return result; } result = RebaseImportAnonymousSymbolTable(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing offset import table {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing offset import table {:08X}", result.raw); return result; } result = VerifyStringTableLength(GetField(ImportStringsOffset), GetField(ImportStringsSize)); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error verifying import strings {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error verifying import strings {:08X}", result.raw); return result; } if (!is_crs) { result = ApplyStaticAnonymousSymbolToCRS(crs_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying offset export to CRS {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying offset export to CRS {:08X}", result.raw); return result; } } result = ApplyInternalRelocations(prev_data_segment_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying internal relocations {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying internal relocations {:08X}", result.raw); return result; } if (!is_crs) { result = ApplyExitRelocations(crs_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying exit relocations {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying exit relocations {:08X}", result.raw); return result; } } @@ -1280,14 +1280,14 @@ ResultCode CROHelper::Link(VAddr crs_address, bool link_on_load_bug_fix) { // Imports named symbols from other modules result = ApplyImportNamedSymbol(crs_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying symbol import {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying symbol import {:08X}", result.raw); return result; } // Imports indexed and anonymous symbols from other modules result = ApplyModuleImport(crs_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying module import {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying module import {:08X}", result.raw); return result; } } @@ -1305,7 +1305,7 @@ ResultCode CROHelper::Link(VAddr crs_address, bool link_on_load_bug_fix) { return MakeResult(true); }); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error applying export {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error applying export {:08X}", result.raw); return result; } @@ -1317,21 +1317,21 @@ ResultCode CROHelper::Unlink(VAddr crs_address) { // Resets all imported named symbols ResultCode result = ResetImportNamedSymbol(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error resetting symbol import {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error resetting symbol import {:08X}", result.raw); return result; } // Resets all imported indexed symbols result = ResetImportIndexedSymbol(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error resetting indexed import {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error resetting indexed import {:08X}", result.raw); return result; } // Resets all imported anonymous symbols result = ResetImportAnonymousSymbol(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error resetting anonymous import {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error resetting anonymous import {:08X}", result.raw); return result; } @@ -1349,7 +1349,7 @@ ResultCode CROHelper::Unlink(VAddr crs_address) { return MakeResult(true); }); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error resetting export {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error resetting export {:08X}", result.raw); return result; } @@ -1359,13 +1359,13 @@ ResultCode CROHelper::Unlink(VAddr crs_address) { ResultCode CROHelper::ClearRelocations() { ResultCode result = ClearExternalRelocations(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error clearing external relocations {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error clearing external relocations {:08X}", result.raw); return result; } result = ClearInternalRelocations(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error clearing internal relocations {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error clearing internal relocations {:08X}", result.raw); return result; } return RESULT_SUCCESS; diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index b4ce0e21e..2a585a544 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -58,7 +58,7 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) { // All other service functions below have the same issue. auto process = rp.PopObject(); - NGLOG_DEBUG(Service_LDR, + LOG_DEBUG(Service_LDR, "called, crs_buffer_ptr=0x{:08X}, crs_address=0x{:08X}, crs_size=0x{:X}", crs_buffer_ptr, crs_address, crs_size); @@ -66,44 +66,44 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) { ClientSlot* slot = GetSessionData(ctx.Session()); if (slot->loaded_crs != 0) { - NGLOG_ERROR(Service_LDR, "Already initialized"); + LOG_ERROR(Service_LDR, "Already initialized"); rb.Push(ERROR_ALREADY_INITIALIZED); return; } if (crs_size < CRO_HEADER_SIZE) { - NGLOG_ERROR(Service_LDR, "CRS is too small"); + LOG_ERROR(Service_LDR, "CRS is too small"); rb.Push(ERROR_BUFFER_TOO_SMALL); return; } if (crs_buffer_ptr & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRS original address is not aligned"); + LOG_ERROR(Service_LDR, "CRS original address is not aligned"); rb.Push(ERROR_MISALIGNED_ADDRESS); return; } if (crs_address & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRS mapping address is not aligned"); + LOG_ERROR(Service_LDR, "CRS mapping address is not aligned"); rb.Push(ERROR_MISALIGNED_ADDRESS); return; } if (crs_size & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRS size is not aligned"); + LOG_ERROR(Service_LDR, "CRS size is not aligned"); rb.Push(ERROR_MISALIGNED_SIZE); return; } if (!VerifyBufferState(*process, crs_buffer_ptr, crs_size)) { - NGLOG_ERROR(Service_LDR, "CRS original buffer is in invalid state"); + LOG_ERROR(Service_LDR, "CRS original buffer is in invalid state"); rb.Push(ERROR_INVALID_MEMORY_STATE); return; } if (crs_address < Memory::PROCESS_IMAGE_VADDR || crs_address + crs_size > Memory::PROCESS_IMAGE_VADDR_END) { - NGLOG_ERROR(Service_LDR, "CRS mapping address is not in the process image region"); + LOG_ERROR(Service_LDR, "CRS mapping address is not in the process image region"); rb.Push(ERROR_ILLEGAL_ADDRESS); return; } @@ -118,7 +118,7 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) { .MapMemoryBlock(crs_address, crs_mem, 0, crs_size, Kernel::MemoryState::Code) .Code(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error mapping memory block {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error mapping memory block {:08X}", result.raw); rb.Push(result); return; } @@ -126,7 +126,7 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) { result = process->vm_manager.ReprotectRange(crs_address, crs_size, Kernel::VMAPermission::Read); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error reprotecting memory block {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error reprotecting memory block {:08X}", result.raw); rb.Push(result); return; } @@ -137,7 +137,7 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) { // TODO(wwylele): verify this behaviour. This is only seen in the web browser app, // and the actual behaviour is unclear. "Do nothing" is probably an incorrect implement. // There is also a chance that another issue causes the app passing wrong arguments. - NGLOG_WARNING(Service_LDR, "crs_buffer_ptr == crs_address (0x{:08X})", crs_address); + LOG_WARNING(Service_LDR, "crs_buffer_ptr == crs_address (0x{:08X})", crs_address); } CROHelper crs(crs_address); @@ -145,7 +145,7 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) { result = crs.Rebase(0, crs_size, 0, 0, 0, 0, true); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing CRS 0x{:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing CRS 0x{:08X}", result.raw); rb.Push(result); return; } @@ -166,7 +166,7 @@ void RO::LoadCRR(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x{:08X}, crr_size=0x{:08X}", + LOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x{:08X}, crr_size=0x{:08X}", crr_buffer_ptr, crr_size); } @@ -178,7 +178,7 @@ void RO::UnloadCRR(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x{:08X}", crr_buffer_ptr); + LOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x{:08X}", crr_buffer_ptr); } void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { @@ -196,7 +196,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { VAddr crr_address = rp.Pop(); auto process = rp.PopObject(); - NGLOG_DEBUG(Service_LDR, + LOG_DEBUG(Service_LDR, "called ({}), cro_buffer_ptr=0x{:08X}, cro_address=0x{:08X}, cro_size=0x{:X}, " "data_segment_address=0x{:08X}, zero={}, data_segment_size=0x{:X}, " "bss_segment_address=0x{:08X}, bss_segment_size=0x{:X}, auto_link={}, " @@ -209,42 +209,42 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { ClientSlot* slot = GetSessionData(ctx.Session()); if (slot->loaded_crs == 0) { - NGLOG_ERROR(Service_LDR, "Not initialized"); + LOG_ERROR(Service_LDR, "Not initialized"); rb.Push(ERROR_NOT_INITIALIZED); rb.Push(0); return; } if (cro_size < CRO_HEADER_SIZE) { - NGLOG_ERROR(Service_LDR, "CRO too small"); + LOG_ERROR(Service_LDR, "CRO too small"); rb.Push(ERROR_BUFFER_TOO_SMALL); rb.Push(0); return; } if (cro_buffer_ptr & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRO original address is not aligned"); + LOG_ERROR(Service_LDR, "CRO original address is not aligned"); rb.Push(ERROR_MISALIGNED_ADDRESS); rb.Push(0); return; } if (cro_address & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRO mapping address is not aligned"); + LOG_ERROR(Service_LDR, "CRO mapping address is not aligned"); rb.Push(ERROR_MISALIGNED_ADDRESS); rb.Push(0); return; } if (cro_size & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRO size is not aligned"); + LOG_ERROR(Service_LDR, "CRO size is not aligned"); rb.Push(ERROR_MISALIGNED_SIZE); rb.Push(0); return; } if (!VerifyBufferState(*process, cro_buffer_ptr, cro_size)) { - NGLOG_ERROR(Service_LDR, "CRO original buffer is in invalid state"); + LOG_ERROR(Service_LDR, "CRO original buffer is in invalid state"); rb.Push(ERROR_INVALID_MEMORY_STATE); rb.Push(0); return; @@ -252,14 +252,14 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { if (cro_address < Memory::PROCESS_IMAGE_VADDR || cro_address + cro_size > Memory::PROCESS_IMAGE_VADDR_END) { - NGLOG_ERROR(Service_LDR, "CRO mapping address is not in the process image region"); + LOG_ERROR(Service_LDR, "CRO mapping address is not in the process image region"); rb.Push(ERROR_ILLEGAL_ADDRESS); rb.Push(0); return; } if (zero) { - NGLOG_ERROR(Service_LDR, "Zero is not zero {}", zero); + LOG_ERROR(Service_LDR, "Zero is not zero {}", zero); rb.Push(ResultCode(static_cast(29), ErrorModule::RO, ErrorSummary::Internal, ErrorLevel::Usage)); rb.Push(0); @@ -276,7 +276,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { .MapMemoryBlock(cro_address, cro_mem, 0, cro_size, Kernel::MemoryState::Code) .Code(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error mapping memory block {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error mapping memory block {:08X}", result.raw); rb.Push(result); rb.Push(0); return; @@ -285,7 +285,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { result = process->vm_manager.ReprotectRange(cro_address, cro_size, Kernel::VMAPermission::Read); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error reprotecting memory block {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error reprotecting memory block {:08X}", result.raw); process->vm_manager.UnmapRange(cro_address, cro_size); rb.Push(result); rb.Push(0); @@ -299,14 +299,14 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { // This is derived from the case of LoadCRS with buffer_ptr==address, // and is never seen in any game. "Do nothing" is probably an incorrect implement. // There is also a chance that this case is just prohibited. - NGLOG_WARNING(Service_LDR, "cro_buffer_ptr == cro_address (0x{:08X})", cro_address); + LOG_WARNING(Service_LDR, "cro_buffer_ptr == cro_address (0x{:08X})", cro_address); } CROHelper cro(cro_address); result = cro.VerifyHash(cro_size, crr_address); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error verifying CRO in CRR {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error verifying CRO in CRR {:08X}", result.raw); process->vm_manager.UnmapRange(cro_address, cro_size); rb.Push(result); rb.Push(0); @@ -316,7 +316,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { result = cro.Rebase(slot->loaded_crs, cro_size, data_segment_address, data_segment_size, bss_segment_address, bss_segment_size, false); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error rebasing CRO {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error rebasing CRO {:08X}", result.raw); process->vm_manager.UnmapRange(cro_address, cro_size); rb.Push(result); rb.Push(0); @@ -325,7 +325,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { result = cro.Link(slot->loaded_crs, link_on_load_bug_fix); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error linking CRO {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error linking CRO {:08X}", result.raw); process->vm_manager.UnmapRange(cro_address, cro_size); rb.Push(result); rb.Push(0); @@ -343,7 +343,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { if (fix_size != cro_size) { result = process->vm_manager.UnmapRange(cro_address + fix_size, cro_size - fix_size); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error unmapping memory block {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error unmapping memory block {:08X}", result.raw); process->vm_manager.UnmapRange(cro_address, cro_size); rb.Push(result); rb.Push(0); @@ -362,7 +362,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { result = process->vm_manager.ReprotectRange(exe_begin, exe_size, Kernel::VMAPermission::ReadExecute); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error reprotecting memory block {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error reprotecting memory block {:08X}", result.raw); process->vm_manager.UnmapRange(cro_address, fix_size); rb.Push(result); rb.Push(0); @@ -372,7 +372,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { Core::CPU().InvalidateCacheRange(cro_address, cro_size); - NGLOG_INFO(Service_LDR, "CRO \"{}\" loaded at 0x{:08X}, fixed_end=0x{:08X}", cro.ModuleName(), + LOG_INFO(Service_LDR, "CRO \"{}\" loaded at 0x{:08X}, fixed_end=0x{:08X}", cro.ModuleName(), cro_address, cro_address + fix_size); rb.Push(RESULT_SUCCESS, fix_size); @@ -385,7 +385,7 @@ void RO::UnloadCRO(Kernel::HLERequestContext& ctx) { VAddr cro_buffer_ptr = rp.Pop(); auto process = rp.PopObject(); - NGLOG_DEBUG(Service_LDR, "called, cro_address=0x{:08X}, zero={}, cro_buffer_ptr=0x{:08X}", + LOG_DEBUG(Service_LDR, "called, cro_address=0x{:08X}, zero={}, cro_buffer_ptr=0x{:08X}", cro_address, zero, cro_buffer_ptr); CROHelper cro(cro_address); @@ -394,24 +394,24 @@ void RO::UnloadCRO(Kernel::HLERequestContext& ctx) { ClientSlot* slot = GetSessionData(ctx.Session()); if (slot->loaded_crs == 0) { - NGLOG_ERROR(Service_LDR, "Not initialized"); + LOG_ERROR(Service_LDR, "Not initialized"); rb.Push(ERROR_NOT_INITIALIZED); return; } if (cro_address & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRO address is not aligned"); + LOG_ERROR(Service_LDR, "CRO address is not aligned"); rb.Push(ERROR_MISALIGNED_ADDRESS); return; } if (!cro.IsLoaded()) { - NGLOG_ERROR(Service_LDR, "Invalid or not loaded CRO"); + LOG_ERROR(Service_LDR, "Invalid or not loaded CRO"); rb.Push(ERROR_NOT_LOADED); return; } - NGLOG_INFO(Service_LDR, "Unloading CRO \"{}\"", cro.ModuleName()); + LOG_INFO(Service_LDR, "Unloading CRO \"{}\"", cro.ModuleName()); u32 fixed_size = cro.GetFixedSize(); @@ -419,7 +419,7 @@ void RO::UnloadCRO(Kernel::HLERequestContext& ctx) { ResultCode result = cro.Unlink(slot->loaded_crs); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error unlinking CRO {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error unlinking CRO {:08X}", result.raw); rb.Push(result); return; } @@ -429,7 +429,7 @@ void RO::UnloadCRO(Kernel::HLERequestContext& ctx) { if (!cro.IsFixed()) { result = cro.ClearRelocations(); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error clearing relocations {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error clearing relocations {:08X}", result.raw); rb.Push(result); return; } @@ -443,7 +443,7 @@ void RO::UnloadCRO(Kernel::HLERequestContext& ctx) { if (cro_address != cro_buffer_ptr) { result = process->vm_manager.UnmapRange(cro_address, fixed_size); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error unmapping CRO {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error unmapping CRO {:08X}", result.raw); } slot->memory_synchronizer.RemoveMemoryBlock(cro_address, cro_buffer_ptr); } @@ -458,7 +458,7 @@ void RO::LinkCRO(Kernel::HLERequestContext& ctx) { VAddr cro_address = rp.Pop(); auto process = rp.PopObject(); - NGLOG_DEBUG(Service_LDR, "called, cro_address=0x{:08X}", cro_address); + LOG_DEBUG(Service_LDR, "called, cro_address=0x{:08X}", cro_address); CROHelper cro(cro_address); @@ -466,28 +466,28 @@ void RO::LinkCRO(Kernel::HLERequestContext& ctx) { ClientSlot* slot = GetSessionData(ctx.Session()); if (slot->loaded_crs == 0) { - NGLOG_ERROR(Service_LDR, "Not initialized"); + LOG_ERROR(Service_LDR, "Not initialized"); rb.Push(ERROR_NOT_INITIALIZED); return; } if (cro_address & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRO address is not aligned"); + LOG_ERROR(Service_LDR, "CRO address is not aligned"); rb.Push(ERROR_MISALIGNED_ADDRESS); return; } if (!cro.IsLoaded()) { - NGLOG_ERROR(Service_LDR, "Invalid or not loaded CRO"); + LOG_ERROR(Service_LDR, "Invalid or not loaded CRO"); rb.Push(ERROR_NOT_LOADED); return; } - NGLOG_INFO(Service_LDR, "Linking CRO \"{}\"", cro.ModuleName()); + LOG_INFO(Service_LDR, "Linking CRO \"{}\"", cro.ModuleName()); ResultCode result = cro.Link(slot->loaded_crs, false); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error linking CRO {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error linking CRO {:08X}", result.raw); } slot->memory_synchronizer.SynchronizeOriginalMemory(*process); @@ -500,7 +500,7 @@ void RO::UnlinkCRO(Kernel::HLERequestContext& ctx) { VAddr cro_address = rp.Pop(); auto process = rp.PopObject(); - NGLOG_DEBUG(Service_LDR, "called, cro_address=0x{:08X}", cro_address); + LOG_DEBUG(Service_LDR, "called, cro_address=0x{:08X}", cro_address); CROHelper cro(cro_address); @@ -508,28 +508,28 @@ void RO::UnlinkCRO(Kernel::HLERequestContext& ctx) { ClientSlot* slot = GetSessionData(ctx.Session()); if (slot->loaded_crs == 0) { - NGLOG_ERROR(Service_LDR, "Not initialized"); + LOG_ERROR(Service_LDR, "Not initialized"); rb.Push(ERROR_NOT_INITIALIZED); return; } if (cro_address & Memory::PAGE_MASK) { - NGLOG_ERROR(Service_LDR, "CRO address is not aligned"); + LOG_ERROR(Service_LDR, "CRO address is not aligned"); rb.Push(ERROR_MISALIGNED_ADDRESS); return; } if (!cro.IsLoaded()) { - NGLOG_ERROR(Service_LDR, "Invalid or not loaded CRO"); + LOG_ERROR(Service_LDR, "Invalid or not loaded CRO"); rb.Push(ERROR_NOT_LOADED); return; } - NGLOG_INFO(Service_LDR, "Unlinking CRO \"{}\"", cro.ModuleName()); + LOG_INFO(Service_LDR, "Unlinking CRO \"{}\"", cro.ModuleName()); ResultCode result = cro.Unlink(slot->loaded_crs); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error unlinking CRO {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error unlinking CRO {:08X}", result.raw); } slot->memory_synchronizer.SynchronizeOriginalMemory(*process); @@ -542,13 +542,13 @@ void RO::Shutdown(Kernel::HLERequestContext& ctx) { VAddr crs_buffer_ptr = rp.Pop(); auto process = rp.PopObject(); - NGLOG_DEBUG(Service_LDR, "called, crs_buffer_ptr=0x{:08X}", crs_buffer_ptr); + LOG_DEBUG(Service_LDR, "called, crs_buffer_ptr=0x{:08X}", crs_buffer_ptr); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); ClientSlot* slot = GetSessionData(ctx.Session()); if (slot->loaded_crs == 0) { - NGLOG_ERROR(Service_LDR, "Not initialized"); + LOG_ERROR(Service_LDR, "Not initialized"); rb.Push(ERROR_NOT_INITIALIZED); return; } @@ -564,7 +564,7 @@ void RO::Shutdown(Kernel::HLERequestContext& ctx) { if (slot->loaded_crs != crs_buffer_ptr) { result = process->vm_manager.UnmapRange(slot->loaded_crs, crs.GetFileSize()); if (result.IsError()) { - NGLOG_ERROR(Service_LDR, "Error unmapping CRS {:08X}", result.raw); + LOG_ERROR(Service_LDR, "Error unmapping CRS {:08X}", result.raw); } slot->memory_synchronizer.RemoveMemoryBlock(slot->loaded_crs, crs_buffer_ptr); } diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp index e0b8e7c13..4e293f255 100644 --- a/src/core/hle/service/mic_u.cpp +++ b/src/core/hle/service/mic_u.cpp @@ -41,14 +41,14 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_MIC, "called, size=0x{:X}", size); + LOG_WARNING(Service_MIC, "called, size=0x{:X}", size); } void UnmapSharedMem(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx, 0x02, 0, 0}; IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_MIC, "called"); + LOG_WARNING(Service_MIC, "called"); } void StartSampling(Kernel::HLERequestContext& ctx) { @@ -63,7 +63,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); is_sampling = true; - NGLOG_WARNING(Service_MIC, + LOG_WARNING(Service_MIC, "(STUBBED) called, encoding={}, sample_rate={}, " "audio_buffer_offset={}, audio_buffer_size={}, audio_buffer_loop={}", static_cast(encoding), static_cast(sample_rate), @@ -76,7 +76,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_MIC, "(STUBBED) called, sample_rate={}", + LOG_WARNING(Service_MIC, "(STUBBED) called, sample_rate={}", static_cast(sample_rate)); } @@ -85,7 +85,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); is_sampling = false; - NGLOG_WARNING(Service_MIC, "(STUBBED) called"); + LOG_WARNING(Service_MIC, "(STUBBED) called"); } void IsSampling(Kernel::HLERequestContext& ctx) { @@ -93,7 +93,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(is_sampling); - NGLOG_WARNING(Service_MIC, "(STUBBED) called"); + LOG_WARNING(Service_MIC, "(STUBBED) called"); } void GetBufferFullEvent(Kernel::HLERequestContext& ctx) { @@ -101,7 +101,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(buffer_full_event); - NGLOG_WARNING(Service_MIC, "(STUBBED) called"); + LOG_WARNING(Service_MIC, "(STUBBED) called"); } void SetGain(Kernel::HLERequestContext& ctx) { @@ -110,7 +110,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_MIC, "(STUBBED) called, mic_gain={}", mic_gain); + LOG_WARNING(Service_MIC, "(STUBBED) called, mic_gain={}", mic_gain); } void GetGain(Kernel::HLERequestContext& ctx) { @@ -119,7 +119,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(mic_gain); - NGLOG_WARNING(Service_MIC, "(STUBBED) called"); + LOG_WARNING(Service_MIC, "(STUBBED) called"); } void SetPower(Kernel::HLERequestContext& ctx) { @@ -128,7 +128,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_MIC, "(STUBBED) called, mic_power={}", mic_power); + LOG_WARNING(Service_MIC, "(STUBBED) called, mic_power={}", mic_power); } void GetPower(Kernel::HLERequestContext& ctx) { @@ -136,7 +136,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(mic_power); - NGLOG_WARNING(Service_MIC, "(STUBBED) called"); + LOG_WARNING(Service_MIC, "(STUBBED) called"); } void SetIirFilterMic(Kernel::HLERequestContext& ctx) { @@ -147,7 +147,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushMappedBuffer(buffer); - NGLOG_WARNING(Service_MIC, "(STUBBED) called, size=0x{:X}, buffer=0x{:08X}", size, + LOG_WARNING(Service_MIC, "(STUBBED) called, size=0x{:X}, buffer=0x{:08X}", size, buffer.GetId()); } @@ -157,7 +157,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_MIC, "(STUBBED) called, clamp={}", clamp); + LOG_WARNING(Service_MIC, "(STUBBED) called, clamp={}", clamp); } void GetClamp(Kernel::HLERequestContext& ctx) { @@ -165,7 +165,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(clamp); - NGLOG_WARNING(Service_MIC, "(STUBBED) called"); + LOG_WARNING(Service_MIC, "(STUBBED) called"); } void SetAllowShellClosed(Kernel::HLERequestContext& ctx) { @@ -174,14 +174,14 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_MIC, "(STUBBED) called, allow_shell_closed={}", allow_shell_closed); + LOG_WARNING(Service_MIC, "(STUBBED) called, allow_shell_closed={}", allow_shell_closed); } void SetClientVersion(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx, 0x10, 1, 0}; const u32 version = rp.Pop(); - NGLOG_WARNING(Service_MIC, "(STUBBED) called, version: 0x{:08X}", version); + LOG_WARNING(Service_MIC, "(STUBBED) called, version: 0x{:08X}", version); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp index 7afea5399..8581f5cd2 100644 --- a/src/core/hle/service/ndm/ndm_u.cpp +++ b/src/core/hle/service/ndm/ndm_u.cpp @@ -15,7 +15,7 @@ void NDM_U::EnterExclusiveState(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x{:08X}", + LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x{:08X}", static_cast(exclusive_state)); } @@ -25,7 +25,7 @@ void NDM_U::LeaveExclusiveState(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::QueryExclusiveMode(Kernel::HLERequestContext& ctx) { @@ -33,7 +33,7 @@ void NDM_U::QueryExclusiveMode(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.PushEnum(exclusive_state); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::LockState(Kernel::HLERequestContext& ctx) { @@ -43,7 +43,7 @@ void NDM_U::LockState(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::UnlockState(Kernel::HLERequestContext& ctx) { @@ -53,7 +53,7 @@ void NDM_U::UnlockState(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::SuspendDaemons(Kernel::HLERequestContext& ctx) { @@ -69,7 +69,7 @@ void NDM_U::SuspendDaemons(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x{:08X}", bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x{:08X}", bit_mask); } void NDM_U::ResumeDaemons(Kernel::HLERequestContext& ctx) { @@ -84,7 +84,7 @@ void NDM_U::ResumeDaemons(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x{:08X}", bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x{:08X}", bit_mask); } void NDM_U::SuspendScheduler(Kernel::HLERequestContext& ctx) { @@ -93,14 +93,14 @@ void NDM_U::SuspendScheduler(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED) perform_in_background={}", perform_in_background); + LOG_WARNING(Service_NDM, "(STUBBED) perform_in_background={}", perform_in_background); } void NDM_U::ResumeScheduler(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x09, 0, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::QueryStatus(Kernel::HLERequestContext& ctx) { @@ -110,7 +110,7 @@ void NDM_U::QueryStatus(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.PushEnum(daemon_status.at(daemon)); - NGLOG_WARNING(Service_NDM, "(STUBBED) daemon=0x{:02X}", daemon); + LOG_WARNING(Service_NDM, "(STUBBED) daemon=0x{:02X}", daemon); } void NDM_U::GetDaemonDisableCount(Kernel::HLERequestContext& ctx) { @@ -121,7 +121,7 @@ void NDM_U::GetDaemonDisableCount(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(0); // current process disable count rb.Push(0); // total disable count - NGLOG_WARNING(Service_NDM, "(STUBBED) daemon=0x{:02X}", daemon); + LOG_WARNING(Service_NDM, "(STUBBED) daemon=0x{:02X}", daemon); } void NDM_U::GetSchedulerDisableCount(Kernel::HLERequestContext& ctx) { @@ -131,7 +131,7 @@ void NDM_U::GetSchedulerDisableCount(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(0); // current process disable count rb.Push(0); // total disable count - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::SetScanInterval(Kernel::HLERequestContext& ctx) { @@ -140,7 +140,7 @@ void NDM_U::SetScanInterval(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x{:08X}", scan_interval); + LOG_WARNING(Service_NDM, "(STUBBED) scan_interval=0x{:08X}", scan_interval); } void NDM_U::GetScanInterval(Kernel::HLERequestContext& ctx) { @@ -148,7 +148,7 @@ void NDM_U::GetScanInterval(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(scan_interval); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::SetRetryInterval(Kernel::HLERequestContext& ctx) { @@ -157,7 +157,7 @@ void NDM_U::SetRetryInterval(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x{:08X}", retry_interval); + LOG_WARNING(Service_NDM, "(STUBBED) retry_interval=0x{:08X}", retry_interval); } void NDM_U::GetRetryInterval(Kernel::HLERequestContext& ctx) { @@ -165,7 +165,7 @@ void NDM_U::GetRetryInterval(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(retry_interval); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::OverrideDefaultDaemons(Kernel::HLERequestContext& ctx) { @@ -181,7 +181,7 @@ void NDM_U::OverrideDefaultDaemons(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x{:08X}", bit_mask); + LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x{:08X}", bit_mask); } void NDM_U::ResetDefaultDaemons(Kernel::HLERequestContext& ctx) { @@ -190,7 +190,7 @@ void NDM_U::ResetDefaultDaemons(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::GetDefaultDaemons(Kernel::HLERequestContext& ctx) { @@ -198,14 +198,14 @@ void NDM_U::GetDefaultDaemons(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.PushEnum(default_daemon_bit_mask); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } void NDM_U::ClearHalfAwakeMacFilter(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x17, 0, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NDM, "(STUBBED)"); + LOG_WARNING(Service_NDM, "(STUBBED)"); } NDM_U::NDM_U() : ServiceFramework("ndm:u", 6) { diff --git a/src/core/hle/service/news/news_s.cpp b/src/core/hle/service/news/news_s.cpp index 684d84208..1949a22f0 100644 --- a/src/core/hle/service/news/news_s.cpp +++ b/src/core/hle/service/news/news_s.cpp @@ -11,7 +11,7 @@ namespace NEWS { void NEWS_S::GetTotalNotifications(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x5, 0, 0); - NGLOG_WARNING(Service, "(STUBBED) called"); + LOG_WARNING(Service, "(STUBBED) called"); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index abf5b5c67..5357f0970 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp @@ -19,7 +19,7 @@ void Module::Interface::Initialize(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NFC, "(STUBBED) called, param={}", param); + LOG_WARNING(Service_NFC, "(STUBBED) called, param={}", param); } void Module::Interface::Shutdown(Kernel::HLERequestContext& ctx) { @@ -30,7 +30,7 @@ void Module::Interface::Shutdown(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NFC, "(STUBBED) called, param={}", param); + LOG_WARNING(Service_NFC, "(STUBBED) called, param={}", param); } void Module::Interface::StartCommunication(Kernel::HLERequestContext& ctx) { @@ -38,7 +38,7 @@ void Module::Interface::StartCommunication(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NFC, "(STUBBED) called"); + LOG_WARNING(Service_NFC, "(STUBBED) called"); } void Module::Interface::StopCommunication(Kernel::HLERequestContext& ctx) { @@ -46,7 +46,7 @@ void Module::Interface::StopCommunication(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NFC, "(STUBBED) called"); + LOG_WARNING(Service_NFC, "(STUBBED) called"); } void Module::Interface::StartTagScanning(Kernel::HLERequestContext& ctx) { @@ -66,7 +66,7 @@ void Module::Interface::StartTagScanning(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(result); - NGLOG_WARNING(Service_NFC, "(STUBBED) called, in_val={:04x}", in_val); + LOG_WARNING(Service_NFC, "(STUBBED) called, in_val={:04x}", in_val); } void Module::Interface::StopTagScanning(Kernel::HLERequestContext& ctx) { @@ -76,7 +76,7 @@ void Module::Interface::StopTagScanning(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NFC, "(STUBBED) called"); + LOG_WARNING(Service_NFC, "(STUBBED) called"); } void Module::Interface::LoadAmiiboData(Kernel::HLERequestContext& ctx) { @@ -86,7 +86,7 @@ void Module::Interface::LoadAmiiboData(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NFC, "(STUBBED) called"); + LOG_WARNING(Service_NFC, "(STUBBED) called"); } void Module::Interface::ResetTagScanState(Kernel::HLERequestContext& ctx) { @@ -96,7 +96,7 @@ void Module::Interface::ResetTagScanState(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_NFC, "(STUBBED) called"); + LOG_WARNING(Service_NFC, "(STUBBED) called"); } void Module::Interface::GetTagInRangeEvent(Kernel::HLERequestContext& ctx) { @@ -105,7 +105,7 @@ void Module::Interface::GetTagInRangeEvent(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(nfc->tag_in_range_event); - NGLOG_WARNING(Service_NFC, "(STUBBED) called"); + LOG_WARNING(Service_NFC, "(STUBBED) called"); } void Module::Interface::GetTagOutOfRangeEvent(Kernel::HLERequestContext& ctx) { @@ -114,7 +114,7 @@ void Module::Interface::GetTagOutOfRangeEvent(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(nfc->tag_out_of_range_event); - NGLOG_WARNING(Service_NFC, "(STUBBED) called"); + LOG_WARNING(Service_NFC, "(STUBBED) called"); } void Module::Interface::GetTagState(Kernel::HLERequestContext& ctx) { @@ -123,7 +123,7 @@ void Module::Interface::GetTagState(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.PushEnum(nfc->nfc_tag_state); - NGLOG_DEBUG(Service_NFC, "(STUBBED) called"); + LOG_DEBUG(Service_NFC, "(STUBBED) called"); } void Module::Interface::CommunicationGetStatus(Kernel::HLERequestContext& ctx) { @@ -132,7 +132,7 @@ void Module::Interface::CommunicationGetStatus(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.PushEnum(nfc->nfc_status); - NGLOG_DEBUG(Service_NFC, "(STUBBED) called"); + LOG_DEBUG(Service_NFC, "(STUBBED) called"); } Module::Interface::Interface(std::shared_ptr nfc, const char* name, u32 max_session) diff --git a/src/core/hle/service/nim/nim_u.cpp b/src/core/hle/service/nim/nim_u.cpp index e07749e5f..5a7a2bafb 100644 --- a/src/core/hle/service/nim/nim_u.cpp +++ b/src/core/hle/service/nim/nim_u.cpp @@ -31,7 +31,7 @@ void NIM_U::CheckForSysUpdateEvent(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(nim_system_update_event); - NGLOG_TRACE(Service_NIM, "called"); + LOG_TRACE(Service_NIM, "called"); } void NIM_U::CheckSysUpdateAvailable(Kernel::HLERequestContext& ctx) { @@ -41,7 +41,7 @@ void NIM_U::CheckSysUpdateAvailable(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(false); // No update available - NGLOG_WARNING(Service_NIM, "(STUBBED) called"); + LOG_WARNING(Service_NIM, "(STUBBED) called"); } } // namespace NIM diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 0c7289c2c..7e7ab9d21 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -16,7 +16,7 @@ Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 tit auto loader = Loader::GetLoader(path); if (!loader) { - NGLOG_WARNING(Service_NS, "Could not find .app for title 0x{:016x}", title_id); + LOG_WARNING(Service_NS, "Could not find .app for title 0x{:016x}", title_id); return nullptr; } @@ -24,7 +24,7 @@ Kernel::SharedPtr LaunchTitle(FS::MediaType media_type, u64 tit Loader::ResultStatus result = loader->Load(process); if (result != Loader::ResultStatus::Success) { - NGLOG_WARNING(Service_NS, "Error loading .app for title 0x{:016x}", title_id); + LOG_WARNING(Service_NS, "Error loading .app for title 0x{:016x}", title_id); return nullptr; } diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index 9b3cb3cd0..e491e2994 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp @@ -238,7 +238,7 @@ static void HandleEAPoLPacket(const Network::WifiPacket& packet) { if (GetEAPoLFrameType(packet.data) == EAPoLStartMagic) { if (connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { - NGLOG_DEBUG(Service_NWM, "Connection sequence aborted, because connection status is {}", + LOG_DEBUG(Service_NWM, "Connection sequence aborted, because connection status is {}", connection_status.status); return; } @@ -247,7 +247,7 @@ static void HandleEAPoLPacket(const Network::WifiPacket& packet) { if (connection_status.max_nodes == connection_status.total_nodes) { // Reject connection attempt - NGLOG_ERROR(Service_NWM, "Reached maximum nodes, but reject packet wasn't sent."); + LOG_ERROR(Service_NWM, "Reached maximum nodes, but reject packet wasn't sent."); // TODO(B3N30): Figure out what packet is sent here return; } @@ -425,7 +425,7 @@ void SendAssociationResponseFrame(const MacAddress& address) { { std::lock_guard lock(connection_status_mutex); if (connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { - NGLOG_ERROR(Service_NWM, "Connection sequence aborted, because connection status is {}", + LOG_ERROR(Service_NWM, "Connection sequence aborted, because connection status is {}", connection_status.status); return; } @@ -457,7 +457,7 @@ void HandleAuthenticationFrame(const Network::WifiPacket& packet) { { std::lock_guard lock(connection_status_mutex); if (connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { - NGLOG_ERROR(Service_NWM, + LOG_ERROR(Service_NWM, "Connection sequence aborted, because connection status is {}", connection_status.status); return; @@ -477,16 +477,16 @@ void HandleAuthenticationFrame(const Network::WifiPacket& packet) { /// Handles the deauthentication frames sent from clients to hosts, when they leave a session void HandleDeauthenticationFrame(const Network::WifiPacket& packet) { - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); std::unique_lock hle_lock(HLE::g_hle_lock, std::defer_lock); std::unique_lock lock(connection_status_mutex, std::defer_lock); std::lock(hle_lock, lock); if (connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { - NGLOG_ERROR(Service_NWM, "Got deauthentication frame but we are not the host"); + LOG_ERROR(Service_NWM, "Got deauthentication frame but we are not the host"); return; } if (node_map.find(packet.transmitter_address) == node_map.end()) { - NGLOG_ERROR(Service_NWM, "Got deauthentication frame from unknown node"); + LOG_ERROR(Service_NWM, "Got deauthentication frame from unknown node"); return; } @@ -555,7 +555,7 @@ void NWM_UDS::Shutdown(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); } void NWM_UDS::RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx) { @@ -617,7 +617,7 @@ void NWM_UDS::RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushMappedBuffer(out_buffer); - NGLOG_DEBUG(Service_NWM, + LOG_DEBUG(Service_NWM, "called out_buffer_size=0x{:08X}, wlan_comm_id=0x{:08X}, id=0x{:08X}," "unk1=0x{:08X}, unk2=0x{:08X}, offset={}", out_buffer_size, wlan_comm_id, id, unk1, unk2, cur_buffer_size); @@ -642,7 +642,7 @@ void NWM_UDS::InitializeWithVersion(Kernel::HLERequestContext& ctx) { if (auto room_member = Network::GetRoomMember().lock()) { wifi_packet_received = room_member->BindOnWifiPacketReceived(OnWifiPacketReceived); } else { - NGLOG_ERROR(Service_NWM, "Network isn't initalized"); + LOG_ERROR(Service_NWM, "Network isn't initalized"); } { @@ -660,7 +660,7 @@ void NWM_UDS::InitializeWithVersion(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(connection_status_event); - NGLOG_DEBUG(Service_NWM, "called sharedmem_size=0x{:08X}, version=0x{:08X}", sharedmem_size, + LOG_DEBUG(Service_NWM, "called sharedmem_size=0x{:08X}, version=0x{:08X}", sharedmem_size, version); } @@ -680,7 +680,7 @@ void NWM_UDS::GetConnectionStatus(Kernel::HLERequestContext& ctx) { connection_status.changed_nodes = 0; } - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); } void NWM_UDS::GetNodeInformation(Kernel::HLERequestContext& ctx) { @@ -711,7 +711,7 @@ void NWM_UDS::GetNodeInformation(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushRaw(*itr); } - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); } void NWM_UDS::Bind(Kernel::HLERequestContext& ctx) { @@ -722,13 +722,13 @@ void NWM_UDS::Bind(Kernel::HLERequestContext& ctx) { u8 data_channel = rp.Pop(); u16 network_node_id = rp.Pop(); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); if (data_channel == 0 || bind_node_id == 0) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ResultCode(ErrorDescription::NotAuthorized, ErrorModule::UDS, ErrorSummary::WrongArgument, ErrorLevel::Usage)); - NGLOG_WARNING(Service_NWM, "data_channel = {}, bind_node_id = {}", data_channel, + LOG_WARNING(Service_NWM, "data_channel = {}, bind_node_id = {}", data_channel, bind_node_id); return; } @@ -738,7 +738,7 @@ void NWM_UDS::Bind(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ResultCode(ErrorDescription::OutOfMemory, ErrorModule::UDS, ErrorSummary::OutOfResource, ErrorLevel::Status)); - NGLOG_WARNING(Service_NWM, "max bind nodes"); + LOG_WARNING(Service_NWM, "max bind nodes"); return; } @@ -747,7 +747,7 @@ void NWM_UDS::Bind(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ResultCode(ErrorDescription::TooLarge, ErrorModule::UDS, ErrorSummary::WrongArgument, ErrorLevel::Usage)); - NGLOG_WARNING(Service_NWM, "MinRecvBufferSize"); + LOG_WARNING(Service_NWM, "MinRecvBufferSize"); return; } @@ -808,7 +808,7 @@ void NWM_UDS::BeginHostingNetwork(Kernel::HLERequestContext& ctx) { // TODO(Subv): Store the passphrase and verify it when attempting a connection. - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); { std::lock_guard lock(connection_status_mutex); @@ -868,7 +868,7 @@ void NWM_UDS::BeginHostingNetwork(Kernel::HLERequestContext& ctx) { CoreTiming::ScheduleEvent(msToCycles(DefaultBeaconInterval * MillisecondsPerTU), beacon_broadcast_event, 0); - NGLOG_DEBUG(Service_NWM, "An UDS network has been created."); + LOG_DEBUG(Service_NWM, "An UDS network has been created."); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); @@ -877,7 +877,7 @@ void NWM_UDS::BeginHostingNetwork(Kernel::HLERequestContext& ctx) { void NWM_UDS::UpdateNetworkAttribute(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x07, 2, 0); rp.Skip(2, false); - NGLOG_WARNING(Service_NWM, "stubbed"); + LOG_WARNING(Service_NWM, "stubbed"); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); } @@ -894,7 +894,7 @@ void NWM_UDS::DestroyNetwork(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ResultCode(ErrCodes::WrongStatus, ErrorModule::UDS, ErrorSummary::InvalidState, ErrorLevel::Status)); - NGLOG_WARNING(Service_NWM, "called with status {}", connection_status.status); + LOG_WARNING(Service_NWM, "called with status {}", connection_status.status); return; } @@ -916,7 +916,7 @@ void NWM_UDS::DestroyNetwork(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); } void NWM_UDS::DisconnectNetwork(Kernel::HLERequestContext& ctx) { @@ -934,7 +934,7 @@ void NWM_UDS::DisconnectNetwork(Kernel::HLERequestContext& ctx) { connection_status.status = static_cast(NetworkStatus::ConnectedAsHost); connection_status.network_node_id = tmp_node_id; node_map.clear(); - NGLOG_DEBUG(Service_NWM, "called as a host"); + LOG_DEBUG(Service_NWM, "called as a host"); rb.Push(ResultCode(ErrCodes::WrongStatus, ErrorModule::UDS, ErrorSummary::InvalidState, ErrorLevel::Status)); return; @@ -961,7 +961,7 @@ void NWM_UDS::DisconnectNetwork(Kernel::HLERequestContext& ctx) { channel_data.clear(); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); } void NWM_UDS::SendTo(Kernel::HLERequestContext& ctx) { @@ -992,7 +992,7 @@ void NWM_UDS::SendTo(Kernel::HLERequestContext& ctx) { } if (dest_node_id == connection_status.network_node_id) { - NGLOG_ERROR(Service_NWM, "tried to send packet to itself"); + LOG_ERROR(Service_NWM, "tried to send packet to itself"); rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::UDS, ErrorSummary::WrongArgument, ErrorLevel::Status)); return; @@ -1001,7 +1001,7 @@ void NWM_UDS::SendTo(Kernel::HLERequestContext& ctx) { Network::MacAddress dest_address; if (flags >> 2) { - NGLOG_ERROR(Service_NWM, "Unexpected flags 0x{:02X}", flags); + LOG_ERROR(Service_NWM, "Unexpected flags 0x{:02X}", flags); } if ((flags & (0x1 << 1)) || dest_node_id == 0xFFFF) { @@ -1013,7 +1013,7 @@ void NWM_UDS::SendTo(Kernel::HLERequestContext& ctx) { std::find_if(node_map.begin(), node_map.end(), [dest_node_id](const auto& node) { return node.second == dest_node_id; }); if (destination == node_map.end()) { - NGLOG_ERROR(Service_NWM, "tried to send packet to unknown dest id {}", dest_node_id); + LOG_ERROR(Service_NWM, "tried to send packet to unknown dest id {}", dest_node_id); rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::UDS, ErrorSummary::WrongArgument, ErrorLevel::Status)); return; @@ -1133,7 +1133,7 @@ void NWM_UDS::GetChannel(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(channel); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); } void NWM_UDS::ConnectToNetwork(Kernel::HLERequestContext& ctx) { @@ -1163,10 +1163,10 @@ void NWM_UDS::ConnectToNetwork(Kernel::HLERequestContext& ctx) { // TODO(B3N30): Add error handling for host full and timeout IPC::RequestBuilder rb(ctx, 0x1E, 1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_NWM, "connection sequence finished"); + LOG_DEBUG(Service_NWM, "connection sequence finished"); }); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); } void NWM_UDS::SetApplicationData(Kernel::HLERequestContext& ctx) { @@ -1177,7 +1177,7 @@ void NWM_UDS::SetApplicationData(Kernel::HLERequestContext& ctx) { const std::vector application_data = rp.PopStaticBuffer(); ASSERT(application_data.size() == size); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -1202,7 +1202,7 @@ void NWM_UDS::DecryptBeaconData(Kernel::HLERequestContext& ctx) { const std::vector encrypted_data0_buffer = rp.PopStaticBuffer(); const std::vector encrypted_data1_buffer = rp.PopStaticBuffer(); - NGLOG_DEBUG(Service_NWM, "called"); + LOG_DEBUG(Service_NWM, "called"); NetworkInfo net_info; std::memcpy(&net_info, network_struct_buffer.data(), sizeof(net_info)); diff --git a/src/core/hle/service/nwm/uds_data.cpp b/src/core/hle/service/nwm/uds_data.cpp index aedcc85d4..16d20166c 100644 --- a/src/core/hle/service/nwm/uds_data.cpp +++ b/src/core/hle/service/nwm/uds_data.cpp @@ -209,7 +209,7 @@ static std::vector DecryptDataFrame(const std::vector& encrypted_payload df.Get(pdata.data(), size); return pdata; } catch (CryptoPP::Exception&) { - NGLOG_ERROR(Service_NWM, "failed to decrypt"); + LOG_ERROR(Service_NWM, "failed to decrypt"); } return {}; @@ -263,7 +263,7 @@ static std::vector EncryptDataFrame(const std::vector& payload, df.Get(cipher.data(), size); return cipher; } catch (CryptoPP::Exception&) { - NGLOG_ERROR(Service_NWM, "failed to encrypt"); + LOG_ERROR(Service_NWM, "failed to encrypt"); } return {}; diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 5e31fa9c3..aca971c9b 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -31,7 +31,7 @@ void Module::Interface::GetAdapterState(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(ptm->battery_is_charging); - NGLOG_WARNING(Service_PTM, "(STUBBED) called"); + LOG_WARNING(Service_PTM, "(STUBBED) called"); } void Module::Interface::GetShellState(Kernel::HLERequestContext& ctx) { @@ -49,7 +49,7 @@ void Module::Interface::GetBatteryLevel(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(static_cast(ChargeLevels::CompletelyFull)); // Set to a completely full battery - NGLOG_WARNING(Service_PTM, "(STUBBED) called"); + LOG_WARNING(Service_PTM, "(STUBBED) called"); } void Module::Interface::GetBatteryChargeState(Kernel::HLERequestContext& ctx) { @@ -59,7 +59,7 @@ void Module::Interface::GetBatteryChargeState(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(ptm->battery_is_charging); - NGLOG_WARNING(Service_PTM, "(STUBBED) called"); + LOG_WARNING(Service_PTM, "(STUBBED) called"); } void Module::Interface::GetPedometerState(Kernel::HLERequestContext& ctx) { @@ -69,7 +69,7 @@ void Module::Interface::GetPedometerState(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(ptm->pedometer_is_counting); - NGLOG_WARNING(Service_PTM, "(STUBBED) called"); + LOG_WARNING(Service_PTM, "(STUBBED) called"); } void Module::Interface::GetStepHistory(Kernel::HLERequestContext& ctx) { @@ -92,7 +92,7 @@ void Module::Interface::GetStepHistory(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushMappedBuffer(buffer); - NGLOG_WARNING(Service_PTM, "(STUBBED) called, from time(raw): 0x{:x}, for {} hours", start_time, + LOG_WARNING(Service_PTM, "(STUBBED) called, from time(raw): 0x{:x}, for {} hours", start_time, hours); } @@ -103,7 +103,7 @@ void Module::Interface::GetTotalStepCount(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(0); - NGLOG_WARNING(Service_PTM, "(STUBBED) called"); + LOG_WARNING(Service_PTM, "(STUBBED) called"); } void Module::Interface::GetSoftwareClosedFlag(Kernel::HLERequestContext& ctx) { @@ -113,14 +113,14 @@ void Module::Interface::GetSoftwareClosedFlag(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(false); - NGLOG_WARNING(Service_PTM, "(STUBBED) called"); + LOG_WARNING(Service_PTM, "(STUBBED) called"); } void CheckNew3DS(IPC::RequestBuilder& rb) { const bool is_new_3ds = Settings::values.is_new_3ds; if (is_new_3ds) { - NGLOG_CRITICAL(Service_PTM, + LOG_CRITICAL(Service_PTM, "The option 'is_new_3ds' is enabled as part of the 'System' " "settings. Citra does not fully support New 3DS emulation yet!"); } @@ -128,7 +128,7 @@ void CheckNew3DS(IPC::RequestBuilder& rb) { rb.Push(RESULT_SUCCESS); rb.Push(is_new_3ds); - NGLOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x{:08x}", + LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x{:08x}", static_cast(is_new_3ds)); } diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 443f32ee9..018c69819 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -94,14 +94,14 @@ void Interface::HandleSyncRequest(SharedPtr server_session) { std::string function_name = (itr == m_functions.end()) ? Common::StringFromFormat("0x%08X", cmd_buff[0]) : itr->second.name; - NGLOG_ERROR(Service, "unknown / unimplemented {}", + LOG_ERROR(Service, "unknown / unimplemented {}", MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff)); // TODO(bunnei): Hack - ignore error cmd_buff[1] = 0; return; } - NGLOG_TRACE(Service, "{}", + LOG_TRACE(Service, "{}", MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff)); itr->second.func(this); @@ -159,7 +159,7 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(u32* cmd_buf, const Funct } buf.push_back('}'); - NGLOG_ERROR(Service, "unknown / unimplemented {}", fmt::to_string(buf)); + LOG_ERROR(Service, "unknown / unimplemented {}", fmt::to_string(buf)); // TODO(bunnei): Hack - ignore error cmd_buf[1] = 0; } @@ -180,7 +180,7 @@ void ServiceFrameworkBase::HandleSyncRequest(SharedPtr server_ses context.PopulateFromIncomingCommandBuffer(cmd_buf, *Kernel::g_current_process, Kernel::g_handle_table); - NGLOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName().c_str(), cmd_buf)); + LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName().c_str(), cmd_buf)); handler_invoker(this, info->handler_callback, context); auto thread = Kernel::GetCurrentThread(); @@ -264,7 +264,7 @@ void Init(std::shared_ptr& sm) { SSL::InstallInterfaces(*sm); Y2R::InstallInterfaces(*sm); - NGLOG_DEBUG(Service, "initialized OK"); + LOG_DEBUG(Service, "initialized OK"); } /// Shutdown ServiceManager @@ -275,6 +275,6 @@ void Shutdown() { FS::ArchiveShutdown(); g_kernel_named_ports.clear(); - NGLOG_DEBUG(Service, "shutdown OK"); + LOG_DEBUG(Service, "shutdown OK"); } } // namespace Service diff --git a/src/core/hle/service/sm/srv.cpp b/src/core/hle/service/sm/srv.cpp index d50c86604..66359ff07 100644 --- a/src/core/hle/service/sm/srv.cpp +++ b/src/core/hle/service/sm/srv.cpp @@ -45,7 +45,7 @@ void SRV::RegisterClient(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_SRV, "(STUBBED) called"); + LOG_WARNING(Service_SRV, "(STUBBED) called"); } /** @@ -67,7 +67,7 @@ void SRV::EnableNotification(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(notification_semaphore); - NGLOG_WARNING(Service_SRV, "(STUBBED) called"); + LOG_WARNING(Service_SRV, "(STUBBED) called"); } /** @@ -92,7 +92,7 @@ void SRV::GetServiceHandle(Kernel::HLERequestContext& ctx) { if (name_len > Service::kMaxPortSize) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ERR_INVALID_NAME_SIZE); - NGLOG_ERROR(Service_SRV, "called name_len=0x{:X} -> ERR_INVALID_NAME_SIZE", name_len); + LOG_ERROR(Service_SRV, "called name_len=0x{:X} -> ERR_INVALID_NAME_SIZE", name_len); return; } std::string name(name_buf.data(), name_len); @@ -103,24 +103,24 @@ void SRV::GetServiceHandle(Kernel::HLERequestContext& ctx) { if (client_port.Failed()) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(client_port.Code()); - NGLOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, + LOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, client_port.Code().raw); return; } auto session = client_port.Unwrap()->Connect(); if (session.Succeeded()) { - NGLOG_DEBUG(Service_SRV, "called service={} -> session={}", name, + LOG_DEBUG(Service_SRV, "called service={} -> session={}", name, (*session)->GetObjectId()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(session.Code()); rb.PushMoveObjects(std::move(session).Unwrap()); } else if (session.Code() == Kernel::ERR_MAX_CONNECTIONS_REACHED && wait_until_available) { - NGLOG_WARNING(Service_SRV, "called service={} -> ERR_MAX_CONNECTIONS_REACHED", name); + LOG_WARNING(Service_SRV, "called service={} -> ERR_MAX_CONNECTIONS_REACHED", name); // TODO(Subv): Put the caller guest thread to sleep until this port becomes available again. UNIMPLEMENTED_MSG("Unimplemented wait until port {} is available.", name); } else { - NGLOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, session.Code().raw); + LOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, session.Code().raw); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(session.Code()); } @@ -141,7 +141,7 @@ void SRV::Subscribe(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}", notification_id); + LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}", notification_id); } /** @@ -159,7 +159,7 @@ void SRV::Unsubscribe(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}", notification_id); + LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}", notification_id); } /** @@ -179,7 +179,7 @@ void SRV::PublishToSubscriber(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}, flags={}", + LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}, flags={}", notification_id, flags); } @@ -197,7 +197,7 @@ void SRV::RegisterService(Kernel::HLERequestContext& ctx) { if (port.Failed()) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(port.Code()); - NGLOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, port.Code().raw); + LOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, port.Code().raw); return; } diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index 0afd7981d..a880ca361 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -463,7 +463,7 @@ static void Fcntl(Interface* self) { } #endif } else { - NGLOG_ERROR(Service_SOC, "Unsupported command ({}) in fcntl call", ctr_cmd); + LOG_ERROR(Service_SOC, "Unsupported command ({}) in fcntl call", ctr_cmd); posix_ret = TranslateError(EINVAL); // TODO: Find the correct error return; } diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index e7de9bd6e..ce96845ad 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -69,7 +69,7 @@ void Y2R_U::SetInputFormat(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called input_format={}", static_cast(conversion.input_format)); + LOG_DEBUG(Service_Y2R, "called input_format={}", static_cast(conversion.input_format)); } void Y2R_U::GetInputFormat(Kernel::HLERequestContext& ctx) { @@ -79,7 +79,7 @@ void Y2R_U::GetInputFormat(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushEnum(conversion.input_format); - NGLOG_DEBUG(Service_Y2R, "called input_format={}", static_cast(conversion.input_format)); + LOG_DEBUG(Service_Y2R, "called input_format={}", static_cast(conversion.input_format)); } void Y2R_U::SetOutputFormat(Kernel::HLERequestContext& ctx) { @@ -90,7 +90,7 @@ void Y2R_U::SetOutputFormat(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called output_format={}", static_cast(conversion.output_format)); + LOG_DEBUG(Service_Y2R, "called output_format={}", static_cast(conversion.output_format)); } void Y2R_U::GetOutputFormat(Kernel::HLERequestContext& ctx) { @@ -100,7 +100,7 @@ void Y2R_U::GetOutputFormat(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushEnum(conversion.output_format); - NGLOG_DEBUG(Service_Y2R, "called output_format={}", static_cast(conversion.output_format)); + LOG_DEBUG(Service_Y2R, "called output_format={}", static_cast(conversion.output_format)); } void Y2R_U::SetRotation(Kernel::HLERequestContext& ctx) { @@ -111,7 +111,7 @@ void Y2R_U::SetRotation(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called rotation={}", static_cast(conversion.rotation)); + LOG_DEBUG(Service_Y2R, "called rotation={}", static_cast(conversion.rotation)); } void Y2R_U::GetRotation(Kernel::HLERequestContext& ctx) { @@ -121,7 +121,7 @@ void Y2R_U::GetRotation(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushEnum(conversion.rotation); - NGLOG_DEBUG(Service_Y2R, "called rotation={}", static_cast(conversion.rotation)); + LOG_DEBUG(Service_Y2R, "called rotation={}", static_cast(conversion.rotation)); } void Y2R_U::SetBlockAlignment(Kernel::HLERequestContext& ctx) { @@ -132,7 +132,7 @@ void Y2R_U::SetBlockAlignment(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called block_alignment={}", + LOG_DEBUG(Service_Y2R, "called block_alignment={}", static_cast(conversion.block_alignment)); } @@ -143,7 +143,7 @@ void Y2R_U::GetBlockAlignment(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushEnum(conversion.block_alignment); - NGLOG_DEBUG(Service_Y2R, "called block_alignment={}", + LOG_DEBUG(Service_Y2R, "called block_alignment={}", static_cast(conversion.block_alignment)); } @@ -155,7 +155,7 @@ void Y2R_U::SetSpacialDithering(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::GetSpacialDithering(Kernel::HLERequestContext& ctx) { @@ -165,7 +165,7 @@ void Y2R_U::GetSpacialDithering(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(spacial_dithering_enabled); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::SetTemporalDithering(Kernel::HLERequestContext& ctx) { @@ -175,7 +175,7 @@ void Y2R_U::SetTemporalDithering(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::GetTemporalDithering(Kernel::HLERequestContext& ctx) { @@ -185,7 +185,7 @@ void Y2R_U::GetTemporalDithering(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(temporal_dithering_enabled); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::SetTransferEndInterrupt(Kernel::HLERequestContext& ctx) { @@ -195,7 +195,7 @@ void Y2R_U::SetTransferEndInterrupt(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::GetTransferEndInterrupt(Kernel::HLERequestContext& ctx) { @@ -205,7 +205,7 @@ void Y2R_U::GetTransferEndInterrupt(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(transfer_end_interrupt_enabled); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::GetTransferEndEvent(Kernel::HLERequestContext& ctx) { @@ -215,7 +215,7 @@ void Y2R_U::GetTransferEndEvent(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushCopyObjects(completion_event); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::SetSendingY(Kernel::HLERequestContext& ctx) { @@ -230,7 +230,7 @@ void Y2R_U::SetSendingY(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, + LOG_DEBUG(Service_Y2R, "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " "src_process_id={}", conversion.src_Y.image_size, conversion.src_Y.transfer_unit, conversion.src_Y.gap, @@ -249,7 +249,7 @@ void Y2R_U::SetSendingU(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, + LOG_DEBUG(Service_Y2R, "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " "src_process_id={}", conversion.src_U.image_size, conversion.src_U.transfer_unit, conversion.src_U.gap, @@ -269,7 +269,7 @@ void Y2R_U::SetSendingV(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, + LOG_DEBUG(Service_Y2R, "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " "src_process_id={}", conversion.src_V.image_size, conversion.src_V.transfer_unit, conversion.src_V.gap, @@ -289,7 +289,7 @@ void Y2R_U::SetSendingYUYV(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, + LOG_DEBUG(Service_Y2R, "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " "src_process_id={}", conversion.src_YUYV.image_size, conversion.src_YUYV.transfer_unit, @@ -303,7 +303,7 @@ void Y2R_U::IsFinishedSendingYuv(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(1); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::IsFinishedSendingY(Kernel::HLERequestContext& ctx) { @@ -313,7 +313,7 @@ void Y2R_U::IsFinishedSendingY(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(1); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::IsFinishedSendingU(Kernel::HLERequestContext& ctx) { @@ -323,7 +323,7 @@ void Y2R_U::IsFinishedSendingU(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(1); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::IsFinishedSendingV(Kernel::HLERequestContext& ctx) { @@ -333,7 +333,7 @@ void Y2R_U::IsFinishedSendingV(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(1); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::SetReceiving(Kernel::HLERequestContext& ctx) { @@ -349,7 +349,7 @@ void Y2R_U::SetReceiving(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, + LOG_DEBUG(Service_Y2R, "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " "dst_process_id={}", conversion.dst.image_size, conversion.dst.transfer_unit, conversion.dst.gap, @@ -363,7 +363,7 @@ void Y2R_U::IsFinishedReceiving(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(1); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::SetInputLineWidth(Kernel::HLERequestContext& ctx) { @@ -373,7 +373,7 @@ void Y2R_U::SetInputLineWidth(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(conversion.SetInputLineWidth(input_line_width)); - NGLOG_DEBUG(Service_Y2R, "called input_line_width={}", input_line_width); + LOG_DEBUG(Service_Y2R, "called input_line_width={}", input_line_width); } void Y2R_U::GetInputLineWidth(Kernel::HLERequestContext& ctx) { @@ -383,7 +383,7 @@ void Y2R_U::GetInputLineWidth(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(conversion.input_line_width); - NGLOG_DEBUG(Service_Y2R, "called input_line_width={}", conversion.input_line_width); + LOG_DEBUG(Service_Y2R, "called input_line_width={}", conversion.input_line_width); } void Y2R_U::SetInputLines(Kernel::HLERequestContext& ctx) { @@ -393,7 +393,7 @@ void Y2R_U::SetInputLines(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(conversion.SetInputLines(input_lines)); - NGLOG_DEBUG(Service_Y2R, "called input_lines={}", input_lines); + LOG_DEBUG(Service_Y2R, "called input_lines={}", input_lines); } void Y2R_U::GetInputLines(Kernel::HLERequestContext& ctx) { @@ -403,7 +403,7 @@ void Y2R_U::GetInputLines(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(static_cast(conversion.input_lines)); - NGLOG_DEBUG(Service_Y2R, "called input_lines={}", conversion.input_lines); + LOG_DEBUG(Service_Y2R, "called input_lines={}", conversion.input_lines); } void Y2R_U::SetCoefficient(Kernel::HLERequestContext& ctx) { @@ -414,7 +414,7 @@ void Y2R_U::SetCoefficient(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called coefficients=[{:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}]", + LOG_DEBUG(Service_Y2R, "called coefficients=[{:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}]", conversion.coefficients[0], conversion.coefficients[1], conversion.coefficients[2], conversion.coefficients[3], conversion.coefficients[4], conversion.coefficients[5], conversion.coefficients[6], conversion.coefficients[7]); @@ -427,7 +427,7 @@ void Y2R_U::GetCoefficient(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushRaw(conversion.coefficients); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::SetStandardCoefficient(Kernel::HLERequestContext& ctx) { @@ -437,7 +437,7 @@ void Y2R_U::SetStandardCoefficient(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(conversion.SetStandardCoefficient(static_cast(index))); - NGLOG_DEBUG(Service_Y2R, "called standard_coefficient={}", index); + LOG_DEBUG(Service_Y2R, "called standard_coefficient={}", index); } void Y2R_U::GetStandardCoefficient(Kernel::HLERequestContext& ctx) { @@ -449,13 +449,13 @@ void Y2R_U::GetStandardCoefficient(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushRaw(standard_coefficients[index]); - NGLOG_DEBUG(Service_Y2R, "called standard_coefficient={} ", index); + LOG_DEBUG(Service_Y2R, "called standard_coefficient={} ", index); } else { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::CAM, ErrorSummary::InvalidArgument, ErrorLevel::Usage)); - NGLOG_ERROR(Service_Y2R, "called standard_coefficient={} The argument is invalid!", index); + LOG_ERROR(Service_Y2R, "called standard_coefficient={} The argument is invalid!", index); } } @@ -466,7 +466,7 @@ void Y2R_U::SetAlpha(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called alpha={}", conversion.alpha); + LOG_DEBUG(Service_Y2R, "called alpha={}", conversion.alpha); } void Y2R_U::GetAlpha(Kernel::HLERequestContext& ctx) { @@ -476,7 +476,7 @@ void Y2R_U::GetAlpha(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(conversion.alpha); - NGLOG_DEBUG(Service_Y2R, "called alpha={}", conversion.alpha); + LOG_DEBUG(Service_Y2R, "called alpha={}", conversion.alpha); } void Y2R_U::SetDitheringWeightParams(Kernel::HLERequestContext& ctx) { @@ -485,7 +485,7 @@ void Y2R_U::SetDitheringWeightParams(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::GetDitheringWeightParams(Kernel::HLERequestContext& ctx) { @@ -495,7 +495,7 @@ void Y2R_U::GetDitheringWeightParams(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushRaw(dithering_weight_params); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::StartConversion(Kernel::HLERequestContext& ctx) { @@ -514,7 +514,7 @@ void Y2R_U::StartConversion(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::StopConversion(Kernel::HLERequestContext& ctx) { @@ -523,7 +523,7 @@ void Y2R_U::StopConversion(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::IsBusyConversion(Kernel::HLERequestContext& ctx) { @@ -533,7 +533,7 @@ void Y2R_U::IsBusyConversion(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(0); // StartConversion always finishes immediately - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::SetPackageParameter(Kernel::HLERequestContext& ctx) { @@ -567,7 +567,7 @@ cleanup: IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(result); - NGLOG_DEBUG(Service_Y2R, + LOG_DEBUG(Service_Y2R, "called input_format={} output_format={} rotation={} block_alignment={} " "input_line_width={} input_lines={} standard_coefficient={} reserved={} alpha={:X}", static_cast(params.input_format), static_cast(params.output_format), @@ -583,7 +583,7 @@ void Y2R_U::PingProcess(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(0); - NGLOG_WARNING(Service_Y2R, "(STUBBED) called"); + LOG_WARNING(Service_Y2R, "(STUBBED) called"); } void Y2R_U::DriverInitialize(Kernel::HLERequestContext& ctx) { @@ -610,7 +610,7 @@ void Y2R_U::DriverInitialize(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::DriverFinalize(Kernel::HLERequestContext& ctx) { @@ -619,7 +619,7 @@ void Y2R_U::DriverFinalize(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } void Y2R_U::GetPackageParameter(Kernel::HLERequestContext& ctx) { @@ -629,7 +629,7 @@ void Y2R_U::GetPackageParameter(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushRaw(conversion); - NGLOG_DEBUG(Service_Y2R, "called"); + LOG_DEBUG(Service_Y2R, "called"); } Y2R_U::Y2R_U() : ServiceFramework("y2r:u", 1) { diff --git a/src/core/hw/aes/ccm.cpp b/src/core/hw/aes/ccm.cpp index 12f0466bc..71a682846 100644 --- a/src/core/hw/aes/ccm.cpp +++ b/src/core/hw/aes/ccm.cpp @@ -46,7 +46,7 @@ public: std::vector EncryptSignCCM(const std::vector& pdata, const CCMNonce& nonce, size_t slot_id) { if (!IsNormalKeyAvailable(slot_id)) { - NGLOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id); + LOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id); } const AESKey normal = GetNormalKey(slot_id); std::vector cipher(pdata.size() + CCM_MAC_SIZE); @@ -59,7 +59,7 @@ std::vector EncryptSignCCM(const std::vector& pdata, const CCMNonce& non new CryptoPP::AuthenticatedEncryptionFilter( e, new CryptoPP::ArraySink(cipher.data(), cipher.size()))); } catch (const CryptoPP::Exception& e) { - NGLOG_ERROR(HW_AES, "FAILED with: {}", e.what()); + LOG_ERROR(HW_AES, "FAILED with: {}", e.what()); } return cipher; } @@ -67,7 +67,7 @@ std::vector EncryptSignCCM(const std::vector& pdata, const CCMNonce& non std::vector DecryptVerifyCCM(const std::vector& cipher, const CCMNonce& nonce, size_t slot_id) { if (!IsNormalKeyAvailable(slot_id)) { - NGLOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id); + LOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id); } const AESKey normal = GetNormalKey(slot_id); const std::size_t pdata_size = cipher.size() - CCM_MAC_SIZE; @@ -81,11 +81,11 @@ std::vector DecryptVerifyCCM(const std::vector& cipher, const CCMNonce& d, new CryptoPP::ArraySink(pdata.data(), pdata_size)); CryptoPP::ArraySource as(cipher.data(), cipher.size(), true, new CryptoPP::Redirector(df)); if (!df.GetLastResult()) { - NGLOG_ERROR(HW_AES, "FAILED"); + LOG_ERROR(HW_AES, "FAILED"); return {}; } } catch (const CryptoPP::Exception& e) { - NGLOG_ERROR(HW_AES, "FAILED with: {}", e.what()); + LOG_ERROR(HW_AES, "FAILED with: {}", e.what()); return {}; } return pdata; diff --git a/src/core/hw/aes/key.cpp b/src/core/hw/aes/key.cpp index f86cb878c..37fb64088 100644 --- a/src/core/hw/aes/key.cpp +++ b/src/core/hw/aes/key.cpp @@ -91,7 +91,7 @@ void LoadPresetKeys() { std::vector parts; Common::SplitString(line, '=', parts); if (parts.size() != 2) { - NGLOG_ERROR(HW_AES, "Failed to parse {}", line); + LOG_ERROR(HW_AES, "Failed to parse {}", line); continue; } @@ -100,7 +100,7 @@ void LoadPresetKeys() { try { key = HexToKey(parts[1]); } catch (const std::logic_error& e) { - NGLOG_ERROR(HW_AES, "Invalid key {}: {}", parts[1], e.what()); + LOG_ERROR(HW_AES, "Invalid key {}: {}", parts[1], e.what()); continue; } @@ -112,12 +112,12 @@ void LoadPresetKeys() { size_t slot_id; char key_type; if (std::sscanf(name.c_str(), "slot0x%zXKey%c", &slot_id, &key_type) != 2) { - NGLOG_ERROR(HW_AES, "Invalid key name {}", name); + LOG_ERROR(HW_AES, "Invalid key name {}", name); continue; } if (slot_id >= MaxKeySlotID) { - NGLOG_ERROR(HW_AES, "Out of range slot ID {:#X}", slot_id); + LOG_ERROR(HW_AES, "Out of range slot ID {:#X}", slot_id); continue; } @@ -132,7 +132,7 @@ void LoadPresetKeys() { key_slots.at(slot_id).SetNormalKey(key); break; default: - NGLOG_ERROR(HW_AES, "Invalid key type {}", key_type); + LOG_ERROR(HW_AES, "Invalid key type {}", key_type); break; } } diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index cd15149b8..61ac7768e 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -40,7 +40,7 @@ inline void Read(T& var, const u32 raw_addr) { // Reads other than u32 are untested, so I'd rather have them abort than silently fail if (index >= Regs::NumIds() || !std::is_same::value) { - NGLOG_ERROR(HW_GPU, "unknown Read{} @ {:#010X}", sizeof(var) * 8, addr); + LOG_ERROR(HW_GPU, "unknown Read{} @ {:#010X}", sizeof(var) * 8, addr); return; } @@ -65,7 +65,7 @@ static Math::Vec4 DecodePixel(Regs::PixelFormat input_format, const u8* src_ return Color::DecodeRGBA4(src_pixel); default: - NGLOG_ERROR(HW_GPU, "Unknown source framebuffer format {:x}", + LOG_ERROR(HW_GPU, "Unknown source framebuffer format {:x}", static_cast(input_format)); return {0, 0, 0, 0}; } @@ -80,17 +80,17 @@ static void MemoryFill(const Regs::MemoryFillConfig& config) { // TODO: do hwtest with these cases if (!Memory::IsValidPhysicalAddress(start_addr)) { - NGLOG_CRITICAL(HW_GPU, "invalid start address {:#010X}", start_addr); + LOG_CRITICAL(HW_GPU, "invalid start address {:#010X}", start_addr); return; } if (!Memory::IsValidPhysicalAddress(end_addr)) { - NGLOG_CRITICAL(HW_GPU, "invalid end address {:#010X}", end_addr); + LOG_CRITICAL(HW_GPU, "invalid end address {:#010X}", end_addr); return; } if (end_addr <= start_addr) { - NGLOG_CRITICAL(HW_GPU, "invalid memory range from {:#010X} to {:#010X}", start_addr, + LOG_CRITICAL(HW_GPU, "invalid memory range from {:#010X} to {:#010X}", start_addr, end_addr); return; } @@ -133,32 +133,32 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) { // TODO: do hwtest with these cases if (!Memory::IsValidPhysicalAddress(src_addr)) { - NGLOG_CRITICAL(HW_GPU, "invalid input address {:#010X}", src_addr); + LOG_CRITICAL(HW_GPU, "invalid input address {:#010X}", src_addr); return; } if (!Memory::IsValidPhysicalAddress(dst_addr)) { - NGLOG_CRITICAL(HW_GPU, "invalid output address {:#010X}", dst_addr); + LOG_CRITICAL(HW_GPU, "invalid output address {:#010X}", dst_addr); return; } if (config.input_width == 0) { - NGLOG_CRITICAL(HW_GPU, "zero input width"); + LOG_CRITICAL(HW_GPU, "zero input width"); return; } if (config.input_height == 0) { - NGLOG_CRITICAL(HW_GPU, "zero input height"); + LOG_CRITICAL(HW_GPU, "zero input height"); return; } if (config.output_width == 0) { - NGLOG_CRITICAL(HW_GPU, "zero output width"); + LOG_CRITICAL(HW_GPU, "zero output width"); return; } if (config.output_height == 0) { - NGLOG_CRITICAL(HW_GPU, "zero output height"); + LOG_CRITICAL(HW_GPU, "zero output height"); return; } @@ -169,14 +169,14 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) { u8* dst_pointer = Memory::GetPhysicalPointer(dst_addr); if (config.scaling > config.ScaleXY) { - NGLOG_CRITICAL(HW_GPU, "Unimplemented display transfer scaling mode {}", + LOG_CRITICAL(HW_GPU, "Unimplemented display transfer scaling mode {}", config.scaling.Value()); UNIMPLEMENTED(); return; } if (config.input_linear && config.scaling != config.NoScale) { - NGLOG_CRITICAL(HW_GPU, "Scaling is only implemented on tiled input"); + LOG_CRITICAL(HW_GPU, "Scaling is only implemented on tiled input"); UNIMPLEMENTED(); return; } @@ -295,7 +295,7 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) { break; default: - NGLOG_ERROR(HW_GPU, "Unknown destination framebuffer format {:x}", + LOG_ERROR(HW_GPU, "Unknown destination framebuffer format {:x}", static_cast(config.output_format.Value())); break; } @@ -309,12 +309,12 @@ static void TextureCopy(const Regs::DisplayTransferConfig& config) { // TODO: do hwtest with invalid addresses if (!Memory::IsValidPhysicalAddress(src_addr)) { - NGLOG_CRITICAL(HW_GPU, "invalid input address {:#010X}", src_addr); + LOG_CRITICAL(HW_GPU, "invalid input address {:#010X}", src_addr); return; } if (!Memory::IsValidPhysicalAddress(dst_addr)) { - NGLOG_CRITICAL(HW_GPU, "invalid output address {:#010X}", dst_addr); + LOG_CRITICAL(HW_GPU, "invalid output address {:#010X}", dst_addr); return; } @@ -327,7 +327,7 @@ static void TextureCopy(const Regs::DisplayTransferConfig& config) { u32 remaining_size = Common::AlignDown(config.texture_copy.size, 16); if (remaining_size == 0) { - NGLOG_CRITICAL(HW_GPU, "zero size. Real hardware freezes on this."); + LOG_CRITICAL(HW_GPU, "zero size. Real hardware freezes on this."); return; } @@ -340,12 +340,12 @@ static void TextureCopy(const Regs::DisplayTransferConfig& config) { u32 output_width = output_gap == 0 ? remaining_size : config.texture_copy.output_width * 16; if (input_width == 0) { - NGLOG_CRITICAL(HW_GPU, "zero input width. Real hardware freezes on this."); + LOG_CRITICAL(HW_GPU, "zero input width. Real hardware freezes on this."); return; } if (output_width == 0) { - NGLOG_CRITICAL(HW_GPU, "zero output width. Real hardware freezes on this."); + LOG_CRITICAL(HW_GPU, "zero output width. Real hardware freezes on this."); return; } @@ -392,7 +392,7 @@ inline void Write(u32 addr, const T data) { // Writes other than u32 are untested, so I'd rather have them abort than silently fail if (index >= Regs::NumIds() || !std::is_same::value) { - NGLOG_ERROR(HW_GPU, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, + LOG_ERROR(HW_GPU, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, addr); return; } @@ -409,7 +409,7 @@ inline void Write(u32 addr, const T data) { if (config.trigger) { MemoryFill(config); - NGLOG_TRACE(HW_GPU, "MemoryFill from {:#010X} to {:#010X}", config.GetStartAddress(), + LOG_TRACE(HW_GPU, "MemoryFill from {:#010X} to {:#010X}", config.GetStartAddress(), config.GetEndAddress()); // It seems that it won't signal interrupt if "address_start" is zero. @@ -442,7 +442,7 @@ inline void Write(u32 addr, const T data) { if (config.is_texture_copy) { TextureCopy(config); - NGLOG_TRACE(HW_GPU, + LOG_TRACE(HW_GPU, "TextureCopy: {:#X} bytes from {:#010X}({}+{})-> " "{:#010X}({}+{}), flags {:#010X}", config.texture_copy.size, config.GetPhysicalInputAddress(), @@ -452,7 +452,7 @@ inline void Write(u32 addr, const T data) { config.texture_copy.output_gap * 16, config.flags); } else { DisplayTransfer(config); - NGLOG_TRACE(HW_GPU, + LOG_TRACE(HW_GPU, "DisplayTransfer: {:#010X}({}x{})-> " "{:#010X}({}x{}), dst format {:x}, flags {:#010X}", config.GetPhysicalInputAddress(), config.input_width.Value(), @@ -561,12 +561,12 @@ void Init() { vblank_event = CoreTiming::RegisterEvent("GPU::VBlankCallback", VBlankCallback); CoreTiming::ScheduleEvent(frame_ticks, vblank_event); - NGLOG_DEBUG(HW_GPU, "initialized OK"); + LOG_DEBUG(HW_GPU, "initialized OK"); } /// Shutdown hardware void Shutdown() { - NGLOG_DEBUG(HW_GPU, "shutdown OK"); + LOG_DEBUG(HW_GPU, "shutdown OK"); } } // namespace GPU diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index c1c97ee10..ff594db0e 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -36,7 +36,7 @@ inline void Read(T& var, const u32 addr) { LCD::Read(var, addr); break; default: - NGLOG_ERROR(HW_Memory, "unknown Read{} @ {:#010X}", sizeof(var) * 8, addr); + LOG_ERROR(HW_Memory, "unknown Read{} @ {:#010X}", sizeof(var) * 8, addr); } } @@ -65,7 +65,7 @@ inline void Write(u32 addr, const T data) { LCD::Write(addr, data); break; default: - NGLOG_ERROR(HW_Memory, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, + LOG_ERROR(HW_Memory, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, addr); } } @@ -90,13 +90,13 @@ void Init() { AES::InitKeys(); GPU::Init(); LCD::Init(); - NGLOG_DEBUG(HW, "initialized OK"); + LOG_DEBUG(HW, "initialized OK"); } /// Shutdown hardware void Shutdown() { GPU::Shutdown(); LCD::Shutdown(); - NGLOG_DEBUG(HW, "shutdown OK"); + LOG_DEBUG(HW, "shutdown OK"); } } // namespace HW diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp index a88aae89e..91b023c6c 100644 --- a/src/core/hw/lcd.cpp +++ b/src/core/hw/lcd.cpp @@ -21,7 +21,7 @@ inline void Read(T& var, const u32 raw_addr) { // Reads other than u32 are untested, so I'd rather have them abort than silently fail if (index >= 0x400 || !std::is_same::value) { - NGLOG_ERROR(HW_LCD, "unknown Read{} @ {:#010X}", sizeof(var) * 8, addr); + LOG_ERROR(HW_LCD, "unknown Read{} @ {:#010X}", sizeof(var) * 8, addr); return; } @@ -35,7 +35,7 @@ inline void Write(u32 addr, const T data) { // Writes other than u32 are untested, so I'd rather have them abort than silently fail if (index >= 0x400 || !std::is_same::value) { - NGLOG_ERROR(HW_LCD, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, + LOG_ERROR(HW_LCD, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, addr); return; } @@ -66,12 +66,12 @@ template void Write(u32 addr, const u8 data); /// Initialize hardware void Init() { memset(&g_regs, 0, sizeof(g_regs)); - NGLOG_DEBUG(HW_LCD, "initialized OK"); + LOG_DEBUG(HW_LCD, "initialized OK"); } /// Shutdown hardware void Shutdown() { - NGLOG_DEBUG(HW_LCD, "shutdown OK"); + LOG_DEBUG(HW_LCD, "shutdown OK"); } } // namespace LCD diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index 25de98567..eb54c8139 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp @@ -172,7 +172,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, for (unsigned current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) { const auto& table = reloc_table[current_inprogress]; - NGLOG_TRACE(Loader, "(t={},skip={},patch={})", current_segment_reloc_table, + LOG_TRACE(Loader, "(t={},skip={},patch={})", current_segment_reloc_table, static_cast(table.skip), static_cast(table.patch)); pos += table.skip; s32 num_patches = table.patch; @@ -182,7 +182,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, u32 orig_data = *pos; u32 sub_type = orig_data >> (32 - 4); u32 addr = TranslateAddr(orig_data & ~0xF0000000, &loadinfo, offsets); - NGLOG_TRACE(Loader, "Patching {:08X} <-- rel({:08X},{}) ({:08X})", in_addr, + LOG_TRACE(Loader, "Patching {:08X} <-- rel({:08X},{}) ({:08X})", in_addr, addr, current_segment_reloc_table, *pos); switch (current_segment_reloc_table) { case 0: { @@ -234,9 +234,9 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, code_set->entrypoint = code_set->code.addr; code_set->memory = std::make_shared>(std::move(program_image)); - NGLOG_DEBUG(Loader, "code size: {:#X}", loadinfo.seg_sizes[0]); - NGLOG_DEBUG(Loader, "rodata size: {:#X}", loadinfo.seg_sizes[1]); - NGLOG_DEBUG(Loader, "data size: {:#X} (including {:#X} of bss)", loadinfo.seg_sizes[2], + LOG_DEBUG(Loader, "code size: {:#X}", loadinfo.seg_sizes[0]); + LOG_DEBUG(Loader, "rodata size: {:#X}", loadinfo.seg_sizes[1]); + LOG_DEBUG(Loader, "data size: {:#X} (including {:#X} of bss)", loadinfo.seg_sizes[2], hdr.bss_size); *out_codeset = code_set; @@ -303,8 +303,8 @@ ResultStatus AppLoader_THREEDSX::ReadRomFS(std::shared_ptr& ro u32 romfs_offset = hdr.fs_offset; u32 romfs_size = static_cast(file.GetSize()) - hdr.fs_offset; - NGLOG_DEBUG(Loader, "RomFS offset: {:#010X}", romfs_offset); - NGLOG_DEBUG(Loader, "RomFS size: {:#010X}", romfs_size); + LOG_DEBUG(Loader, "RomFS offset: {:#010X}", romfs_offset); + LOG_DEBUG(Loader, "RomFS size: {:#010X}", romfs_size); // We reopen the file, to allow its position to be independent from file's romfs_file = std::make_shared(filepath, "rb"); @@ -316,7 +316,7 @@ ResultStatus AppLoader_THREEDSX::ReadRomFS(std::shared_ptr& ro return ResultStatus::Success; } - NGLOG_DEBUG(Loader, "3DSX has no RomFS"); + LOG_DEBUG(Loader, "3DSX has no RomFS"); return ResultStatus::ErrorNotUsed; } diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 85dff38ca..bb9e85b46 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -272,18 +272,18 @@ const char* ElfReader::GetSectionName(int section) const { } SharedPtr ElfReader::LoadInto(u32 vaddr) { - NGLOG_DEBUG(Loader, "String section: {}", header->e_shstrndx); + LOG_DEBUG(Loader, "String section: {}", header->e_shstrndx); // Should we relocate? relocate = (header->e_type != ET_EXEC); if (relocate) { - NGLOG_DEBUG(Loader, "Relocatable module"); + LOG_DEBUG(Loader, "Relocatable module"); entryPoint += vaddr; } else { - NGLOG_DEBUG(Loader, "Prerelocated executable"); + LOG_DEBUG(Loader, "Prerelocated executable"); } - NGLOG_DEBUG(Loader, "{} segments:", header->e_phnum); + LOG_DEBUG(Loader, "{} segments:", header->e_phnum); // First pass : Get the bits into RAM u32 base_addr = relocate ? vaddr : 0; @@ -303,7 +303,7 @@ SharedPtr ElfReader::LoadInto(u32 vaddr) { for (unsigned int i = 0; i < header->e_phnum; ++i) { Elf32_Phdr* p = &segments[i]; - NGLOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type, + LOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type, p->p_vaddr, p->p_filesz, p->p_memsz); if (p->p_type == PT_LOAD) { @@ -316,13 +316,13 @@ SharedPtr ElfReader::LoadInto(u32 vaddr) { } else if (permission_flags == (PF_R | PF_W)) { codeset_segment = &codeset->data; } else { - NGLOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i, + LOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i, p->p_flags); continue; } if (codeset_segment->size != 0) { - NGLOG_ERROR(Loader, + LOG_ERROR(Loader, "ELF has more than one segment of the same type. Skipping extra " "segment (id {})", i); @@ -344,7 +344,7 @@ SharedPtr ElfReader::LoadInto(u32 vaddr) { codeset->entrypoint = base_addr + header->e_entry; codeset->memory = std::make_shared>(std::move(program_image)); - NGLOG_DEBUG(Loader, "Done loading."); + LOG_DEBUG(Loader, "Done loading."); return codeset; } diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index afdcc017d..8c9c7778b 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -41,7 +41,7 @@ FileType IdentifyFile(FileUtil::IOFile& file) { FileType IdentifyFile(const std::string& file_name) { FileUtil::IOFile file(file_name, "rb"); if (!file.IsOpen()) { - NGLOG_ERROR(Loader, "Failed to load file {}", file_name); + LOG_ERROR(Loader, "Failed to load file {}", file_name); return FileType::Unknown; } @@ -123,7 +123,7 @@ static std::unique_ptr GetFileLoader(FileUtil::IOFile&& file, FileTyp std::unique_ptr GetLoader(const std::string& filename) { FileUtil::IOFile file(filename, "rb"); if (!file.IsOpen()) { - NGLOG_ERROR(Loader, "Failed to load file {}", filename); + LOG_ERROR(Loader, "Failed to load file {}", filename); return nullptr; } @@ -134,12 +134,12 @@ std::unique_ptr GetLoader(const std::string& filename) { FileType filename_type = GuessFromExtension(filename_extension); if (type != filename_type) { - NGLOG_WARNING(Loader, "File {} has a different type than its extension.", filename); + LOG_WARNING(Loader, "File {} has a different type than its extension.", filename); if (FileType::Unknown == type) type = filename_type; } - NGLOG_DEBUG(Loader, "Loading file {} as {}...", filename, GetFileTypeString(type)); + LOG_DEBUG(Loader, "Loading file {} as {}...", filename, GetFileTypeString(type)); return GetFileLoader(std::move(file), type, filename_filename, filename); } diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index a6140b455..9b29d8528 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -156,7 +156,7 @@ ResultStatus AppLoader_NCCH::Load(Kernel::SharedPtr& process) { ReadProgramId(ncch_program_id); std::string program_id{Common::StringFromFormat("%016" PRIX64, ncch_program_id)}; - NGLOG_INFO(Loader, "Program ID: {}", program_id); + LOG_INFO(Loader, "Program ID: {}", program_id); update_ncch.OpenFile(Service::AM::GetTitleContentPath(Service::FS::MediaType::SDMC, ncch_program_id | UPDATE_MASK)); diff --git a/src/core/memory.cpp b/src/core/memory.cpp index de4eeb71f..bd6957e37 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -38,7 +38,7 @@ PageTable* GetCurrentPageTable() { } static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { - NGLOG_DEBUG(HW_Memory, "Mapping {} onto {:08X}-{:08X}", (void*)memory, base * PAGE_SIZE, + LOG_DEBUG(HW_Memory, "Mapping {} onto {:08X}-{:08X}", (void*)memory, base * PAGE_SIZE, (base + size) * PAGE_SIZE); RasterizerFlushVirtualRegion(base << PAGE_BITS, size * PAGE_SIZE, @@ -151,7 +151,7 @@ T Read(const VAddr vaddr) { PageType type = current_page_table->attributes[vaddr >> PAGE_BITS]; switch (type) { case PageType::Unmapped: - NGLOG_ERROR(HW_Memory, "unmapped Read{} @ 0x{:08X}", sizeof(T) * 8, vaddr); + LOG_ERROR(HW_Memory, "unmapped Read{} @ 0x{:08X}", sizeof(T) * 8, vaddr); return 0; case PageType::Memory: ASSERT_MSG(false, "Mapped memory page without a pointer @ {:08X}", vaddr); @@ -188,7 +188,7 @@ void Write(const VAddr vaddr, const T data) { PageType type = current_page_table->attributes[vaddr >> PAGE_BITS]; switch (type) { case PageType::Unmapped: - NGLOG_ERROR(HW_Memory, "unmapped Write{} 0x{:08X} @ 0x{:08X}", sizeof(data) * 8, (u32)data, + LOG_ERROR(HW_Memory, "unmapped Write{} 0x{:08X} @ 0x{:08X}", sizeof(data) * 8, (u32)data, vaddr); return; case PageType::Memory: @@ -246,7 +246,7 @@ u8* GetPointer(const VAddr vaddr) { return GetPointerFromVMA(vaddr); } - NGLOG_ERROR(HW_Memory, "unknown GetPointer @ 0x{:08x}", vaddr); + LOG_ERROR(HW_Memory, "unknown GetPointer @ 0x{:08x}", vaddr); return nullptr; } @@ -284,12 +284,12 @@ u8* GetPhysicalPointer(PAddr address) { }); if (area == std::end(memory_areas)) { - NGLOG_ERROR(HW_Memory, "unknown GetPhysicalPointer @ 0x{:08X}", address); + LOG_ERROR(HW_Memory, "unknown GetPhysicalPointer @ 0x{:08X}", address); return nullptr; } if (area->paddr_base == IO_AREA_PADDR) { - NGLOG_ERROR(HW_Memory, "MMIO mappings are not supported yet. phys_addr=0x{:08X}", address); + LOG_ERROR(HW_Memory, "MMIO mappings are not supported yet. phys_addr=0x{:08X}", address); return nullptr; } @@ -339,7 +339,7 @@ void RasterizerMarkRegionCached(PAddr start, u32 size, bool cached) { // the end address of VRAM, causing the Virtual->Physical translation to fail when flushing // parts of the texture. if (!maybe_vaddr) { - NGLOG_ERROR(HW_Memory, + LOG_ERROR(HW_Memory, "Trying to flush a cached region to an invalid physical address {:08X}", paddr); continue; @@ -485,7 +485,7 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_ switch (page_table.attributes[page_index]) { case PageType::Unmapped: { - NGLOG_ERROR(HW_Memory, + LOG_ERROR(HW_Memory, "unmapped ReadBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", current_vaddr, src_addr, size); std::memset(dest_buffer, 0, copy_amount); @@ -554,7 +554,7 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi switch (page_table.attributes[page_index]) { case PageType::Unmapped: { - NGLOG_ERROR(HW_Memory, + LOG_ERROR(HW_Memory, "unmapped WriteBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", current_vaddr, dest_addr, size); break; @@ -607,7 +607,7 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size switch (page_table.attributes[page_index]) { case PageType::Unmapped: { - NGLOG_ERROR(HW_Memory, + LOG_ERROR(HW_Memory, "unmapped ZeroBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", current_vaddr, dest_addr, size); break; @@ -657,7 +657,7 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, switch (page_table.attributes[page_index]) { case PageType::Unmapped: { - NGLOG_ERROR(HW_Memory, + LOG_ERROR(HW_Memory, "unmapped CopyBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", current_vaddr, src_addr, size); ZeroBlock(process, dest_addr, copy_amount); @@ -762,7 +762,7 @@ boost::optional TryVirtualToPhysicalAddress(const VAddr addr) { PAddr VirtualToPhysicalAddress(const VAddr addr) { auto paddr = TryVirtualToPhysicalAddress(addr); if (!paddr) { - NGLOG_ERROR(HW_Memory, "Unknown virtual address @ 0x{:08X}", addr); + LOG_ERROR(HW_Memory, "Unknown virtual address @ 0x{:08X}", addr); // To help with debugging, set bit on address so that it's obviously invalid. return addr | 0x80000000; } diff --git a/src/core/movie.cpp b/src/core/movie.cpp index 92a65c197..8270cfe66 100644 --- a/src/core/movie.cpp +++ b/src/core/movie.cpp @@ -127,7 +127,7 @@ bool Movie::IsRecordingInput() { void Movie::CheckInputEnd() { if (current_byte + sizeof(ControllerState) > recorded_input.size()) { - NGLOG_INFO(Movie, "Playback finished"); + LOG_INFO(Movie, "Playback finished"); play_mode = PlayMode::None; } } @@ -138,7 +138,7 @@ void Movie::Play(Service::HID::PadState& pad_state, s16& circle_pad_x, s16& circ current_byte += sizeof(ControllerState); if (s.type != ControllerStateType::PadAndCircle) { - NGLOG_ERROR(Movie, + LOG_ERROR(Movie, "Expected to read type {}, but found {}. Your playback will be out of sync", static_cast(ControllerStateType::PadAndCircle), static_cast(s.type)); return; @@ -167,7 +167,7 @@ void Movie::Play(Service::HID::TouchDataEntry& touch_data) { current_byte += sizeof(ControllerState); if (s.type != ControllerStateType::Touch) { - NGLOG_ERROR(Movie, + LOG_ERROR(Movie, "Expected to read type {}, but found {}. Your playback will be out of sync", static_cast(ControllerStateType::Touch), static_cast(s.type)); return; @@ -184,7 +184,7 @@ void Movie::Play(Service::HID::AccelerometerDataEntry& accelerometer_data) { current_byte += sizeof(ControllerState); if (s.type != ControllerStateType::Accelerometer) { - NGLOG_ERROR(Movie, + LOG_ERROR(Movie, "Expected to read type {}, but found {}. Your playback will be out of sync", static_cast(ControllerStateType::Accelerometer), static_cast(s.type)); return; @@ -201,7 +201,7 @@ void Movie::Play(Service::HID::GyroscopeDataEntry& gyroscope_data) { current_byte += sizeof(ControllerState); if (s.type != ControllerStateType::Gyroscope) { - NGLOG_ERROR(Movie, + LOG_ERROR(Movie, "Expected to read type {}, but found {}. Your playback will be out of sync", static_cast(ControllerStateType::Gyroscope), static_cast(s.type)); return; @@ -218,7 +218,7 @@ void Movie::Play(Service::IR::PadState& pad_state, s16& c_stick_x, s16& c_stick_ current_byte += sizeof(ControllerState); if (s.type != ControllerStateType::IrRst) { - NGLOG_ERROR(Movie, + LOG_ERROR(Movie, "Expected to read type {}, but found {}. Your playback will be out of sync", static_cast(ControllerStateType::IrRst), static_cast(s.type)); return; @@ -236,7 +236,7 @@ void Movie::Play(Service::IR::ExtraHIDResponse& extra_hid_response) { current_byte += sizeof(ControllerState); if (s.type != ControllerStateType::ExtraHidResponse) { - NGLOG_ERROR( + LOG_ERROR( Movie, "Expected to read type {}, but found {}. Your playback will be out of sync", static_cast(ControllerStateType::ExtraHidResponse), static_cast(s.type)); return; @@ -342,7 +342,7 @@ void Movie::Record(const Service::IR::ExtraHIDResponse& extra_hid_response) { bool Movie::ValidateHeader(const CTMHeader& header) { if (header_magic_bytes != header.filetype) { - NGLOG_ERROR(Movie, "Playback file does not have valid header"); + LOG_ERROR(Movie, "Playback file does not have valid header"); return false; } @@ -351,25 +351,25 @@ bool Movie::ValidateHeader(const CTMHeader& header) { revision = Common::ToLower(revision); if (revision != Common::g_scm_rev) { - NGLOG_WARNING( + LOG_WARNING( Movie, "This movie was created on a different version of Citra, playback may desync"); } u64 program_id; Core::System::GetInstance().GetAppLoader().ReadProgramId(program_id); if (program_id != header.program_id) { - NGLOG_WARNING(Movie, "This movie was recorded using a ROM with a different program id"); + LOG_WARNING(Movie, "This movie was recorded using a ROM with a different program id"); } return true; } void Movie::SaveMovie() { - NGLOG_INFO(Movie, "Saving movie"); + LOG_INFO(Movie, "Saving movie"); FileUtil::IOFile save_record(Settings::values.movie_record, "wb"); if (!save_record.IsGood()) { - NGLOG_ERROR(Movie, "Unable to open file to save movie"); + LOG_ERROR(Movie, "Unable to open file to save movie"); return; } @@ -387,13 +387,13 @@ void Movie::SaveMovie() { save_record.WriteBytes(recorded_input.data(), recorded_input.size()); if (!save_record.IsGood()) { - NGLOG_ERROR(Movie, "Error saving movie"); + LOG_ERROR(Movie, "Error saving movie"); } } void Movie::Init() { if (!Settings::values.movie_play.empty()) { - NGLOG_INFO(Movie, "Loading Movie for playback"); + LOG_INFO(Movie, "Loading Movie for playback"); FileUtil::IOFile save_record(Settings::values.movie_play, "rb"); u64 size = save_record.GetSize(); @@ -407,13 +407,13 @@ void Movie::Init() { current_byte = 0; } } else { - NGLOG_ERROR(Movie, "Failed to playback movie: Unable to open '{}'", + LOG_ERROR(Movie, "Failed to playback movie: Unable to open '{}'", Settings::values.movie_play); } } if (!Settings::values.movie_record.empty()) { - NGLOG_INFO(Movie, "Enabling Movie recording"); + LOG_INFO(Movie, "Enabling Movie recording"); play_mode = PlayMode::Recording; } } diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index c253d2db1..d463e1432 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -50,14 +50,14 @@ u64 GetTelemetryId() { if (FileUtil::Exists(filename)) { FileUtil::IOFile file(filename, "rb"); if (!file.IsOpen()) { - NGLOG_ERROR(Core, "failed to open telemetry_id: {}", filename); + LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); return {}; } file.ReadBytes(&telemetry_id, sizeof(u64)); } else { FileUtil::IOFile file(filename, "wb"); if (!file.IsOpen()) { - NGLOG_ERROR(Core, "failed to open telemetry_id: {}", filename); + LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); return {}; } telemetry_id = GenerateTelemetryId(); @@ -73,7 +73,7 @@ u64 RegenerateTelemetryId() { FileUtil::IOFile file(filename, "wb"); if (!file.IsOpen()) { - NGLOG_ERROR(Core, "failed to open telemetry_id: {}", filename); + LOG_ERROR(Core, "failed to open telemetry_id: {}", filename); return {}; } file.WriteBytes(&new_telemetry_id, sizeof(u64)); diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp index 2f848c994..af032f0c9 100644 --- a/src/core/tracer/recorder.cpp +++ b/src/core/tracer/recorder.cpp @@ -159,7 +159,7 @@ void Recorder::Finish(const std::string& filename) { throw "Failed to write stream element"; } } catch (const char* str) { - NGLOG_ERROR(HW_GPU, "Writing CiTrace file failed: {}", str); + LOG_ERROR(HW_GPU, "Writing CiTrace file failed: {}", str); } } diff --git a/src/input_common/sdl/sdl.cpp b/src/input_common/sdl/sdl.cpp index 66240b903..ddcedbd81 100644 --- a/src/input_common/sdl/sdl.cpp +++ b/src/input_common/sdl/sdl.cpp @@ -32,7 +32,7 @@ public: explicit SDLJoystick(int joystick_index) : joystick{SDL_JoystickOpen(joystick_index), SDL_JoystickClose} { if (!joystick) { - NGLOG_ERROR(Input, "failed to open joystick {}", joystick_index); + LOG_ERROR(Input, "failed to open joystick {}", joystick_index); } } @@ -204,7 +204,7 @@ public: trigger_if_greater = false; } else { trigger_if_greater = true; - NGLOG_ERROR(Input, "Unknown direction {}", direction_name); + LOG_ERROR(Input, "Unknown direction {}", direction_name); } return std::make_unique(GetJoystick(joystick_index), axis, threshold, trigger_if_greater); @@ -235,7 +235,7 @@ public: void Init() { if (SDL_Init(SDL_INIT_JOYSTICK) < 0) { - NGLOG_CRITICAL(Input, "SDL_Init(SDL_INIT_JOYSTICK) failed with: {}", SDL_GetError()); + LOG_CRITICAL(Input, "SDL_Init(SDL_INIT_JOYSTICK) failed with: {}", SDL_GetError()); } else { using namespace Input; RegisterFactory("sdl", std::make_shared()); diff --git a/src/network/network.cpp b/src/network/network.cpp index 829675357..51b5d6a9f 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -15,12 +15,12 @@ static std::shared_ptr g_room; ///< Room (Server) for network bool Init() { if (enet_initialize() != 0) { - NGLOG_ERROR(Network, "Error initalizing ENet"); + LOG_ERROR(Network, "Error initalizing ENet"); return false; } g_room = std::make_shared(); g_room_member = std::make_shared(); - NGLOG_DEBUG(Network, "initialized OK"); + LOG_DEBUG(Network, "initialized OK"); return true; } @@ -44,7 +44,7 @@ void Shutdown() { g_room.reset(); } enet_deinitialize(); - NGLOG_DEBUG(Network, "shutdown OK"); + LOG_DEBUG(Network, "shutdown OK"); } } // namespace Network diff --git a/src/network/room.cpp b/src/network/room.cpp index 1a61394d9..89ca13083 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -408,7 +408,7 @@ void Room::RoomImpl::HandleWifiPacket(const ENetEvent* event) { if (member != members.end()) { enet_peer_send(member->peer, 0, enet_packet); } else { - NGLOG_ERROR(Network, + LOG_ERROR(Network, "Attempting to send to unknown MAC address: " "{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}", destination_address[0], destination_address[1], destination_address[2], diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 3e533034d..e73e159a2 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -68,7 +68,7 @@ static void WriteUniformIntReg(Shader::ShaderSetup& setup, unsigned index, const Math::Vec4& values) { ASSERT(index < setup.uniforms.i.size()); setup.uniforms.i[index] = values; - NGLOG_TRACE(HW_GPU, "Set {} integer uniform {} to {:02x} {:02x} {:02x} {:02x}", + LOG_TRACE(HW_GPU, "Set {} integer uniform {} to {:02x} {:02x} {:02x} {:02x}", GetShaderSetupTypeName(setup), index, values.x, values.y, values.z, values.w); } @@ -90,7 +90,7 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup, auto& uniform = setup.uniforms.f[uniform_setup.index]; if (uniform_setup.index >= 96) { - NGLOG_ERROR(HW_GPU, "Invalid {} float uniform index {}", GetShaderSetupTypeName(setup), + LOG_ERROR(HW_GPU, "Invalid {} float uniform index {}", GetShaderSetupTypeName(setup), (int)uniform_setup.index); } else { @@ -108,7 +108,7 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup, uniform.x = float24::FromRaw(uniform_write_buffer[2] & 0xFFFFFF); } - NGLOG_TRACE(HW_GPU, "Set {} float uniform {:x} to ({} {} {} {})", + LOG_TRACE(HW_GPU, "Set {} float uniform {:x} to ({} {} {} {})", GetShaderSetupTypeName(setup), (int)uniform_setup.index, uniform.x.ToFloat32(), uniform.y.ToFloat32(), uniform.z.ToFloat32(), uniform.w.ToFloat32()); @@ -123,7 +123,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { auto& regs = g_state.regs; if (id >= Regs::NUM_REGS) { - NGLOG_ERROR( + LOG_ERROR( HW_GPU, "Commandlist tried to write to invalid register 0x{:03X} (value: {:08X}, mask: {:X})", id, value, mask); @@ -184,7 +184,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { auto& setup = regs.pipeline.vs_default_attributes_setup; if (setup.index >= 16) { - NGLOG_ERROR(HW_GPU, "Invalid VS default attribute index {}", (int)setup.index); + LOG_ERROR(HW_GPU, "Invalid VS default attribute index {}", (int)setup.index); break; } @@ -198,7 +198,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { ((default_attr_write_buffer[2] >> 24) & 0xFF)); attribute.x = float24::FromRaw(default_attr_write_buffer[2] & 0xFFFFFF); - NGLOG_TRACE(HW_GPU, "Set default VS attribute {:x} to ({} {} {} {})", (int)setup.index, + LOG_TRACE(HW_GPU, "Set default VS attribute {:x} to ({} {} {} {})", (int)setup.index, attribute.x.ToFloat32(), attribute.y.ToFloat32(), attribute.z.ToFloat32(), attribute.w.ToFloat32()); @@ -474,7 +474,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { case PICA_REG_INDEX_WORKAROUND(gs.program.set_word[7], 0x2a3): { u32& offset = g_state.regs.gs.program.offset; if (offset >= 4096) { - NGLOG_ERROR(HW_GPU, "Invalid GS program offset {}", offset); + LOG_ERROR(HW_GPU, "Invalid GS program offset {}", offset); } else { g_state.gs.program_code[offset] = value; g_state.gs.MarkProgramCodeDirty(); @@ -493,7 +493,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { case PICA_REG_INDEX_WORKAROUND(gs.swizzle_patterns.set_word[7], 0x2ad): { u32& offset = g_state.regs.gs.swizzle_patterns.offset; if (offset >= g_state.gs.swizzle_data.size()) { - NGLOG_ERROR(HW_GPU, "Invalid GS swizzle pattern offset {}", offset); + LOG_ERROR(HW_GPU, "Invalid GS swizzle pattern offset {}", offset); } else { g_state.gs.swizzle_data[offset] = value; g_state.gs.MarkSwizzleDataDirty(); @@ -543,7 +543,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { case PICA_REG_INDEX_WORKAROUND(vs.program.set_word[7], 0x2d3): { u32& offset = g_state.regs.vs.program.offset; if (offset >= 512) { - NGLOG_ERROR(HW_GPU, "Invalid VS program offset {}", offset); + LOG_ERROR(HW_GPU, "Invalid VS program offset {}", offset); } else { g_state.vs.program_code[offset] = value; g_state.vs.MarkProgramCodeDirty(); @@ -566,7 +566,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { case PICA_REG_INDEX_WORKAROUND(vs.swizzle_patterns.set_word[7], 0x2dd): { u32& offset = g_state.regs.vs.swizzle_patterns.offset; if (offset >= g_state.vs.swizzle_data.size()) { - NGLOG_ERROR(HW_GPU, "Invalid VS swizzle pattern offset {}", offset); + LOG_ERROR(HW_GPU, "Invalid VS swizzle pattern offset {}", offset); } else { g_state.vs.swizzle_data[offset] = value; g_state.vs.MarkSwizzleDataDirty(); diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 269ae792d..96976a273 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -178,7 +178,7 @@ void DumpShader(const std::string& filename, const ShaderRegs& config, } } catch (const std::out_of_range&) { DEBUG_ASSERT_MSG(false, "Unknown output attribute mapping"); - NGLOG_ERROR(HW_GPU, + LOG_ERROR(HW_GPU, "Unknown output attribute mapping: {:03x}, {:03x}, {:03x}, {:03x}", (int)output_attributes[i].map_x.Value(), (int)output_attributes[i].map_y.Value(), @@ -278,7 +278,7 @@ bool g_is_pica_tracing = false; void StartPicaTracing() { if (g_is_pica_tracing) { - NGLOG_WARNING(HW_GPU, "StartPicaTracing called even though tracing already running!"); + LOG_WARNING(HW_GPU, "StartPicaTracing called even though tracing already running!"); return; } @@ -299,7 +299,7 @@ void OnPicaRegWrite(PicaTrace::Write write) { std::unique_ptr FinishPicaTracing() { if (!g_is_pica_tracing) { - NGLOG_WARNING(HW_GPU, "FinishPicaTracing called even though tracing isn't running!"); + LOG_WARNING(HW_GPU, "FinishPicaTracing called even though tracing isn't running!"); return {}; } @@ -457,7 +457,7 @@ void DumpTevStageConfig(const std::array& stag GetTevStageConfigColorCombinerString(tev_stage) + " " + GetTevStageConfigAlphaCombinerString(tev_stage) + "\n"; } - NGLOG_TRACE(HW_GPU, "{}", stage_info); + LOG_TRACE(HW_GPU, "{}", stage_info); } } // namespace DebugUtils diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h index af5629877..95b3a40d6 100644 --- a/src/video_core/gpu_debugger.h +++ b/src/video_core/gpu_debugger.h @@ -30,7 +30,7 @@ public: virtual void GXCommandProcessed(int total_command_count) { const Service::GSP::Command& cmd = observed->ReadGXCommandHistory(total_command_count - 1); - NGLOG_TRACE(Debug_GPU, "Received command: id={:x}", (int)cmd.id.Value()); + LOG_TRACE(Debug_GPU, "Received command: id={:x}", (int)cmd.id.Value()); } protected: diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp index fd22ff4be..cdc484d67 100644 --- a/src/video_core/primitive_assembly.cpp +++ b/src/video_core/primitive_assembly.cpp @@ -48,7 +48,7 @@ void PrimitiveAssembler::SubmitVertex(const VertexType& vtx, break; default: - NGLOG_ERROR(HW_GPU, "Unknown triangle topology {:x}:", (int)topology); + LOG_ERROR(HW_GPU, "Unknown triangle topology {:x}:", (int)topology); break; } } diff --git a/src/video_core/regs_framebuffer.h b/src/video_core/regs_framebuffer.h index 56bc7ce54..578c27e79 100644 --- a/src/video_core/regs_framebuffer.h +++ b/src/video_core/regs_framebuffer.h @@ -200,7 +200,7 @@ struct FramebufferRegs { case ColorFormat::RGBA4: return 2; default: - NGLOG_CRITICAL(HW_GPU, "Unknown color format {}", static_cast(format)); + LOG_CRITICAL(HW_GPU, "Unknown color format {}", static_cast(format)); UNIMPLEMENTED(); } } diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 9f07e38d2..a4567c1a4 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -43,7 +43,7 @@ RasterizerOpenGL::RasterizerOpenGL() allow_shadow = GLAD_GL_ARB_shader_image_load_store && GLAD_GL_ARB_shader_image_size && GLAD_GL_ARB_framebuffer_no_attachments; if (!allow_shadow) { - NGLOG_WARNING( + LOG_WARNING( Render_OpenGL, "Shadow might not be able to render because of unsupported OpenGL extensions."); } @@ -432,7 +432,7 @@ bool RasterizerOpenGL::AccelerateDrawBatchInternal(bool is_indexed, bool use_gs) auto [vs_input_index_min, vs_input_index_max, vs_input_size] = AnalyzeVertexArray(is_indexed); if (vs_input_size > VERTEX_BUFFER_SIZE) { - NGLOG_WARNING(Render_OpenGL, "Too large vertex input size {}", vs_input_size); + LOG_WARNING(Render_OpenGL, "Too large vertex input size {}", vs_input_size); return false; } @@ -453,7 +453,7 @@ bool RasterizerOpenGL::AccelerateDrawBatchInternal(bool is_indexed, bool use_gs) std::size_t index_buffer_size = regs.pipeline.num_vertices * (index_u16 ? 2 : 1); if (index_buffer_size > INDEX_BUFFER_SIZE) { - NGLOG_WARNING(Render_OpenGL, "Too large index input size {}", index_buffer_size); + LOG_WARNING(Render_OpenGL, "Too large index input size {}", index_buffer_size); return false; } @@ -1600,7 +1600,7 @@ void RasterizerOpenGL::SyncCullMode() { break; default: - NGLOG_CRITICAL(Render_OpenGL, "Unknown cull mode {}", + LOG_CRITICAL(Render_OpenGL, "Unknown cull mode {}", static_cast(regs.rasterizer.cull_mode.Value())); UNIMPLEMENTED(); break; diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index cde356061..d870dd9e2 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -1390,7 +1390,7 @@ SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces( // Make sure that framebuffers don't overlap if both color and depth are being used if (using_color_fb && using_depth_fb && boost::icl::length(color_vp_interval & depth_vp_interval)) { - NGLOG_CRITICAL(Render_OpenGL, "Color and depth framebuffer memory regions overlap; " + LOG_CRITICAL(Render_OpenGL, "Color and depth framebuffer memory regions overlap; " "overlapping framebuffers not supported!"); using_depth_fb = false; } diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 403983bc6..fe83de426 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -546,9 +546,9 @@ private: const CompareOp op_y = instr.common.compare_op.y.Value(); if (cmp_ops.find(op_x) == cmp_ops.end()) { - NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast(op_x)); + LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast(op_x)); } else if (cmp_ops.find(op_y) == cmp_ops.end()) { - NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast(op_y)); + LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast(op_y)); } else if (op_x != op_y) { shader.AddLine("conditional_code.x = " + src1 + ".x " + cmp_ops.find(op_x)->second.first + " " + src2 + ".x;"); @@ -572,7 +572,7 @@ private: } default: { - NGLOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}", + LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}", (int)instr.opcode.Value().EffectiveOpCode(), instr.opcode.Value().GetInfo().name, instr.hex); throw DecompileFail("Unhandled instruction"); @@ -616,7 +616,7 @@ private: SetDest(swizzle, dest_reg, src1 + " * " + src2 + " + " + src3, 4, 4); } } else { - NGLOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}", + LOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}", (int)instr.opcode.Value().EffectiveOpCode(), instr.opcode.Value().GetInfo().name, instr.hex); throw DecompileFail("Unhandled instruction"); @@ -770,7 +770,7 @@ private: } default: { - NGLOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}", + LOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}", (int)instr.opcode.Value().EffectiveOpCode(), instr.opcode.Value().GetInfo().name, instr.hex); throw DecompileFail("Unhandled instruction"); @@ -921,7 +921,7 @@ boost::optional DecompileProgram(const ProgramCode& program_code, inputreg_getter, outputreg_getter, sanitize_mul, is_gs); return generator.MoveShaderCode(); } catch (const DecompileFail& exception) { - NGLOG_INFO(HW_GPU, "Shader decompilation failed: {}", exception.what()); + LOG_INFO(HW_GPU, "Shader decompilation failed: {}", exception.what()); return boost::none; } } diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 7ccbb6de8..32a4c4069 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -269,7 +269,7 @@ void PicaGSConfigCommonRaw::Init(const Pica::Regs& regs) { if (static_cast(semantic) < 24) { semantic_maps[static_cast(semantic)] = {attrib, comp}; } else if (semantic != VSOutputAttributes::INVALID) { - NGLOG_ERROR(Render_OpenGL, "Invalid/unknown semantic id: {}", + LOG_ERROR(Render_OpenGL, "Invalid/unknown semantic id: {}", static_cast(semantic)); } } @@ -320,7 +320,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un case TexturingRegs::TextureConfig::ShadowCube: return "shadowTextureCube(texcoord0, texcoord0_w)"; default: - NGLOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}", + LOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}", static_cast(state.texture0_type)); UNIMPLEMENTED(); return "texture(tex0, texcoord0)"; @@ -336,7 +336,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un if (state.proctex.enable) { return "ProcTex()"; } else { - NGLOG_DEBUG(Render_OpenGL, "Using Texture3 without enabling it"); + LOG_DEBUG(Render_OpenGL, "Using Texture3 without enabling it"); return "vec4(0.0)"; } default: @@ -383,7 +383,7 @@ static void AppendSource(std::string& out, const PicaFSConfig& config, break; default: out += "vec4(0.0)"; - NGLOG_CRITICAL(Render_OpenGL, "Unknown source op {}", static_cast(source)); + LOG_CRITICAL(Render_OpenGL, "Unknown source op {}", static_cast(source)); break; } } @@ -441,7 +441,7 @@ static void AppendColorModifier(std::string& out, const PicaFSConfig& config, break; default: out += "vec3(0.0)"; - NGLOG_CRITICAL(Render_OpenGL, "Unknown color modifier op {}", static_cast(modifier)); + LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op {}", static_cast(modifier)); break; } } @@ -490,7 +490,7 @@ static void AppendAlphaModifier(std::string& out, const PicaFSConfig& config, break; default: out += "0.0"; - NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op {}", static_cast(modifier)); + LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op {}", static_cast(modifier)); break; } } @@ -534,7 +534,7 @@ static void AppendColorCombiner(std::string& out, TevStageConfig::Operation oper break; default: out += "vec3(0.0)"; - NGLOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: {}", + LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: {}", static_cast(operation)); break; } @@ -575,7 +575,7 @@ static void AppendAlphaCombiner(std::string& out, TevStageConfig::Operation oper break; default: out += "0.0"; - NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: {}", + LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: {}", static_cast(operation)); break; } @@ -606,7 +606,7 @@ static void AppendAlphaTestCondition(std::string& out, FramebufferRegs::CompareF default: out += "false"; - NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition {}", static_cast(func)); + LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition {}", static_cast(func)); break; } } @@ -776,7 +776,7 @@ static void WriteLighting(std::string& out, const PicaFSConfig& config) { break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown lighting LUT input {}\n", (int)input); + LOG_CRITICAL(HW_GPU, "Unknown lighting LUT input {}\n", (int)input); UNIMPLEMENTED(); index = "0.0"; break; @@ -992,7 +992,7 @@ void AppendProcTexShiftOffset(std::string& out, const std::string& v, ProcTexShi out += offset + " * (((int(" + v + ") + 1) / 2) % 2)"; break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast(mode)); + LOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast(mode)); out += "0"; break; } @@ -1018,7 +1018,7 @@ void AppendProcTexClamp(std::string& out, const std::string& var, ProcTexClamp m out += var + " = " + var + " > 0.5 ? 1.0 : 0.0;\n"; break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast(mode)); + LOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast(mode)); out += var + " = " + "min(" + var + ", 1.0);\n"; break; } @@ -1059,7 +1059,7 @@ void AppendProcTexCombineAndMap(std::string& out, ProcTexCombiner combiner, combined = "min(((u + v) * 0.5 + sqrt(u * u + v * v)) * 0.5, 1.0)"; break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast(combiner)); + LOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast(combiner)); combined = "0.0"; break; } @@ -1126,7 +1126,7 @@ float ProcTexNoiseCoef(vec2 x) { if (config.state.proctex.coord < 3) { out += "vec2 uv = abs(texcoord" + std::to_string(config.state.proctex.coord) + ");\n"; } else { - NGLOG_CRITICAL(Render_OpenGL, "Unexpected proctex.coord >= 3"); + LOG_CRITICAL(Render_OpenGL, "Unexpected proctex.coord >= 3"); out += "vec2 uv = abs(texcoord0);\n"; } @@ -1499,7 +1499,7 @@ vec4 secondary_fragment_color = vec4(0.0); } else if (state.fog_mode == TexturingRegs::FogMode::Gas) { Core::Telemetry().AddField(Telemetry::FieldType::Session, "VideoCore_Pica_UseGasMode", true); - NGLOG_CRITICAL(Render_OpenGL, "Unimplemented gas mode"); + LOG_CRITICAL(Render_OpenGL, "Unimplemented gas mode"); out += "discard; }"; return out; } diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index ae8cdf550..d78244d66 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -28,7 +28,7 @@ GLuint LoadShader(const char* source, GLenum type) { GLuint shader_id = glCreateShader(type); glShaderSource(shader_id, 1, &source, nullptr); - NGLOG_DEBUG(Render_OpenGL, "Compiling {} shader...", debug_type); + LOG_DEBUG(Render_OpenGL, "Compiling {} shader...", debug_type); glCompileShader(shader_id); GLint result = GL_FALSE; @@ -40,11 +40,11 @@ GLuint LoadShader(const char* source, GLenum type) { std::vector shader_error(info_log_length); glGetShaderInfoLog(shader_id, info_log_length, nullptr, &shader_error[0]); if (result == GL_TRUE) { - NGLOG_DEBUG(Render_OpenGL, "{}", &shader_error[0]); + LOG_DEBUG(Render_OpenGL, "{}", &shader_error[0]); } else { - NGLOG_ERROR(Render_OpenGL, "Error compiling {} shader:\n{}", debug_type, + LOG_ERROR(Render_OpenGL, "Error compiling {} shader:\n{}", debug_type, &shader_error[0]); - NGLOG_ERROR(Render_OpenGL, "Shader source code:\n{}", source); + LOG_ERROR(Render_OpenGL, "Shader source code:\n{}", source); } } return shader_id; @@ -52,7 +52,7 @@ GLuint LoadShader(const char* source, GLenum type) { GLuint LoadProgram(bool separable_program, const std::vector& shaders) { // Link the program - NGLOG_DEBUG(Render_OpenGL, "Linking program..."); + LOG_DEBUG(Render_OpenGL, "Linking program..."); GLuint program_id = glCreateProgram(); @@ -78,9 +78,9 @@ GLuint LoadProgram(bool separable_program, const std::vector& shaders) { std::vector program_error(info_log_length); glGetProgramInfoLog(program_id, info_log_length, nullptr, &program_error[0]); if (result == GL_TRUE) { - NGLOG_DEBUG(Render_OpenGL, "{}", &program_error[0]); + LOG_DEBUG(Render_OpenGL, "{}", &program_error[0]); } else { - NGLOG_ERROR(Render_OpenGL, "Error linking shader:\n{}", &program_error[0]); + LOG_ERROR(Render_OpenGL, "Error linking shader:\n{}", &program_error[0]); } } diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h index faada1556..3c6073a9a 100644 --- a/src/video_core/renderer_opengl/pica_to_gl.h +++ b/src/video_core/renderer_opengl/pica_to_gl.h @@ -39,7 +39,7 @@ inline GLenum TextureFilterMode(Pica::TexturingRegs::TextureConfig::TextureFilte // Range check table for input if (index >= filter_mode_table.size()) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index); UNREACHABLE(); return GL_LINEAR; @@ -49,7 +49,7 @@ inline GLenum TextureFilterMode(Pica::TexturingRegs::TextureConfig::TextureFilte // Check for dummy values indicating an unknown mode if (gl_mode == 0) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index); UNIMPLEMENTED(); return GL_LINEAR; @@ -76,7 +76,7 @@ inline GLenum WrapMode(Pica::TexturingRegs::TextureConfig::WrapMode mode) { // Range check table for input if (index >= wrap_mode_table.size()) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index); UNREACHABLE(); return GL_CLAMP_TO_EDGE; @@ -86,14 +86,14 @@ inline GLenum WrapMode(Pica::TexturingRegs::TextureConfig::WrapMode mode) { Core::Telemetry().AddField(Telemetry::FieldType::Session, "VideoCore_Pica_UnsupportedTextureWrapMode", static_cast(index)); - NGLOG_WARNING(Render_OpenGL, "Using texture wrap mode {}", index); + LOG_WARNING(Render_OpenGL, "Using texture wrap mode {}", index); } GLenum gl_mode = wrap_mode_table[index]; // Check for dummy values indicating an unknown mode if (gl_mode == 0) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index); UNIMPLEMENTED(); return GL_CLAMP_TO_EDGE; @@ -115,7 +115,7 @@ inline GLenum BlendEquation(Pica::FramebufferRegs::BlendEquation equation) { // Range check table for input if (index >= blend_equation_table.size()) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown blend equation {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown blend equation {}", index); // This return value is hwtested, not just a stub return GL_FUNC_ADD; @@ -147,7 +147,7 @@ inline GLenum BlendFunc(Pica::FramebufferRegs::BlendFactor factor) { // Range check table for input if (index >= blend_func_table.size()) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index); UNREACHABLE(); return GL_ONE; @@ -180,7 +180,7 @@ inline GLenum LogicOp(Pica::FramebufferRegs::LogicOp op) { // Range check table for input if (index >= logic_op_table.size()) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown logic op {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown logic op {}", index); UNREACHABLE(); return GL_COPY; @@ -205,7 +205,7 @@ inline GLenum CompareFunc(Pica::FramebufferRegs::CompareFunc func) { // Range check table for input if (index >= compare_func_table.size()) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown compare function {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown compare function {}", index); UNREACHABLE(); return GL_ALWAYS; @@ -230,7 +230,7 @@ inline GLenum StencilOp(Pica::FramebufferRegs::StencilAction action) { // Range check table for input if (index >= stencil_op_table.size()) { - NGLOG_CRITICAL(Render_OpenGL, "Unknown stencil op {}", index); + LOG_CRITICAL(Render_OpenGL, "Unknown stencil op {}", index); UNREACHABLE(); return GL_KEEP; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index dc6bb7958..4072d0c72 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -171,7 +171,7 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram ? (!right_eye ? framebuffer.address_left1 : framebuffer.address_right1) : (!right_eye ? framebuffer.address_left2 : framebuffer.address_right2); - NGLOG_TRACE(Render_OpenGL, "0x{:08x} bytes from 0x{:08x}({}x{}), fmt {:x}", + LOG_TRACE(Render_OpenGL, "0x{:08x} bytes from 0x{:08x}({}x{}), fmt {:x}", framebuffer.stride * framebuffer.height, framebuffer_addr, (int)framebuffer.width, (int)framebuffer.height, (int)framebuffer.format); @@ -494,7 +494,7 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum level = Log::Level::Debug; break; } - NGLOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source), + LOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source), GetType(type), id, message); } @@ -511,9 +511,9 @@ bool RendererOpenGL::Init() { const char* gpu_vendor{reinterpret_cast(glGetString(GL_VENDOR))}; const char* gpu_model{reinterpret_cast(glGetString(GL_RENDERER))}; - NGLOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version); - NGLOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor); - NGLOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model); + LOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version); + LOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor); + LOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model); Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Vendor", gpu_vendor); Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Model", gpu_model); diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 4309468d9..852342b2b 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -65,7 +65,7 @@ OutputVertex OutputVertex::FromAttributeBuffer(const RasterizerRegs& regs, ret.color[i] = float24::FromFloat32(c < 1.0f ? c : 1.0f); } - NGLOG_TRACE(HW_GPU, + LOG_TRACE(HW_GPU, "Output vertex: pos({:.2}, {:.2}, {:.2}, {:.2}), quat({:.2}, {:.2}, {:.2}, {:.2}), " "col({:.2}, {:.2}, {:.2}, {:.2}), tc0({:.2}, {:.2}), view({:.2}, {:.2}, {:.2})", ret.pos.x.ToFloat32(), ret.pos.y.ToFloat32(), ret.pos.z.ToFloat32(), diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 5e61c1339..1c69a3e48 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp @@ -404,7 +404,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData break; default: - NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast(op)); + LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast(op)); break; } } @@ -446,7 +446,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData } default: - NGLOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}", + LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}", (int)instr.opcode.Value().EffectiveOpCode(), instr.opcode.Value().GetInfo().name, instr.hex); DEBUG_ASSERT(false); @@ -535,7 +535,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData } Record(debug_data, iteration, dest); } else { - NGLOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}", + LOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}", (int)instr.opcode.Value().EffectiveOpCode(), instr.opcode.Value().GetInfo().name, instr.hex); } @@ -653,7 +653,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData } default: - NGLOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}", + LOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}", (int)instr.opcode.Value().EffectiveOpCode(), instr.opcode.Value().GetInfo().name, instr.hex); break; diff --git a/src/video_core/shader/shader_jit_x64_compiler.cpp b/src/video_core/shader/shader_jit_x64_compiler.cpp index f14b0ee25..2457585c3 100644 --- a/src/video_core/shader/shader_jit_x64_compiler.cpp +++ b/src/video_core/shader/shader_jit_x64_compiler.cpp @@ -161,7 +161,7 @@ static const u8 NO_SRC_REG_SWIZZLE = 0x1b; static const u8 NO_DEST_REG_MASK = 0xf; static void LogCritical(const char* msg) { - NGLOG_CRITICAL(HW_GPU, "{}", msg); + LOG_CRITICAL(HW_GPU, "{}", msg); } void JitShader::Compile_Assert(bool condition, const char* msg) { @@ -858,7 +858,7 @@ void JitShader::Compile_NextInstr() { ((*this).*instr_func)(instr); } else { // Unhandled instruction - NGLOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x{:02x} (0x{:08x})", + LOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x{:02x} (0x{:08x})", static_cast(instr.opcode.Value().EffectiveOpCode()), instr.hex); } } @@ -945,7 +945,7 @@ void JitShader::Compile(const std::array* program_ ready(); ASSERT_MSG(getSize() <= MAX_SHADER_SIZE, "Compiled a shader that exceeds the allocated size!"); - NGLOG_DEBUG(HW_GPU, "Compiled shader size={}", getSize()); + LOG_DEBUG(HW_GPU, "Compiled shader size={}", getSize()); } JitShader::JitShader() : Xbyak::CodeGenerator(MAX_SHADER_SIZE) { diff --git a/src/video_core/swrasterizer/clipper.cpp b/src/video_core/swrasterizer/clipper.cpp index ceea540dd..6af36ca3a 100644 --- a/src/video_core/swrasterizer/clipper.cpp +++ b/src/video_core/swrasterizer/clipper.cpp @@ -173,7 +173,7 @@ void ProcessTriangle(const OutputVertex& v0, const OutputVertex& v1, const Outpu InitScreenCoordinates(vtx2); - NGLOG_TRACE( + LOG_TRACE( Render_Software, "Triangle {}/{} at position ({:.3}, {:.3}, {:.3}, {:.3f}), " "({:.3}, {:.3}, {:.3}, {:.3}), ({:.3}, {:.3}, {:.3}, {:.3}) and " diff --git a/src/video_core/swrasterizer/framebuffer.cpp b/src/video_core/swrasterizer/framebuffer.cpp index 920642176..78e748a10 100644 --- a/src/video_core/swrasterizer/framebuffer.cpp +++ b/src/video_core/swrasterizer/framebuffer.cpp @@ -57,7 +57,7 @@ void DrawPixel(int x, int y, const Math::Vec4& color) { break; default: - NGLOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}", + LOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}", static_cast(framebuffer.color_format.Value())); UNIMPLEMENTED(); } @@ -93,7 +93,7 @@ const Math::Vec4 GetPixel(int x, int y) { return Color::DecodeRGBA4(src_pixel); default: - NGLOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}", + LOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}", static_cast(framebuffer.color_format.Value())); UNIMPLEMENTED(); } @@ -123,7 +123,7 @@ u32 GetDepth(int x, int y) { case FramebufferRegs::DepthFormat::D24S8: return Color::DecodeD24S8(src_pixel).x; default: - NGLOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", + LOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", static_cast(framebuffer.depth_format.Value())); UNIMPLEMENTED(); return 0; @@ -149,7 +149,7 @@ u8 GetStencil(int x, int y) { return Color::DecodeD24S8(src_pixel).y; default: - NGLOG_WARNING( + LOG_WARNING( HW_GPU, "GetStencil called for function which doesn't have a stencil component (format {})", static_cast(framebuffer.depth_format.Value())); @@ -185,7 +185,7 @@ void SetDepth(int x, int y, u32 value) { break; default: - NGLOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", + LOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", static_cast(framebuffer.depth_format.Value())); UNIMPLEMENTED(); break; @@ -217,7 +217,7 @@ void SetStencil(int x, int y, u8 value) { break; default: - NGLOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", + LOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", static_cast(framebuffer.depth_format.Value())); UNIMPLEMENTED(); break; @@ -253,7 +253,7 @@ u8 PerformStencilAction(FramebufferRegs::StencilAction action, u8 old_stencil, u return old_stencil - 1; default: - NGLOG_CRITICAL(HW_GPU, "Unknown stencil action {:x}", (int)action); + LOG_CRITICAL(HW_GPU, "Unknown stencil action {:x}", (int)action); UNIMPLEMENTED(); return 0; } @@ -297,7 +297,7 @@ Math::Vec4 EvaluateBlendEquation(const Math::Vec4& src, const Math::Vec4 break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown RGB blend equation 0x{:x}", static_cast(equation)); + LOG_CRITICAL(HW_GPU, "Unknown RGB blend equation 0x{:x}", static_cast(equation)); UNIMPLEMENTED(); } diff --git a/src/video_core/swrasterizer/lighting.cpp b/src/video_core/swrasterizer/lighting.cpp index 1a2a811cc..69e132cb0 100644 --- a/src/video_core/swrasterizer/lighting.cpp +++ b/src/video_core/swrasterizer/lighting.cpp @@ -53,7 +53,7 @@ std::tuple, Math::Vec4> ComputeFragmentsColors( surface_normal = Math::MakeVec(0.0f, 0.0f, 1.0f); surface_tangent = perturbation; } else { - NGLOG_ERROR(HW_GPU, "Unknown bump mode {}", + LOG_ERROR(HW_GPU, "Unknown bump mode {}", static_cast(lighting.config0.bump_mode.Value())); } } else { @@ -143,7 +143,7 @@ std::tuple, Math::Vec4> ComputeFragmentsColors( } break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown lighting LUT input {}\n", static_cast(input)); + LOG_CRITICAL(HW_GPU, "Unknown lighting LUT input {}\n", static_cast(input)); UNIMPLEMENTED(); result = 0.0f; } diff --git a/src/video_core/swrasterizer/proctex.cpp b/src/video_core/swrasterizer/proctex.cpp index 84570995a..ba24d9730 100644 --- a/src/video_core/swrasterizer/proctex.cpp +++ b/src/video_core/swrasterizer/proctex.cpp @@ -77,7 +77,7 @@ static float GetShiftOffset(float v, ProcTexShift mode, ProcTexClamp clamp_mode) case ProcTexShift::Even: return offset * ((((int)v + 1) / 2) % 2); default: - NGLOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast(mode)); + LOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast(mode)); return 0; } }; @@ -107,7 +107,7 @@ static void ClampCoord(float& coord, ProcTexClamp mode) { coord = 1.0f; break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast(mode)); + LOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast(mode)); coord = std::min(coord, 1.0f); break; } @@ -148,7 +148,7 @@ float CombineAndMap(float u, float v, ProcTexCombiner combiner, f = std::min(((u + v) * 0.5f + std::sqrt(u * u + v * v)) * 0.5f, 1.0f); break; default: - NGLOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast(combiner)); + LOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast(combiner)); f = 0.0f; break; } diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index e88dabadc..36c198ea2 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -363,7 +363,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve } default: // TODO: Change to LOG_ERROR when more types are handled. - NGLOG_DEBUG(HW_GPU, "Unhandled texture type {:x}", + LOG_DEBUG(HW_GPU, "Unhandled texture type {:x}", (int)texture.config.type); UNIMPLEMENTED(); break; @@ -513,7 +513,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve return combiner_output; default: - NGLOG_ERROR(HW_GPU, "Unknown color combiner source {}", (int)source); + LOG_ERROR(HW_GPU, "Unknown color combiner source {}", (int)source); UNIMPLEMENTED(); return {0, 0, 0, 0}; } @@ -844,7 +844,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve return std::min(combiner_output.a(), static_cast(255 - dest.a())); default: - NGLOG_CRITICAL(HW_GPU, "Unknown blend factor {:x}", + LOG_CRITICAL(HW_GPU, "Unknown blend factor {:x}", static_cast(factor)); UNIMPLEMENTED(); break; diff --git a/src/video_core/swrasterizer/texturing.cpp b/src/video_core/swrasterizer/texturing.cpp index d81c59881..0d92dbcf9 100644 --- a/src/video_core/swrasterizer/texturing.cpp +++ b/src/video_core/swrasterizer/texturing.cpp @@ -48,7 +48,7 @@ int GetWrappedTexCoord(TexturingRegs::TextureConfig::WrapMode mode, int val, uns } default: - NGLOG_ERROR(HW_GPU, "Unknown texture coordinate wrapping mode {:x}", (int)mode); + LOG_ERROR(HW_GPU, "Unknown texture coordinate wrapping mode {:x}", (int)mode); UNIMPLEMENTED(); return 0; } @@ -197,7 +197,7 @@ Math::Vec3 ColorCombine(TevStageConfig::Operation op, const Math::Vec3 i return {(u8)result, (u8)result, (u8)result}; } default: - NGLOG_ERROR(HW_GPU, "Unknown color combiner operation {}", (int)op); + LOG_ERROR(HW_GPU, "Unknown color combiner operation {}", (int)op); UNIMPLEMENTED(); return {0, 0, 0}; } @@ -234,7 +234,7 @@ u8 AlphaCombine(TevStageConfig::Operation op, const std::array& input) { return (std::min(255, (input[0] + input[1])) * input[2]) / 255; default: - NGLOG_ERROR(HW_GPU, "Unknown alpha combiner operation {}", (int)op); + LOG_ERROR(HW_GPU, "Unknown alpha combiner operation {}", (int)op); UNIMPLEMENTED(); return 0; } diff --git a/src/video_core/texture/texture_decode.cpp b/src/video_core/texture/texture_decode.cpp index a1e425d43..015327c15 100644 --- a/src/video_core/texture/texture_decode.cpp +++ b/src/video_core/texture/texture_decode.cpp @@ -206,7 +206,7 @@ Math::Vec4 LookupTexelInTile(const u8* source, unsigned int x, unsigned int } default: - NGLOG_ERROR(HW_GPU, "Unknown texture format: {:x}", (u32)info.format); + LOG_ERROR(HW_GPU, "Unknown texture format: {:x}", (u32)info.format); DEBUG_ASSERT(false); return {}; } diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index 7a1002c06..aac541bea 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp @@ -37,7 +37,7 @@ void VertexLoader::Setup(const PipelineRegs& regs) { // TODO: What happens if a loader overwrites a previous one's data? for (unsigned component = 0; component < loader_config.component_count; ++component) { if (component >= 12) { - NGLOG_ERROR( + LOG_ERROR( HW_GPU, "Overflow in the vertex attribute loader {} trying to load component {}", loader, component); @@ -137,7 +137,7 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, comp == 3 ? float24::FromFloat32(1.0f) : float24::FromFloat32(0.0f); } - NGLOG_TRACE(HW_GPU, + LOG_TRACE(HW_GPU, "Loaded {} components of attribute {:x} for vertex {:x} (index {:x}) from " "0x{:08x} + 0x{:08x} + 0x{:04x}: {} {} {} {}", vertex_attribute_elements[i], i, vertex, index, base_address, @@ -147,7 +147,7 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, } else if (vertex_attribute_is_default[i]) { // Load the default attribute if we're configured to do so input.attr[i] = g_state.input_default_attributes.attr[i]; - NGLOG_TRACE( + LOG_TRACE( HW_GPU, "Loaded default attribute {:x} for vertex {:x} (index {:x}): ({}, {}, {}, {})", i, vertex, index, input.attr[i][0].ToFloat32(), input.attr[i][1].ToFloat32(), diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 14dba2dd4..9fc29bbad 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -31,9 +31,9 @@ bool Init(EmuWindow* emu_window) { g_renderer = std::make_unique(); g_renderer->SetWindow(g_emu_window); if (g_renderer->Init()) { - NGLOG_DEBUG(Render, "initialized OK"); + LOG_DEBUG(Render, "initialized OK"); } else { - NGLOG_ERROR(Render, "initialization failed !"); + LOG_ERROR(Render, "initialization failed !"); return false; } return true; @@ -45,7 +45,7 @@ void Shutdown() { g_renderer.reset(); - NGLOG_DEBUG(Render, "shutdown OK"); + LOG_DEBUG(Render, "shutdown OK"); } } // namespace VideoCore diff --git a/src/web_service/announce_room_json.cpp b/src/web_service/announce_room_json.cpp index 3ef58c10d..fa95b3f27 100644 --- a/src/web_service/announce_room_json.cpp +++ b/src/web_service/announce_room_json.cpp @@ -50,7 +50,7 @@ void from_json(const nlohmann::json& json, Room& room) { try { room.members = json.at("players").get>(); } catch (const nlohmann::detail::out_of_range& e) { - NGLOG_DEBUG(Network, "Out of range {}", e.what()); + LOG_DEBUG(Network, "Out of range {}", e.what()); } } diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 88cb97a81..868d5d190 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -38,7 +38,7 @@ std::unique_ptr GetClientFor(const LUrlParser::clParseURL& pars } return std::make_unique(parsedUrl.m_Host.c_str(), port, TIMEOUT_SECONDS); } else { - NGLOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme); + LOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme); return nullptr; } } @@ -52,7 +52,7 @@ std::future PostJson(const std::string& url, const std::strin lup parsedUrl = lup::ParseURL(url); if (url.empty() || !parsedUrl.IsValid()) { - NGLOG_ERROR(WebService, "URL is invalid"); + LOG_ERROR(WebService, "URL is invalid"); return std::async(std::launch::deferred, []() { return Common::WebResult{Common::WebResult::Code::InvalidURL, "URL is invalid"}; }); @@ -60,7 +60,7 @@ std::future PostJson(const std::string& url, const std::strin const bool are_credentials_provided{!token.empty() && !username.empty()}; if (!allow_anonymous && !are_credentials_provided) { - NGLOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); + LOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); return std::async(std::launch::deferred, []() { return Common::WebResult{Common::WebResult::Code::CredentialsMissing, "Credentials needed"}; @@ -98,12 +98,12 @@ std::future PostJson(const std::string& url, const std::strin hl::Response response; if (!cli->send(request, response)) { - NGLOG_ERROR(WebService, "POST to {} returned null", url); + LOG_ERROR(WebService, "POST to {} returned null", url); return Common::WebResult{Common::WebResult::Code::LibError, "Null response"}; } if (response.status >= 400) { - NGLOG_ERROR(WebService, "POST to {} returned error status code: {}", url, + LOG_ERROR(WebService, "POST to {} returned error status code: {}", url, response.status); return Common::WebResult{Common::WebResult::Code::HttpError, std::to_string(response.status)}; @@ -113,7 +113,7 @@ std::future PostJson(const std::string& url, const std::strin if (content_type == response.headers.end() || content_type->second.find("application/json") == std::string::npos) { - NGLOG_ERROR(WebService, "POST to {} returned wrong content: {}", url, + LOG_ERROR(WebService, "POST to {} returned wrong content: {}", url, content_type->second); return Common::WebResult{Common::WebResult::Code::WrongContent, content_type->second}; } @@ -132,13 +132,13 @@ std::future GetJson(std::function func, const std::str lup parsedUrl = lup::ParseURL(url); if (url.empty() || !parsedUrl.IsValid()) { - NGLOG_ERROR(WebService, "URL is invalid"); + LOG_ERROR(WebService, "URL is invalid"); return std::async(std::launch::deferred, [func{std::move(func)}]() { return func(""); }); } const bool are_credentials_provided{!token.empty() && !username.empty()}; if (!allow_anonymous && !are_credentials_provided) { - NGLOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); + LOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); return std::async(std::launch::deferred, [func{std::move(func)}]() { return func(""); }); } @@ -170,12 +170,12 @@ std::future GetJson(std::function func, const std::str hl::Response response; if (!cli->send(request, response)) { - NGLOG_ERROR(WebService, "GET to {} returned null", url); + LOG_ERROR(WebService, "GET to {} returned null", url); return func(""); } if (response.status >= 400) { - NGLOG_ERROR(WebService, "GET to {} returned error status code: {}", url, + LOG_ERROR(WebService, "GET to {} returned error status code: {}", url, response.status); return func(""); } @@ -184,7 +184,7 @@ std::future GetJson(std::function func, const std::str if (content_type == response.headers.end() || content_type->second.find("application/json") == std::string::npos) { - NGLOG_ERROR(WebService, "GET to {} returned wrong content: {}", url, + LOG_ERROR(WebService, "GET to {} returned wrong content: {}", url, content_type->second); return func(""); } @@ -209,13 +209,13 @@ void DeleteJson(const std::string& url, const std::string& data, const std::stri lup parsedUrl = lup::ParseURL(url); if (url.empty() || !parsedUrl.IsValid()) { - NGLOG_ERROR(WebService, "URL is invalid"); + LOG_ERROR(WebService, "URL is invalid"); return; } const bool are_credentials_provided{!token.empty() && !username.empty()}; if (!are_credentials_provided) { - NGLOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); + LOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); return; } @@ -242,12 +242,12 @@ void DeleteJson(const std::string& url, const std::string& data, const std::stri hl::Response response; if (!cli->send(request, response)) { - NGLOG_ERROR(WebService, "DELETE to {} returned null", url); + LOG_ERROR(WebService, "DELETE to {} returned null", url); return; } if (response.status >= 400) { - NGLOG_ERROR(WebService, "DELETE to {} returned error status code: {}", url, + LOG_ERROR(WebService, "DELETE to {} returned error status code: {}", url, response.status); return; } @@ -256,7 +256,7 @@ void DeleteJson(const std::string& url, const std::string& data, const std::stri if (content_type == response.headers.end() || content_type->second.find("application/json") == std::string::npos) { - NGLOG_ERROR(WebService, "DELETE to {} returned wrong content: {}", url, + LOG_ERROR(WebService, "DELETE to {} returned wrong content: {}", url, content_type->second); return; } From 0eab94872833e68521ba28392bebe5172ad64036 Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 29 Jun 2018 16:56:12 +0300 Subject: [PATCH 3/3] reformat all files with clang-format --- src/audio_core/hle/hle.cpp | 9 +- src/audio_core/hle/mixers.cpp | 2 +- src/audio_core/hle/source.cpp | 24 +- src/audio_core/sdl2_sink.cpp | 2 +- src/citra/citra.cpp | 12 +- src/citra/emu_window/emu_window_sdl2.cpp | 4 +- src/citra_qt/main.cpp | 4 +- src/citra_qt/updater/updater.cpp | 2 +- src/common/assert.h | 5 +- src/common/chunk_file.h | 8 +- src/common/file_util.cpp | 12 +- src/common/logging/filter.cpp | 2 +- src/common/logging/log.h | 14 +- .../arm/dyncom/arm_dyncom_interpreter.cpp | 20 +- src/core/arm/skyeye_common/armstate.cpp | 2 +- src/core/arm/skyeye_common/vfp/vfp.cpp | 2 +- src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 16 +- src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 10 +- src/core/core.cpp | 4 +- src/core/file_sys/archive_ncch.cpp | 19 +- src/core/file_sys/archive_sdmc.cpp | 2 +- src/core/file_sys/archive_selfncch.cpp | 6 +- src/core/file_sys/ivfc_archive.cpp | 13 +- src/core/file_sys/ncch_container.cpp | 17 +- src/core/file_sys/savedata_archive.cpp | 2 +- src/core/file_sys/title_metadata.cpp | 10 +- src/core/gdbstub/gdbstub.cpp | 8 +- src/core/hle/kernel/memory.cpp | 10 +- src/core/hle/kernel/shared_memory.cpp | 8 +- src/core/hle/kernel/svc.cpp | 43 ++- src/core/hle/kernel/thread.cpp | 4 +- src/core/hle/kernel/vm_manager.cpp | 10 +- src/core/hle/service/ac/ac.cpp | 4 +- src/core/hle/service/am/am.cpp | 16 +- src/core/hle/service/apt/applet_manager.cpp | 8 +- src/core/hle/service/apt/apt.cpp | 67 +++-- src/core/hle/service/boss/boss.cpp | 257 +++++++++--------- src/core/hle/service/cam/cam.cpp | 56 ++-- src/core/hle/service/cfg/cfg.cpp | 10 +- src/core/hle/service/dsp_dsp.cpp | 28 +- src/core/hle/service/err_f.cpp | 25 +- src/core/hle/service/fs/archive.cpp | 21 +- src/core/hle/service/fs/fs_user.cpp | 78 +++--- src/core/hle/service/gsp/gsp_gpu.cpp | 28 +- src/core/hle/service/ir/extra_hid.cpp | 8 +- src/core/hle/service/ir/ir_user.cpp | 13 +- src/core/hle/service/ldr_ro/cro_helper.cpp | 35 ++- src/core/hle/service/ldr_ro/ldr_ro.cpp | 25 +- src/core/hle/service/mic_u.cpp | 13 +- src/core/hle/service/ndm/ndm_u.cpp | 2 +- src/core/hle/service/nwm/nwm_uds.cpp | 18 +- src/core/hle/service/ptm/ptm.cpp | 10 +- src/core/hle/service/service.cpp | 5 +- src/core/hle/service/sm/srv.cpp | 10 +- src/core/hle/service/y2r_u.cpp | 62 ++--- src/core/hw/gpu.cpp | 39 ++- src/core/hw/hw.cpp | 2 +- src/core/hw/lcd.cpp | 3 +- src/core/loader/3dsx.cpp | 6 +- src/core/loader/elf.cpp | 10 +- src/core/memory.cpp | 24 +- src/core/movie.cpp | 26 +- src/network/room.cpp | 8 +- src/video_core/command_processor.cpp | 14 +- src/video_core/debug_utils/debug_utils.cpp | 10 +- .../renderer_opengl/gl_rasterizer.cpp | 7 +- .../renderer_opengl/gl_rasterizer_cache.cpp | 2 +- .../renderer_opengl/gl_shader_decompiler.cpp | 12 +- .../renderer_opengl/gl_shader_gen.cpp | 8 +- .../renderer_opengl/gl_shader_util.cpp | 2 +- .../renderer_opengl/renderer_opengl.cpp | 8 +- src/video_core/shader/shader.cpp | 16 +- src/video_core/shader/shader_interpreter.cpp | 12 +- .../shader/shader_jit_x64_compiler.cpp | 2 +- src/video_core/swrasterizer/framebuffer.cpp | 10 +- src/video_core/swrasterizer/lighting.cpp | 2 +- src/video_core/swrasterizer/rasterizer.cpp | 6 +- src/video_core/vertex_loader.cpp | 19 +- src/web_service/web_backend.cpp | 13 +- 79 files changed, 659 insertions(+), 707 deletions(-) diff --git a/src/audio_core/hle/hle.cpp b/src/audio_core/hle/hle.cpp index 476980668..5d39d7b43 100644 --- a/src/audio_core/hle/hle.cpp +++ b/src/audio_core/hle/hle.cpp @@ -127,7 +127,7 @@ void DspHle::Impl::PipeWrite(DspPipe pipe_number, const std::vector& buffer) case DspPipe::Audio: { if (buffer.size() != 4) { LOG_ERROR(Audio_DSP, "DspPipe::Audio: Unexpected buffer length {} was written", - buffer.size()); + buffer.size()); return; } @@ -168,8 +168,8 @@ void DspHle::Impl::PipeWrite(DspPipe pipe_number, const std::vector& buffer) break; default: LOG_ERROR(Audio_DSP, - "Application has requested unknown state transition of DSP hardware {}", - buffer[0]); + "Application has requested unknown state transition of DSP hardware {}", + buffer[0]); dsp_state = DspState::Off; break; } @@ -177,8 +177,7 @@ void DspHle::Impl::PipeWrite(DspPipe pipe_number, const std::vector& buffer) return; } default: - LOG_CRITICAL(Audio_DSP, "pipe_number = {} unimplemented", - static_cast(pipe_number)); + LOG_CRITICAL(Audio_DSP, "pipe_number = {} unimplemented", static_cast(pipe_number)); UNIMPLEMENTED(); return; } diff --git a/src/audio_core/hle/mixers.cpp b/src/audio_core/hle/mixers.cpp index c8175d58e..1f1f23364 100644 --- a/src/audio_core/hle/mixers.cpp +++ b/src/audio_core/hle/mixers.cpp @@ -69,7 +69,7 @@ void Mixers::ParseConfig(DspConfiguration& config) { config.output_format_dirty.Assign(0); state.output_format = config.output_format; LOG_TRACE(Audio_DSP, "mixers output_format = {}", - static_cast(config.output_format)); + static_cast(config.output_format)); } if (config.headphones_connected_dirty) { diff --git a/src/audio_core/hle/source.cpp b/src/audio_core/hle/source.cpp index 0930230e8..d2ef898b6 100644 --- a/src/audio_core/hle/source.cpp +++ b/src/audio_core/hle/source.cpp @@ -82,7 +82,7 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, if (state.rate_multiplier <= 0) { LOG_ERROR(Audio_DSP, "Was given an invalid rate multiplier: source_id={} rate={}", - source_id, state.rate_multiplier); + source_id, state.rate_multiplier); state.rate_multiplier = 1.0f; // Note: Actual firmware starts producing garbage if this occurs. } @@ -122,7 +122,7 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, state.filters.Enable(config.simple_filter_enabled.ToBool(), config.biquad_filter_enabled.ToBool()); LOG_TRACE(Audio_DSP, "source_id={} enable_simple={} enable_biquad={}", source_id, - config.simple_filter_enabled.Value(), config.biquad_filter_enabled.Value()); + config.simple_filter_enabled.Value(), config.biquad_filter_enabled.Value()); } if (config.simple_filter_dirty) { @@ -141,21 +141,21 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, config.interpolation_dirty.Assign(0); state.interpolation_mode = config.interpolation_mode; LOG_TRACE(Audio_DSP, "source_id={} interpolation_mode={}", source_id, - static_cast(state.interpolation_mode)); + static_cast(state.interpolation_mode)); } if (config.format_dirty || config.embedded_buffer_dirty) { config.format_dirty.Assign(0); state.format = config.format; LOG_TRACE(Audio_DSP, "source_id={} format={}", source_id, - static_cast(state.format)); + static_cast(state.format)); } if (config.mono_or_stereo_dirty || config.embedded_buffer_dirty) { config.mono_or_stereo_dirty.Assign(0); state.mono_or_stereo = config.mono_or_stereo; LOG_TRACE(Audio_DSP, "source_id={} mono_or_stereo={}", source_id, - static_cast(state.mono_or_stereo)); + static_cast(state.mono_or_stereo)); } u32_dsp play_position = {}; @@ -183,14 +183,14 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, false, }); LOG_TRACE(Audio_DSP, "enqueuing embedded addr={:#010x} len={} id={} start={}", - config.physical_address, config.length, config.buffer_id, - static_cast(config.play_position)); + config.physical_address, config.length, config.buffer_id, + static_cast(config.play_position)); } if (config.loop_related_dirty && config.loop_related != 0) { config.loop_related_dirty.Assign(0); LOG_WARNING(Audio_DSP, "Unhandled complex loop with loop_related={:#010x}", - static_cast(config.loop_related)); + static_cast(config.loop_related)); } if (config.buffer_queue_dirty) { @@ -213,7 +213,7 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, false, }); LOG_TRACE(Audio_DSP, "enqueuing queued {} addr={:#010x} len={} id={}", i, - b.physical_address, b.length, b.buffer_id); + b.physical_address, b.length, b.buffer_id); } } config.buffers_dirty = 0; @@ -305,8 +305,8 @@ bool Source::DequeueBuffer() { } } else { LOG_WARNING(Audio_DSP, - "source_id={} buffer_id={} length={}: Invalid physical address {:#010x}", - source_id, buf.buffer_id, buf.length, buf.physical_address); + "source_id={} buffer_id={} length={}: Invalid physical address {:#010x}", + source_id, buf.buffer_id, buf.length, buf.physical_address); state.current_buffer.clear(); return true; } @@ -323,7 +323,7 @@ bool Source::DequeueBuffer() { } LOG_TRACE(Audio_DSP, "source_id={} buffer_id={} from_queue={} current_buffer.size()={}", - source_id, buf.buffer_id, buf.from_queue, state.current_buffer.size()); + source_id, buf.buffer_id, buf.from_queue, state.current_buffer.size()); return true; } diff --git a/src/audio_core/sdl2_sink.cpp b/src/audio_core/sdl2_sink.cpp index 383dbe00b..c3fba3b84 100644 --- a/src/audio_core/sdl2_sink.cpp +++ b/src/audio_core/sdl2_sink.cpp @@ -59,7 +59,7 @@ SDL2Sink::SDL2Sink() : impl(std::make_unique()) { device, false, &desired_audiospec, &obtained_audiospec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); if (impl->audio_device_id <= 0) { LOG_CRITICAL(Audio_Sink, "SDL_OpenAudioDevice failed with code {} for device \"{}\"", - impl->audio_device_id, Settings::values.audio_device_id); + impl->audio_device_id, Settings::values.audio_device_id); return; } diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index fb6171765..08a05c558 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -92,7 +92,7 @@ static void OnStateChanged(const Network::RoomMember::State& state) { break; case Network::RoomMember::State::MacCollision: LOG_ERROR(Network, "You tried to use the same MAC-Address then another user that is " - "connected to the Room"); + "connected to the Room"); exit(1); break; case Network::RoomMember::State::WrongPassword: @@ -101,7 +101,7 @@ static void OnStateChanged(const Network::RoomMember::State& state) { break; case Network::RoomMember::State::WrongVersion: LOG_ERROR(Network, - "You are using a different version then the room you are trying to connect to"); + "You are using a different version then the room you are trying to connect to"); exit(1); break; default: @@ -288,9 +288,9 @@ int main(int argc, char** argv) { return -1; case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " - "being used with Citra. \n\n For more information on dumping and " - "decrypting games, please refer to: " - "https://citra-emu.org/wiki/dumping-game-cartridges/"); + "being used with Citra. \n\n For more information on dumping and " + "decrypting games, please refer to: " + "https://citra-emu.org/wiki/dumping-game-cartridges/"); return -1; case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); @@ -315,7 +315,7 @@ int main(int argc, char** argv) { member->BindOnChatMessageRecieved(OnMessageReceived); member->BindOnStateChanged(OnStateChanged); LOG_DEBUG(Network, "Start connection to {}:{} with nickname {}", address, port, - nickname); + nickname); member->Join(nickname, address.c_str(), port, 0, Network::NoPreferredMac, password); } else { LOG_ERROR(Network, "Could not access RoomMember"); diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 60063b6be..651f290a4 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -134,8 +134,8 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); SDL_PumpEvents(); SDL_GL_SetSwapInterval(Settings::values.use_vsync); - LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, - Common::g_scm_branch, Common::g_scm_desc); + LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, + Common::g_scm_desc); DoneCurrent(); } diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 7c3c37e12..ff16a0006 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -137,8 +137,8 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { ConnectWidgetEvents(); SetupUIStrings(); - LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, - Common::g_scm_branch, Common::g_scm_desc); + LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, + Common::g_scm_desc); show(); diff --git a/src/citra_qt/updater/updater.cpp b/src/citra_qt/updater/updater.cpp index 53c81a613..73579b9d5 100644 --- a/src/citra_qt/updater/updater.cpp +++ b/src/citra_qt/updater/updater.cpp @@ -276,7 +276,7 @@ void UpdaterPrivate::LaunchWithArguments(const QStringList& args) { if (!QProcess::startDetached(tool_info.absoluteFilePath(), args, tool_info.absolutePath())) { LOG_WARNING(Frontend, "Unable to start program {}", - tool_info.absoluteFilePath().toStdString()); + tool_info.absoluteFilePath().toStdString()); } } diff --git a/src/common/assert.h b/src/common/assert.h index 252a4dfbe..5c479f501 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -30,15 +30,14 @@ __declspec(noinline, noreturn) #define ASSERT(_a_) \ do \ if (!(_a_)) { \ - assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ + assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ } \ while (0) #define ASSERT_MSG(_a_, ...) \ do \ if (!(_a_)) { \ - assert_noinline_call( \ - [&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ + assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ } \ while (0) diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index a7bbe9f8a..2793edbbe 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -160,7 +160,7 @@ public: if (error == ERROR_FAILURE || foundVersion < minVer || foundVersion > ver) { LOG_ERROR(Common, "Savestate failure: wrong version {} found for {}", foundVersion, - title); + title); SetError(ERROR_FAILURE); return PointerWrapSection(*this, -1, title); } @@ -608,9 +608,9 @@ public: Do(cookie); if (mode == PointerWrap::MODE_READ && cookie != arbitraryNumber) { LOG_ERROR(Common, - "After \"{}\", found {} ({:#X}) instead of save marker {} ({:#X}). " - "Aborting savestate load...", - prevName, cookie, cookie, arbitraryNumber, arbitraryNumber); + "After \"{}\", found {} ({:#X}) instead of save marker {} ({:#X}). " + "Aborting savestate load...", + prevName, cookie, cookie, arbitraryNumber, arbitraryNumber); SetError(ERROR_FAILURE); } } diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index f2b967e03..ac32a1fc6 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -257,7 +257,7 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename) { return true; #endif LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, - GetLastErrorMsg()); + GetLastErrorMsg()); return false; } @@ -270,7 +270,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { return true; LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, - GetLastErrorMsg()); + GetLastErrorMsg()); return false; #else @@ -283,7 +283,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { FILE* input = fopen(srcFilename.c_str(), "rb"); if (!input) { LOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename, - destFilename, GetLastErrorMsg()); + destFilename, GetLastErrorMsg()); return false; } @@ -292,7 +292,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { if (!output) { fclose(input); LOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename, - destFilename, GetLastErrorMsg()); + destFilename, GetLastErrorMsg()); return false; } @@ -303,7 +303,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { if (rnum != BSIZE) { if (ferror(input) != 0) { LOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}", - srcFilename, destFilename, GetLastErrorMsg()); + srcFilename, destFilename, GetLastErrorMsg()); goto bail; } } @@ -312,7 +312,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { size_t wnum = fwrite(buffer, sizeof(char), rnum, output); if (wnum != rnum) { LOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename, - destFilename, GetLastErrorMsg()); + destFilename, GetLastErrorMsg()); goto bail; } } diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 47bd3a01d..4e783a577 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -66,7 +66,7 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin, auto level_separator = std::find(begin, end, ':'); if (level_separator == end) { LOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: {}", - std::string(begin, end)); + std::string(begin, end)); return false; } diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 4910f5fed..31ba5beae 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -113,29 +113,29 @@ void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsig } // namespace Log // Define the fmt lib macros -#define LOG_GENERIC(log_class, log_level, ...) \ +#define LOG_GENERIC(log_class, log_level, ...) \ ::Log::FmtLogMessage(log_class, log_level, __FILE__, __LINE__, __func__, __VA_ARGS__) #ifdef _DEBUG -#define LOG_TRACE(log_class, ...) \ +#define LOG_TRACE(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Trace, __FILE__, __LINE__, \ __func__, __VA_ARGS__) #else #define LOG_TRACE(log_class, fmt, ...) (void(0)) #endif -#define LOG_DEBUG(log_class, ...) \ +#define LOG_DEBUG(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Debug, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define LOG_INFO(log_class, ...) \ +#define LOG_INFO(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Info, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define LOG_WARNING(log_class, ...) \ +#define LOG_WARNING(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Warning, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define LOG_ERROR(log_class, ...) \ +#define LOG_ERROR(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Error, __FILE__, __LINE__, \ __func__, __VA_ARGS__) -#define LOG_CRITICAL(log_class, ...) \ +#define LOG_CRITICAL(log_class, ...) \ ::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Critical, __FILE__, __LINE__, \ __func__, __VA_ARGS__) diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 6b0125292..0fa392b4b 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -231,7 +231,7 @@ static unsigned int DPO(RotateRightByRegister)(ARMul_State* cpu, unsigned int sh } #define DEBUG_MSG \ - LOG_DEBUG(Core_ARM11, "inst is {:x}", inst); \ + LOG_DEBUG(Core_ARM11, "inst is {:x}", inst); \ CITRA_IGNORE_EXIT(0) #define LnSWoUB(s) glue(LnSWoUB, s) @@ -829,9 +829,9 @@ static unsigned int InterpreterTranslateInstruction(const ARMul_State* cpu, cons int idx; if (DecodeARMInstruction(inst, &idx) == ARMDecodeStatus::FAILURE) { LOG_ERROR(Core_ARM11, "Decode failure.\tPC: [{:#010X}]\tInstruction: {:08X}", phys_addr, - inst); + inst); LOG_ERROR(Core_ARM11, "cpsr={:#X}, cpu->TFlag={}, r15={:#010X}", cpu->Cpsr, cpu->TFlag, - cpu->Reg[15]); + cpu->Reg[15]); CITRA_IGNORE_EXIT(-1); } inst_base = arm_instruction_trans[idx](inst, idx); @@ -2368,10 +2368,9 @@ MCRR_INST : { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { mcrr_inst* const inst_cream = (mcrr_inst*)inst_base->component; - LOG_ERROR(Core_ARM11, - "MCRR executed | Coprocessor: {}, CRm {}, opc1: {}, Rt: {}, Rt2: {}", - inst_cream->cp_num, inst_cream->crm, inst_cream->opcode_1, inst_cream->rt, - inst_cream->rt2); + LOG_ERROR(Core_ARM11, "MCRR executed | Coprocessor: {}, CRm {}, opc1: {}, Rt: {}, Rt2: {}", + inst_cream->cp_num, inst_cream->crm, inst_cream->opcode_1, inst_cream->rt, + inst_cream->rt2); } cpu->Reg[15] += cpu->GetInstructionSize(); @@ -2452,10 +2451,9 @@ MRRC_INST : { if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { mcrr_inst* const inst_cream = (mcrr_inst*)inst_base->component; - LOG_ERROR(Core_ARM11, - "MRRC executed | Coprocessor: {}, CRm {}, opc1: {}, Rt: {}, Rt2: {}", - inst_cream->cp_num, inst_cream->crm, inst_cream->opcode_1, inst_cream->rt, - inst_cream->rt2); + LOG_ERROR(Core_ARM11, "MRRC executed | Coprocessor: {}, CRm {}, opc1: {}, Rt: {}, Rt2: {}", + inst_cream->cp_num, inst_cream->crm, inst_cream->opcode_1, inst_cream->rt, + inst_cream->rt2); } cpu->Reg[15] += cpu->GetInstructionSize(); diff --git a/src/core/arm/skyeye_common/armstate.cpp b/src/core/arm/skyeye_common/armstate.cpp index 2283dc4a1..dd388d38a 100644 --- a/src/core/arm/skyeye_common/armstate.cpp +++ b/src/core/arm/skyeye_common/armstate.cpp @@ -429,7 +429,7 @@ u32 ARMul_State::ReadCP15Register(u32 crn, u32 opcode_1, u32 crm, u32 opcode_2) } LOG_ERROR(Core_ARM11, "MRC CRn={}, CRm={}, OP1={} OP2={} is not implemented. Returning zero.", - crn, crm, opcode_1, opcode_2); + crn, crm, opcode_1, opcode_2); return 0; } diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp index 4ce6cd806..7f942bc75 100644 --- a/src/core/arm/skyeye_common/vfp/vfp.cpp +++ b/src/core/arm/skyeye_common/vfp/vfp.cpp @@ -107,7 +107,7 @@ u64 vfp_get_double(ARMul_State* state, unsigned int reg) { void vfp_put_double(ARMul_State* state, u64 val, unsigned int reg) { LOG_TRACE(Core_ARM11, "VFP put double: s[{}-{}] <= [{:08x}-{:08x}]", reg * 2 + 1, reg * 2, - (u32)(val >> 32), (u32)(val & 0xffffffff)); + (u32)(val >> 32), (u32)(val & 0xffffffff)); state->ExtReg[reg * 2] = (u32)(val & 0xffffffff); state->ExtReg[reg * 2 + 1] = (u32)(val >> 32); } diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index 305c7401b..f0f60a34a 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -65,7 +65,7 @@ static struct vfp_double vfp_double_default_qnan = { static void vfp_double_dump(const char* str, struct vfp_double* d) { LOG_TRACE(Core_ARM11, "VFP: {}: sign={} exponent={} significand={:016llx}", str, d->sign != 0, - d->exponent, d->significand); + d->exponent, d->significand); } static void vfp_double_normalise_denormal(struct vfp_double* vd) { @@ -222,7 +222,7 @@ pack: { s64 d = vfp_double_pack(vd); LOG_TRACE(Core_ARM11, "VFP: {}: d(d{})={:016llx} exceptions={:08x}", func, dd, d, - exceptions); + exceptions); vfp_put_double(state, d, dd); } return exceptions; @@ -390,8 +390,7 @@ static u32 vfp_compare(ARMul_State* state, int dd, int signal_on_qnan, s64 m, u3 s64 d; u32 ret = 0; - LOG_TRACE(Core_ARM11, "In {}, state=0x{}, fpscr=0x{:x}", __FUNCTION__, fmt::ptr(state), - fpscr); + LOG_TRACE(Core_ARM11, "In {}, state=0x{}, fpscr=0x{:x}", __FUNCTION__, fmt::ptr(state), fpscr); if (vfp_double_packed_exponent(m) == 2047 && vfp_double_packed_mantissa(m)) { ret |= FPSCR_CFLAG | FPSCR_VFLAG; if (signal_on_qnan || @@ -1210,7 +1209,7 @@ u32 vfp_double_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { veclen = fpscr & FPSCR_LENGTH_MASK; LOG_TRACE(Core_ARM11, "VFP: vecstride={} veclen={}", vecstride, - (veclen >> FPSCR_LENGTH_BIT) + 1); + (veclen >> FPSCR_LENGTH_BIT) + 1); if (!fop->fn) { LOG_TRACE(Core_ARM11, "VFP: could not find double op {}", FEXT_TO_IDX(inst)); @@ -1224,14 +1223,13 @@ u32 vfp_double_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { type = (fop->flags & OP_SD) ? 's' : 'd'; if (op == FOP_EXT) LOG_TRACE(Core_ARM11, "VFP: itr{} ({}{}) = op[{}] (d{})", vecitr >> FPSCR_LENGTH_BIT, - type, dest, dn, dm); + type, dest, dn, dm); else LOG_TRACE(Core_ARM11, "VFP: itr{} ({}{}) = (d{}) op[{}] (d{})", - vecitr >> FPSCR_LENGTH_BIT, type, dest, dn, FOP_TO_IDX(op), dm); + vecitr >> FPSCR_LENGTH_BIT, type, dest, dn, FOP_TO_IDX(op), dm); except = fop->fn(state, dest, dn, dm, fpscr); - LOG_TRACE(Core_ARM11, "VFP: itr{}: exceptions={:08x}", vecitr >> FPSCR_LENGTH_BIT, - except); + LOG_TRACE(Core_ARM11, "VFP: itr{}: exceptions={:08x}", vecitr >> FPSCR_LENGTH_BIT, except); exceptions |= except & ~VFP_NAN_FLAG; diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index abbb0771e..6536bf03d 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -67,7 +67,7 @@ static struct vfp_single vfp_single_default_qnan = { static void vfp_single_dump(const char* str, struct vfp_single* s) { LOG_TRACE(Core_ARM11, "{}: sign={} exponent={} significand={:08x}", str, s->sign != 0, - s->exponent, s->significand); + s->exponent, s->significand); } static void vfp_single_normalise_denormal(struct vfp_single* vs) { @@ -1234,7 +1234,7 @@ u32 vfp_single_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { if (!fop->fn) { LOG_CRITICAL(Core_ARM11, "could not find single op {}, inst=0x{:x}@0x{:x}", - FEXT_TO_IDX(inst), inst, state->Reg[15]); + FEXT_TO_IDX(inst), inst, state->Reg[15]); Crash(); goto invalid; } @@ -1246,11 +1246,11 @@ u32 vfp_single_cpdo(ARMul_State* state, u32 inst, u32 fpscr) { type = (fop->flags & OP_DD) ? 'd' : 's'; if (op == FOP_EXT) - LOG_TRACE(Core_ARM11, "itr{} ({}{}) = op[{}] (s{}={:08x})", - vecitr >> FPSCR_LENGTH_BIT, type, dest, sn, sm, m); + LOG_TRACE(Core_ARM11, "itr{} ({}{}) = op[{}] (s{}={:08x})", vecitr >> FPSCR_LENGTH_BIT, + type, dest, sn, sm, m); else LOG_TRACE(Core_ARM11, "itr{} ({}{}) = (s{}) op[{}] (s{}={:08x})", - vecitr >> FPSCR_LENGTH_BIT, type, dest, sn, FOP_TO_IDX(op), sm, m); + vecitr >> FPSCR_LENGTH_BIT, type, dest, sn, FOP_TO_IDX(op), sm, m); except = fop->fn(state, dest, sn, m, fpscr); LOG_TRACE(Core_ARM11, "itr{}: exceptions={:08x}", vecitr >> FPSCR_LENGTH_BIT, except); diff --git a/src/core/core.cpp b/src/core/core.cpp index bfe15f443..287014c4c 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -92,7 +92,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file if (system_mode.second != Loader::ResultStatus::Success) { LOG_CRITICAL(Core, "Failed to determine system mode (Error {})!", - static_cast(system_mode.second)); + static_cast(system_mode.second)); switch (system_mode.second) { case Loader::ResultStatus::ErrorEncrypted: @@ -107,7 +107,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file ResultStatus init_result{Init(emu_window, system_mode.first.get())}; if (init_result != ResultStatus::Success) { LOG_CRITICAL(Core, "Failed to initialize system (Error {})!", - static_cast(init_result)); + static_cast(init_result)); System::Shutdown(); return init_result; } diff --git a/src/core/file_sys/archive_ncch.cpp b/src/core/file_sys/archive_ncch.cpp index c8e6e7ca2..10a344366 100644 --- a/src/core/file_sys/archive_ncch.cpp +++ b/src/core/file_sys/archive_ncch.cpp @@ -107,7 +107,7 @@ ResultVal> NCCHArchive::OpenFile(const Path& path, u32 low = static_cast(title_id & 0xFFFFFFFF); LOG_DEBUG(Service_FS, "Full Path: {}. Category: 0x{:X}. Path: 0x{:X}.", path.DebugStr(), - high, low); + high, low); std::string archive_name; if (high == shared_data_archive) { @@ -122,7 +122,7 @@ ResultVal> NCCHArchive::OpenFile(const Path& path, if (!archive_name.empty()) { LOG_ERROR(Service_FS, "Failed to get a handle for shared data archive: {}. ", - archive_name); + archive_name); Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorSystemFiles, archive_name.c_str()); } @@ -140,22 +140,21 @@ ResultCode NCCHArchive::DeleteFile(const Path& path) const { } ResultCode NCCHArchive::RenameFile(const Path& src_path, const Path& dest_path) const { - LOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", - GetName()); + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode NCCHArchive::DeleteDirectory(const Path& path) const { LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an NCCH archive ({}).", - GetName()); + GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode NCCHArchive::DeleteDirectoryRecursively(const Path& path) const { LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an NCCH archive ({}).", - GetName()); + GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } @@ -168,22 +167,20 @@ ResultCode NCCHArchive::CreateFile(const Path& path, u64 size) const { } ResultCode NCCHArchive::CreateDirectory(const Path& path) const { - LOG_CRITICAL(Service_FS, "Attempted to create a directory in an NCCH archive ({}).", - GetName()); + LOG_CRITICAL(Service_FS, "Attempted to create a directory in an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode NCCHArchive::RenameDirectory(const Path& src_path, const Path& dest_path) const { - LOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", - GetName()); + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an NCCH archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultVal> NCCHArchive::OpenDirectory(const Path& path) const { LOG_CRITICAL(Service_FS, "Attempted to open a directory within an NCCH archive ({}).", - GetName().c_str()); + GetName().c_str()); // TODO(shinyquagsire23): Use correct error code return ResultCode(-1); } diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 638ccf2d5..d826e0f8d 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -79,7 +79,7 @@ ResultVal> SDMCArchive::OpenFileBase(const Path& pa case PathParser::NotFound: if (!mode.create_flag) { LOG_ERROR(Service_FS, "Non-existing file {} can't be open without mode create.", - full_path); + full_path); return ERROR_NOT_FOUND; } else { // Create the file diff --git a/src/core/file_sys/archive_selfncch.cpp b/src/core/file_sys/archive_selfncch.cpp index f62b69bb7..c0d5dac0b 100644 --- a/src/core/file_sys/archive_selfncch.cpp +++ b/src/core/file_sys/archive_selfncch.cpp @@ -242,12 +242,12 @@ void ArchiveFactory_SelfNCCH::Register(Loader::AppLoader& app_loader) { } LOG_DEBUG(Service_FS, "Registering program {:016X} with the SelfNCCH archive factory", - program_id); + program_id); if (ncch_data.find(program_id) != ncch_data.end()) { LOG_WARNING(Service_FS, - "Registering program {:016X} with SelfNCCH will override existing mapping", - program_id); + "Registering program {:016X} with SelfNCCH will override existing mapping", + program_id); } NCCHData& data = ncch_data[program_id]; diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index a82c18618..cbe3ac188 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -36,22 +36,21 @@ ResultCode IVFCArchive::DeleteFile(const Path& path) const { } ResultCode IVFCArchive::RenameFile(const Path& src_path, const Path& dest_path) const { - LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", - GetName()); + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode IVFCArchive::DeleteDirectory(const Path& path) const { LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).", - GetName()); + GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode IVFCArchive::DeleteDirectoryRecursively(const Path& path) const { LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).", - GetName()); + GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } @@ -64,15 +63,13 @@ ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const { } ResultCode IVFCArchive::CreateDirectory(const Path& path) const { - LOG_CRITICAL(Service_FS, "Attempted to create a directory in an IVFC archive ({}).", - GetName()); + LOG_CRITICAL(Service_FS, "Attempted to create a directory in an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } ResultCode IVFCArchive::RenameDirectory(const Path& src_path, const Path& dest_path) const { - LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", - GetName()); + LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).", GetName()); // TODO(wwylele): Use correct error code return ResultCode(-1); } diff --git a/src/core/file_sys/ncch_container.cpp b/src/core/file_sys/ncch_container.cpp index d3c07568b..e9739a586 100644 --- a/src/core/file_sys/ncch_container.cpp +++ b/src/core/file_sys/ncch_container.cpp @@ -160,10 +160,9 @@ Loader::ResultStatus NCCHContainer::Load() { exheader_header.arm11_system_local_caps.resource_limit_category; LOG_DEBUG(Service_FS, "Name: {}", - exheader_header.codeset_info.name); + exheader_header.codeset_info.name); LOG_DEBUG(Service_FS, "Program ID: {:016X}", ncch_header.program_id); - LOG_DEBUG(Service_FS, "Code compressed: {}", - is_compressed ? "yes" : "no"); + LOG_DEBUG(Service_FS, "Code compressed: {}", is_compressed ? "yes" : "no"); LOG_DEBUG(Service_FS, "Entry point: 0x{:08X}", entry_point); LOG_DEBUG(Service_FS, "Code size: 0x{:08X}", code_size); LOG_DEBUG(Service_FS, "Stack size: 0x{:08X}", stack_size); @@ -172,11 +171,11 @@ Loader::ResultStatus NCCHContainer::Load() { LOG_DEBUG(Service_FS, "Thread priority: 0x{:X}", priority); LOG_DEBUG(Service_FS, "Resource limit category: {}", resource_limit_category); LOG_DEBUG(Service_FS, "System Mode: {}", - static_cast(exheader_header.arm11_system_local_caps.system_mode)); + static_cast(exheader_header.arm11_system_local_caps.system_mode)); if (exheader_header.system_info.jump_id != ncch_header.program_id) { LOG_ERROR(Service_FS, - "ExHeader Program ID mismatch: the ROM is probably encrypted."); + "ExHeader Program ID mismatch: the ROM is probably encrypted."); return Loader::ResultStatus::ErrorEncrypted; } @@ -240,8 +239,8 @@ Loader::ResultStatus NCCHContainer::LoadOverrides() { if (is_tainted) LOG_WARNING(Service_FS, - "Loaded NCCH {} is tainted, application behavior may not be as expected!", - filepath); + "Loaded NCCH {} is tainted, application behavior may not be as expected!", + filepath); return Loader::ResultStatus::Success; } @@ -287,8 +286,8 @@ Loader::ResultStatus NCCHContainer::LoadSectionExeFS(const char* name, std::vect // Load the specified section... if (strcmp(section.name, name) == 0) { - LOG_DEBUG(Service_FS, "{} - offset: 0x{:08X}, size: 0x{:08X}, name: {}", - section_number, section.offset, section.size, section.name); + LOG_DEBUG(Service_FS, "{} - offset: 0x{:08X}, size: 0x{:08X}, name: {}", section_number, + section.offset, section.size, section.name); s64 section_offset = (section.offset + exefs_offset + sizeof(ExeFs_Header) + ncch_offset); diff --git a/src/core/file_sys/savedata_archive.cpp b/src/core/file_sys/savedata_archive.cpp index 2367b15ce..7892a9d08 100644 --- a/src/core/file_sys/savedata_archive.cpp +++ b/src/core/file_sys/savedata_archive.cpp @@ -64,7 +64,7 @@ ResultVal> SaveDataArchive::OpenFile(const Path& pa case PathParser::NotFound: if (!mode.create_flag) { LOG_ERROR(Service_FS, "Non-existing file {} can't be open without mode create.", - full_path); + full_path); return ERROR_FILE_NOT_FOUND; } else { // Create the file diff --git a/src/core/file_sys/title_metadata.cpp b/src/core/file_sys/title_metadata.cpp index 77a693734..8e0b6b30f 100644 --- a/src/core/file_sys/title_metadata.cpp +++ b/src/core/file_sys/title_metadata.cpp @@ -76,7 +76,7 @@ Loader::ResultStatus TitleMetadata::Load(const std::vector file_data, size_t body_start + sizeof(Body) + tmd_body.content_count * sizeof(ContentChunk); if (total_size < expected_size) { LOG_ERROR(Service_FS, "Malformed TMD, expected size 0x{:x}, got 0x{:x}!", expected_size, - total_size); + total_size); return Loader::ResultStatus::ErrorInvalidFormat; } @@ -218,8 +218,8 @@ void TitleMetadata::Print() const { break; LOG_DEBUG(Service_FS, " Index {:04X}, Command Count {:04X}", - static_cast(tmd_body.contentinfo[i].index), - static_cast(tmd_body.contentinfo[i].command_count)); + static_cast(tmd_body.contentinfo[i].index), + static_cast(tmd_body.contentinfo[i].command_count)); } // For each content info, print their content chunk range @@ -238,8 +238,8 @@ void TitleMetadata::Print() const { const ContentChunk& chunk = tmd_chunks[j]; LOG_DEBUG(Service_FS, " ID {:08X}, Index {:04X}, Type {:04x}, Size {:016X}", - static_cast(chunk.id), static_cast(chunk.index), - static_cast(chunk.type), static_cast(chunk.size)); + static_cast(chunk.id), static_cast(chunk.index), + static_cast(chunk.type), static_cast(chunk.size)); } } } diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 0872ffab0..5d4e94f0a 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -302,7 +302,7 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) { auto bp = p.find(addr); if (bp != p.end()) { LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:08x} bytes at {:08x} of type {}\n", - bp->second.len, bp->second.addr, static_cast(type)); + bp->second.len, bp->second.addr, static_cast(type)); p.erase(addr); } } @@ -348,8 +348,8 @@ bool CheckBreakpoint(PAddr addr, BreakpointType type) { if (bp->second.active && (addr >= bp->second.addr && addr < bp->second.addr + len)) { LOG_DEBUG(Debug_GDBStub, - "Found breakpoint type {} @ {:08x}, range: {:08x} - {:08x} ({} bytes)\n", - static_cast(type), addr, bp->second.addr, bp->second.addr + len, len); + "Found breakpoint type {} @ {:08x}, range: {:08x} - {:08x} ({} bytes)\n", + static_cast(type), addr, bp->second.addr, bp->second.addr + len, len); return true; } } @@ -740,7 +740,7 @@ static bool CommitBreakpoint(BreakpointType type, PAddr addr, u32 len) { p.insert({addr, breakpoint}); LOG_DEBUG(Debug_GDBStub, "gdb: added {} breakpoint: {:08x} bytes at {:08x}\n", - static_cast(type), breakpoint.len, breakpoint.addr); + static_cast(type), breakpoint.len, breakpoint.addr); return true; } diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp index 65f995218..a998a87e2 100644 --- a/src/core/hle/kernel/memory.cpp +++ b/src/core/hle/kernel/memory.cpp @@ -116,7 +116,7 @@ void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mappin VAddr mapping_limit = mapping.address + mapping.size; if (mapping_limit < mapping.address) { LOG_CRITICAL(Loader, "Mapping size overflowed: address=0x{:08X} size=0x{:X}", - mapping.address, mapping.size); + mapping.address, mapping.size); return; } @@ -127,16 +127,16 @@ void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mappin }); if (area == std::end(memory_areas)) { LOG_ERROR(Loader, - "Unhandled special mapping: address=0x{:08X} size=0x{:X}" - " read_only={} unk_flag={}", - mapping.address, mapping.size, mapping.read_only, mapping.unk_flag); + "Unhandled special mapping: address=0x{:08X} size=0x{:X}" + " read_only={} unk_flag={}", + mapping.address, mapping.size, mapping.read_only, mapping.unk_flag); return; } u32 offset_into_region = mapping.address - area->vaddr_base; if (area->paddr_base == IO_AREA_PADDR) { LOG_ERROR(Loader, "MMIO mappings are not supported yet. phys_addr=0x{:08X}", - area->paddr_base + offset_into_region); + area->paddr_base + offset_into_region); return; } diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 5deef1c79..59c7e39dd 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -107,14 +107,14 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the requested permissions don't match what the creator process allows. if (static_cast(permissions) & ~static_cast(own_other_permissions)) { LOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, permissions don't match", - GetObjectId(), address, name); + GetObjectId(), address, name); return ERR_INVALID_COMBINATION; } // Heap-backed memory blocks can not be mapped with other_permissions = DontCare if (base_address != 0 && other_permissions == MemoryPermission::DontCare) { LOG_ERROR(Kernel, "cannot map id={}, address=0x{08X} name={}, permissions don't match", - GetObjectId(), address, name); + GetObjectId(), address, name); return ERR_INVALID_COMBINATION; } @@ -122,7 +122,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi if (other_permissions != MemoryPermission::DontCare && static_cast(this->permissions) & ~static_cast(other_permissions)) { LOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, permissions don't match", - GetObjectId(), address, name); + GetObjectId(), address, name); return ERR_WRONG_PERMISSION; } @@ -138,7 +138,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi if (address != 0) { if (address < Memory::HEAP_VADDR || address + size >= Memory::SHARED_MEMORY_VADDR_END) { LOG_ERROR(Kernel, "cannot map id={}, address=0x{:08X} name={}, invalid address", - GetObjectId(), address, name); + GetObjectId(), address, name); return ERR_INVALID_ADDRESS; } } diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 0843b5f58..6e30bb0a6 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -59,9 +59,9 @@ enum ControlMemoryOperation { static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { LOG_DEBUG(Kernel_SVC, - "called operation=0x{:08X}, addr0=0x{:08X}, addr1=0x{:08X}, " - "size=0x{:X}, permissions=0x{:08X}", - operation, addr0, addr1, size, permissions); + "called operation=0x{:08X}, addr0=0x{:08X}, addr1=0x{:08X}, " + "size=0x{:X}, permissions=0x{:08X}", + operation, addr0, addr1, size, permissions); if ((addr0 & Memory::PAGE_MASK) != 0 || (addr1 & Memory::PAGE_MASK) != 0) { return ERR_MISALIGNED_ADDRESS; @@ -75,7 +75,7 @@ static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 add if (region != 0) { LOG_WARNING(Kernel_SVC, "ControlMemory with specified region not supported, region={:X}", - region); + region); } if ((permissions & (u32)MemoryPermission::ReadWrite) != permissions) { @@ -177,9 +177,9 @@ static void ExitProcess() { /// Maps a memory block to specified address static ResultCode MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { LOG_TRACE(Kernel_SVC, - "called memblock=0x{:08X}, addr=0x{:08X}, mypermissions=0x{:08X}, " - "otherpermission={}", - handle, addr, permissions, other_permissions); + "called memblock=0x{:08X}, addr=0x{:08X}, mypermissions=0x{:08X}, " + "otherpermission={}", + handle, addr, permissions, other_permissions); SharedPtr shared_memory = g_handle_table.Get(handle); if (shared_memory == nullptr) @@ -274,7 +274,7 @@ static ResultCode WaitSynchronization1(Handle handle, s64 nano_seconds) { return ERR_INVALID_HANDLE; LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({}:{}), nanoseconds={}", handle, - object->GetTypeName(), object->GetName(), nano_seconds); + object->GetTypeName(), object->GetName(), nano_seconds); if (object->ShouldWait(thread)) { @@ -624,9 +624,8 @@ static ResultCode CreateAddressArbiter(Handle* out_handle) { /// Arbitrate address static ResultCode ArbitrateAddress(Handle handle, u32 address, u32 type, u32 value, s64 nanoseconds) { - LOG_TRACE(Kernel_SVC, - "called handle=0x{:08X}, address=0x{:08X}, type=0x{:08X}, value=0x{:08X}", handle, - address, type, value); + LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}, address=0x{:08X}, type=0x{:08X}, value=0x{:08X}", + handle, address, type, value); SharedPtr arbiter = g_handle_table.Get(handle); if (arbiter == nullptr) @@ -685,7 +684,7 @@ static ResultCode GetResourceLimit(Handle* resource_limit, Handle process_handle static ResultCode GetResourceLimitCurrentValues(VAddr values, Handle resource_limit_handle, VAddr names, u32 name_count) { LOG_TRACE(Kernel_SVC, "called resource_limit={:08X}, names={:08X}, name_count={}", - resource_limit_handle, names, name_count); + resource_limit_handle, names, name_count); SharedPtr resource_limit = g_handle_table.Get(resource_limit_handle); @@ -705,7 +704,7 @@ static ResultCode GetResourceLimitCurrentValues(VAddr values, Handle resource_li static ResultCode GetResourceLimitLimitValues(VAddr values, Handle resource_limit_handle, VAddr names, u32 name_count) { LOG_TRACE(Kernel_SVC, "called resource_limit={:08X}, names={:08X}, name_count={}", - resource_limit_handle, names, name_count); + resource_limit_handle, names, name_count); SharedPtr resource_limit = g_handle_table.Get(resource_limit_handle); @@ -746,11 +745,11 @@ static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point break; case THREADPROCESSORID_ALL: LOG_INFO(Kernel_SVC, - "Newly created thread is allowed to be run in any Core, unimplemented."); + "Newly created thread is allowed to be run in any Core, unimplemented."); break; case THREADPROCESSORID_1: LOG_ERROR(Kernel_SVC, - "Newly created thread must run in the SysCore (Core1), unimplemented."); + "Newly created thread must run in the SysCore (Core1), unimplemented."); break; default: // TODO(bunnei): Implement support for other processor IDs @@ -770,9 +769,9 @@ static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point Core::System::GetInstance().PrepareReschedule(); LOG_TRACE(Kernel_SVC, - "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, " - "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}", - entry_point, name, arg, stack_top, priority, processor_id, *out_handle); + "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, " + "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}", + entry_point, name, arg, stack_top, priority, processor_id, *out_handle); return RESULT_SUCCESS; } @@ -830,7 +829,7 @@ static ResultCode CreateMutex(Handle* out_handle, u32 initial_locked) { CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(mutex))); LOG_TRACE(Kernel_SVC, "called initial_locked={} : created handle=0x{:08X}", - initial_locked ? "true" : "false", *out_handle); + initial_locked ? "true" : "false", *out_handle); return RESULT_SUCCESS; } @@ -893,7 +892,7 @@ static ResultCode CreateSemaphore(Handle* out_handle, s32 initial_count, s32 max CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(semaphore))); LOG_TRACE(Kernel_SVC, "called initial_count={}, max_count={}, created handle=0x{:08X}", - initial_count, max_count, *out_handle); + initial_count, max_count, *out_handle); return RESULT_SUCCESS; } @@ -944,7 +943,7 @@ static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) { CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(evt))); LOG_TRACE(Kernel_SVC, "called reset_type=0x{:08X} : created handle=0x{:08X}", reset_type, - *out_handle); + *out_handle); return RESULT_SUCCESS; } @@ -987,7 +986,7 @@ static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) { CASCADE_RESULT(*out_handle, g_handle_table.Create(std::move(timer))); LOG_TRACE(Kernel_SVC, "called reset_type=0x{:08X} : created handle=0x{:08X}", reset_type, - *out_handle); + *out_handle); return RESULT_SUCCESS; } diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 7154a1876..ebff4d18e 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -267,7 +267,7 @@ static void DebugThreadQueue() { LOG_DEBUG(Kernel, "Current: NO CURRENT THREAD"); } else { LOG_DEBUG(Kernel, "0x{:02X} {} (current)", thread->current_priority, - GetCurrentThread()->GetObjectId()); + GetCurrentThread()->GetObjectId()); } for (auto& t : thread_list) { @@ -376,7 +376,7 @@ ResultVal> Thread::Create(std::string name, VAddr entry_point, if (linheap_memory->size() + Memory::PAGE_SIZE > memory_region->size) { LOG_ERROR(Kernel_SVC, - "Not enough space in region to allocate a new TLS page for thread"); + "Not enough space in region to allocate a new TLS page for thread"); return ERR_OUT_OF_MEMORY; } diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 24301f53c..8c86b94a1 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -261,11 +261,11 @@ void VMManager::LogLayout(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} {}{}{} {}", - vma.base, vma.base + vma.size, vma.size, - (u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-', - (u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-', - (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-', - GetMemoryStateName(vma.meminfo_state)); + vma.base, vma.base + vma.size, vma.size, + (u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-', + (u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-', + (u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-', + GetMemoryStateName(vma.meminfo_state)); } } diff --git a/src/core/hle/service/ac/ac.cpp b/src/core/hle/service/ac/ac.cpp index d616135ee..d158e9822 100644 --- a/src/core/hle/service/ac/ac.cpp +++ b/src/core/hle/service/ac/ac.cpp @@ -153,8 +153,8 @@ void Module::Interface::IsConnected(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.Push(ac->ac_connected); - LOG_WARNING(Service_AC, "(STUBBED) called unk=0x{:08X} descriptor=0x{:08X} param=0x{:08X}", - unk, unk_descriptor, unk_param); + LOG_WARNING(Service_AC, "(STUBBED) called unk=0x{:08X} descriptor=0x{:08X} param=0x{:08X}", unk, + unk_descriptor, unk_param); } void Module::Interface::SetClientVersion(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 520628a92..66a38544b 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -144,7 +144,7 @@ ResultVal CIAFile::WriteContentData(u64 offset, size_t length, const u8* // values can be calculated. content_written[i] += available_to_write; LOG_DEBUG(Service_AM, "Wrote {:x} to content {}, total {:x}", available_to_write, i, - content_written[i]); + content_written[i]); } } @@ -312,7 +312,7 @@ InstallStatus InstallCIA(const std::string& path, update_callback(total_bytes_read, file.GetSize()); if (result.Failed()) { LOG_ERROR(Service_AM, "CIA file installation aborted with error code {:08x}", - result.Code().raw); + result.Code().raw); return InstallStatus::ErrorAborted; } total_bytes_read += bytes_read; @@ -386,7 +386,7 @@ std::string GetTitleContentPath(Service::FS::MediaType media_type, u64 tid, u16 if (media_type == Service::FS::MediaType::GameCard) { // TODO(shinyquagsire23): get current app file if TID matches? LOG_ERROR(Service_AM, "Request for gamecard partition {} content path unimplemented!", - static_cast(index)); + static_cast(index)); return ""; } @@ -608,7 +608,7 @@ void Module::Interface::DeleteContents(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); rb.PushMappedBuffer(content_ids_in); LOG_WARNING(Service_AM, "(STUBBED) media_type={}, title_id=0x{:016x}, content_count={}", - media_type, title_id, content_count); + media_type, title_id, content_count); } void Module::Interface::GetProgramList(Kernel::HLERequestContext& ctx) { @@ -828,8 +828,8 @@ void Module::Interface::ListDataTitleTicketInfos(Kernel::HLERequestContext& ctx) rb.PushMappedBuffer(ticket_info_out); LOG_WARNING(Service_AM, - "(STUBBED) ticket_count=0x{:08X}, title_id=0x{:016x}, start_index=0x{:08X}", - ticket_count, title_id, start_index); + "(STUBBED) ticket_count=0x{:08X}, title_id=0x{:016x}, start_index=0x{:08X}", + ticket_count, title_id, start_index); } void Module::Interface::GetDLCContentInfoCount(Kernel::HLERequestContext& ctx) { @@ -858,7 +858,7 @@ void Module::Interface::GetDLCContentInfoCount(Kernel::HLERequestContext& ctx) { } else { rb.Push(1); // Number of content infos plus one LOG_WARNING(Service_AM, "(STUBBED) called media_type={}, title_id=0x{:016x}", - static_cast(media_type), title_id); + static_cast(media_type), title_id); } } @@ -892,7 +892,7 @@ void Module::Interface::GetTicketList(Kernel::HLERequestContext& ctx) { rb.Push(ticket_list_count); rb.PushMappedBuffer(ticket_tids_out); LOG_WARNING(Service_AM, "(STUBBED) ticket_list_count=0x{:08x}, ticket_index=0x{:08x}", - ticket_list_count, ticket_index); + ticket_list_count, ticket_index); } void Module::Interface::QueryAvailableTitleDatabase(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/apt/applet_manager.cpp b/src/core/hle/service/apt/applet_manager.cpp index 06d2fd44f..5d30309ca 100644 --- a/src/core/hle/service/apt/applet_manager.cpp +++ b/src/core/hle/service/apt/applet_manager.cpp @@ -171,7 +171,7 @@ void AppletManager::CancelAndSendParameter(const MessageParameter& parameter) { auto* const slot_data = GetAppletSlotData(static_cast(parameter.destination_id)); if (slot_data == nullptr) { LOG_DEBUG(Service_APT, "No applet was registered with the id {:03X}", - static_cast(parameter.destination_id)); + static_cast(parameter.destination_id)); return; } @@ -330,7 +330,7 @@ ResultCode AppletManager::PrepareToStartLibraryApplet(AppletId applet_id) { auto applet = HLE::Applets::Applet::Get(applet_id); if (applet) { LOG_WARNING(Service_APT, "applet has already been started id={:08X}", - static_cast(applet_id)); + static_cast(applet_id)); return RESULT_SUCCESS; } else { return HLE::Applets::Applet::Create(applet_id, shared_from_this()); @@ -354,7 +354,7 @@ ResultCode AppletManager::PreloadLibraryApplet(AppletId applet_id) { auto applet = HLE::Applets::Applet::Get(applet_id); if (applet) { LOG_WARNING(Service_APT, "applet has already been started id={:08X}", - static_cast(applet_id)); + static_cast(applet_id)); return RESULT_SUCCESS; } else { return HLE::Applets::Applet::Create(applet_id, shared_from_this()); @@ -401,7 +401,7 @@ ResultVal AppletManager::GetAppletInfo(AppletId app_i ErrorSummary::NotFound, ErrorLevel::Status); } LOG_WARNING(Service_APT, "Using HLE applet info for applet {:03X}", - static_cast(app_id)); + static_cast(app_id)); // TODO(Subv): Get the title id for the current applet and write it in the response[2-3] return MakeResult({0, Service::FS::MediaType::NAND, true, true, 0}); } diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index e80aac8b7..5efd2dd20 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -32,8 +32,8 @@ void Module::Interface::Initialize(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 attributes = rp.Pop(); - LOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", - static_cast(app_id), attributes); + LOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", static_cast(app_id), + attributes); auto result = apt->applet_manager->Initialize(app_id, attributes); if (result.Failed()) { @@ -307,10 +307,10 @@ void Module::Interface::SendParameter(Kernel::HLERequestContext& ctx) { std::vector buffer = rp.PopStaticBuffer(); LOG_DEBUG(Service_APT, - "called src_app_id={:#010X}, dst_app_id={:#010X}, signal_type={:#010X}," - "buffer_size={:#010X}", - static_cast(src_app_id), static_cast(dst_app_id), - static_cast(signal_type), buffer_size); + "called src_app_id={:#010X}, dst_app_id={:#010X}, signal_type={:#010X}," + "buffer_size={:#010X}", + static_cast(src_app_id), static_cast(dst_app_id), + static_cast(signal_type), buffer_size); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -329,8 +329,8 @@ void Module::Interface::ReceiveParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", - static_cast(app_id), buffer_size); + LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), + buffer_size); auto next_parameter = apt->applet_manager->ReceiveParameter(app_id); @@ -357,8 +357,8 @@ void Module::Interface::GlanceParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", - static_cast(app_id), buffer_size); + LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), + buffer_size); auto next_parameter = apt->applet_manager->GlanceParameter(app_id); @@ -394,10 +394,10 @@ void Module::Interface::CancelParameter(Kernel::HLERequestContext& ctx) { receiver_appid)); LOG_DEBUG(Service_APT, - "called check_sender={}, sender_appid={:#010X}, " - "check_receiver={}, receiver_appid={:#010X}", - check_sender, static_cast(sender_appid), check_receiver, - static_cast(receiver_appid)); + "called check_sender={}, sender_appid={:#010X}, " + "check_receiver={}, receiver_appid={:#010X}", + check_sender, static_cast(sender_appid), check_receiver, + static_cast(receiver_appid)); } void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx) { @@ -415,11 +415,10 @@ void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING( - Service_APT, - "(STUBBED) called title_info1={:#010X}, title_info2={:#010X}, title_info3={:#010X}," - "title_info4={:#010X}, flags={:#010X}", - title_info1, title_info2, title_info3, title_info4, flags); + LOG_WARNING(Service_APT, + "(STUBBED) called title_info1={:#010X}, title_info2={:#010X}, title_info3={:#010X}," + "title_info4={:#010X}, flags={:#010X}", + title_info1, title_info2, title_info3, title_info4, flags); } void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { @@ -434,8 +433,8 @@ void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error LOG_WARNING(Service_APT, - "(STUBBED) called buffer1_size={:#010X}, buffer2_size={:#010X}, flag={:#010X}", - buffer1_size, buffer2_size, flag); + "(STUBBED) called buffer1_size={:#010X}, buffer2_size={:#010X}, flag={:#010X}", + buffer1_size, buffer2_size, flag); } void Module::Interface::AppletUtility(Kernel::HLERequestContext& ctx) { @@ -451,8 +450,8 @@ void Module::Interface::AppletUtility(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error LOG_WARNING(Service_APT, - "(STUBBED) called command={:#010X}, input_size={:#010X}, output_size={:#010X}", - utility_command, input_size, output_size); + "(STUBBED) called command={:#010X}, input_size={:#010X}, output_size={:#010X}", + utility_command, input_size, output_size); } void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { @@ -467,8 +466,7 @@ void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, - value); + LOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, value); } void Module::Interface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { @@ -583,7 +581,7 @@ void Module::Interface::SetScreenCapPostPermission(Kernel::HLERequestContext& ct IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error LOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", - static_cast(apt->screen_capture_post_permission)); + static_cast(apt->screen_capture_post_permission)); } void Module::Interface::GetScreenCapPostPermission(Kernel::HLERequestContext& ctx) { @@ -593,7 +591,7 @@ void Module::Interface::GetScreenCapPostPermission(Kernel::HLERequestContext& ct rb.Push(RESULT_SUCCESS); // No error rb.Push(static_cast(apt->screen_capture_post_permission)); LOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", - static_cast(apt->screen_capture_post_permission)); + static_cast(apt->screen_capture_post_permission)); } void Module::Interface::GetAppletInfo(Kernel::HLERequestContext& ctx) { @@ -632,9 +630,8 @@ void Module::Interface::GetStartupArgument(Kernel::HLERequestContext& ctx) { std::vector parameter(parameter_size, 0); - LOG_WARNING(Service_APT, - "(STUBBED) called, startup_argument_type={}, parameter_size={:#010X}", - static_cast(startup_argument_type), parameter_size); + LOG_WARNING(Service_APT, "(STUBBED) called, startup_argument_type={}, parameter_size={:#010X}", + static_cast(startup_argument_type), parameter_size); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); rb.Push(RESULT_SUCCESS); @@ -658,9 +655,8 @@ void Module::Interface::Wrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size + HW::AES::CCM_MAC_SIZE, "input_size ({}) doesn't match to output_size ({})", input_size, output_size); - LOG_DEBUG(Service_APT, - "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", - output_size, input_size, nonce_offset, nonce_size); + LOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", + output_size, input_size, nonce_offset, nonce_size); // Note: This weird nonce size modification is verified against real 3DS nonce_size = std::min(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE); @@ -704,9 +700,8 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size - HW::AES::CCM_MAC_SIZE, "input_size ({}) doesn't match to output_size ({})", input_size, output_size); - LOG_DEBUG(Service_APT, - "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", - output_size, input_size, nonce_offset, nonce_size); + LOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", + output_size, input_size, nonce_offset, nonce_size); // Note: This weird nonce size modification is verified against real 3DS nonce_size = std::min(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE); diff --git a/src/core/hle/service/boss/boss.cpp b/src/core/hle/service/boss/boss.cpp index eba337f75..0c2b3141e 100644 --- a/src/core/hle/service/boss/boss.cpp +++ b/src/core/hle/service/boss/boss.cpp @@ -36,8 +36,8 @@ void InitializeSession(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param={:#018X}, translation={:#010X}, unk_param4={:#010X}", - unk_param, translation, unk_param4); + "(STUBBED) unk_param={:#018X}, translation={:#010X}, unk_param4={:#010X}", + unk_param, translation, unk_param4); } void RegisterStorage(Service::Interface* self) { @@ -52,9 +52,9 @@ void RegisterStorage(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "unk_flag={:#010X}", - unk_param1, unk_param2, unk_param3, unk_flag); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "unk_flag={:#010X}", + unk_param1, unk_param2, unk_param3, unk_flag); } void UnregisterStorage(Service::Interface* self) { @@ -89,8 +89,8 @@ void RegisterPrivateRootCa(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) translation={:#010X}, buff_addr{:#010X}, buff_size={:#010X}", - translation, buff_addr, buff_size); + "(STUBBED) translation={:#010X}, buff_addr{:#010X}, buff_size={:#010X}", + translation, buff_addr, buff_size); } void RegisterPrivateClientCert(Service::Interface* self) { @@ -113,11 +113,11 @@ void RegisterPrivateClientCert(Service::Interface* self) { cmd_buff[3] = buff2_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " - "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " - "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", - unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2, - buff2_addr, buff2_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " + "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " + "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", + unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2, + buff2_addr, buff2_size); } void GetNewArrivalFlag(Service::Interface* self) { @@ -140,7 +140,7 @@ void RegisterNewArrivalEvent(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}", unk_param1, - unk_param2); + unk_param2); } void SetOptoutFlag(Service::Interface* self) { @@ -180,9 +180,9 @@ void RegisterTask(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); } void UnregisterTask(Service::Interface* self) { @@ -200,9 +200,9 @@ void UnregisterTask(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, translation, buff_addr, buff_size); } void ReconfigureTask(Service::Interface* self) { @@ -220,9 +220,9 @@ void ReconfigureTask(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, translation, buff_addr, buff_size); } void GetTaskIdList(Service::Interface* self) { @@ -247,8 +247,8 @@ void GetStepIdList(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", - translation, buff_addr, buff_size); + "(STUBBED) translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", + translation, buff_addr, buff_size); } void GetNsDataIdList(Service::Interface* self) { @@ -270,11 +270,10 @@ void GetNsDataIdList(Service::Interface* self) { cmd_buff[5] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "unk_param4={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, - buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "unk_param4={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size); } void GetOwnNsDataIdList(Service::Interface* self) { @@ -296,11 +295,10 @@ void GetOwnNsDataIdList(Service::Interface* self) { cmd_buff[5] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "unk_param4={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, - buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "unk_param4={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size); } void GetNewDataNsDataIdList(Service::Interface* self) { @@ -322,11 +320,10 @@ void GetNewDataNsDataIdList(Service::Interface* self) { cmd_buff[5] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "unk_param4={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, - buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "unk_param4={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size); } void GetOwnNewDataNsDataIdList(Service::Interface* self) { @@ -348,11 +345,10 @@ void GetOwnNewDataNsDataIdList(Service::Interface* self) { cmd_buff[5] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "unk_param4={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, - buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "unk_param4={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size); } void SendProperty(Service::Interface* self) { @@ -370,9 +366,9 @@ void SendProperty(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, translation, buff_addr, buff_size); } void SendPropertyHandle(Service::Interface* self) { @@ -389,9 +385,9 @@ void SendPropertyHandle(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void ReceiveProperty(Service::Interface* self) { @@ -409,9 +405,9 @@ void ReceiveProperty(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, buff_size={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}", - unk_param1, buff_size, translation, buff_addr); + "(STUBBED) unk_param1={:#010X}, buff_size={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}", + unk_param1, buff_size, translation, buff_addr); } void UpdateTaskInterval(Service::Interface* self) { @@ -429,9 +425,9 @@ void UpdateTaskInterval(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, translation, buff_addr, buff_size); } void UpdateTaskCount(Service::Interface* self) { @@ -448,9 +444,9 @@ void UpdateTaskCount(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}", - buff_size, unk_param2, translation, buff_addr); + "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}", + buff_size, unk_param2, translation, buff_addr); } void GetTaskInterval(Service::Interface* self) { @@ -468,9 +464,9 @@ void GetTaskInterval(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void GetTaskCount(Service::Interface* self) { @@ -488,9 +484,9 @@ void GetTaskCount(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void GetTaskServiceStatus(Service::Interface* self) { @@ -508,9 +504,9 @@ void GetTaskServiceStatus(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void StartTask(Service::Interface* self) { @@ -527,9 +523,9 @@ void StartTask(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void StartTaskImmediate(Service::Interface* self) { @@ -546,9 +542,9 @@ void StartTaskImmediate(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void CancelTask(Service::Interface* self) { @@ -565,9 +561,9 @@ void CancelTask(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void GetTaskFinishHandle(Service::Interface* self) { @@ -598,9 +594,9 @@ void GetTaskState(Service::Interface* self) { cmd_buff[6] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}", - buff_size, unk_param2, translation, buff_addr); + "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}", + buff_size, unk_param2, translation, buff_addr); } void GetTaskResult(Service::Interface* self) { @@ -620,9 +616,9 @@ void GetTaskResult(Service::Interface* self) { cmd_buff[6] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void GetTaskCommErrorCode(Service::Interface* self) { @@ -642,9 +638,9 @@ void GetTaskCommErrorCode(Service::Interface* self) { cmd_buff[6] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void GetTaskStatus(Service::Interface* self) { @@ -664,9 +660,9 @@ void GetTaskStatus(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); } void GetTaskError(Service::Interface* self) { @@ -685,9 +681,9 @@ void GetTaskError(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, translation, buff_addr, buff_size); } void GetTaskInfo(Service::Interface* self) { @@ -705,9 +701,9 @@ void GetTaskInfo(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, translation, buff_addr, buff_size); } void DeleteNsData(Service::Interface* self) { @@ -737,9 +733,9 @@ void GetNsDataHeaderInfo(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); } void ReadNsData(Service::Interface* self) { @@ -761,11 +757,10 @@ void ReadNsData(Service::Interface* self) { cmd_buff[5] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "unk_param4={:#010X}, translation={:#010X}, " - "buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, - buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "unk_param4={:#010X}, translation={:#010X}, " + "buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size); } void SetNsDataAdditionalInfo(Service::Interface* self) { @@ -778,7 +773,7 @@ void SetNsDataAdditionalInfo(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}", unk_param1, - unk_param2); + unk_param2); } void GetNsDataAdditionalInfo(Service::Interface* self) { @@ -803,7 +798,7 @@ void SetNsDataNewFlag(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, ns_data_new_flag={:#010X}", - unk_param1, ns_data_new_flag); + unk_param1, ns_data_new_flag); } void GetNsDataNewFlag(Service::Interface* self) { @@ -816,7 +811,7 @@ void GetNsDataNewFlag(Service::Interface* self) { cmd_buff[2] = ns_data_new_flag; LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1={:#010X}, ns_data_new_flag={:#010X}", - unk_param1, ns_data_new_flag); + unk_param1, ns_data_new_flag); } void GetNsDataLastUpdate(Service::Interface* self) { @@ -857,9 +852,9 @@ void RegisterStorageEntry(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "unk_param4={:#010X}, unk_param5={:#010X}", - unk_param1, unk_param2, unk_param3, unk_param4, unk_param5); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "unk_param4={:#010X}, unk_param5={:#010X}", + unk_param1, unk_param2, unk_param3, unk_param4, unk_param5); } void GetStorageEntryInfo(Service::Interface* self) { @@ -885,9 +880,9 @@ void SetStorageOption(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " - "unk_param3={:#010X}, unk_param4={:#010X}", - unk_param1, unk_param2, unk_param3, unk_param4); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " + "unk_param3={:#010X}, unk_param4={:#010X}", + unk_param1, unk_param2, unk_param3, unk_param4); } void GetStorageOption(Service::Interface* self) { @@ -917,9 +912,9 @@ void StartBgImmediate(Service::Interface* self) { cmd_buff[3] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void GetTaskActivePriority(Service::Interface* self) { @@ -937,9 +932,9 @@ void GetTaskActivePriority(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}", - unk_param1, translation, buff_addr, buff_size); + "(STUBBED) buff_size={:#010X}, unk_param2={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}", + unk_param1, translation, buff_addr, buff_size); } void RegisterImmediateTask(Service::Interface* self) { @@ -958,9 +953,9 @@ void RegisterImmediateTask(Service::Interface* self) { cmd_buff[4] = buff_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " - "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", - unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, unk_param3={:#010X}, " + "translation={:#010X}, buff_addr={:#010X}, buff_size={:#010X}", + unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size); } void SetTaskQuery(Service::Interface* self) { @@ -983,11 +978,11 @@ void SetTaskQuery(Service::Interface* self) { cmd_buff[3] = buff2_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " - "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " - "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", - unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2, - buff2_addr, buff2_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " + "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " + "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", + unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2, + buff2_addr, buff2_size); } void GetTaskQuery(Service::Interface* self) { @@ -1010,11 +1005,11 @@ void GetTaskQuery(Service::Interface* self) { cmd_buff[3] = buff2_addr; LOG_WARNING(Service_BOSS, - "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " - "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " - "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", - unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2, - buff2_addr, buff2_size); + "(STUBBED) unk_param1={:#010X}, unk_param2={:#010X}, " + "translation1={:#010X}, buff1_addr={:#010X}, buff1_size={:#010X}, " + "translation2={:#010X}, buff2_addr={:#010X}, buff2_size={:#010X}", + unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2, + buff2_addr, buff2_size); } void Init() { diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp index c0c8f78d8..aad4756a3 100644 --- a/src/core/hle/service/cam/cam.cpp +++ b/src/core/hle/service/cam/cam.cpp @@ -87,7 +87,7 @@ void Module::CompletionEventCallBack(u64 port_id, int) { if (port.x1 <= port.x0 || port.y1 <= port.y0 || port.x1 > original_width || port.y1 > original_height) { LOG_ERROR(Service_CAM, "Invalid trimming coordinates x0={}, y0={}, x1={}, y1={}", - port.x0, port.y0, port.x1, port.y1); + port.x0, port.y0, port.x1, port.y1); trim_width = 0; trim_height = 0; } else { @@ -98,7 +98,7 @@ void Module::CompletionEventCallBack(u64 port_id, int) { u32 trim_size = (port.x1 - port.x0) * (port.y1 - port.y0) * 2; if (port.dest_size != trim_size) { LOG_ERROR(Service_CAM, "The destination size ({}) doesn't match the source ({})!", - port.dest_size, trim_size); + port.dest_size, trim_size); } const u32 src_offset = port.y0 * original_width + port.x0; @@ -125,7 +125,7 @@ void Module::CompletionEventCallBack(u64 port_id, int) { std::size_t buffer_size = buffer.size() * sizeof(u16); if (port.dest_size != buffer_size) { LOG_ERROR(Service_CAM, "The destination size ({}) doesn't match the source ({})!", - port.dest_size, buffer_size); + port.dest_size, buffer_size); } Memory::WriteBlock(*port.dest_process, port.dest, buffer.data(), std::min(port.dest_size, buffer_size)); @@ -361,7 +361,7 @@ void Module::Interface::SetReceiving(Kernel::HLERequestContext& ctx) { } LOG_DEBUG(Service_CAM, "called, addr=0x{:X}, port_select={}, image_size={}, trans_unit={}", - dest, port_select.m_val, image_size, trans_unit); + dest, port_select.m_val, image_size, trans_unit); } void Module::Interface::IsFinishedReceiving(Kernel::HLERequestContext& ctx) { @@ -402,7 +402,7 @@ void Module::Interface::SetTransferLines(Kernel::HLERequestContext& ctx) { } LOG_WARNING(Service_CAM, "(STUBBED) called, port_select={}, lines={}, width={}, height={}", - port_select.m_val, transfer_lines, width, height); + port_select.m_val, transfer_lines, width, height); } void Module::Interface::GetMaxLines(Kernel::HLERequestContext& ctx) { @@ -457,7 +457,7 @@ void Module::Interface::SetTransferBytes(Kernel::HLERequestContext& ctx) { } LOG_WARNING(Service_CAM, "(STUBBED)called, port_select={}, bytes={}, width={}, height={}", - port_select.m_val, transfer_bytes, width, height); + port_select.m_val, transfer_bytes, width, height); } void Module::Interface::GetTransferBytes(Kernel::HLERequestContext& ctx) { @@ -564,8 +564,8 @@ void Module::Interface::SetTrimmingParams(Kernel::HLERequestContext& ctx) { rb.Push(ERROR_INVALID_ENUM_VALUE); } - LOG_DEBUG(Service_CAM, "called, port_select={}, x0={}, y0={}, x1={}, y1={}", - port_select.m_val, x0, y0, x1, y1); + LOG_DEBUG(Service_CAM, "called, port_select={}, x0={}, y0={}, x1={}, y1={}", port_select.m_val, + x0, y0, x1, y1); } void Module::Interface::GetTrimmingParams(Kernel::HLERequestContext& ctx) { @@ -612,7 +612,7 @@ void Module::Interface::SetTrimmingParamsCenter(Kernel::HLERequestContext& ctx) } LOG_DEBUG(Service_CAM, "called, port_select={}, trim_w={}, trim_h={}, cam_w={}, cam_h={}", - port_select.m_val, trim_w, trim_h, cam_w, cam_h); + port_select.m_val, trim_w, trim_h, cam_w, cam_h); } void Module::Interface::Activate(Kernel::HLERequestContext& ctx) { @@ -673,12 +673,12 @@ void Module::Interface::SwitchContext(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } else { LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, - context_select.m_val); + context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } LOG_DEBUG(Service_CAM, "called, camera_select={}, context_select={}", camera_select.m_val, - context_select.m_val); + context_select.m_val); } void Module::Interface::FlipImage(Kernel::HLERequestContext& ctx) { @@ -700,12 +700,12 @@ void Module::Interface::FlipImage(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } else { LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, - context_select.m_val); + context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } LOG_DEBUG(Service_CAM, "called, camera_select={}, flip={}, context_select={}", - camera_select.m_val, static_cast(flip), context_select.m_val); + camera_select.m_val, static_cast(flip), context_select.m_val); } void Module::Interface::SetDetailSize(Kernel::HLERequestContext& ctx) { @@ -733,15 +733,15 @@ void Module::Interface::SetDetailSize(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } else { LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, - context_select.m_val); + context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } LOG_DEBUG(Service_CAM, - "called, camera_select={}, width={}, height={}, crop_x0={}, crop_y0={}, " - "crop_x1={}, crop_y1={}, context_select={}", - camera_select.m_val, resolution.width, resolution.height, resolution.crop_x0, - resolution.crop_y0, resolution.crop_x1, resolution.crop_y1, context_select.m_val); + "called, camera_select={}, width={}, height={}, crop_x0={}, crop_y0={}, " + "crop_x1={}, crop_y1={}, context_select={}", + camera_select.m_val, resolution.width, resolution.height, resolution.crop_x0, + resolution.crop_y0, resolution.crop_x1, resolution.crop_y1, context_select.m_val); } void Module::Interface::SetSize(Kernel::HLERequestContext& ctx) { @@ -763,12 +763,12 @@ void Module::Interface::SetSize(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } else { LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, - context_select.m_val); + context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } LOG_DEBUG(Service_CAM, "called, camera_select={}, size={}, context_select={}", - camera_select.m_val, size, context_select.m_val); + camera_select.m_val, size, context_select.m_val); } void Module::Interface::SetFrameRate(Kernel::HLERequestContext& ctx) { @@ -789,7 +789,7 @@ void Module::Interface::SetFrameRate(Kernel::HLERequestContext& ctx) { } LOG_WARNING(Service_CAM, "(STUBBED) called, camera_select={}, frame_rate={}", - camera_select.m_val, static_cast(frame_rate)); + camera_select.m_val, static_cast(frame_rate)); } void Module::Interface::SetEffect(Kernel::HLERequestContext& ctx) { @@ -811,12 +811,12 @@ void Module::Interface::SetEffect(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } else { LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, - context_select.m_val); + context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } LOG_DEBUG(Service_CAM, "called, camera_select={}, effect={}, context_select={}", - camera_select.m_val, static_cast(effect), context_select.m_val); + camera_select.m_val, static_cast(effect), context_select.m_val); } void Module::Interface::SetOutputFormat(Kernel::HLERequestContext& ctx) { @@ -838,12 +838,12 @@ void Module::Interface::SetOutputFormat(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } else { LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", camera_select.m_val, - context_select.m_val); + context_select.m_val); rb.Push(ERROR_INVALID_ENUM_VALUE); } LOG_DEBUG(Service_CAM, "called, camera_select={}, format={}, context_select={}", - camera_select.m_val, static_cast(format), context_select.m_val); + camera_select.m_val, static_cast(format), context_select.m_val); } void Module::Interface::SynchronizeVsyncTiming(Kernel::HLERequestContext& ctx) { @@ -855,7 +855,7 @@ void Module::Interface::SynchronizeVsyncTiming(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_WARNING(Service_CAM, "(STUBBED) called, camera_select1={}, camera_select2={}", - camera_select1, camera_select2); + camera_select1, camera_select2); } void Module::Interface::GetStereoCameraCalibrationData(Kernel::HLERequestContext& ctx) { @@ -918,8 +918,8 @@ ResultCode Module::SetPackageParameter(const PackageParameterType& package) { } return RESULT_SUCCESS; } else { - LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", - package.camera_select, package.context_select); + LOG_ERROR(Service_CAM, "invalid camera_select={}, context_select={}", package.camera_select, + package.context_select); return ERROR_INVALID_ENUM_VALUE; } } diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 9b7278a48..7395399c4 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -161,7 +161,7 @@ void Module::Interface::GetCountryCodeID(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); if (0 == country_code_id) { LOG_ERROR(Service_CFG, "requested country code name={}{} is invalid", - static_cast(country_code & 0xff), static_cast(country_code >> 8)); + static_cast(country_code & 0xff), static_cast(country_code >> 8)); rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent)); rb.Push(0x00FF); @@ -310,21 +310,21 @@ ResultVal Module::GetConfigInfoBlockPointer(u32 block_id, u32 size, u32 f if (itr == std::end(config->block_entries)) { LOG_ERROR(Service_CFG, "Config block 0x{:X} with flags {} and size {} was not found", - block_id, flag, size); + block_id, flag, size); return ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); } if ((itr->flags & flag) == 0) { LOG_ERROR(Service_CFG, "Invalid flag {} for config block 0x{:X} with size {}", flag, - block_id, size); + block_id, size); return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); } if (itr->size != size) { LOG_ERROR(Service_CFG, "Invalid size {} for config block 0x{:X} with flags {}", size, - block_id, flag); + block_id, flag); return ResultCode(ErrorDescription::InvalidSize, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); } @@ -607,7 +607,7 @@ void Module::SetPreferredRegionCode(u32 region_code) { AdjustLanguageInfoBlock(region_code, current_language); if (current_language != adjusted_language) { LOG_WARNING(Service_CFG, "System language {} does not fit the region. Adjusted to {}", - static_cast(current_language), static_cast(adjusted_language)); + static_cast(current_language), static_cast(adjusted_language)); SetSystemLanguage(adjusted_language); } } diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index 53e59d5d7..0a5f7fecf 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -147,11 +147,11 @@ static void LoadComponent(Service::Interface* self) { Memory::ReadBlock(buffer, component_data.data(), component_data.size()); LOG_INFO(Service_DSP, "Firmware hash: {:#018x}", - Common::ComputeHash64(component_data.data(), component_data.size())); + Common::ComputeHash64(component_data.data(), component_data.size())); // Some versions of the firmware have the location of DSP structures listed here. if (size > 0x37C) { LOG_INFO(Service_DSP, "Structures hash: {:#018x}", - Common::ComputeHash64(component_data.data() + 0x340, 60)); + Common::ComputeHash64(component_data.data() + 0x340, 60)); } LOG_WARNING( Service_DSP, @@ -198,8 +198,8 @@ static void FlushDataCache(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x13, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_TRACE(Service_DSP, "called address=0x{:08X}, size=0x{:X}, process=0x{:08X}", address, - size, process); + LOG_TRACE(Service_DSP, "called address=0x{:08X}, size=0x{:X}, process=0x{:08X}", address, size, + process); } /** @@ -231,15 +231,15 @@ static void RegisterInterruptEvents(Service::Interface* self) { if (!evt) { LOG_INFO(Service_DSP, "Invalid event handle! type={}, pipe={}, event_handle=0x{:08X}", - type_index, pipe_index, event_handle); + type_index, pipe_index, event_handle); ASSERT(false); // TODO: This should really be handled at an IPC translation layer. } if (interrupt_events.HasTooManyEventsRegistered()) { LOG_INFO(Service_DSP, - "Ran out of space to register interrupts (Attempted to register " - "type={}, pipe={}, event_handle=0x{:08X})", - type_index, pipe_index, event_handle); + "Ran out of space to register interrupts (Attempted to register " + "type={}, pipe={}, event_handle=0x{:08X})", + type_index, pipe_index, event_handle); cmd_buff[1] = ResultCode(ErrorDescription::InvalidResultValue, ErrorModule::DSP, ErrorSummary::OutOfResource, ErrorLevel::Status) .raw; @@ -248,12 +248,12 @@ static void RegisterInterruptEvents(Service::Interface* self) { interrupt_events.Get(type, pipe) = evt; LOG_INFO(Service_DSP, "Registered type={}, pipe={}, event_handle=0x{:08X}", type_index, - pipe_index, event_handle); + pipe_index, event_handle); cmd_buff[1] = RESULT_SUCCESS.raw; } else { interrupt_events.Get(type, pipe) = nullptr; LOG_INFO(Service_DSP, "Unregistered interrupt={}, channel={}, event_handle=0x{:08X}", - type_index, pipe_index, event_handle); + type_index, pipe_index, event_handle); cmd_buff[1] = RESULT_SUCCESS.raw; } } @@ -296,9 +296,9 @@ static void WriteProcessPipe(Service::Interface* self) { if (IPC::StaticBufferDesc(size, 1) != cmd_buff[3]) { LOG_ERROR(Service_DSP, - "IPC static buffer descriptor failed validation (0x{:X}). pipe={}, " - "size=0x{:X}, buffer=0x{:08X}", - cmd_buff[3], pipe_index, size, buffer); + "IPC static buffer descriptor failed validation (0x{:X}). pipe={}, " + "size=0x{:X}, buffer=0x{:08X}", + cmd_buff[3], pipe_index, size, buffer); cmd_buff[0] = IPC::MakeHeader(0, 1, 0); cmd_buff[1] = IPC::ERR_INVALID_BUFFER_DESCRIPTOR.raw; return; @@ -454,7 +454,7 @@ static void GetPipeReadableSize(Service::Interface* self) { cmd_buff[2] = static_cast(Core::DSP().GetPipeReadableSize(pipe)); LOG_DEBUG(Service_DSP, "pipe={}, unknown=0x{:08X}, return cmd_buff[2]=0x{:08X}", pipe_index, - unknown, cmd_buff[2]); + unknown, cmd_buff[2]); } /** diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index 51348d261..de45db0f6 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -134,11 +134,11 @@ static std::string GetCurrentSystemTime() { static void LogGenericInfo(const ErrInfo::ErrInfoCommon& errinfo_common) { LOG_CRITICAL(Service_ERR, "PID: 0x{:08X}", errinfo_common.pid); LOG_CRITICAL(Service_ERR, "REV: 0x{:08X}_0x{:08X}", errinfo_common.rev_high, - errinfo_common.rev_low); + errinfo_common.rev_low); LOG_CRITICAL(Service_ERR, "TID: 0x{:08X}_0x{:08X}", errinfo_common.title_id_high, - errinfo_common.title_id_low); + errinfo_common.title_id_low); LOG_CRITICAL(Service_ERR, "AID: 0x{:08X}_0x{:08X}", errinfo_common.app_title_id_high, - errinfo_common.app_title_id_low); + errinfo_common.app_title_id_low); LOG_CRITICAL(Service_ERR, "ADR: 0x{:08X}", errinfo_common.pc_address); ResultCode result_code{errinfo_common.result_code}; @@ -154,8 +154,7 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) { LOG_CRITICAL(Service_ERR, "Fatal error"); const ErrInfo errinfo = rp.PopRaw(); - LOG_CRITICAL(Service_ERR, "Fatal error type: {}", - GetErrType(errinfo.errinfo_common.specifier)); + LOG_CRITICAL(Service_ERR, "Fatal error type: {}", GetErrType(errinfo.errinfo_common.specifier)); Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorUnknown); // Generic Info @@ -178,23 +177,23 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) { ++index) { if (index < 13) { LOG_DEBUG(Service_ERR, "r{}=0x{:08X}", index, - errtype.exception_data.exception_context.arm_regs.at(index)); + errtype.exception_data.exception_context.arm_regs.at(index)); } else if (index == 13) { LOG_CRITICAL(Service_ERR, "SP=0x{:08X}", - errtype.exception_data.exception_context.arm_regs.at(index)); + errtype.exception_data.exception_context.arm_regs.at(index)); } else if (index == 14) { LOG_CRITICAL(Service_ERR, "LR=0x{:08X}", - errtype.exception_data.exception_context.arm_regs.at(index)); + errtype.exception_data.exception_context.arm_regs.at(index)); } else if (index == 15) { LOG_CRITICAL(Service_ERR, "PC=0x{:08X}", - errtype.exception_data.exception_context.arm_regs.at(index)); + errtype.exception_data.exception_context.arm_regs.at(index)); } } LOG_CRITICAL(Service_ERR, "CPSR=0x{:08X}", errtype.exception_data.exception_context.cpsr); // Exception Info LOG_CRITICAL(Service_ERR, "EXCEPTION TYPE: {}", - GetExceptionType(errtype.exception_data.exception_info.exception_type)); + GetExceptionType(errtype.exception_data.exception_info.exception_type)); switch (static_cast(errtype.exception_data.exception_info.exception_type)) { case ExceptionType::PrefetchAbort: LOG_CRITICAL(Service_ERR, "IFSR: 0x{:08X}", errtype.exception_data.exception_info.sr); @@ -206,11 +205,11 @@ void ERR_F::ThrowFatalError(Kernel::HLERequestContext& ctx) { break; case ExceptionType::VectorFP: LOG_CRITICAL(Service_ERR, "FPEXC: 0x{:08X}", - errtype.exception_data.exception_info.fpinst); + errtype.exception_data.exception_info.fpinst); LOG_CRITICAL(Service_ERR, "FINST: 0x{:08X}", - errtype.exception_data.exception_info.fpinst); + errtype.exception_data.exception_info.fpinst); LOG_CRITICAL(Service_ERR, "FINST2: 0x{:08X}", - errtype.exception_data.exception_info.fpinst2); + errtype.exception_data.exception_info.fpinst2); break; case ExceptionType::Undefined: break; // Not logging exception_info for this case diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index af8400087..22b338212 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -87,8 +87,8 @@ void File::Read(Kernel::HLERequestContext& ctx) { if (offset + length > backend->GetSize()) { LOG_ERROR(Service_FS, - "Reading from out of bounds offset=0x{:x} length=0x{:08X} file_size=0x{:x}", - offset, length, backend->GetSize()); + "Reading from out of bounds offset=0x{:x} length=0x{:08X} file_size=0x{:x}", + offset, length, backend->GetSize()); } IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); @@ -120,7 +120,7 @@ void File::Write(Kernel::HLERequestContext& ctx) { u32 flush = rp.Pop(); auto& buffer = rp.PopMappedBuffer(); LOG_TRACE(Service_FS, "Write {}: offset=0x{:x} length={}, flush=0x{:x}", GetName(), offset, - length, flush); + length, flush); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); @@ -182,7 +182,7 @@ void File::Close(Kernel::HLERequestContext& ctx) { // TODO(Subv): Only close the backend if this client is the only one left. if (connected_sessions.size() > 1) LOG_WARNING(Service_FS, "Closing File backend but {} clients still connected", - connected_sessions.size()); + connected_sessions.size()); backend->Close(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -405,7 +405,7 @@ ResultCode RegisterArchiveType(std::unique_ptr&& factor auto& archive = result.first->second; LOG_DEBUG(Service_FS, "Registered archive {} with id code 0x{:08X}", archive->GetName(), - static_cast(id_code)); + static_cast(id_code)); return RESULT_SUCCESS; } @@ -630,7 +630,7 @@ void RegisterArchiveTypes() { RegisterArchiveType(std::move(sdmcwo_factory), ArchiveIdCode::SDMCWriteOnly); else LOG_ERROR(Service_FS, "Can't instantiate SDMCWriteOnly archive with path {}", - sdmc_directory); + sdmc_directory); // Create the SaveData archive auto sd_savedata_source = std::make_shared(sdmc_directory); @@ -651,7 +651,7 @@ void RegisterArchiveTypes() { RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData); else LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path {}", - extsavedata_factory->GetMountPoint()); + extsavedata_factory->GetMountPoint()); auto sharedextsavedata_factory = std::make_unique(nand_directory, true); @@ -659,7 +659,7 @@ void RegisterArchiveTypes() { RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData); else LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path {}", - sharedextsavedata_factory->GetMountPoint()); + sharedextsavedata_factory->GetMountPoint()); // Create the NCCH archive, basically a small variation of the RomFS archive auto savedatacheck_factory = std::make_unique(); @@ -676,9 +676,8 @@ void RegisterArchiveTypes() { void RegisterSelfNCCH(Loader::AppLoader& app_loader) { auto itr = id_code_map.find(ArchiveIdCode::SelfNCCH); if (itr == id_code_map.end()) { - LOG_ERROR( - Service_FS, - "Could not register a new NCCH because the SelfNCCH archive hasn't been created"); + LOG_ERROR(Service_FS, + "Could not register a new NCCH because the SelfNCCH archive hasn't been created"); return; } diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 1b48685fc..674db8e3b 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -54,8 +54,7 @@ void FS_USER::OpenFile(Kernel::HLERequestContext& ctx) { ASSERT(filename.size() == filename_size); FileSys::Path file_path(filename_type, filename); - LOG_DEBUG(Service_FS, "path={}, mode={} attrs={}", file_path.DebugStr(), mode.hex, - attributes); + LOG_DEBUG(Service_FS, "path={}, mode={} attrs={}", file_path.DebugStr(), mode.hex, attributes); ResultVal> file_res = OpenFileFromArchive(archive_handle, file_path, mode); @@ -88,18 +87,17 @@ void FS_USER::OpenFileDirectly(Kernel::HLERequestContext& ctx) { FileSys::Path archive_path(archivename_type, archivename); FileSys::Path file_path(filename_type, filename); - LOG_DEBUG(Service_FS, - "archive_id=0x{:08X} archive_path={} file_path={}, mode={} attributes={}", - static_cast(archive_id), archive_path.DebugStr(), file_path.DebugStr(), - mode.hex, attributes); + LOG_DEBUG(Service_FS, "archive_id=0x{:08X} archive_path={} file_path={}, mode={} attributes={}", + static_cast(archive_id), archive_path.DebugStr(), file_path.DebugStr(), mode.hex, + attributes); IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); ResultVal archive_handle = Service::FS::OpenArchive(archive_id, archive_path); if (archive_handle.Failed()) { LOG_ERROR(Service_FS, - "Failed to get a handle for archive archive_id=0x{:08X} archive_path={}", - static_cast(archive_id), archive_path.DebugStr()); + "Failed to get a handle for archive archive_id=0x{:08X} archive_path={}", + static_cast(archive_id), archive_path.DebugStr()); rb.Push(archive_handle.Code()); rb.PushMoveObjects(nullptr); return; @@ -115,7 +113,7 @@ void FS_USER::OpenFileDirectly(Kernel::HLERequestContext& ctx) { } else { rb.PushMoveObjects(nullptr); LOG_ERROR(Service_FS, "failed to get a handle for file {} mode={} attributes={}", - file_path.DebugStr(), mode.hex, attributes); + file_path.DebugStr(), mode.hex, attributes); } } @@ -130,8 +128,8 @@ void FS_USER::DeleteFile(Kernel::HLERequestContext& ctx) { FileSys::Path file_path(filename_type, filename); - LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(filename_type), - filename_size, file_path.DebugStr()); + LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(filename_type), filename_size, + file_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(DeleteFileFromArchive(archive_handle, file_path)); @@ -155,10 +153,10 @@ void FS_USER::RenameFile(Kernel::HLERequestContext& ctx) { FileSys::Path src_file_path(src_filename_type, src_filename); FileSys::Path dest_file_path(dest_filename_type, dest_filename); - LOG_DEBUG( - Service_FS, "src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}", - static_cast(src_filename_type), src_filename_size, src_file_path.DebugStr(), - static_cast(dest_filename_type), dest_filename_size, dest_file_path.DebugStr()); + LOG_DEBUG(Service_FS, + "src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}", + static_cast(src_filename_type), src_filename_size, src_file_path.DebugStr(), + static_cast(dest_filename_type), dest_filename_size, dest_file_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, @@ -178,7 +176,7 @@ void FS_USER::DeleteDirectory(Kernel::HLERequestContext& ctx) { FileSys::Path dir_path(dirname_type, dirname); LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, - dir_path.DebugStr()); + dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(DeleteDirectoryFromArchive(archive_handle, dir_path)); @@ -197,7 +195,7 @@ void FS_USER::DeleteDirectoryRecursively(Kernel::HLERequestContext& ctx) { FileSys::Path dir_path(dirname_type, dirname); LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, - dir_path.DebugStr()); + dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(DeleteDirectoryRecursivelyFromArchive(archive_handle, dir_path)); @@ -218,7 +216,7 @@ void FS_USER::CreateFile(Kernel::HLERequestContext& ctx) { FileSys::Path file_path(filename_type, filename); LOG_DEBUG(Service_FS, "type={} attributes={} size={:x} data={}", - static_cast(filename_type), attributes, file_size, file_path.DebugStr()); + static_cast(filename_type), attributes, file_size, file_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(CreateFileInArchive(archive_handle, file_path, file_size)); @@ -236,7 +234,7 @@ void FS_USER::CreateDirectory(Kernel::HLERequestContext& ctx) { FileSys::Path dir_path(dirname_type, dirname); LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, - dir_path.DebugStr()); + dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(CreateDirectoryFromArchive(archive_handle, dir_path)); @@ -260,9 +258,9 @@ void FS_USER::RenameDirectory(Kernel::HLERequestContext& ctx) { FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname); LOG_DEBUG(Service_FS, - "src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}", - static_cast(src_dirname_type), src_dirname_size, src_dir_path.DebugStr(), - static_cast(dest_dirname_type), dest_dirname_size, dest_dir_path.DebugStr()); + "src_type={} src_size={} src_data={} dest_type={} dest_size={} dest_data={}", + static_cast(src_dirname_type), src_dirname_size, src_dir_path.DebugStr(), + static_cast(dest_dirname_type), dest_dirname_size, dest_dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, dest_archive_handle, @@ -280,7 +278,7 @@ void FS_USER::OpenDirectory(Kernel::HLERequestContext& ctx) { FileSys::Path dir_path(dirname_type, dirname); LOG_DEBUG(Service_FS, "type={} size={} data={}", static_cast(dirname_type), dirname_size, - dir_path.DebugStr()); + dir_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); ResultVal> dir_res = @@ -293,7 +291,7 @@ void FS_USER::OpenDirectory(Kernel::HLERequestContext& ctx) { rb.PushMoveObjects(std::get>(sessions)); } else { LOG_ERROR(Service_FS, "failed to get a handle for directory type={} size={} data={}", - static_cast(dirname_type), dirname_size, dir_path.DebugStr()); + static_cast(dirname_type), dirname_size, dir_path.DebugStr()); rb.PushMoveObjects(nullptr); } } @@ -308,7 +306,7 @@ void FS_USER::OpenArchive(Kernel::HLERequestContext& ctx) { FileSys::Path archive_path(archivename_type, archivename); LOG_DEBUG(Service_FS, "archive_id=0x{:08X} archive_path={}", static_cast(archive_id), - archive_path.DebugStr()); + archive_path.DebugStr()); IPC::RequestBuilder rb = rp.MakeBuilder(3, 0); ResultVal handle = Service::FS::OpenArchive(archive_id, archive_path); @@ -318,8 +316,8 @@ void FS_USER::OpenArchive(Kernel::HLERequestContext& ctx) { } else { rb.Push(0); LOG_ERROR(Service_FS, - "failed to get a handle for archive archive_id=0x{:08X} archive_path={}", - static_cast(archive_id), archive_path.DebugStr()); + "failed to get a handle for archive archive_id=0x{:08X} archive_path={}", + static_cast(archive_id), archive_path.DebugStr()); } } @@ -369,7 +367,7 @@ void FS_USER::FormatSaveData(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); if (archive_id != FS::ArchiveIdCode::SaveData) { LOG_ERROR(Service_FS, "tried to format an archive different than SaveData, {}", - static_cast(archive_id)); + static_cast(archive_id)); rb.Push(FileSys::ERROR_INVALID_PATH); return; } @@ -439,9 +437,9 @@ void FS_USER::CreateExtSaveData(Kernel::HLERequestContext& ctx) { auto icon_buffer = rp.PopMappedBuffer(); LOG_WARNING(Service_FS, - "(STUBBED) savedata_high={:08X} savedata_low={:08X} unknown={:08X} " - "files={:08X} directories={:08X} size_limit={:016x} icon_size={:08X}", - save_high, save_low, unknown, directories, files, size_limit, icon_size); + "(STUBBED) savedata_high={:08X} savedata_low={:08X} unknown={:08X} " + "files={:08X} directories={:08X} size_limit={:016x} icon_size={:08X}", + save_high, save_low, unknown, directories, files, size_limit, icon_size); std::vector icon(icon_size); icon_buffer.Read(icon.data(), 0, icon_size); @@ -465,8 +463,8 @@ void FS_USER::DeleteExtSaveData(Kernel::HLERequestContext& ctx) { u32 unknown = rp.Pop(); // TODO(Subv): Figure out what this is LOG_WARNING(Service_FS, - "(STUBBED) save_low={:08X} save_high={:08X} media_type={:08X} unknown={:08X}", - save_low, save_high, static_cast(media_type), unknown); + "(STUBBED) save_low={:08X} save_high={:08X} media_type={:08X} unknown={:08X}", + save_low, save_high, static_cast(media_type), unknown); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(Service::FS::DeleteExtSaveData(media_type, save_high, save_low)); @@ -524,10 +522,10 @@ void FS_USER::CreateLegacySystemSaveData(Kernel::HLERequestContext& ctx) { bool duplicate = rp.Pop(); LOG_WARNING(Service_FS, - "(STUBBED) savedata_id={:08X} total_size={:08X} block_size={:08X} directories={} " - "files={} directory_buckets={} file_buckets={} duplicate={}", - savedata_id, total_size, block_size, directories, files, directory_buckets, - file_buckets, duplicate); + "(STUBBED) savedata_id={:08X} total_size={:08X} block_size={:08X} directories={} " + "files={} directory_buckets={} file_buckets={} duplicate={}", + savedata_id, total_size, block_size, directories, files, directory_buckets, + file_buckets, duplicate); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); // With this command, the SystemSaveData always has save_high = 0 (Always created in the NAND) @@ -667,9 +665,9 @@ void FS_USER::SetSaveDataSecureValue(Kernel::HLERequestContext& ctx) { // TODO: Generate and Save the Secure Value LOG_WARNING(Service_FS, - "(STUBBED) called, value=0x{:016x} secure_value_slot=0x{:08X} " - "unqiue_id=0x{:08X} title_variation=0x{:02X}", - value, secure_value_slot, unique_id, title_variation); + "(STUBBED) called, value=0x{:016x} secure_value_slot=0x{:08X} " + "unqiue_id=0x{:08X} title_variation=0x{:02X}", + value, secure_value_slot, unique_id, title_variation); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); diff --git a/src/core/hle/service/gsp/gsp_gpu.cpp b/src/core/hle/service/gsp/gsp_gpu.cpp index 4e4ce399f..5835f1587 100644 --- a/src/core/hle/service/gsp/gsp_gpu.cpp +++ b/src/core/hle/service/gsp/gsp_gpu.cpp @@ -120,10 +120,9 @@ static ResultCode WriteHWRegs(u32 base_address, u32 size_in_bytes, const std::ve const u32 max_size_in_bytes = 0x80; if (base_address & 3 || base_address >= 0x420000) { - LOG_ERROR( - Service_GSP, - "Write address was out of range or misaligned! (address=0x{:08x}, size=0x{:08x})", - base_address, size_in_bytes); + LOG_ERROR(Service_GSP, + "Write address was out of range or misaligned! (address=0x{:08x}, size=0x{:08x})", + base_address, size_in_bytes); return ERR_REGS_OUTOFRANGE_OR_MISALIGNED; } else if (size_in_bytes <= max_size_in_bytes) { if (size_in_bytes & 3) { @@ -165,10 +164,9 @@ static ResultCode WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, const u32 max_size_in_bytes = 0x80; if (base_address & 3 || base_address >= 0x420000) { - LOG_ERROR( - Service_GSP, - "Write address was out of range or misaligned! (address=0x{:08x}, size=0x{:08x})", - base_address, size_in_bytes); + LOG_ERROR(Service_GSP, + "Write address was out of range or misaligned! (address=0x{:08x}, size=0x{:08x})", + base_address, size_in_bytes); return ERR_REGS_OUTOFRANGE_OR_MISALIGNED; } else if (size_in_bytes <= max_size_in_bytes) { if (size_in_bytes & 3) { @@ -319,8 +317,8 @@ void GSP_GPU::FlushDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", - address, size, process->process_id); + LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address, + size, process->process_id); } void GSP_GPU::InvalidateDataCache(Kernel::HLERequestContext& ctx) { @@ -334,8 +332,8 @@ void GSP_GPU::InvalidateDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", - address, size, process->process_id); + LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address, + size, process->process_id); } void GSP_GPU::SetAxiConfigQoSMode(Kernel::HLERequestContext& ctx) { @@ -680,7 +678,7 @@ void GSP_GPU::AcquireRight(Kernel::HLERequestContext& ctx) { SessionData* session_data = GetSessionData(ctx.Session()); LOG_WARNING(Service_GSP, "called flag={:08X} process={} thread_id={}", flag, - process->process_id, session_data->thread_id); + process->process_id, session_data->thread_id); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -726,8 +724,8 @@ void GSP_GPU::StoreDataCache(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", - address, size, process->process_id); + LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address, + size, process->process_id); } void GSP_GPU::SetLedForceOff(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/ir/extra_hid.cpp b/src/core/hle/service/ir/extra_hid.cpp index 56008c3ae..f1f0c1043 100644 --- a/src/core/hle/service/ir/extra_hid.cpp +++ b/src/core/hle/service/ir/extra_hid.cpp @@ -166,7 +166,7 @@ void ExtraHID::OnDisconnect() { void ExtraHID::HandleConfigureHIDPollingRequest(const std::vector& request) { if (request.size() != 3) { LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(), - Common::ArrayToString(request.data(), request.size())); + Common::ArrayToString(request.data(), request.size())); return; } @@ -188,7 +188,7 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector& request_b if (request_buf.size() != sizeof(ReadCalibrationDataRequest)) { LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request_buf.size(), - Common::ArrayToString(request_buf.data(), request_buf.size())); + Common::ArrayToString(request_buf.data(), request_buf.size())); return; } @@ -200,7 +200,7 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector& request_b if (offset + size > calibration_data.size()) { LOG_ERROR(Service_IR, "Read beyond the end of calibration data! (offset={}, size={})", - offset, size); + offset, size); return; } @@ -223,7 +223,7 @@ void ExtraHID::OnReceive(const std::vector& data) { break; default: LOG_ERROR(Service_IR, "Unknown request: {}", - Common::ArrayToString(data.data(), data.size())); + Common::ArrayToString(data.data(), data.size())); break; } } diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp index d8ad6ab06..1ac00663f 100644 --- a/src/core/hle/service/ir/ir_user.cpp +++ b/src/core/hle/service/ir/ir_user.cpp @@ -183,8 +183,7 @@ private: /// Wraps the payload into packet and puts it to the receive buffer void IR_USER::PutToReceive(const std::vector& payload) { - LOG_TRACE(Service_IR, "called, data={}", - Common::ArrayToString(payload.data(), payload.size())); + LOG_TRACE(Service_IR, "called, data={}", Common::ArrayToString(payload.data(), payload.size())); size_t size = payload.size(); std::vector packet; @@ -252,11 +251,11 @@ void IR_USER::InitializeIrNopShared(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_INFO(Service_IR, - "called, shared_buff_size={}, recv_buff_size={}, " - "recv_buff_packet_count={}, send_buff_size={}, " - "send_buff_packet_count={}, baud_rate={}", - shared_buff_size, recv_buff_size, recv_buff_packet_count, send_buff_size, - send_buff_packet_count, baud_rate); + "called, shared_buff_size={}, recv_buff_size={}, " + "recv_buff_packet_count={}, send_buff_size={}, " + "send_buff_packet_count={}, baud_rate={}", + shared_buff_size, recv_buff_size, recv_buff_packet_count, send_buff_size, + send_buff_packet_count, baud_rate); } void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp index 903b25c55..272f1b027 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.cpp +++ b/src/core/hle/service/ldr_ro/cro_helper.cpp @@ -551,7 +551,7 @@ ResultCode CROHelper::ApplyStaticAnonymousSymbolToCRS(VAddr crs_address) { CROHelper crs(crs_address); u32 offset_export_num = GetField(StaticAnonymousSymbolNum); LOG_INFO(Service_LDR, "CRO \"{}\" exports {} static anonymous symbols", ModuleName(), - offset_export_num); + offset_export_num); for (u32 i = 0; i < offset_export_num; ++i) { StaticAnonymousSymbolEntry entry; GetEntry(i, entry); @@ -564,7 +564,7 @@ ResultCode CROHelper::ApplyStaticAnonymousSymbolToCRS(VAddr crs_address) { u32 symbol_address = SegmentTagToAddress(entry.symbol_position); LOG_TRACE(Service_LDR, "CRO \"{}\" exports 0x{:08X} to the static module", ModuleName(), - symbol_address); + symbol_address); ResultCode result = crs.ApplyRelocationBatch(batch_address, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", result.raw); @@ -604,7 +604,7 @@ ResultCode CROHelper::ApplyInternalRelocations(u32 old_data_segment_address) { SegmentEntry symbol_segment; GetEntry(relocation.symbol_segment, symbol_segment); LOG_TRACE(Service_LDR, "Internally relocates 0x{:08X} with 0x{:08X}", target_address, - symbol_segment.offset); + symbol_segment.offset); ResultCode result = ApplyRelocation(target_address, relocation.type, relocation.addend, symbol_segment.offset, target_addressB); if (result.IsError()) { @@ -765,12 +765,12 @@ ResultCode CROHelper::ApplyImportNamedSymbol(VAddr crs_address) { if (symbol_address != 0) { LOG_TRACE(Service_LDR, "CRO \"{}\" imports \"{}\" from \"{}\"", - ModuleName(), symbol_name, source.ModuleName()); + ModuleName(), symbol_name, source.ModuleName()); ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", - result.raw); + result.raw); return result; } @@ -860,7 +860,7 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { if (want_cro_name == source.ModuleName()) { LOG_INFO(Service_LDR, "CRO \"{}\" imports {} indexed symbols from \"{}\"", - ModuleName(), entry.import_indexed_symbol_num, source.ModuleName()); + ModuleName(), entry.import_indexed_symbol_num, source.ModuleName()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; entry.GetImportIndexedSymbolEntry(j, im); @@ -872,13 +872,12 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", - result.raw); + result.raw); return result; } } LOG_INFO(Service_LDR, "CRO \"{}\" imports {} anonymous symbols from \"{}\"", - ModuleName(), entry.import_anonymous_symbol_num, - source.ModuleName()); + ModuleName(), entry.import_anonymous_symbol_num, source.ModuleName()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; entry.GetImportAnonymousSymbolEntry(j, im); @@ -888,7 +887,7 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", - result.raw); + result.raw); return result; } } @@ -905,7 +904,7 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { LOG_DEBUG(Service_LDR, "CRO \"{}\" exports named symbols to \"{}\"", ModuleName(), - target.ModuleName()); + target.ModuleName()); u32 target_import_strings_size = target.GetField(ImportStringsSize); u32 target_symbol_import_num = target.GetField(ImportNamedSymbolNum); for (u32 i = 0; i < target_symbol_import_num; ++i) { @@ -934,7 +933,7 @@ ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { ResultCode CROHelper::ResetExportNamedSymbol(CROHelper target) { LOG_DEBUG(Service_LDR, "CRO \"{}\" unexports named symbols to \"{}\"", ModuleName(), - target.ModuleName()); + target.ModuleName()); u32 unresolved_symbol = target.GetOnUnresolvedAddress(); u32 target_import_strings_size = target.GetField(ImportStringsSize); u32 target_symbol_import_num = target.GetField(ImportNamedSymbolNum); @@ -975,7 +974,7 @@ ResultCode CROHelper::ApplyModuleExport(CROHelper target) { continue; LOG_INFO(Service_LDR, "CRO \"{}\" exports {} indexed symbols to \"{}\"", module_name, - entry.import_indexed_symbol_num, target.ModuleName()); + entry.import_indexed_symbol_num, target.ModuleName()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; entry.GetImportIndexedSymbolEntry(j, im); @@ -992,7 +991,7 @@ ResultCode CROHelper::ApplyModuleExport(CROHelper target) { } LOG_INFO(Service_LDR, "CRO \"{}\" exports {} anonymous symbols to \"{}\"", module_name, - entry.import_anonymous_symbol_num, target.ModuleName()); + entry.import_anonymous_symbol_num, target.ModuleName()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; entry.GetImportAnonymousSymbolEntry(j, im); @@ -1024,7 +1023,7 @@ ResultCode CROHelper::ResetModuleExport(CROHelper target) { continue; LOG_DEBUG(Service_LDR, "CRO \"{}\" unexports indexed symbols to \"{}\"", module_name, - target.ModuleName()); + target.ModuleName()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; entry.GetImportIndexedSymbolEntry(j, im); @@ -1037,7 +1036,7 @@ ResultCode CROHelper::ResetModuleExport(CROHelper target) { } LOG_DEBUG(Service_LDR, "CRO \"{}\" unexports anonymous symbols to \"{}\"", module_name, - target.ModuleName()); + target.ModuleName()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; entry.GetImportAnonymousSymbolEntry(j, im); @@ -1070,12 +1069,12 @@ ResultCode CROHelper::ApplyExitRelocations(VAddr crs_address) { if (symbol_address != 0) { LOG_DEBUG(Service_LDR, "CRO \"{}\" import exit function from \"{}\"", - ModuleName(), source.ModuleName()); + ModuleName(), source.ModuleName()); ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch {:08X}", - result.raw); + result.raw); return result; } diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index 2a585a544..fdb7b0fdf 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -58,9 +58,8 @@ void RO::Initialize(Kernel::HLERequestContext& ctx) { // All other service functions below have the same issue. auto process = rp.PopObject(); - LOG_DEBUG(Service_LDR, - "called, crs_buffer_ptr=0x{:08X}, crs_address=0x{:08X}, crs_size=0x{:X}", - crs_buffer_ptr, crs_address, crs_size); + LOG_DEBUG(Service_LDR, "called, crs_buffer_ptr=0x{:08X}, crs_address=0x{:08X}, crs_size=0x{:X}", + crs_buffer_ptr, crs_address, crs_size); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -167,7 +166,7 @@ void RO::LoadCRR(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x{:08X}, crr_size=0x{:08X}", - crr_buffer_ptr, crr_size); + crr_buffer_ptr, crr_size); } void RO::UnloadCRR(Kernel::HLERequestContext& ctx) { @@ -197,13 +196,13 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { auto process = rp.PopObject(); LOG_DEBUG(Service_LDR, - "called ({}), cro_buffer_ptr=0x{:08X}, cro_address=0x{:08X}, cro_size=0x{:X}, " - "data_segment_address=0x{:08X}, zero={}, data_segment_size=0x{:X}, " - "bss_segment_address=0x{:08X}, bss_segment_size=0x{:X}, auto_link={}, " - "fix_level={}, crr_address=0x{:08X}", - link_on_load_bug_fix ? "new" : "old", cro_buffer_ptr, cro_address, cro_size, - data_segment_address, zero, data_segment_size, bss_segment_address, - bss_segment_size, auto_link ? "true" : "false", fix_level, crr_address); + "called ({}), cro_buffer_ptr=0x{:08X}, cro_address=0x{:08X}, cro_size=0x{:X}, " + "data_segment_address=0x{:08X}, zero={}, data_segment_size=0x{:X}, " + "bss_segment_address=0x{:08X}, bss_segment_size=0x{:X}, auto_link={}, " + "fix_level={}, crr_address=0x{:08X}", + link_on_load_bug_fix ? "new" : "old", cro_buffer_ptr, cro_address, cro_size, + data_segment_address, zero, data_segment_size, bss_segment_address, bss_segment_size, + auto_link ? "true" : "false", fix_level, crr_address); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); @@ -373,7 +372,7 @@ void RO::LoadCRO(Kernel::HLERequestContext& ctx, bool link_on_load_bug_fix) { Core::CPU().InvalidateCacheRange(cro_address, cro_size); LOG_INFO(Service_LDR, "CRO \"{}\" loaded at 0x{:08X}, fixed_end=0x{:08X}", cro.ModuleName(), - cro_address, cro_address + fix_size); + cro_address, cro_address + fix_size); rb.Push(RESULT_SUCCESS, fix_size); } @@ -386,7 +385,7 @@ void RO::UnloadCRO(Kernel::HLERequestContext& ctx) { auto process = rp.PopObject(); LOG_DEBUG(Service_LDR, "called, cro_address=0x{:08X}, zero={}, cro_buffer_ptr=0x{:08X}", - cro_address, zero, cro_buffer_ptr); + cro_address, zero, cro_buffer_ptr); CROHelper cro(cro_address); diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp index 4e293f255..4e07abe70 100644 --- a/src/core/hle/service/mic_u.cpp +++ b/src/core/hle/service/mic_u.cpp @@ -64,10 +64,10 @@ struct MIC_U::Impl { rb.Push(RESULT_SUCCESS); is_sampling = true; LOG_WARNING(Service_MIC, - "(STUBBED) called, encoding={}, sample_rate={}, " - "audio_buffer_offset={}, audio_buffer_size={}, audio_buffer_loop={}", - static_cast(encoding), static_cast(sample_rate), - audio_buffer_offset, audio_buffer_size, audio_buffer_loop); + "(STUBBED) called, encoding={}, sample_rate={}, " + "audio_buffer_offset={}, audio_buffer_size={}, audio_buffer_loop={}", + static_cast(encoding), static_cast(sample_rate), audio_buffer_offset, + audio_buffer_size, audio_buffer_loop); } void AdjustSampling(Kernel::HLERequestContext& ctx) { @@ -76,8 +76,7 @@ struct MIC_U::Impl { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - LOG_WARNING(Service_MIC, "(STUBBED) called, sample_rate={}", - static_cast(sample_rate)); + LOG_WARNING(Service_MIC, "(STUBBED) called, sample_rate={}", static_cast(sample_rate)); } void StopSampling(Kernel::HLERequestContext& ctx) { @@ -148,7 +147,7 @@ struct MIC_U::Impl { rb.Push(RESULT_SUCCESS); rb.PushMappedBuffer(buffer); LOG_WARNING(Service_MIC, "(STUBBED) called, size=0x{:X}, buffer=0x{:08X}", size, - buffer.GetId()); + buffer.GetId()); } void SetClamp(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp index 8581f5cd2..73282cb36 100644 --- a/src/core/hle/service/ndm/ndm_u.cpp +++ b/src/core/hle/service/ndm/ndm_u.cpp @@ -16,7 +16,7 @@ void NDM_U::EnterExclusiveState(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); LOG_WARNING(Service_NDM, "(STUBBED) exclusive_state=0x{:08X}", - static_cast(exclusive_state)); + static_cast(exclusive_state)); } void NDM_U::LeaveExclusiveState(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index e491e2994..36f403805 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp @@ -239,7 +239,7 @@ static void HandleEAPoLPacket(const Network::WifiPacket& packet) { if (GetEAPoLFrameType(packet.data) == EAPoLStartMagic) { if (connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { LOG_DEBUG(Service_NWM, "Connection sequence aborted, because connection status is {}", - connection_status.status); + connection_status.status); return; } @@ -426,7 +426,7 @@ void SendAssociationResponseFrame(const MacAddress& address) { std::lock_guard lock(connection_status_mutex); if (connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { LOG_ERROR(Service_NWM, "Connection sequence aborted, because connection status is {}", - connection_status.status); + connection_status.status); return; } @@ -458,8 +458,8 @@ void HandleAuthenticationFrame(const Network::WifiPacket& packet) { std::lock_guard lock(connection_status_mutex); if (connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { LOG_ERROR(Service_NWM, - "Connection sequence aborted, because connection status is {}", - connection_status.status); + "Connection sequence aborted, because connection status is {}", + connection_status.status); return; } @@ -618,9 +618,9 @@ void NWM_UDS::RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx) { rb.PushMappedBuffer(out_buffer); LOG_DEBUG(Service_NWM, - "called out_buffer_size=0x{:08X}, wlan_comm_id=0x{:08X}, id=0x{:08X}," - "unk1=0x{:08X}, unk2=0x{:08X}, offset={}", - out_buffer_size, wlan_comm_id, id, unk1, unk2, cur_buffer_size); + "called out_buffer_size=0x{:08X}, wlan_comm_id=0x{:08X}, id=0x{:08X}," + "unk1=0x{:08X}, unk2=0x{:08X}, offset={}", + out_buffer_size, wlan_comm_id, id, unk1, unk2, cur_buffer_size); } void NWM_UDS::InitializeWithVersion(Kernel::HLERequestContext& ctx) { @@ -661,7 +661,7 @@ void NWM_UDS::InitializeWithVersion(Kernel::HLERequestContext& ctx) { rb.PushCopyObjects(connection_status_event); LOG_DEBUG(Service_NWM, "called sharedmem_size=0x{:08X}, version=0x{:08X}", sharedmem_size, - version); + version); } void NWM_UDS::GetConnectionStatus(Kernel::HLERequestContext& ctx) { @@ -729,7 +729,7 @@ void NWM_UDS::Bind(Kernel::HLERequestContext& ctx) { rb.Push(ResultCode(ErrorDescription::NotAuthorized, ErrorModule::UDS, ErrorSummary::WrongArgument, ErrorLevel::Usage)); LOG_WARNING(Service_NWM, "data_channel = {}, bind_node_id = {}", data_channel, - bind_node_id); + bind_node_id); return; } diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index aca971c9b..933cb74db 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -93,7 +93,7 @@ void Module::Interface::GetStepHistory(Kernel::HLERequestContext& ctx) { rb.PushMappedBuffer(buffer); LOG_WARNING(Service_PTM, "(STUBBED) called, from time(raw): 0x{:x}, for {} hours", start_time, - hours); + hours); } void Module::Interface::GetTotalStepCount(Kernel::HLERequestContext& ctx) { @@ -120,16 +120,14 @@ void CheckNew3DS(IPC::RequestBuilder& rb) { const bool is_new_3ds = Settings::values.is_new_3ds; if (is_new_3ds) { - LOG_CRITICAL(Service_PTM, - "The option 'is_new_3ds' is enabled as part of the 'System' " - "settings. Citra does not fully support New 3DS emulation yet!"); + LOG_CRITICAL(Service_PTM, "The option 'is_new_3ds' is enabled as part of the 'System' " + "settings. Citra does not fully support New 3DS emulation yet!"); } rb.Push(RESULT_SUCCESS); rb.Push(is_new_3ds); - LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x{:08x}", - static_cast(is_new_3ds)); + LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x{:08x}", static_cast(is_new_3ds)); } void Module::Interface::CheckNew3DS(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 018c69819..422b26f23 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -95,14 +95,13 @@ void Interface::HandleSyncRequest(SharedPtr server_session) { ? Common::StringFromFormat("0x%08X", cmd_buff[0]) : itr->second.name; LOG_ERROR(Service, "unknown / unimplemented {}", - MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff)); + MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff)); // TODO(bunnei): Hack - ignore error cmd_buff[1] = 0; return; } - LOG_TRACE(Service, "{}", - MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff)); + LOG_TRACE(Service, "{}", MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff)); itr->second.func(this); } diff --git a/src/core/hle/service/sm/srv.cpp b/src/core/hle/service/sm/srv.cpp index 66359ff07..f459d3784 100644 --- a/src/core/hle/service/sm/srv.cpp +++ b/src/core/hle/service/sm/srv.cpp @@ -103,15 +103,13 @@ void SRV::GetServiceHandle(Kernel::HLERequestContext& ctx) { if (client_port.Failed()) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(client_port.Code()); - LOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, - client_port.Code().raw); + LOG_ERROR(Service_SRV, "called service={} -> error 0x{:08X}", name, client_port.Code().raw); return; } auto session = client_port.Unwrap()->Connect(); if (session.Succeeded()) { - LOG_DEBUG(Service_SRV, "called service={} -> session={}", name, - (*session)->GetObjectId()); + LOG_DEBUG(Service_SRV, "called service={} -> session={}", name, (*session)->GetObjectId()); IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(session.Code()); rb.PushMoveObjects(std::move(session).Unwrap()); @@ -179,8 +177,8 @@ void SRV::PublishToSubscriber(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); - LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}, flags={}", - notification_id, flags); + LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x{:X}, flags={}", notification_id, + flags); } void SRV::RegisterService(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index ce96845ad..c270c1efb 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -133,7 +133,7 @@ void Y2R_U::SetBlockAlignment(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_Y2R, "called block_alignment={}", - static_cast(conversion.block_alignment)); + static_cast(conversion.block_alignment)); } void Y2R_U::GetBlockAlignment(Kernel::HLERequestContext& ctx) { @@ -144,7 +144,7 @@ void Y2R_U::GetBlockAlignment(Kernel::HLERequestContext& ctx) { rb.PushEnum(conversion.block_alignment); LOG_DEBUG(Service_Y2R, "called block_alignment={}", - static_cast(conversion.block_alignment)); + static_cast(conversion.block_alignment)); } void Y2R_U::SetSpacialDithering(Kernel::HLERequestContext& ctx) { @@ -231,10 +231,10 @@ void Y2R_U::SetSendingY(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_Y2R, - "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " - "src_process_id={}", - conversion.src_Y.image_size, conversion.src_Y.transfer_unit, conversion.src_Y.gap, - process->process_id); + "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " + "src_process_id={}", + conversion.src_Y.image_size, conversion.src_Y.transfer_unit, conversion.src_Y.gap, + process->process_id); } void Y2R_U::SetSendingU(Kernel::HLERequestContext& ctx) { @@ -250,10 +250,10 @@ void Y2R_U::SetSendingU(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_Y2R, - "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " - "src_process_id={}", - conversion.src_U.image_size, conversion.src_U.transfer_unit, conversion.src_U.gap, - process->process_id); + "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " + "src_process_id={}", + conversion.src_U.image_size, conversion.src_U.transfer_unit, conversion.src_U.gap, + process->process_id); } void Y2R_U::SetSendingV(Kernel::HLERequestContext& ctx) { @@ -270,10 +270,10 @@ void Y2R_U::SetSendingV(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_Y2R, - "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " - "src_process_id={}", - conversion.src_V.image_size, conversion.src_V.transfer_unit, conversion.src_V.gap, - process->process_id); + "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " + "src_process_id={}", + conversion.src_V.image_size, conversion.src_V.transfer_unit, conversion.src_V.gap, + process->process_id); } void Y2R_U::SetSendingYUYV(Kernel::HLERequestContext& ctx) { @@ -290,10 +290,10 @@ void Y2R_U::SetSendingYUYV(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_Y2R, - "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " - "src_process_id={}", - conversion.src_YUYV.image_size, conversion.src_YUYV.transfer_unit, - conversion.src_YUYV.gap, process->process_id); + "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " + "src_process_id={}", + conversion.src_YUYV.image_size, conversion.src_YUYV.transfer_unit, + conversion.src_YUYV.gap, process->process_id); } void Y2R_U::IsFinishedSendingYuv(Kernel::HLERequestContext& ctx) { @@ -350,10 +350,10 @@ void Y2R_U::SetReceiving(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_Y2R, - "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " - "dst_process_id={}", - conversion.dst.image_size, conversion.dst.transfer_unit, conversion.dst.gap, - static_cast(dst_process->process_id)); + "called image_size=0x{:08X}, transfer_unit={}, transfer_stride={}, " + "dst_process_id={}", + conversion.dst.image_size, conversion.dst.transfer_unit, conversion.dst.gap, + static_cast(dst_process->process_id)); } void Y2R_U::IsFinishedReceiving(Kernel::HLERequestContext& ctx) { @@ -415,9 +415,9 @@ void Y2R_U::SetCoefficient(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_Y2R, "called coefficients=[{:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}, {:X}]", - conversion.coefficients[0], conversion.coefficients[1], conversion.coefficients[2], - conversion.coefficients[3], conversion.coefficients[4], conversion.coefficients[5], - conversion.coefficients[6], conversion.coefficients[7]); + conversion.coefficients[0], conversion.coefficients[1], conversion.coefficients[2], + conversion.coefficients[3], conversion.coefficients[4], conversion.coefficients[5], + conversion.coefficients[6], conversion.coefficients[7]); } void Y2R_U::GetCoefficient(Kernel::HLERequestContext& ctx) { @@ -568,12 +568,12 @@ cleanup: rb.Push(result); LOG_DEBUG(Service_Y2R, - "called input_format={} output_format={} rotation={} block_alignment={} " - "input_line_width={} input_lines={} standard_coefficient={} reserved={} alpha={:X}", - static_cast(params.input_format), static_cast(params.output_format), - static_cast(params.rotation), static_cast(params.block_alignment), - params.input_line_width, params.input_lines, - static_cast(params.standard_coefficient), params.padding, params.alpha); + "called input_format={} output_format={} rotation={} block_alignment={} " + "input_line_width={} input_lines={} standard_coefficient={} reserved={} alpha={:X}", + static_cast(params.input_format), static_cast(params.output_format), + static_cast(params.rotation), static_cast(params.block_alignment), + params.input_line_width, params.input_lines, + static_cast(params.standard_coefficient), params.padding, params.alpha); } void Y2R_U::PingProcess(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 61ac7768e..306c91009 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -65,8 +65,7 @@ static Math::Vec4 DecodePixel(Regs::PixelFormat input_format, const u8* src_ return Color::DecodeRGBA4(src_pixel); default: - LOG_ERROR(HW_GPU, "Unknown source framebuffer format {:x}", - static_cast(input_format)); + LOG_ERROR(HW_GPU, "Unknown source framebuffer format {:x}", static_cast(input_format)); return {0, 0, 0, 0}; } } @@ -91,7 +90,7 @@ static void MemoryFill(const Regs::MemoryFillConfig& config) { if (end_addr <= start_addr) { LOG_CRITICAL(HW_GPU, "invalid memory range from {:#010X} to {:#010X}", start_addr, - end_addr); + end_addr); return; } @@ -170,7 +169,7 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) { if (config.scaling > config.ScaleXY) { LOG_CRITICAL(HW_GPU, "Unimplemented display transfer scaling mode {}", - config.scaling.Value()); + config.scaling.Value()); UNIMPLEMENTED(); return; } @@ -296,7 +295,7 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) { default: LOG_ERROR(HW_GPU, "Unknown destination framebuffer format {:x}", - static_cast(config.output_format.Value())); + static_cast(config.output_format.Value())); break; } } @@ -392,8 +391,7 @@ inline void Write(u32 addr, const T data) { // Writes other than u32 are untested, so I'd rather have them abort than silently fail if (index >= Regs::NumIds() || !std::is_same::value) { - LOG_ERROR(HW_GPU, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, - addr); + LOG_ERROR(HW_GPU, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, addr); return; } @@ -410,7 +408,7 @@ inline void Write(u32 addr, const T data) { if (config.trigger) { MemoryFill(config); LOG_TRACE(HW_GPU, "MemoryFill from {:#010X} to {:#010X}", config.GetStartAddress(), - config.GetEndAddress()); + config.GetEndAddress()); // It seems that it won't signal interrupt if "address_start" is zero. // TODO: hwtest this @@ -443,22 +441,21 @@ inline void Write(u32 addr, const T data) { if (config.is_texture_copy) { TextureCopy(config); LOG_TRACE(HW_GPU, - "TextureCopy: {:#X} bytes from {:#010X}({}+{})-> " - "{:#010X}({}+{}), flags {:#010X}", - config.texture_copy.size, config.GetPhysicalInputAddress(), - config.texture_copy.input_width * 16, - config.texture_copy.input_gap * 16, config.GetPhysicalOutputAddress(), - config.texture_copy.output_width * 16, - config.texture_copy.output_gap * 16, config.flags); + "TextureCopy: {:#X} bytes from {:#010X}({}+{})-> " + "{:#010X}({}+{}), flags {:#010X}", + config.texture_copy.size, config.GetPhysicalInputAddress(), + config.texture_copy.input_width * 16, config.texture_copy.input_gap * 16, + config.GetPhysicalOutputAddress(), config.texture_copy.output_width * 16, + config.texture_copy.output_gap * 16, config.flags); } else { DisplayTransfer(config); LOG_TRACE(HW_GPU, - "DisplayTransfer: {:#010X}({}x{})-> " - "{:#010X}({}x{}), dst format {:x}, flags {:#010X}", - config.GetPhysicalInputAddress(), config.input_width.Value(), - config.input_height.Value(), config.GetPhysicalOutputAddress(), - config.output_width.Value(), config.output_height.Value(), - static_cast(config.output_format.Value()), config.flags); + "DisplayTransfer: {:#010X}({}x{})-> " + "{:#010X}({}x{}), dst format {:x}, flags {:#010X}", + config.GetPhysicalInputAddress(), config.input_width.Value(), + config.input_height.Value(), config.GetPhysicalOutputAddress(), + config.output_width.Value(), config.output_height.Value(), + static_cast(config.output_format.Value()), config.flags); } g_regs.display_transfer_config.trigger = 0; diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index ff594db0e..4d31b3c80 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -66,7 +66,7 @@ inline void Write(u32 addr, const T data) { break; default: LOG_ERROR(HW_Memory, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, - addr); + addr); } } diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp index 91b023c6c..b7e86dd42 100644 --- a/src/core/hw/lcd.cpp +++ b/src/core/hw/lcd.cpp @@ -35,8 +35,7 @@ inline void Write(u32 addr, const T data) { // Writes other than u32 are untested, so I'd rather have them abort than silently fail if (index >= 0x400 || !std::is_same::value) { - LOG_ERROR(HW_LCD, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, - addr); + LOG_ERROR(HW_LCD, "unknown Write{} {:#010X} @ {:#010X}", sizeof(data) * 8, (u32)data, addr); return; } diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index eb54c8139..b7bf37399 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp @@ -173,7 +173,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, current_inprogress < remaining && pos < end_pos; current_inprogress++) { const auto& table = reloc_table[current_inprogress]; LOG_TRACE(Loader, "(t={},skip={},patch={})", current_segment_reloc_table, - static_cast(table.skip), static_cast(table.patch)); + static_cast(table.skip), static_cast(table.patch)); pos += table.skip; s32 num_patches = table.patch; while (0 < num_patches && pos < end_pos) { @@ -183,7 +183,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, u32 sub_type = orig_data >> (32 - 4); u32 addr = TranslateAddr(orig_data & ~0xF0000000, &loadinfo, offsets); LOG_TRACE(Loader, "Patching {:08X} <-- rel({:08X},{}) ({:08X})", in_addr, - addr, current_segment_reloc_table, *pos); + addr, current_segment_reloc_table, *pos); switch (current_segment_reloc_table) { case 0: { if (sub_type != 0) @@ -237,7 +237,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, LOG_DEBUG(Loader, "code size: {:#X}", loadinfo.seg_sizes[0]); LOG_DEBUG(Loader, "rodata size: {:#X}", loadinfo.seg_sizes[1]); LOG_DEBUG(Loader, "data size: {:#X} (including {:#X} of bss)", loadinfo.seg_sizes[2], - hdr.bss_size); + hdr.bss_size); *out_codeset = code_set; return ERROR_NONE; diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index bb9e85b46..c4dd0579a 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -304,7 +304,7 @@ SharedPtr ElfReader::LoadInto(u32 vaddr) { for (unsigned int i = 0; i < header->e_phnum; ++i) { Elf32_Phdr* p = &segments[i]; LOG_DEBUG(Loader, "Type: {} Vaddr: {:08X} Filesz: {:08X} Memsz: {:08X} ", p->p_type, - p->p_vaddr, p->p_filesz, p->p_memsz); + p->p_vaddr, p->p_filesz, p->p_memsz); if (p->p_type == PT_LOAD) { CodeSet::Segment* codeset_segment; @@ -317,15 +317,15 @@ SharedPtr ElfReader::LoadInto(u32 vaddr) { codeset_segment = &codeset->data; } else { LOG_ERROR(Loader, "Unexpected ELF PT_LOAD segment id {} with flags {:X}", i, - p->p_flags); + p->p_flags); continue; } if (codeset_segment->size != 0) { LOG_ERROR(Loader, - "ELF has more than one segment of the same type. Skipping extra " - "segment (id {})", - i); + "ELF has more than one segment of the same type. Skipping extra " + "segment (id {})", + i); continue; } diff --git a/src/core/memory.cpp b/src/core/memory.cpp index bd6957e37..5663a4c33 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -39,7 +39,7 @@ PageTable* GetCurrentPageTable() { static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { LOG_DEBUG(HW_Memory, "Mapping {} onto {:08X}-{:08X}", (void*)memory, base * PAGE_SIZE, - (base + size) * PAGE_SIZE); + (base + size) * PAGE_SIZE); RasterizerFlushVirtualRegion(base << PAGE_BITS, size * PAGE_SIZE, FlushMode::FlushAndInvalidate); @@ -189,7 +189,7 @@ void Write(const VAddr vaddr, const T data) { switch (type) { case PageType::Unmapped: LOG_ERROR(HW_Memory, "unmapped Write{} 0x{:08X} @ 0x{:08X}", sizeof(data) * 8, (u32)data, - vaddr); + vaddr); return; case PageType::Memory: ASSERT_MSG(false, "Mapped memory page without a pointer @ {:08X}", vaddr); @@ -340,8 +340,8 @@ void RasterizerMarkRegionCached(PAddr start, u32 size, bool cached) { // parts of the texture. if (!maybe_vaddr) { LOG_ERROR(HW_Memory, - "Trying to flush a cached region to an invalid physical address {:08X}", - paddr); + "Trying to flush a cached region to an invalid physical address {:08X}", + paddr); continue; } VAddr vaddr = *maybe_vaddr; @@ -486,8 +486,8 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_ switch (page_table.attributes[page_index]) { case PageType::Unmapped: { LOG_ERROR(HW_Memory, - "unmapped ReadBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", - current_vaddr, src_addr, size); + "unmapped ReadBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", + current_vaddr, src_addr, size); std::memset(dest_buffer, 0, copy_amount); break; } @@ -555,8 +555,8 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi switch (page_table.attributes[page_index]) { case PageType::Unmapped: { LOG_ERROR(HW_Memory, - "unmapped WriteBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", - current_vaddr, dest_addr, size); + "unmapped WriteBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", + current_vaddr, dest_addr, size); break; } case PageType::Memory: { @@ -608,8 +608,8 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size switch (page_table.attributes[page_index]) { case PageType::Unmapped: { LOG_ERROR(HW_Memory, - "unmapped ZeroBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", - current_vaddr, dest_addr, size); + "unmapped ZeroBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", + current_vaddr, dest_addr, size); break; } case PageType::Memory: { @@ -658,8 +658,8 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, switch (page_table.attributes[page_index]) { case PageType::Unmapped: { LOG_ERROR(HW_Memory, - "unmapped CopyBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", - current_vaddr, src_addr, size); + "unmapped CopyBlock @ 0x{:08X} (start address = 0x{:08X}, size = {})", + current_vaddr, src_addr, size); ZeroBlock(process, dest_addr, copy_amount); break; } diff --git a/src/core/movie.cpp b/src/core/movie.cpp index 8270cfe66..e72016238 100644 --- a/src/core/movie.cpp +++ b/src/core/movie.cpp @@ -139,8 +139,8 @@ void Movie::Play(Service::HID::PadState& pad_state, s16& circle_pad_x, s16& circ if (s.type != ControllerStateType::PadAndCircle) { LOG_ERROR(Movie, - "Expected to read type {}, but found {}. Your playback will be out of sync", - static_cast(ControllerStateType::PadAndCircle), static_cast(s.type)); + "Expected to read type {}, but found {}. Your playback will be out of sync", + static_cast(ControllerStateType::PadAndCircle), static_cast(s.type)); return; } @@ -168,8 +168,8 @@ void Movie::Play(Service::HID::TouchDataEntry& touch_data) { if (s.type != ControllerStateType::Touch) { LOG_ERROR(Movie, - "Expected to read type {}, but found {}. Your playback will be out of sync", - static_cast(ControllerStateType::Touch), static_cast(s.type)); + "Expected to read type {}, but found {}. Your playback will be out of sync", + static_cast(ControllerStateType::Touch), static_cast(s.type)); return; } @@ -185,8 +185,8 @@ void Movie::Play(Service::HID::AccelerometerDataEntry& accelerometer_data) { if (s.type != ControllerStateType::Accelerometer) { LOG_ERROR(Movie, - "Expected to read type {}, but found {}. Your playback will be out of sync", - static_cast(ControllerStateType::Accelerometer), static_cast(s.type)); + "Expected to read type {}, but found {}. Your playback will be out of sync", + static_cast(ControllerStateType::Accelerometer), static_cast(s.type)); return; } @@ -202,8 +202,8 @@ void Movie::Play(Service::HID::GyroscopeDataEntry& gyroscope_data) { if (s.type != ControllerStateType::Gyroscope) { LOG_ERROR(Movie, - "Expected to read type {}, but found {}. Your playback will be out of sync", - static_cast(ControllerStateType::Gyroscope), static_cast(s.type)); + "Expected to read type {}, but found {}. Your playback will be out of sync", + static_cast(ControllerStateType::Gyroscope), static_cast(s.type)); return; } @@ -219,8 +219,8 @@ void Movie::Play(Service::IR::PadState& pad_state, s16& c_stick_x, s16& c_stick_ if (s.type != ControllerStateType::IrRst) { LOG_ERROR(Movie, - "Expected to read type {}, but found {}. Your playback will be out of sync", - static_cast(ControllerStateType::IrRst), static_cast(s.type)); + "Expected to read type {}, but found {}. Your playback will be out of sync", + static_cast(ControllerStateType::IrRst), static_cast(s.type)); return; } @@ -351,8 +351,8 @@ bool Movie::ValidateHeader(const CTMHeader& header) { revision = Common::ToLower(revision); if (revision != Common::g_scm_rev) { - LOG_WARNING( - Movie, "This movie was created on a different version of Citra, playback may desync"); + LOG_WARNING(Movie, + "This movie was created on a different version of Citra, playback may desync"); } u64 program_id; @@ -408,7 +408,7 @@ void Movie::Init() { } } else { LOG_ERROR(Movie, "Failed to playback movie: Unable to open '{}'", - Settings::values.movie_play); + Settings::values.movie_play); } } diff --git a/src/network/room.cpp b/src/network/room.cpp index 89ca13083..d6b032baf 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -409,10 +409,10 @@ void Room::RoomImpl::HandleWifiPacket(const ENetEvent* event) { enet_peer_send(member->peer, 0, enet_packet); } else { LOG_ERROR(Network, - "Attempting to send to unknown MAC address: " - "{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}", - destination_address[0], destination_address[1], destination_address[2], - destination_address[3], destination_address[4], destination_address[5]); + "Attempting to send to unknown MAC address: " + "{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}", + destination_address[0], destination_address[1], destination_address[2], + destination_address[3], destination_address[4], destination_address[5]); enet_packet_destroy(enet_packet); } } diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index e73e159a2..098f4c0d8 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -69,7 +69,7 @@ static void WriteUniformIntReg(Shader::ShaderSetup& setup, unsigned index, ASSERT(index < setup.uniforms.i.size()); setup.uniforms.i[index] = values; LOG_TRACE(HW_GPU, "Set {} integer uniform {} to {:02x} {:02x} {:02x} {:02x}", - GetShaderSetupTypeName(setup), index, values.x, values.y, values.z, values.w); + GetShaderSetupTypeName(setup), index, values.x, values.y, values.z, values.w); } static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup, @@ -91,7 +91,7 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup, if (uniform_setup.index >= 96) { LOG_ERROR(HW_GPU, "Invalid {} float uniform index {}", GetShaderSetupTypeName(setup), - (int)uniform_setup.index); + (int)uniform_setup.index); } else { // NOTE: The destination component order indeed is "backwards" @@ -109,9 +109,9 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup, } LOG_TRACE(HW_GPU, "Set {} float uniform {:x} to ({} {} {} {})", - GetShaderSetupTypeName(setup), (int)uniform_setup.index, - uniform.x.ToFloat32(), uniform.y.ToFloat32(), uniform.z.ToFloat32(), - uniform.w.ToFloat32()); + GetShaderSetupTypeName(setup), (int)uniform_setup.index, + uniform.x.ToFloat32(), uniform.y.ToFloat32(), uniform.z.ToFloat32(), + uniform.w.ToFloat32()); // TODO: Verify that this actually modifies the register! uniform_setup.index.Assign(uniform_setup.index + 1); @@ -199,8 +199,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { attribute.x = float24::FromRaw(default_attr_write_buffer[2] & 0xFFFFFF); LOG_TRACE(HW_GPU, "Set default VS attribute {:x} to ({} {} {} {})", (int)setup.index, - attribute.x.ToFloat32(), attribute.y.ToFloat32(), attribute.z.ToFloat32(), - attribute.w.ToFloat32()); + attribute.x.ToFloat32(), attribute.y.ToFloat32(), attribute.z.ToFloat32(), + attribute.w.ToFloat32()); // TODO: Verify that this actually modifies the register! if (setup.index < 15) { diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 96976a273..fcbe46195 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -179,11 +179,11 @@ void DumpShader(const std::string& filename, const ShaderRegs& config, } catch (const std::out_of_range&) { DEBUG_ASSERT_MSG(false, "Unknown output attribute mapping"); LOG_ERROR(HW_GPU, - "Unknown output attribute mapping: {:03x}, {:03x}, {:03x}, {:03x}", - (int)output_attributes[i].map_x.Value(), - (int)output_attributes[i].map_y.Value(), - (int)output_attributes[i].map_z.Value(), - (int)output_attributes[i].map_w.Value()); + "Unknown output attribute mapping: {:03x}, {:03x}, {:03x}, {:03x}", + (int)output_attributes[i].map_x.Value(), + (int)output_attributes[i].map_y.Value(), + (int)output_attributes[i].map_z.Value(), + (int)output_attributes[i].map_w.Value()); } } } diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index a4567c1a4..fb876a3d1 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -43,9 +43,8 @@ RasterizerOpenGL::RasterizerOpenGL() allow_shadow = GLAD_GL_ARB_shader_image_load_store && GLAD_GL_ARB_shader_image_size && GLAD_GL_ARB_framebuffer_no_attachments; if (!allow_shadow) { - LOG_WARNING( - Render_OpenGL, - "Shadow might not be able to render because of unsupported OpenGL extensions."); + LOG_WARNING(Render_OpenGL, + "Shadow might not be able to render because of unsupported OpenGL extensions."); } // Clipping plane 0 is always enabled for PICA fixed clip plane z <= 0 @@ -1601,7 +1600,7 @@ void RasterizerOpenGL::SyncCullMode() { default: LOG_CRITICAL(Render_OpenGL, "Unknown cull mode {}", - static_cast(regs.rasterizer.cull_mode.Value())); + static_cast(regs.rasterizer.cull_mode.Value())); UNIMPLEMENTED(); break; } diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index d870dd9e2..f2f1d73c5 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -1391,7 +1391,7 @@ SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces( if (using_color_fb && using_depth_fb && boost::icl::length(color_vp_interval & depth_vp_interval)) { LOG_CRITICAL(Render_OpenGL, "Color and depth framebuffer memory regions overlap; " - "overlapping framebuffers not supported!"); + "overlapping framebuffers not supported!"); using_depth_fb = false; } diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index fe83de426..85bdf2f0f 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -573,8 +573,8 @@ private: default: { LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}", - (int)instr.opcode.Value().EffectiveOpCode(), - instr.opcode.Value().GetInfo().name, instr.hex); + (int)instr.opcode.Value().EffectiveOpCode(), + instr.opcode.Value().GetInfo().name, instr.hex); throw DecompileFail("Unhandled instruction"); break; } @@ -617,8 +617,8 @@ private: } } else { LOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}", - (int)instr.opcode.Value().EffectiveOpCode(), - instr.opcode.Value().GetInfo().name, instr.hex); + (int)instr.opcode.Value().EffectiveOpCode(), + instr.opcode.Value().GetInfo().name, instr.hex); throw DecompileFail("Unhandled instruction"); } break; @@ -771,8 +771,8 @@ private: default: { LOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}", - (int)instr.opcode.Value().EffectiveOpCode(), - instr.opcode.Value().GetInfo().name, instr.hex); + (int)instr.opcode.Value().EffectiveOpCode(), + instr.opcode.Value().GetInfo().name, instr.hex); throw DecompileFail("Unhandled instruction"); break; } diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 32a4c4069..0c71c9345 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -270,7 +270,7 @@ void PicaGSConfigCommonRaw::Init(const Pica::Regs& regs) { semantic_maps[static_cast(semantic)] = {attrib, comp}; } else if (semantic != VSOutputAttributes::INVALID) { LOG_ERROR(Render_OpenGL, "Invalid/unknown semantic id: {}", - static_cast(semantic)); + static_cast(semantic)); } } } @@ -321,7 +321,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un return "shadowTextureCube(texcoord0, texcoord0_w)"; default: LOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}", - static_cast(state.texture0_type)); + static_cast(state.texture0_type)); UNIMPLEMENTED(); return "texture(tex0, texcoord0)"; } @@ -535,7 +535,7 @@ static void AppendColorCombiner(std::string& out, TevStageConfig::Operation oper default: out += "vec3(0.0)"; LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: {}", - static_cast(operation)); + static_cast(operation)); break; } out += ", vec3(0.0), vec3(1.0))"; // Clamp result to 0.0, 1.0 @@ -576,7 +576,7 @@ static void AppendAlphaCombiner(std::string& out, TevStageConfig::Operation oper default: out += "0.0"; LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: {}", - static_cast(operation)); + static_cast(operation)); break; } out += ", 0.0, 1.0)"; diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index d78244d66..58c54444e 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -43,7 +43,7 @@ GLuint LoadShader(const char* source, GLenum type) { LOG_DEBUG(Render_OpenGL, "{}", &shader_error[0]); } else { LOG_ERROR(Render_OpenGL, "Error compiling {} shader:\n{}", debug_type, - &shader_error[0]); + &shader_error[0]); LOG_ERROR(Render_OpenGL, "Shader source code:\n{}", source); } } diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 4072d0c72..96125075f 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -172,8 +172,8 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram : (!right_eye ? framebuffer.address_left2 : framebuffer.address_right2); LOG_TRACE(Render_OpenGL, "0x{:08x} bytes from 0x{:08x}({}x{}), fmt {:x}", - framebuffer.stride * framebuffer.height, framebuffer_addr, (int)framebuffer.width, - (int)framebuffer.height, (int)framebuffer.format); + framebuffer.stride * framebuffer.height, framebuffer_addr, (int)framebuffer.width, + (int)framebuffer.height, (int)framebuffer.format); int bpp = GPU::Regs::BytesPerPixel(framebuffer.color_format); size_t pixel_stride = framebuffer.stride / bpp; @@ -494,8 +494,8 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum level = Log::Level::Debug; break; } - LOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source), - GetType(type), id, message); + LOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source), GetType(type), + id, message); } /// Initialize the renderer diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 852342b2b..341d8a453 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -66,14 +66,14 @@ OutputVertex OutputVertex::FromAttributeBuffer(const RasterizerRegs& regs, } LOG_TRACE(HW_GPU, - "Output vertex: pos({:.2}, {:.2}, {:.2}, {:.2}), quat({:.2}, {:.2}, {:.2}, {:.2}), " - "col({:.2}, {:.2}, {:.2}, {:.2}), tc0({:.2}, {:.2}), view({:.2}, {:.2}, {:.2})", - ret.pos.x.ToFloat32(), ret.pos.y.ToFloat32(), ret.pos.z.ToFloat32(), - ret.pos.w.ToFloat32(), ret.quat.x.ToFloat32(), ret.quat.y.ToFloat32(), - ret.quat.z.ToFloat32(), ret.quat.w.ToFloat32(), ret.color.x.ToFloat32(), - ret.color.y.ToFloat32(), ret.color.z.ToFloat32(), ret.color.w.ToFloat32(), - ret.tc0.u().ToFloat32(), ret.tc0.v().ToFloat32(), ret.view.x.ToFloat32(), - ret.view.y.ToFloat32(), ret.view.z.ToFloat32()); + "Output vertex: pos({:.2}, {:.2}, {:.2}, {:.2}), quat({:.2}, {:.2}, {:.2}, {:.2}), " + "col({:.2}, {:.2}, {:.2}, {:.2}), tc0({:.2}, {:.2}), view({:.2}, {:.2}, {:.2})", + ret.pos.x.ToFloat32(), ret.pos.y.ToFloat32(), ret.pos.z.ToFloat32(), + ret.pos.w.ToFloat32(), ret.quat.x.ToFloat32(), ret.quat.y.ToFloat32(), + ret.quat.z.ToFloat32(), ret.quat.w.ToFloat32(), ret.color.x.ToFloat32(), + ret.color.y.ToFloat32(), ret.color.z.ToFloat32(), ret.color.w.ToFloat32(), + ret.tc0.u().ToFloat32(), ret.tc0.v().ToFloat32(), ret.view.x.ToFloat32(), + ret.view.y.ToFloat32(), ret.view.z.ToFloat32()); return ret; } diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 1c69a3e48..6d001c709 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp @@ -447,8 +447,8 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData default: LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}", - (int)instr.opcode.Value().EffectiveOpCode(), - instr.opcode.Value().GetInfo().name, instr.hex); + (int)instr.opcode.Value().EffectiveOpCode(), + instr.opcode.Value().GetInfo().name, instr.hex); DEBUG_ASSERT(false); break; } @@ -536,8 +536,8 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData Record(debug_data, iteration, dest); } else { LOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}", - (int)instr.opcode.Value().EffectiveOpCode(), - instr.opcode.Value().GetInfo().name, instr.hex); + (int)instr.opcode.Value().EffectiveOpCode(), + instr.opcode.Value().GetInfo().name, instr.hex); } break; } @@ -654,8 +654,8 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData default: LOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}", - (int)instr.opcode.Value().EffectiveOpCode(), - instr.opcode.Value().GetInfo().name, instr.hex); + (int)instr.opcode.Value().EffectiveOpCode(), + instr.opcode.Value().GetInfo().name, instr.hex); break; } diff --git a/src/video_core/shader/shader_jit_x64_compiler.cpp b/src/video_core/shader/shader_jit_x64_compiler.cpp index 2457585c3..02f6b2791 100644 --- a/src/video_core/shader/shader_jit_x64_compiler.cpp +++ b/src/video_core/shader/shader_jit_x64_compiler.cpp @@ -859,7 +859,7 @@ void JitShader::Compile_NextInstr() { } else { // Unhandled instruction LOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x{:02x} (0x{:08x})", - static_cast(instr.opcode.Value().EffectiveOpCode()), instr.hex); + static_cast(instr.opcode.Value().EffectiveOpCode()), instr.hex); } } diff --git a/src/video_core/swrasterizer/framebuffer.cpp b/src/video_core/swrasterizer/framebuffer.cpp index 78e748a10..7e89e9966 100644 --- a/src/video_core/swrasterizer/framebuffer.cpp +++ b/src/video_core/swrasterizer/framebuffer.cpp @@ -58,7 +58,7 @@ void DrawPixel(int x, int y, const Math::Vec4& color) { default: LOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}", - static_cast(framebuffer.color_format.Value())); + static_cast(framebuffer.color_format.Value())); UNIMPLEMENTED(); } } @@ -94,7 +94,7 @@ const Math::Vec4 GetPixel(int x, int y) { default: LOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}", - static_cast(framebuffer.color_format.Value())); + static_cast(framebuffer.color_format.Value())); UNIMPLEMENTED(); } @@ -124,7 +124,7 @@ u32 GetDepth(int x, int y) { return Color::DecodeD24S8(src_pixel).x; default: LOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", - static_cast(framebuffer.depth_format.Value())); + static_cast(framebuffer.depth_format.Value())); UNIMPLEMENTED(); return 0; } @@ -186,7 +186,7 @@ void SetDepth(int x, int y, u32 value) { default: LOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", - static_cast(framebuffer.depth_format.Value())); + static_cast(framebuffer.depth_format.Value())); UNIMPLEMENTED(); break; } @@ -218,7 +218,7 @@ void SetStencil(int x, int y, u8 value) { default: LOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", - static_cast(framebuffer.depth_format.Value())); + static_cast(framebuffer.depth_format.Value())); UNIMPLEMENTED(); break; } diff --git a/src/video_core/swrasterizer/lighting.cpp b/src/video_core/swrasterizer/lighting.cpp index 69e132cb0..16491d6ef 100644 --- a/src/video_core/swrasterizer/lighting.cpp +++ b/src/video_core/swrasterizer/lighting.cpp @@ -54,7 +54,7 @@ std::tuple, Math::Vec4> ComputeFragmentsColors( surface_tangent = perturbation; } else { LOG_ERROR(HW_GPU, "Unknown bump mode {}", - static_cast(lighting.config0.bump_mode.Value())); + static_cast(lighting.config0.bump_mode.Value())); } } else { surface_normal = Math::MakeVec(0.0f, 0.0f, 1.0f); diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index 36c198ea2..d6d5256bf 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -363,8 +363,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve } default: // TODO: Change to LOG_ERROR when more types are handled. - LOG_DEBUG(HW_GPU, "Unhandled texture type {:x}", - (int)texture.config.type); + LOG_DEBUG(HW_GPU, "Unhandled texture type {:x}", (int)texture.config.type); UNIMPLEMENTED(); break; } @@ -844,8 +843,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve return std::min(combiner_output.a(), static_cast(255 - dest.a())); default: - LOG_CRITICAL(HW_GPU, "Unknown blend factor {:x}", - static_cast(factor)); + LOG_CRITICAL(HW_GPU, "Unknown blend factor {:x}", static_cast(factor)); UNIMPLEMENTED(); break; } diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index aac541bea..a6cfd6080 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp @@ -37,10 +37,9 @@ void VertexLoader::Setup(const PipelineRegs& regs) { // TODO: What happens if a loader overwrites a previous one's data? for (unsigned component = 0; component < loader_config.component_count; ++component) { if (component >= 12) { - LOG_ERROR( - HW_GPU, - "Overflow in the vertex attribute loader {} trying to load component {}", - loader, component); + LOG_ERROR(HW_GPU, + "Overflow in the vertex attribute loader {} trying to load component {}", + loader, component); continue; } @@ -138,12 +137,12 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, } LOG_TRACE(HW_GPU, - "Loaded {} components of attribute {:x} for vertex {:x} (index {:x}) from " - "0x{:08x} + 0x{:08x} + 0x{:04x}: {} {} {} {}", - vertex_attribute_elements[i], i, vertex, index, base_address, - vertex_attribute_sources[i], vertex_attribute_strides[i] * vertex, - input.attr[i][0].ToFloat32(), input.attr[i][1].ToFloat32(), - input.attr[i][2].ToFloat32(), input.attr[i][3].ToFloat32()); + "Loaded {} components of attribute {:x} for vertex {:x} (index {:x}) from " + "0x{:08x} + 0x{:08x} + 0x{:04x}: {} {} {} {}", + vertex_attribute_elements[i], i, vertex, index, base_address, + vertex_attribute_sources[i], vertex_attribute_strides[i] * vertex, + input.attr[i][0].ToFloat32(), input.attr[i][1].ToFloat32(), + input.attr[i][2].ToFloat32(), input.attr[i][3].ToFloat32()); } else if (vertex_attribute_is_default[i]) { // Load the default attribute if we're configured to do so input.attr[i] = g_state.input_default_attributes.attr[i]; diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 868d5d190..696de6c30 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -104,7 +104,7 @@ std::future PostJson(const std::string& url, const std::strin if (response.status >= 400) { LOG_ERROR(WebService, "POST to {} returned error status code: {}", url, - response.status); + response.status); return Common::WebResult{Common::WebResult::Code::HttpError, std::to_string(response.status)}; } @@ -114,7 +114,7 @@ std::future PostJson(const std::string& url, const std::strin if (content_type == response.headers.end() || content_type->second.find("application/json") == std::string::npos) { LOG_ERROR(WebService, "POST to {} returned wrong content: {}", url, - content_type->second); + content_type->second); return Common::WebResult{Common::WebResult::Code::WrongContent, content_type->second}; } @@ -175,8 +175,7 @@ std::future GetJson(std::function func, const std::str } if (response.status >= 400) { - LOG_ERROR(WebService, "GET to {} returned error status code: {}", url, - response.status); + LOG_ERROR(WebService, "GET to {} returned error status code: {}", url, response.status); return func(""); } @@ -185,7 +184,7 @@ std::future GetJson(std::function func, const std::str if (content_type == response.headers.end() || content_type->second.find("application/json") == std::string::npos) { LOG_ERROR(WebService, "GET to {} returned wrong content: {}", url, - content_type->second); + content_type->second); return func(""); } @@ -248,7 +247,7 @@ void DeleteJson(const std::string& url, const std::string& data, const std::stri if (response.status >= 400) { LOG_ERROR(WebService, "DELETE to {} returned error status code: {}", url, - response.status); + response.status); return; } @@ -257,7 +256,7 @@ void DeleteJson(const std::string& url, const std::string& data, const std::stri if (content_type == response.headers.end() || content_type->second.find("application/json") == std::string::npos) { LOG_ERROR(WebService, "DELETE to {} returned wrong content: {}", url, - content_type->second); + content_type->second); return; }