From c7230e56bcca6840c05a892491fa3a43b2da2ab1 Mon Sep 17 00:00:00 2001 From: LibretroAdmin Date: Thu, 8 Sep 2022 07:35:46 +0200 Subject: [PATCH] Remove Log_Debug/Dev/etc logs --- src/common/cd_image_m3u.cpp | 1 - src/common/cd_image_ppf.cpp | 3 - src/common/cue_parser.cpp | 3 +- src/common/file_system.cpp | 10 - src/common/heap_array.h | 2 - src/common/image.cpp | 3 - src/common/iso_reader.cpp | 1 - src/common/log.h | 30 --- src/common/progress_callback.cpp | 3 +- src/core/analog_controller.cpp | 13 -- src/core/cdrom.cpp | 187 +----------------- src/core/cdrom_async_reader.cpp | 39 ---- src/core/cpu_code_cache.cpp | 26 --- src/core/cpu_recompiler_code_generator.cpp | 10 - .../cpu_recompiler_code_generator_aarch32.cpp | 8 - .../cpu_recompiler_code_generator_aarch64.cpp | 8 - .../cpu_recompiler_code_generator_generic.cpp | 26 --- .../cpu_recompiler_code_generator_x64.cpp | 8 - src/core/cpu_recompiler_register_cache.cpp | 5 - src/core/gpu_hw_opengl.cpp | 2 - src/core/host_interface.cpp | 1 - src/core/host_interface_progress_callback.cpp | 2 +- src/core/memory_card.cpp | 5 - src/core/system.cpp | 1 - src/libretro/libretro_opengl_host_display.cpp | 1 - 25 files changed, 6 insertions(+), 392 deletions(-) diff --git a/src/common/cd_image_m3u.cpp b/src/common/cd_image_m3u.cpp index 5a3d0fa6..600aa650 100644 --- a/src/common/cd_image_m3u.cpp +++ b/src/common/cd_image_m3u.cpp @@ -94,7 +94,6 @@ bool CDImageM3u::Open(const char* path, Common::Error* error) else entry.filename = std::move(entry_filename); - Log_DevPrintf("Read path from m3u: '%s'", entry.filename.c_str()); m_entries.push_back(std::move(entry)); } diff --git a/src/common/cd_image_ppf.cpp b/src/common/cd_image_ppf.cpp index 7bccd58a..523a40e8 100644 --- a/src/common/cd_image_ppf.cpp +++ b/src/common/cd_image_ppf.cpp @@ -350,8 +350,6 @@ bool CDImagePPF::ReadV3Patch(std::FILE* fp) bool CDImagePPF::AddPatch(u64 offset, const u8* patch, u32 patch_size) { - Log_DebugPrintf("Starting applying patch of %u bytes at at offset %" PRIu64, patch_size, offset); - while (patch_size > 0) { const u32 sector_index = Truncate32(offset / RAW_SECTOR_SIZE) + m_replacement_offset; @@ -380,7 +378,6 @@ bool CDImagePPF::AddPatch(u64 offset, const u8* patch, u32 patch_size) } // patch it! - Log_DebugPrintf(" Patching %u bytes at sector %u offset %u", bytes_to_patch, sector_index, sector_offset); std::memcpy(&m_replacement_data[iter->second + sector_offset], patch, bytes_to_patch); offset += bytes_to_patch; patch += bytes_to_patch; diff --git a/src/common/cue_parser.cpp b/src/common/cue_parser.cpp index d9d2826c..2797b8e6 100644 --- a/src/common/cue_parser.cpp +++ b/src/common/cue_parser.cpp @@ -225,7 +225,6 @@ bool File::HandleFileCommand(const char* line, u32 line_number, Common::Error* e } m_current_file = filename; - Log_DebugPrintf("File '%s'", m_current_file->c_str()); return true; } @@ -474,4 +473,4 @@ const CueParser::MSF* Track::GetIndex(u32 n) const return nullptr; } -} // namespace CueParser \ No newline at end of file +} // namespace CueParser diff --git a/src/common/file_system.cpp b/src/common/file_system.cpp index 51b44e27..a51c66d6 100644 --- a/src/common/file_system.cpp +++ b/src/common/file_system.cpp @@ -371,14 +371,9 @@ static bool GetDisplayNameForUriPath(const char* path, std::string* result) const char* result_name = env->GetStringUTFChars(result_jstr, nullptr); if (result_name) - { - Log_DevPrintf("GetDisplayNameForUriPath(\"%s\") -> \"%s\"", path, result_name); result->assign(result_name); - } else - { result->clear(); - } env->ReleaseStringUTFChars(result_jstr, result_name); env->DeleteLocalRef(result_jstr); @@ -403,14 +398,9 @@ static bool GetRelativePathForUriPath(const char* path, const char* filename, st const char* result_name = env->GetStringUTFChars(result_jstr, nullptr); if (result_name) - { - Log_DevPrintf("GetRelativePathForUriPath(\"%s\", \"%s\") -> \"%s\"", path, filename, result_name); result->assign(result_name); - } else - { result->clear(); - } env->ReleaseStringUTFChars(result_jstr, result_name); env->DeleteLocalRef(result_jstr); diff --git a/src/common/heap_array.h b/src/common/heap_array.h index bf4a9a2d..bc9c4f94 100644 --- a/src/common/heap_array.h +++ b/src/common/heap_array.h @@ -63,8 +63,6 @@ public: void fill(const_reference value) { std::fill(begin(), end(), value); } - void swap(this_type& move) { std::swap(m_data, move.m_data); } - this_type& operator=(const this_type& rhs) { std::copy(begin(), end(), rhs.cbegin()); diff --git a/src/common/image.cpp b/src/common/image.cpp index 628dba0c..a0add6e1 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -15,10 +15,7 @@ bool LoadImageFromFile(Common::RGBA8Image* image, const char* filename) int width, height, file_channels; u8* pixel_data = stbi_load_from_file(fp.get(), &width, &height, &file_channels, 4); if (!pixel_data) - { - const char* error_reason = stbi_failure_reason(); return false; - } image->SetPixels(static_cast(width), static_cast(height), reinterpret_cast(pixel_data)); stbi_image_free(pixel_data); diff --git a/src/common/iso_reader.cpp b/src/common/iso_reader.cpp index b3cef5e8..36e7515a 100644 --- a/src/common/iso_reader.cpp +++ b/src/common/iso_reader.cpp @@ -50,7 +50,6 @@ bool ISOReader::ReadPVD() break; std::memcpy(&m_pvd, buffer, sizeof(ISOPrimaryVolumeDescriptor)); - Log_DebugPrintf("PVD found at index %u", i); return true; } diff --git a/src/common/log.h b/src/common/log.h index 2bb8bd8b..df753941 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -49,33 +49,3 @@ void Writev(const char* channelName, const char* functionName, LOGLEVEL level, c #define Log_WarningPrintf(...) Log::Writef(___LogChannel___, __func__, LOGLEVEL_WARNING, __VA_ARGS__) #define Log_InfoPrint(msg) Log::Write(___LogChannel___, __func__, LOGLEVEL_INFO, msg) #define Log_InfoPrintf(...) Log::Writef(___LogChannel___, __func__, LOGLEVEL_INFO, __VA_ARGS__) -#define Log_VerbosePrint(msg) Log::Write(___LogChannel___, __func__, LOGLEVEL_VERBOSE, msg) -#define Log_VerbosePrintf(...) Log::Writef(___LogChannel___, __func__, LOGLEVEL_VERBOSE, __VA_ARGS__) -#define Log_DevPrint(msg) Log::Write(___LogChannel___, __func__, LOGLEVEL_DEV, msg) -#define Log_DevPrintf(...) Log::Writef(___LogChannel___, __func__, LOGLEVEL_DEV, __VA_ARGS__) -#define Log_ProfilePrint(msg) Log::Write(___LogChannel___, __func__, LOGLEVEL_PROFILE, msg) -#define Log_ProfilePrintf(...) Log::Writef(___LogChannel___, __func__, LOGLEVEL_PROFILE, __VA_ARGS__) - -#ifdef _DEBUG -#define Log_DebugPrint(msg) Log::Write(___LogChannel___, __func__, LOGLEVEL_DEBUG, msg) -#define Log_DebugPrintf(...) Log::Writef(___LogChannel___, __func__, LOGLEVEL_DEBUG, __VA_ARGS__) -#define Log_TracePrint(msg) Log::Write(___LogChannel___, __func__, LOGLEVEL_TRACE, msg) -#define Log_TracePrintf(...) Log::Writef(___LogChannel___, __func__, LOGLEVEL_TRACE, __VA_ARGS__) -#else -#define Log_DebugPrint(msg) \ - do \ - { \ - } while (0) -#define Log_DebugPrintf(...) \ - do \ - { \ - } while (0) -#define Log_TracePrint(msg) \ - do \ - { \ - } while (0) -#define Log_TracePrintf(...) \ - do \ - { \ - } while (0) -#endif diff --git a/src/common/progress_callback.cpp b/src/common/progress_callback.cpp index 88178a1e..51d43a76 100644 --- a/src/common/progress_callback.cpp +++ b/src/common/progress_callback.cpp @@ -133,7 +133,7 @@ public: void DisplayError(const char* message) override { Log_ErrorPrint(message); } void DisplayWarning(const char* message) override { Log_WarningPrint(message); } void DisplayInformation(const char* message) override { Log_InfoPrint(message); } - void DisplayDebugMessage(const char* message) override { Log_DevPrint(message); } + void DisplayDebugMessage(const char* message) override { } void ModalError(const char* message) override { Log_ErrorPrint(message); } bool ModalConfirmation(const char* message) override @@ -383,7 +383,6 @@ void ConsoleProgressCallback::DisplayInformation(const char* message) void ConsoleProgressCallback::DisplayDebugMessage(const char* message) { Clear(); - Log_DevPrint(message); Redraw(false); } diff --git a/src/core/analog_controller.cpp b/src/core/analog_controller.cpp index 84a108e2..a0ea51e6 100644 --- a/src/core/analog_controller.cpp +++ b/src/core/analog_controller.cpp @@ -331,12 +331,10 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out) if (data_in == 0x01) { - Log_DevPrintf("ACK controller access"); m_command = Command::Ready; return true; } - Log_DevPrintf("Unknown data_in = 0x%02X", data_in); return false; } break; @@ -556,8 +554,6 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out) m_dualshock_enabled = true; m_status_byte = 0x5A; } - - Log_DevPrintf("0x%02x(%s) config mode", m_rx_buffer[2], m_configuration_mode ? "enter" : "leave"); } } break; @@ -566,15 +562,11 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out) { if (m_command_step == 2) { - Log_DevPrintf("analog mode val 0x%02x", data_in); - if (data_in == 0x00 || data_in == 0x01) SetAnalogMode((data_in == 0x01)); } else if (m_command_step == 3) { - Log_DevPrintf("analog mode lock 0x%02x", data_in); - if (data_in == 0x02 || data_in == 0x03) m_analog_locked = (data_in == 0x03); } @@ -670,11 +662,6 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out) { m_command = Command::Idle; - Log_DevPrintf("Rx: %02x %02x %02x %02x %02x %02x %02x %02x", m_rx_buffer[0], m_rx_buffer[1], m_rx_buffer[2], - m_rx_buffer[3], m_rx_buffer[4], m_rx_buffer[5], m_rx_buffer[6], m_rx_buffer[7]); - Log_DevPrintf("Tx: %02x %02x %02x %02x %02x %02x %02x %02x", m_tx_buffer[0], m_tx_buffer[1], m_tx_buffer[2], - m_tx_buffer[3], m_tx_buffer[4], m_tx_buffer[5], m_tx_buffer[6], m_tx_buffer[7]); - m_rx_buffer.fill(0x00); m_tx_buffer.fill(0x00); } diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 25a296d8..5ff0d0f8 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -214,17 +214,6 @@ void CDROM::SoftReset(TickCount ticks_late) const TickCount seek_ticks = (m_current_lba != 0) ? GetTicksForSeek(0) : 0; const TickCount total_ticks = toc_read_ticks + speed_change_ticks + seek_ticks - ticks_late; - if (was_double_speed) - { - Log_DevPrintf("CDROM was double speed on reset, switching to single speed in %d ticks, reading TOC in %d ticks, " - "seeking in %d ticks", - speed_change_ticks, toc_read_ticks, seek_ticks); - } - else - { - Log_DevPrintf("CDROM reading TOC on reset in %d ticks and seeking in %d ticks", toc_read_ticks, seek_ticks); - } - if (m_current_lba != 0) { m_drive_state = DriveState::SeekingImplicit; @@ -423,20 +412,15 @@ u8 CDROM::ReadRegister(u32 offset) switch (offset) { case 0: // status register - Log_TracePrintf("CDROM read status register -> 0x%08X", m_status.bits); return m_status.bits; case 1: // always response FIFO { if (m_response_fifo.IsEmpty()) - { - Log_DevPrint("Response FIFO empty on read"); return 0x00; - } const u8 value = m_response_fifo.Pop(); UpdateStatusRegister(); - Log_DebugPrintf("CDROM read response FIFO -> 0x%08X", ZeroExtend32(value)); return value; } @@ -444,24 +428,14 @@ u8 CDROM::ReadRegister(u32 offset) { const u8 value = m_data_fifo.Pop(); UpdateStatusRegister(); - Log_DebugPrintf("CDROM read data FIFO -> 0x%08X", ZeroExtend32(value)); return value; } case 3: { if (m_status.index & 1) - { - const u8 value = m_interrupt_flag_register | ~INTERRUPT_REGISTER_MASK; - Log_DebugPrintf("CDROM read interrupt flag register -> 0x%02X", ZeroExtend32(value)); - return value; - } - else - { - const u8 value = m_interrupt_enable_register | ~INTERRUPT_REGISTER_MASK; - Log_DebugPrintf("CDROM read interrupt enable register -> 0x%02X", ZeroExtend32(value)); - return value; - } + return m_interrupt_flag_register | ~INTERRUPT_REGISTER_MASK; + return m_interrupt_enable_register | ~INTERRUPT_REGISTER_MASK; } break; } @@ -476,7 +450,6 @@ void CDROM::WriteRegister(u32 offset, u8 value) { if (offset == 0) { - Log_TracePrintf("CDROM status register <- 0x%02X", value); m_status.bits = (m_status.bits & static_cast(~3)) | (value & u8(3)); return; } @@ -486,7 +459,6 @@ void CDROM::WriteRegister(u32 offset, u8 value) { case 0: { - Log_DebugPrintf("CDROM command register <- 0x%02X (%s)", value, s_command_info[value].name); BeginCommand(static_cast(value)); return; } @@ -506,7 +478,6 @@ void CDROM::WriteRegister(u32 offset, u8 value) case 2: { - Log_DebugPrintf("Request register <- 0x%02X", value); const RequestRegister rr{value}; // Sound map is not currently implemented, haven't found anything which uses it. @@ -516,14 +487,9 @@ void CDROM::WriteRegister(u32 offset, u8 value) Log_ErrorPrintf("Buffer write enable set"); if (rr.BFRD) - { LoadDataFIFO(); - } else - { - Log_DebugPrintf("Clearing data FIFO"); m_data_fifo.Clear(); - } UpdateStatusRegister(); return; @@ -537,7 +503,6 @@ void CDROM::WriteRegister(u32 offset, u8 value) case 4: { - Log_DebugPrintf("Interrupt enable register <- 0x%02X", value); m_interrupt_enable_register = value & INTERRUPT_REGISTER_MASK; UpdateInterruptRequest(); return; @@ -545,7 +510,6 @@ void CDROM::WriteRegister(u32 offset, u8 value) case 5: { - Log_DebugPrintf("Interrupt flag register <- 0x%02X", value); m_interrupt_flag_register &= ~(value & INTERRUPT_REGISTER_MASK); if (m_interrupt_flag_register == 0) { @@ -573,35 +537,30 @@ void CDROM::WriteRegister(u32 offset, u8 value) case 7: { - Log_DebugPrintf("Audio volume for left-to-left output <- 0x%02X", value); m_next_cd_audio_volume_matrix[0][0] = value; return; } case 8: { - Log_DebugPrintf("Audio volume for left-to-right output <- 0x%02X", value); m_next_cd_audio_volume_matrix[0][1] = value; return; } case 9: { - Log_DebugPrintf("Audio volume for right-to-right output <- 0x%02X", value); m_next_cd_audio_volume_matrix[1][1] = value; return; } case 10: { - Log_DebugPrintf("Audio volume for right-to-left output <- 0x%02X", value); m_next_cd_audio_volume_matrix[1][0] = value; return; } case 11: { - Log_DebugPrintf("Audio volume apply changes <- 0x%02X", value); const bool adpcm_muted = ConvertToBoolUnchecked(value & u8(0x01)); if (adpcm_muted != m_adpcm_muted || @@ -651,8 +610,6 @@ void CDROM::SetAsyncInterrupt(Interrupt interrupt) { if (m_interrupt_flag_register == static_cast(interrupt)) { - Log_DevPrintf("Not setting async interrupt %u because there is already one unacknowledged", - static_cast(interrupt)); m_async_response_fifo.Clear(); return; } @@ -672,7 +629,6 @@ void CDROM::ClearAsyncInterrupt() void CDROM::DeliverAsyncInterrupt() { Assert(m_pending_async_interrupt != 0 && !HasPendingInterrupt()); - Log_DebugPrintf("Delivering async interrupt %u", m_pending_async_interrupt); if (m_pending_async_interrupt == static_cast(Interrupt::DataReady)) m_current_read_sector_buffer = m_current_write_sector_buffer; @@ -835,14 +791,6 @@ TickCount CDROM::GetTicksForSeek(CDImage::LBA new_lba, bool ignore_speed_change) // we're still reading the TOC, so add that time in const TickCount remaining_change_ticks = m_drive_event->GetTicksUntilNextExecution(); ticks += remaining_change_ticks; - - Log_DevPrintf("Seek time for %u LBAs: %d (%.3f ms) (%d for speed change/implicit TOC read)", lba_diff, ticks, - (static_cast(ticks) / static_cast(ticks_per_second)) * 1000.0f, remaining_change_ticks); - } - else - { - Log_DevPrintf("Seek time for %u LBAs: %d (%.3f ms)", lba_diff, ticks, - (static_cast(ticks) / static_cast(ticks_per_second)) * 1000.0f); } if (g_settings.cdrom_seek_speedup > 1) @@ -951,8 +899,6 @@ void CDROM::AbortCommand() void CDROM::ExecuteCommand(TickCount ticks_late) { const CommandInfo& ci = s_command_info[static_cast(m_command)]; - Log_DevPrintf("CDROM executing command 0x%02X (%s), stat = 0x%02X", static_cast(m_command), ci.name, - m_secondary_status.bits); if (m_param_fifo.GetSize() < ci.expected_parameters) { Log_WarningPrintf("Too few parameters for command 0x%02X (%s), expecting %u got %u", static_cast(m_command), @@ -963,17 +909,12 @@ void CDROM::ExecuteCommand(TickCount ticks_late) } if (!m_response_fifo.IsEmpty()) - { - Log_DebugPrintf("Response FIFO not empty on command begin"); m_response_fifo.Clear(); - } switch (m_command) { case Command::Getstat: { - Log_DebugPrintf("CDROM Getstat command"); - // if bit 0 or 2 is set, send an additional byte SendACKAndStat(); @@ -994,8 +935,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::GetID: { - Log_DebugPrintf("CDROM GetID command"); - if (!CanReadMedia()) { SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY); @@ -1012,7 +951,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::ReadTOC: { - Log_DebugPrintf("CDROM ReadTOC command"); if (!CanReadMedia()) { SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY); @@ -1032,7 +970,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) { const u8 file = m_param_fifo.Peek(0); const u8 channel = m_param_fifo.Peek(1); - Log_DebugPrintf("CDROM setfilter command 0x%02X 0x%02X", ZeroExtend32(file), ZeroExtend32(channel)); m_xa_filter_file_number = file; m_xa_filter_channel_number = channel; m_xa_current_set = false; @@ -1045,7 +982,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) { const u8 mode = m_param_fifo.Peek(0); const bool speed_change = (mode & 0x80) != (m_mode.bits & 0x80); - Log_DevPrintf("CDROM setmode command 0x%02X", ZeroExtend32(mode)); m_mode.bits = mode; SendACKAndStat(); @@ -1057,25 +993,16 @@ void CDROM::ExecuteCommand(TickCount ticks_late) { // cancel the speed change if it's less than a quarter complete if (m_drive_event->GetTicksUntilNextExecution() >= (GetTicksForSpeedChange() / 4)) - { - Log_DevPrintf("Cancelling speed change event"); ClearDriveState(); - } } else if (m_drive_state != DriveState::SeekingImplicit && m_drive_state != DriveState::ShellOpening) { // if we're seeking or reading, we need to add time to the current seek/read const TickCount change_ticks = GetTicksForSpeedChange(); if (m_drive_state != DriveState::Idle) - { - Log_DevPrintf("Drive is %s, delaying event by %d ticks for speed change to %s-speed", - s_drive_state_names[static_cast(m_drive_state)], change_ticks, - m_mode.double_speed ? "double" : "single"); m_drive_event->Delay(change_ticks); - } else { - Log_DevPrintf("Drive is idle, speed change takes %d ticks", change_ticks); m_drive_state = DriveState::ChangingSpeedOrTOCRead; m_drive_event->Schedule(change_ticks); } @@ -1090,7 +1017,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) const u8 mm = m_param_fifo.Peek(0); const u8 ss = m_param_fifo.Peek(1); const u8 ff = m_param_fifo.Peek(2); - Log_DevPrintf("CDROM setloc command (%02X, %02X, %02X)", mm, ss, ff); // MM must be BCD, SS must be BCD and <0x60, FF must be BCD and <0x75 if (((mm & 0x0F) > 0x09) || (mm > 0x99) || ((ss & 0x0F) > 0x09) || (ss >= 0x60) || ((ff & 0x0F) > 0x09) || @@ -1117,7 +1043,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::SeekP: { const bool logical = (m_command == Command::SeekL); - Log_DebugPrintf("CDROM %s command", logical ? "SeekL" : "SeekP"); if (IsSeeking()) UpdatePositionWhileSeeking(); @@ -1139,7 +1064,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::SetSession: { const u8 session = m_param_fifo.Peek(0); - Log_DebugPrintf("CDROM SetSession command, session=%u", session); if (!CanReadMedia() || m_drive_state == DriveState::Reading || m_drive_state == DriveState::Playing) { @@ -1165,7 +1089,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::ReadN: case Command::ReadS: { - Log_DebugPrintf("CDROM read command"); if (!CanReadMedia()) { SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY); @@ -1180,11 +1103,7 @@ void CDROM::ExecuteCommand(TickCount ticks_late) if ((!m_setloc_pending || m_setloc_position.ToLBA() == GetNextSectorToBeRead()) && (m_drive_state == DriveState::Reading || (IsSeeking() && m_read_after_seek))) - { - Log_DevPrintf("Ignoring read command with %s setloc, already reading/reading after seek", - m_setloc_pending ? "pending" : "same"); m_setloc_pending = false; - } else { if (IsSeeking()) @@ -1201,7 +1120,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::Play: { const u8 track = m_param_fifo.IsEmpty() ? 0 : PackedBCDToBinary(m_param_fifo.Peek(0)); - Log_DebugPrintf("CDROM play command, track=%u", track); if (!CanReadMedia()) { @@ -1213,10 +1131,7 @@ void CDROM::ExecuteCommand(TickCount ticks_late) if (track == 0 && (!m_setloc_pending || m_setloc_position.ToLBA() == GetNextSectorToBeRead()) && (m_drive_state == DriveState::Playing || (IsSeeking() && m_play_after_seek))) - { - Log_DevPrintf("Ignoring play command with no/same setloc, already playing/playing after seek"); m_fast_forward_rate = 0; - } else { if (IsSeeking()) @@ -1320,7 +1235,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::Reset: { - Log_DebugPrintf("CDROM reset command"); SendACKAndStat(); if (m_command_second_response == Command::Reset) @@ -1342,7 +1256,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::MotorOn: { - Log_DebugPrintf("CDROM motor on command"); if (m_secondary_status.motor_on) { SendErrorResponse(STAT_ERROR, ERROR_REASON_INCORRECT_NUMBER_OF_PARAMETERS); @@ -1368,7 +1281,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::Mute: { - Log_DebugPrintf("CDROM mute command"); m_muted = true; SendACKAndStat(); EndCommand(); @@ -1377,7 +1289,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::Demute: { - Log_DebugPrintf("CDROM demute command"); m_muted = false; SendACKAndStat(); EndCommand(); @@ -1387,17 +1298,11 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::GetlocL: { if (!m_last_sector_header_valid) - { - Log_DevPrintf("CDROM GetlocL command - header invalid, status 0x%02X", m_secondary_status.bits); SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY); - } else { UpdatePhysicalPosition(true); - Log_DebugPrintf("CDROM GetlocL command - [%02X:%02X:%02X]", m_last_sector_header.minute, - m_last_sector_header.second, m_last_sector_header.frame); - m_response_fifo.PushRange(reinterpret_cast(&m_last_sector_header), sizeof(m_last_sector_header)); m_response_fifo.PushRange(reinterpret_cast(&m_last_sector_subheader), sizeof(m_last_sector_subheader)); @@ -1412,7 +1317,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) { if (!CanReadMedia()) { - Log_DebugPrintf("CDROM GetlocP command - not ready"); SendErrorResponse(STAT_ERROR, ERROR_REASON_NOT_READY); } else @@ -1422,11 +1326,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) else UpdatePhysicalPosition(false); - Log_DevPrintf("CDROM GetlocP command - T%02x I%02x R[%02x:%02x:%02x] A[%02x:%02x:%02x]", - m_last_subq.track_number_bcd, m_last_subq.index_number_bcd, m_last_subq.relative_minute_bcd, - m_last_subq.relative_second_bcd, m_last_subq.relative_frame_bcd, m_last_subq.absolute_minute_bcd, - m_last_subq.absolute_second_bcd, m_last_subq.absolute_frame_bcd); - m_response_fifo.Push(m_last_subq.track_number_bcd); m_response_fifo.Push(m_last_subq.index_number_bcd); m_response_fifo.Push(m_last_subq.relative_minute_bcd); @@ -1444,12 +1343,8 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::GetTN: { - Log_DebugPrintf("CDROM GetTN command"); if (CanReadMedia()) { - Log_DevPrintf("GetTN -> %u %u", m_reader.GetMedia()->GetFirstTrackNumber(), - m_reader.GetMedia()->GetLastTrackNumber()); - m_response_fifo.Push(m_secondary_status.bits); m_response_fifo.Push(BinaryToBCD(Truncate8(m_reader.GetMedia()->GetFirstTrackNumber()))); m_response_fifo.Push(BinaryToBCD(Truncate8(m_reader.GetMedia()->GetLastTrackNumber()))); @@ -1466,7 +1361,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::GetTD: { - Log_DebugPrintf("CDROM GetTD command"); Assert(m_param_fifo.GetSize() >= 1); const u8 track = PackedBCDToBinary(m_param_fifo.Peek()); @@ -1489,7 +1383,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) m_response_fifo.Push(m_secondary_status.bits); m_response_fifo.Push(BinaryToBCD(Truncate8(pos.minute))); m_response_fifo.Push(BinaryToBCD(Truncate8(pos.second))); - Log_DevPrintf("GetTD %u -> %u %u", track, pos.minute, pos.second); SetInterrupt(Interrupt::ACK); } @@ -1500,8 +1393,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::Getparam: { - Log_DebugPrintf("CDROM Getparam command"); - m_response_fifo.Push(m_secondary_status.bits); m_response_fifo.Push(m_mode.bits); m_response_fifo.Push(0); @@ -1514,7 +1405,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::Sync: { - Log_DebugPrintf("CDROM sync command"); SendErrorResponse(STAT_ERROR, ERROR_REASON_INVALID_COMMAND); EndCommand(); @@ -1523,7 +1413,6 @@ void CDROM::ExecuteCommand(TickCount ticks_late) case Command::VideoCD: { - Log_DebugPrintf("CDROM VideoCD command"); SendErrorResponse(STAT_ERROR, ERROR_REASON_INVALID_COMMAND); // According to nocash this doesn't clear the parameter FIFO. @@ -1550,7 +1439,6 @@ void CDROM::ExecuteTestCommand(u8 subcommand) { case 0x04: // Reset SCEx counters { - Log_DebugPrintf("Reset SCEx counters"); m_secondary_status.motor_on = true; m_response_fifo.Push(m_secondary_status.bits); SetInterrupt(Interrupt::ACK); @@ -1560,7 +1448,6 @@ void CDROM::ExecuteTestCommand(u8 subcommand) case 0x05: // Read SCEx counters { - Log_DebugPrintf("Read SCEx counters"); m_response_fifo.Push(m_secondary_status.bits); m_response_fifo.Push(0); // # of TOC reads? m_response_fifo.Push(0); // # of SCEx strings received @@ -1571,7 +1458,6 @@ void CDROM::ExecuteTestCommand(u8 subcommand) case 0x20: // Get CDROM BIOS Date/Version { - Log_DebugPrintf("Get CDROM BIOS Date/Version"); static constexpr u8 response[] = {0x95, 0x05, 0x16, 0xC1}; m_response_fifo.PushRange(response, countof(response)); @@ -1582,7 +1468,6 @@ void CDROM::ExecuteTestCommand(u8 subcommand) case 0x22: { - Log_DebugPrintf("Get CDROM region ID string"); switch (System::GetRegion()) { @@ -1765,15 +1650,11 @@ void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = fa // Fixes crash in Disney's The Lion King - Simba's Mighty Adventure. if (IsSeeking()) { - Log_DevPrintf("Read command while seeking, scheduling read after seek %u -> %u finishes in %d ticks", - m_seek_start_lba, m_seek_end_lba, m_drive_event->GetTicksUntilNextExecution()); m_read_after_seek = true; m_play_after_seek = false; return; } - Log_DebugPrintf("Starting reading @ LBA %u", m_current_lba); - const TickCount ticks = GetTicksForRead(); const TickCount first_sector_ticks = ticks + (after_seek ? 0 : GetTicksForSeek(m_current_lba)) - ticks_late; @@ -1791,7 +1672,6 @@ void CDROM::BeginReading(TickCount ticks_late /* = 0 */, bool after_seek /* = fa void CDROM::BeginPlaying(u8 track, TickCount ticks_late /* = 0 */, bool after_seek /* = false */) { - Log_DebugPrintf("Starting playing CDDA track %x", track); m_last_cdda_report_frame_nibble = 0xFF; m_play_track_number_bcd = track; m_fast_forward_rate = 0; @@ -1843,9 +1723,6 @@ void CDROM::BeginSeeking(bool logical, bool read_after_seek, bool play_after_see // TODO: Pending should stay set on seek command. m_setloc_pending = false; - Log_DebugPrintf("Seeking to [%02u:%02u:%02u] (LBA %u) (%s)", m_setloc_position.minute, m_setloc_position.second, - m_setloc_position.frame, m_setloc_position.ToLBA(), logical ? "logical" : "physical"); - const CDImage::LBA seek_lba = m_setloc_position.ToLBA(); const TickCount seek_time = GetTicksForSeek(seek_lba, play_after_seek); @@ -1890,9 +1767,6 @@ void CDROM::UpdatePositionWhileSeeking() return; } - Log_DevPrintf("Update position while seeking from %u to %u - %u (%.2f)", m_seek_start_lba, m_seek_end_lba, - current_lba, completed_frac); - // access the image directly since we want to preserve the cached data for the seek complete CDImage::SubChannelQ subq; if (!m_reader.ReadSectorUncached(current_lba, &subq, nullptr)) @@ -1957,12 +1831,6 @@ void CDROM::UpdatePhysicalPosition(bool update_logical) const CDImage::LBA old_offset = m_physical_lba - base; const CDImage::LBA new_offset = (old_offset + sector_diff) % sectors_per_track; const CDImage::LBA new_physical_lba = base + new_offset; -#ifdef _DEBUG - const CDImage::Position old_pos(CDImage::Position::FromLBA(m_physical_lba)); - const CDImage::Position new_pos(CDImage::Position::FromLBA(new_physical_lba)); - Log_DevPrintf("Tick diff %u, sector diff %u, old pos %02u:%02u:%02u, new pos %02u:%02u:%02u", diff, sector_diff, - old_pos.minute, old_pos.second, old_pos.frame, new_pos.minute, new_pos.second, new_pos.frame); -#endif if (m_physical_lba != new_physical_lba) { m_physical_lba = new_physical_lba; @@ -2130,7 +1998,6 @@ void CDROM::DoStatSecondResponse() void CDROM::DoChangeSessionComplete() { - Log_DebugPrintf("Changing session complete"); ClearDriveState(); m_secondary_status.ClearActiveBits(); m_secondary_status.motor_on = true; @@ -2150,7 +2017,6 @@ void CDROM::DoChangeSessionComplete() void CDROM::DoSpinUpComplete() { - Log_DebugPrintf("Spinup complete"); m_drive_state = DriveState::Idle; m_drive_event->Deactivate(); m_secondary_status.ClearActiveBits(); @@ -2159,14 +2025,12 @@ void CDROM::DoSpinUpComplete() void CDROM::DoSpeedChangeOrImplicitTOCReadComplete() { - Log_DebugPrintf("Speed change/implicit TOC read complete"); m_drive_state = DriveState::Idle; m_drive_event->Deactivate(); } void CDROM::DoIDRead() { - Log_DebugPrintf("ID read complete"); m_secondary_status.ClearActiveBits(); m_secondary_status.motor_on = CanReadMedia(); @@ -2219,12 +2083,8 @@ void CDROM::StopReadingWithDataEnd() void CDROM::StartMotor() { if (m_drive_state == DriveState::SpinningUp) - { - Log_DevPrintf("Starting motor - already spinning up"); return; - } - Log_DevPrintf("Starting motor"); m_drive_state = DriveState::SpinningUp; m_drive_event->Schedule(GetTicksForSpinUp()); } @@ -2261,13 +2121,10 @@ void CDROM::DoSectorRead() else { const CDImage::Position pos(CDImage::Position::FromLBA(m_current_lba)); - Log_DevPrintf("Sector %u [%02u:%02u:%02u] has invalid subchannel Q", m_current_lba, pos.minute, pos.second, - pos.frame); } if (subq.track_number_bcd == CDImage::LEAD_OUT_TRACK_NUMBER) { - Log_DevPrintf("Read reached lead-out area of disc at LBA %u, stopping", m_reader.GetLastReadSector()); StopReadingWithDataEnd(); StopMotor(); return; @@ -2276,16 +2133,12 @@ void CDROM::DoSectorRead() const bool is_data_sector = subq.IsData(); if (!is_data_sector) { + // track number was not specified, but we've found the track now if (m_play_track_number_bcd == 0) - { - // track number was not specified, but we've found the track now m_play_track_number_bcd = subq.track_number_bcd; - Log_DebugPrintf("Setting playing track number to %u", m_play_track_number_bcd); - } else if (m_mode.auto_pause && subq.track_number_bcd != m_play_track_number_bcd) { // we don't want to update the position if the track changes, so we check it before reading the actual sector. - Log_DevPrintf("Auto pause at the start of track %02x (LBA %u)", m_last_subq.track_number_bcd, m_current_lba); StopReadingWithDataEnd(); return; } @@ -2333,9 +2186,6 @@ void CDROM::ProcessDataSectorHeader(const u8* raw_sector) void CDROM::ProcessDataSector(const u8* raw_sector, const CDImage::SubChannelQ& subq) { const u32 sb_num = (m_current_write_sector_buffer + 1) % NUM_SECTOR_BUFFERS; - Log_DevPrintf("Read sector %u: mode %u submode 0x%02X into buffer %u", m_current_lba, - ZeroExtend32(m_last_sector_header.sector_mode), ZeroExtend32(m_last_sector_subheader.submode.bits), - sb_num); if (m_mode.xa_enable && m_last_sector_header.sector_mode == 2) { @@ -2350,11 +2200,6 @@ void CDROM::ProcessDataSector(const u8* raw_sector, const CDImage::SubChannelQ& // TODO: How does XA relate to this buffering? SectorBuffer* sb = &m_sector_buffers[sb_num]; - if (sb->size > 0) - { - Log_DevPrintf("Sector buffer %u was not read, previous sector dropped", - (m_current_write_sector_buffer - 1) % NUM_SECTOR_BUFFERS); - } if (m_mode.ignore_bit) Log_WarningPrintf("SetMode.4 bit set on read of sector %u", m_current_lba); @@ -2435,11 +2280,7 @@ void CDROM::ResampleXAADPCM(const s16* frames_in, u32 num_frames_in) // Since the disc reads and SPU are running at different speeds, we might be _slightly_ behind, which is fine, since // the SPU will over-read in the next batch to catch up. if (m_audio_fifo.GetSize() > AUDIO_FIFO_LOW_WATERMARK) - { - Log_DevPrintf("Dropping %u XA frames because audio FIFO still has %u frames", num_frames_in, - m_audio_fifo.GetSize()); return; - } s16* left_ringbuf = m_xa_resample_ring_buffer[0].data(); s16* right_ringbuf = m_xa_resample_ring_buffer[1].data(); @@ -2506,12 +2347,7 @@ void CDROM::ProcessXAADPCMSector(const u8* raw_sector, const CDImage::SubChannel // Check for automatic ADPCM filter. if (m_mode.xa_filter && (m_last_sector_subheader.file_number != m_xa_filter_file_number || m_last_sector_subheader.channel_number != m_xa_filter_channel_number)) - { - Log_DebugPrintf("Skipping sector due to filter mismatch (expected %u/%u got %u/%u)", m_xa_filter_file_number, - m_xa_filter_channel_number, m_last_sector_subheader.file_number, - m_last_sector_subheader.channel_number); return; - } // Track the current file being played. If this is not set by the filter, it'll be set by the first file/sector which // is read. Fixes audio in Tomb Raider III menu. @@ -2534,12 +2370,7 @@ void CDROM::ProcessXAADPCMSector(const u8* raw_sector, const CDImage::SubChannel } else if (m_last_sector_subheader.file_number != m_xa_current_file_number || m_last_sector_subheader.channel_number != m_xa_current_channel_number) - { - Log_DebugPrintf("Skipping sector due to current file mismatch (expected %u/%u got %u/%u)", m_xa_current_file_number, - m_xa_current_channel_number, m_last_sector_subheader.file_number, - m_last_sector_subheader.channel_number); return; - } // Reset current file on EOF, and play the file in the next sector. if (m_last_sector_subheader.submode.eof) @@ -2611,7 +2442,6 @@ static s16 GetPeakVolume(const u8* raw_sector, u8 channel) void CDROM::ProcessCDDASector(const u8* raw_sector, const CDImage::SubChannelQ& subq) { // For CDDA sectors, the whole sector contains the audio data. - Log_DevPrintf("Read sector %u as CDDA", m_current_lba); // The reporting doesn't happen if we're reading with the CDDA mode bit set. if (m_drive_state == DriveState::Playing && m_mode.report_audio) @@ -2646,11 +2476,6 @@ void CDROM::ProcessCDDASector(const u8* raw_sector, const CDImage::SubChannelQ& m_async_response_fifo.Push(Truncate8(peak_value)); // peak low m_async_response_fifo.Push(Truncate8(peak_value >> 8)); // peak high SetAsyncInterrupt(Interrupt::DataReady); - - Log_DevPrintf("CDDA report at track[%02x] index[%02x] rel[%02x:%02x:%02x] abs[%02x:%02x:%02x] peak[%u:%d]", - subq.track_number_bcd, subq.index_number_bcd, subq.relative_minute_bcd, subq.relative_second_bcd, - subq.relative_frame_bcd, subq.absolute_minute_bcd, subq.absolute_second_bcd, - subq.absolute_frame_bcd, channel, peak_volume); } } @@ -2683,10 +2508,7 @@ void CDROM::ProcessCDDASector(const u8* raw_sector, const CDImage::SubChannelQ& void CDROM::LoadDataFIFO() { if (!m_data_fifo.IsEmpty()) - { - Log_DevPrintf("Load data fifo when not empty"); return; - } // any data to load? SectorBuffer& sb = m_sector_buffers[m_current_read_sector_buffer]; @@ -2701,12 +2523,9 @@ void CDROM::LoadDataFIFO() sb.size = 0; } - Log_DebugPrintf("Loaded %u bytes to data FIFO from buffer %u", m_data_fifo.GetSize(), m_current_read_sector_buffer); - SectorBuffer& next_sb = m_sector_buffers[m_current_write_sector_buffer]; if (next_sb.size > 0) { - Log_DevPrintf("Sending additional INT1 for missed sector in buffer %u", m_current_write_sector_buffer); m_async_response_fifo.Push(m_secondary_status.bits); SetAsyncInterrupt(Interrupt::DataReady); } diff --git a/src/core/cdrom_async_reader.cpp b/src/core/cdrom_async_reader.cpp index 07711df6..a3d73287 100644 --- a/src/core/cdrom_async_reader.cpp +++ b/src/core/cdrom_async_reader.cpp @@ -72,17 +72,13 @@ void CDROMAsyncReader::QueueReadSector(CDImage::LBA lba) // the CDC code does this when seeking->reading const u32 buffer_front = m_buffer_front.load(); if (m_buffers[buffer_front].lba == lba) - { - Log_DebugPrintf("Skipping re-reading same sector %u", lba); return; - } // did we readahead to the correct sector? const u32 next_buffer = (buffer_front + 1) % static_cast(m_buffers.size()); if (m_buffer_count > 1 && m_buffers[next_buffer].lba == lba) { // great, don't need a seek, but still kick the thread to start reading ahead again - Log_DebugPrintf("Readahead buffer hit for sector %u", lba); m_buffer_front.store(next_buffer); m_buffer_count.fetch_sub(1); m_can_readahead.store(true); @@ -92,7 +88,6 @@ void CDROMAsyncReader::QueueReadSector(CDImage::LBA lba) } // we need to toss away our readahead and start fresh - Log_DebugPrintf("Readahead buffer miss, queueing seek to %u", lba); std::unique_lock lock(m_mutex); m_next_position_set.store(true); m_next_position = lba; @@ -142,13 +137,9 @@ bool CDROMAsyncReader::WaitForReadToComplete() { // Safe without locking with memory_order_seq_cst. if (!m_next_position_set.load() && m_buffer_count.load() > 0) - { - Log_TracePrintf("Returning sector %u", m_buffers[m_buffer_front.load()].lba); return m_buffers[m_buffer_front.load()].result; - } Common::Timer wait_timer; - Log_DebugPrintf("Sector read pending, waiting"); std::unique_lock lock(m_mutex); m_notify_read_complete_cv.wait( @@ -164,7 +155,6 @@ bool CDROMAsyncReader::WaitForReadToComplete() if (wait_time > 1.0f) Log_WarningPrintf("Had to wait %.2f msec for LBA %u", wait_time, m_buffers[front].lba); - Log_TracePrintf("Returning sector %u after waiting", m_buffers[front].lba); return m_buffers[front].result; } @@ -196,19 +186,7 @@ bool CDROMAsyncReader::ReadSectorIntoBuffer(std::unique_lock& lock) m_is_reading.store(true); lock.unlock(); - Log_TracePrintf("Reading LBA %u...", buffer.lba); - buffer.result = m_media->ReadRawSector(buffer.data.data(), &buffer.subq); - if (buffer.result) - { - const double read_time = timer.GetTimeMilliseconds(); - if (read_time > 1.0f) - Log_DevPrintf("Read LBA %u took %.2f msec", buffer.lba, read_time); - } - else - { - Log_ErrorPrintf("Read of LBA %u failed", buffer.lba); - } lock.lock(); m_is_reading.store(false); @@ -235,27 +213,12 @@ void CDROMAsyncReader::ReadSectorNonThreaded(CDImage::LBA lba) BufferSlot& buffer = m_buffers.front(); buffer.lba = m_media->GetPositionOnDisc(); - Log_TracePrintf("Reading LBA %u...", buffer.lba); - buffer.result = m_media->ReadRawSector(buffer.data.data(), &buffer.subq); - if (buffer.result) - { - const double read_time = timer.GetTimeMilliseconds(); - if (read_time > 1.0f) - Log_DevPrintf("Read LBA %u took %.2f msec", buffer.lba, read_time); - } - else - { - Log_ErrorPrintf("Read of LBA %u failed", buffer.lba); - } - m_buffer_count.fetch_add(1); } void CDROMAsyncReader::CancelReadahead() { - Log_DevPrintf("Cancelling readahead"); - std::unique_lock lock(m_mutex); // wait until the read thread is idle @@ -290,7 +253,6 @@ void CDROMAsyncReader::WorkerThreadEntryPoint() lock.unlock(); // seek without lock held in case it takes time - Log_DebugPrintf("Seeking to LBA %u...", seek_location); const bool seek_result = (m_media->GetPositionOnDisc() == seek_location || m_media->Seek(seek_location)); lock.lock(); @@ -318,7 +280,6 @@ void CDROMAsyncReader::WorkerThreadEntryPoint() break; // readahead time! read as many sectors as we have space for - Log_DebugPrintf("Reading ahead %u sectors...", static_cast(m_buffers.size()) - m_buffer_count.load()); while (m_buffer_count.load() < static_cast(m_buffers.size())) { if (m_next_position_set.load()) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index 5d009eea..2f068863 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -553,11 +553,7 @@ bool RevalidateBlock(CodeBlock* block) u32 new_code = 0; SafeReadInstruction(cbi.pc, &new_code); if (cbi.instruction.bits != new_code) - { - Log_DebugPrintf("Block 0x%08X changed at PC 0x%08X - %08X to %08X - recompiling.", block->GetPC(), cbi.pc, - cbi.instruction.bits, new_code); goto recompile; - } } // re-add it to the page map since it's still up-to-date @@ -689,7 +685,6 @@ bool CompileBlock(CodeBlock* block) // change the pc for the second branch's delay slot, it comes from the first branch pc = GetDirectBranchTarget(prev_cbi.instruction, prev_cbi.pc); - Log_DevPrintf("Double branch at %08X, using delay slot from %08X -> %08X", cbi.pc, prev_cbi.pc, pc); } // instruction is decoded now @@ -790,7 +785,6 @@ void InvalidCodeFunction() static void InvalidateBlock(CodeBlock* block, bool allow_frame_invalidation) { // Invalidate forces the block to be checked again. - Log_DebugPrintf("Invalidating block at 0x%08X", block->GetPC()); block->invalidated = true; if (block->can_link) @@ -800,10 +794,7 @@ static void InvalidateBlock(CodeBlock* block, bool allow_frame_invalidation) { const u32 frame_diff = frame_number - block->invalidate_frame_number; if (frame_diff <= INVALIDATE_THRESHOLD_TO_DISABLE_LINKING) - { - Log_DevPrintf("Block 0x%08X has been invalidated in %u frames, disabling linking", block->GetPC(), frame_diff); block->can_link = false; - } else { // It's been a while since this block was modified, so it's all good. @@ -904,8 +895,6 @@ void RemoveBlockFromPageMap(CodeBlock* block) void LinkBlock(CodeBlock* from, CodeBlock* to, void* host_pc, void* host_resolve_pc, u32 host_pc_size) { - Log_DebugPrintf("Linking block %p(%08x) to %p(%08x)", from, from->GetPC(), to, to->GetPC()); - CodeBlock::LinkInfo li; li.block = to; li.host_pc = host_pc; @@ -920,7 +909,6 @@ void LinkBlock(CodeBlock* from, CodeBlock* to, void* host_pc, void* host_resolve // apply in code if (host_pc) { - Log_ProfilePrintf("Backpatching %p(%08x) to jump to block %p (%08x)", host_pc, from->GetPC(), to, to->GetPC()); s_code_buffer.WriteProtect(false); Recompiler::CodeGenerator::BackpatchBranch(host_pc, host_pc_size, reinterpret_cast(to->host_code)); s_code_buffer.WriteProtect(true); @@ -947,10 +935,7 @@ void UnlinkBlock(CodeBlock* block) #ifdef WITH_RECOMPILER // Restore blocks linked to this block back to the resolver if (li.host_pc) - { - Log_ProfilePrintf("Backpatching %p(%08x) [predecessor] to jump to resolver", li.host_pc, li.block->GetPC()); Recompiler::CodeGenerator::BackpatchBranch(li.host_pc, li.host_pc_size, li.host_resolve_pc); - } #endif li.block->link_successors.erase(iter); @@ -967,10 +952,7 @@ void UnlinkBlock(CodeBlock* block) // Restore blocks we're linking to back to the resolver, since the successor won't be linked to us to backpatch if // it changes. if (li.host_pc) - { - Log_ProfilePrintf("Backpatching %p(%08x) [successor] to jump to resolver", li.host_pc, li.block->GetPC()); Recompiler::CodeGenerator::BackpatchBranch(li.host_pc, li.host_pc_size, li.host_resolve_pc); - } #endif // Don't have to do anything special for successors - just let the successor know it's no longer linked. @@ -1051,9 +1033,6 @@ Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, const PhysicalMemoryAddress fastmem_address = static_cast(static_cast(static_cast(fault_address) - g_state.fastmem_base)); - Log_DevPrintf("Page fault handler invoked at PC=%p Address=%p %s, fastmem offset 0x%08X", exception_pc, fault_address, - is_write ? "(write)" : "(read)", fastmem_address); - // use upper_bound to find the next block after the pc HostCodeMap::iterator upper_iter = s_host_code_map.upper_bound(reinterpret_cast(exception_pc)); @@ -1082,11 +1061,6 @@ Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, InvalidateBlocksWithPageIndex(code_page_index); return Common::PageFaultHandler::HandlerResult::ContinueExecution; } - else - { - Log_DevPrintf("Backpatching code write at %p (%08X) address %p (%08X) to slowmem after threshold", - exception_pc, lbi.guest_pc, fault_address, fastmem_address); - } } } diff --git a/src/core/cpu_recompiler_code_generator.cpp b/src/core/cpu_recompiler_code_generator.cpp index 607f370e..03664ea6 100644 --- a/src/core/cpu_recompiler_code_generator.cpp +++ b/src/core/cpu_recompiler_code_generator.cpp @@ -52,8 +52,6 @@ bool CodeGenerator::CompileBlock(CodeBlock* block, CodeBlock::HostCodePointer* o } FinalizeBlock(out_host_code, out_host_code_size); - Log_ProfilePrintf("JIT block 0x%08X: %zu instructions (%u bytes), %u host bytes", block->GetPC(), - block->instructions.size(), block->GetSizeInBytes(), *out_host_code_size); DebugAssert(m_register_cache.GetUsedHostRegisters() == 0); @@ -1042,7 +1040,6 @@ void CodeGenerator::InstructionEpilogue(const CodeBlockInstruction& cbi) if (m_load_delay_dirty) { // we have to invalidate the register cache, since the load delayed register might've been cached - Log_DebugPrint("Emitting delay slot flush"); EmitFlushInterpreterLoadDelay(); m_register_cache.InvalidateAllNonDirtyGuestRegisters(); m_load_delay_dirty = false; @@ -1051,7 +1048,6 @@ void CodeGenerator::InstructionEpilogue(const CodeBlockInstruction& cbi) // copy if the previous instruction was a load, reset the current value on the next instruction if (m_next_load_delay_dirty) { - Log_DebugPrint("Emitting delay slot flush (with move next)"); EmitMoveNextInterpreterLoadDelay(); m_next_load_delay_dirty = false; m_load_delay_dirty = true; @@ -1060,7 +1056,6 @@ void CodeGenerator::InstructionEpilogue(const CodeBlockInstruction& cbi) void CodeGenerator::TruncateBlockAtCurrentInstruction() { - Log_DevPrintf("Truncating block %08X at %08X", m_block->GetPC(), m_current_instruction->pc); m_block_end = m_current_instruction + 1; WriteNewPC(CalculatePC(), true); } @@ -1103,7 +1098,6 @@ void CodeGenerator::AddPendingCycles(bool commit) void CodeGenerator::AddGTETicks(TickCount ticks) { m_gte_done_cycle = m_delayed_cycles_add + ticks; - Log_DebugPrintf("Adding %d GTE ticks", ticks); } void CodeGenerator::StallUntilGTEComplete() @@ -1112,10 +1106,7 @@ void CodeGenerator::StallUntilGTEComplete() { // simple case - in block scheduling if (m_gte_done_cycle > m_delayed_cycles_add) - { - Log_DebugPrintf("Stalling for %d ticks from GTE", m_gte_done_cycle - m_delayed_cycles_add); m_delayed_cycles_add += (m_gte_done_cycle - m_delayed_cycles_add); - } return; } @@ -1634,7 +1625,6 @@ bool CodeGenerator::Compile_LoadLeftRight(const CodeBlockInstruction& cbi) // we don't actually care if it's our target reg or not, if it's not, it won't affect anything if (m_load_delay_dirty) { - Log_DevPrintf("Flushing interpreter load delay for lwl/lwr instruction at 0x%08X", cbi.pc); EmitFlushInterpreterLoadDelay(); m_register_cache.InvalidateGuestRegister(cbi.instruction.r.rt); m_load_delay_dirty = false; diff --git a/src/core/cpu_recompiler_code_generator_aarch32.cpp b/src/core/cpu_recompiler_code_generator_aarch32.cpp index 7b163197..049aa612 100644 --- a/src/core/cpu_recompiler_code_generator_aarch32.cpp +++ b/src/core/cpu_recompiler_code_generator_aarch32.cpp @@ -1520,8 +1520,6 @@ void CodeGenerator::EmitStoreGuestMemorySlowmem(const CodeBlockInstruction& cbi, bool CodeGenerator::BackpatchLoadStore(const LoadStoreBackpatchInfo& lbi) { - Log_DevPrintf("Backpatching %p (guest PC 0x%08X) to slowmem at %p", lbi.host_pc, lbi.guest_pc, lbi.host_slowmem_pc); - // turn it into a jump to the slowmem handler vixl::aarch32::MacroAssembler emit(static_cast(lbi.host_pc), lbi.host_code_size, a32::A32); @@ -1549,8 +1547,6 @@ bool CodeGenerator::BackpatchLoadStore(const LoadStoreBackpatchInfo& lbi) void CodeGenerator::BackpatchReturn(void* pc, u32 pc_size) { - Log_ProfilePrintf("Backpatching %p to return", pc); - vixl::aarch32::MacroAssembler emit(static_cast(pc), pc_size, a32::A32); emit.bx(a32::lr); @@ -1564,8 +1560,6 @@ void CodeGenerator::BackpatchReturn(void* pc, u32 pc_size) void CodeGenerator::BackpatchBranch(void* pc, u32 pc_size, void* target) { - Log_ProfilePrintf("Backpatching %p to %p [branch]", pc, target); - vixl::aarch32::MacroAssembler emit(static_cast(pc), pc_size, a32::A32); // check jump distance @@ -2114,7 +2108,6 @@ CodeCache::DispatcherFunction CodeGenerator::CompileDispatcher() CodeBlock::HostCodePointer ptr; u32 code_size; FinalizeBlock(&ptr, &code_size); - Log_DevPrintf("Dispatcher is %u bytes at %p", code_size, ptr); return reinterpret_cast(ptr); } @@ -2136,7 +2129,6 @@ CodeCache::SingleBlockDispatcherFunction CodeGenerator::CompileSingleBlockDispat CodeBlock::HostCodePointer ptr; u32 code_size; FinalizeBlock(&ptr, &code_size); - Log_DevPrintf("Single block dispatcher is %u bytes at %p", code_size, ptr); return reinterpret_cast(ptr); } diff --git a/src/core/cpu_recompiler_code_generator_aarch64.cpp b/src/core/cpu_recompiler_code_generator_aarch64.cpp index a6e7d35c..df581606 100644 --- a/src/core/cpu_recompiler_code_generator_aarch64.cpp +++ b/src/core/cpu_recompiler_code_generator_aarch64.cpp @@ -1710,8 +1710,6 @@ void CodeGenerator::EmitUpdateFastmemBase() bool CodeGenerator::BackpatchLoadStore(const LoadStoreBackpatchInfo& lbi) { - Log_DevPrintf("Backpatching %p (guest PC 0x%08X) to slowmem at %p", lbi.host_pc, lbi.guest_pc, lbi.host_slowmem_pc); - // check jump distance const s64 jump_distance = static_cast(reinterpret_cast(lbi.host_slowmem_pc) - reinterpret_cast(lbi.host_pc)); @@ -1734,8 +1732,6 @@ bool CodeGenerator::BackpatchLoadStore(const LoadStoreBackpatchInfo& lbi) void CodeGenerator::BackpatchReturn(void* pc, u32 pc_size) { - Log_ProfilePrintf("Backpatching %p to return", pc); - vixl::aarch64::MacroAssembler emit(static_cast(pc), pc_size, a64::PositionDependentCode); emit.ret(); @@ -1749,8 +1745,6 @@ void CodeGenerator::BackpatchReturn(void* pc, u32 pc_size) void CodeGenerator::BackpatchBranch(void* pc, u32 pc_size, void* target) { - Log_ProfilePrintf("Backpatching %p to %p [branch]", pc, target); - // check jump distance const s64 jump_distance = static_cast(reinterpret_cast(target) - reinterpret_cast(pc)); Assert(Common::IsAligned(jump_distance, 4)); @@ -2309,7 +2303,6 @@ CodeCache::DispatcherFunction CodeGenerator::CompileDispatcher() CodeBlock::HostCodePointer ptr; u32 code_size; FinalizeBlock(&ptr, &code_size); - Log_DevPrintf("Dispatcher is %u bytes at %p", code_size, ptr); return reinterpret_cast(ptr); } @@ -2331,7 +2324,6 @@ CodeCache::SingleBlockDispatcherFunction CodeGenerator::CompileSingleBlockDispat CodeBlock::HostCodePointer ptr; u32 code_size; FinalizeBlock(&ptr, &code_size); - Log_DevPrintf("Dispatcher is %u bytes at %p", code_size, ptr); return reinterpret_cast(ptr); } diff --git a/src/core/cpu_recompiler_code_generator_generic.cpp b/src/core/cpu_recompiler_code_generator_generic.cpp index 3feae598..4a9b57d2 100644 --- a/src/core/cpu_recompiler_code_generator_generic.cpp +++ b/src/core/cpu_recompiler_code_generator_generic.cpp @@ -61,19 +61,6 @@ Value CodeGenerator::EmitLoadGuestMemory(const CodeBlockInstruction& cbi, const const bool use_fastmem = (address_spec ? Bus::CanUseFastmemForAddress(*address_spec) : true) && !SpeculativeIsCacheIsolated(); - if (address_spec) - { - if (!use_fastmem) - { - Log_ProfilePrintf("Non-constant load at 0x%08X, speculative address 0x%08X, using fastmem = %s", cbi.pc, - *address_spec, use_fastmem ? "yes" : "no"); - } - } - else - { - Log_ProfilePrintf("Non-constant load at 0x%08X, speculative address UNKNOWN, using fastmem = %s", cbi.pc, - use_fastmem ? "yes" : "no"); - } if (g_settings.IsUsingFastmem() && use_fastmem && g_settings.cpu_fastmem_rewrite) { @@ -133,19 +120,6 @@ void CodeGenerator::EmitStoreGuestMemory(const CodeBlockInstruction& cbi, const const bool use_fastmem = (address_spec ? Bus::CanUseFastmemForAddress(*address_spec) : true) && !SpeculativeIsCacheIsolated(); - if (address_spec) - { - if (!use_fastmem) - { - Log_ProfilePrintf("Non-constant store at 0x%08X, speculative address 0x%08X, using fastmem = %s", cbi.pc, - *address_spec, use_fastmem ? "yes" : "no"); - } - } - else - { - Log_ProfilePrintf("Non-constant store at 0x%08X, speculative address UNKNOWN, using fastmem = %s", cbi.pc, - use_fastmem ? "yes" : "no"); - } if (g_settings.IsUsingFastmem() && use_fastmem && g_settings.cpu_fastmem_rewrite) { diff --git a/src/core/cpu_recompiler_code_generator_x64.cpp b/src/core/cpu_recompiler_code_generator_x64.cpp index 9940e1dc..18d1a4c6 100644 --- a/src/core/cpu_recompiler_code_generator_x64.cpp +++ b/src/core/cpu_recompiler_code_generator_x64.cpp @@ -2296,8 +2296,6 @@ void CodeGenerator::EmitUpdateFastmemBase() bool CodeGenerator::BackpatchLoadStore(const LoadStoreBackpatchInfo& lbi) { - Log_ProfilePrintf("Backpatching %p (guest PC 0x%08X) to slowmem", lbi.host_pc, lbi.guest_pc); - // turn it into a jump to the slowmem handler Xbyak::CodeGenerator cg(lbi.host_code_size, lbi.host_pc); cg.jmp(lbi.host_slowmem_pc); @@ -2314,8 +2312,6 @@ bool CodeGenerator::BackpatchLoadStore(const LoadStoreBackpatchInfo& lbi) void CodeGenerator::BackpatchReturn(void* pc, u32 pc_size) { - Log_ProfilePrintf("Backpatching %p to return", pc); - Xbyak::CodeGenerator cg(pc_size, pc); cg.ret(); @@ -2330,8 +2326,6 @@ void CodeGenerator::BackpatchReturn(void* pc, u32 pc_size) void CodeGenerator::BackpatchBranch(void* pc, u32 pc_size, void* target) { - Log_ProfilePrintf("Backpatching %p to %p [branch]", pc, target); - Xbyak::CodeGenerator cg(pc_size, pc); cg.jmp(target); @@ -3038,7 +3032,6 @@ CodeCache::DispatcherFunction CodeGenerator::CompileDispatcher() CodeBlock::HostCodePointer ptr; u32 code_size; FinalizeBlock(&ptr, &code_size); - Log_DevPrintf("Dispatcher is %u bytes at %p", code_size, ptr); return ptr; } @@ -3058,7 +3051,6 @@ CodeCache::SingleBlockDispatcherFunction CodeGenerator::CompileSingleBlockDispat CodeBlock::HostCodePointer ptr; u32 code_size; FinalizeBlock(&ptr, &code_size); - Log_DevPrintf("Single block dispatcher is %u bytes at %p", code_size, ptr); return reinterpret_cast(ptr); } diff --git a/src/core/cpu_recompiler_register_cache.cpp b/src/core/cpu_recompiler_register_cache.cpp index 99edd9b3..7b35917b 100644 --- a/src/core/cpu_recompiler_register_cache.cpp +++ b/src/core/cpu_recompiler_register_cache.cpp @@ -603,7 +603,6 @@ Value RegisterCache::WriteGuestRegister(Reg guest_reg, Value&& value) // cancel any load delay delay if (m_state.load_delay_register == guest_reg) { - Log_DebugPrintf("Cancelling load delay of register %s because of non-delayed write", GetRegName(guest_reg)); m_state.load_delay_register = Reg::count; m_state.load_delay_value.ReleaseAndClear(); } @@ -658,7 +657,6 @@ void RegisterCache::WriteGuestRegisterDelayed(Reg guest_reg, Value&& value) // two load delays in a row? cancel the first one. if (guest_reg == m_state.load_delay_register) { - Log_DebugPrintf("Cancelling load delay of register %s due to new load delay", GetRegName(guest_reg)); m_state.load_delay_register = Reg::count; m_state.load_delay_value.ReleaseAndClear(); } @@ -710,7 +708,6 @@ void RegisterCache::WriteLoadDelayToCPU(bool clear) Assert(m_state.next_load_delay_register == Reg::count); if (m_state.load_delay_register != Reg::count) { - Log_DebugPrintf("Flushing pending load delay of %s", GetRegName(m_state.load_delay_register)); m_code_generator.EmitStoreInterpreterLoadDelay(m_state.load_delay_register, m_state.load_delay_value); if (clear) { @@ -764,7 +761,6 @@ void RegisterCache::InvalidateGuestRegister(Reg guest_reg) ClearRegisterFromOrder(guest_reg); } - Log_DebugPrintf("Invalidating guest register %s", GetRegName(guest_reg)); cache_value.Clear(); } @@ -806,7 +802,6 @@ bool RegisterCache::EvictOneGuestRegister() // evict the register used the longest time ago Reg evict_reg = m_state.guest_reg_order[m_state.guest_reg_order_count - 1]; - Log_ProfilePrintf("Evicting guest register %s", GetRegName(evict_reg)); FlushGuestRegister(evict_reg, true, true); return HasFreeHostRegister(); diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index 375b731b..4eddc496 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -828,8 +828,6 @@ void GPU_HW_OpenGL::SetScissorFromDrawingArea() const int height = bottom - top; const int x = left; const int y = m_vram_texture.GetHeight() - bottom; - - Log_DebugPrintf("SetScissor: (%d-%d, %d-%d)", x, x + width, y, y + height); glScissor(x, y, width, height); } diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 3458987c..475ce3e6 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -218,7 +218,6 @@ std::optional> HostInterface::FindBIOSImageInDirectory(ConsoleRe continue; BIOS::Hash found_hash = BIOS::GetHash(*found_image); - Log_DevPrintf("Hash for BIOS '%s': %s", fd.FileName.c_str(), found_hash.ToString().c_str()); const BIOS::ImageInfo* ii = BIOS::GetImageInfoForHash(found_hash); diff --git a/src/core/host_interface_progress_callback.cpp b/src/core/host_interface_progress_callback.cpp index 897899d0..bacbb201 100644 --- a/src/core/host_interface_progress_callback.cpp +++ b/src/core/host_interface_progress_callback.cpp @@ -67,7 +67,7 @@ void HostInterfaceProgressCallback::DisplayWarning(const char* message) { Log_Wa void HostInterfaceProgressCallback::DisplayInformation(const char* message) { Log_InfoPrint(message); } -void HostInterfaceProgressCallback::DisplayDebugMessage(const char* message) { Log_DevPrint(message); } +void HostInterfaceProgressCallback::DisplayDebugMessage(const char* message) { } void HostInterfaceProgressCallback::ModalError(const char* message) { diff --git a/src/core/memory_card.cpp b/src/core/memory_card.cpp index 8d92f050..24e51304 100644 --- a/src/core/memory_card.cpp +++ b/src/core/memory_card.cpp @@ -127,14 +127,9 @@ bool MemoryCard::Transfer(const u8 data_in, u8* data_out) { const u8 bits = m_data[ZeroExtend32(m_address) * MemoryCardImage::FRAME_SIZE + m_sector_offset]; if (m_sector_offset == 0) - { - Log_DevPrintf("Reading memory card sector %u", ZeroExtend32(m_address)); m_checksum = Truncate8(m_address >> 8) ^ Truncate8(m_address) ^ bits; - } else - { m_checksum ^= bits; - } *data_out = bits; ack = true; diff --git a/src/core/system.cpp b/src/core/system.cpp index 4e243a36..acfbb513 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -378,7 +378,6 @@ bool ReadExecutableFromImage(ISOReader& iso, std::string* out_executable_name, s bool result = false; std::string executable_path(GetExecutableNameForImage(iso, false)); - Log_DevPrintf("Executable path: '%s'", executable_path.c_str()); if (!executable_path.empty()) { result = iso.ReadFile(executable_path.c_str(), out_executable_data); diff --git a/src/libretro/libretro_opengl_host_display.cpp b/src/libretro/libretro_opengl_host_display.cpp index acb6629d..2aa644ed 100644 --- a/src/libretro/libretro_opengl_host_display.cpp +++ b/src/libretro/libretro_opengl_host_display.cpp @@ -209,7 +209,6 @@ static void APIENTRY GLDebugCallback(GLenum source, GLenum type, GLuint id, GLen Log_InfoPrint(message); break; case GL_DEBUG_SEVERITY_NOTIFICATION: - // Log_DebugPrint(message); break; } }