From 76d9209ad4cbcccd076646c33be414abe07e01a7 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 14 Dec 2010 23:19:34 +0000 Subject: [PATCH] When the gfx debugger is saving shaders make sure the directory exists. Make sure the gfx debugger unpauses when the emulator is stopped. When a wad is installed make sure directories exist. For the cmake build if a header is not provided in the check_lib macro don't check for it, and assume pkg-config was supposed to work. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6581 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeTests/CheckLib.cmake | 6 +++++- Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp | 1 + Source/Core/Core/Src/HW/SI_Device.cpp | 4 ++-- Source/Core/Core/Src/HW/SI_DeviceGBA.cpp | 3 ++- Source/Core/VideoCommon/Src/Debugger.cpp | 4 ++-- Source/Core/VideoUICommon/CMakeLists.txt | 2 +- Source/Core/VideoUICommon/Src/DebuggerPanel.cpp | 9 ++++----- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CMakeTests/CheckLib.cmake b/CMakeTests/CheckLib.cmake index d77ceadeb8..c1174ecb58 100644 --- a/CMakeTests/CheckLib.cmake +++ b/CMakeTests/CheckLib.cmake @@ -34,7 +34,11 @@ macro(check_lib var lib) _internal_message("${lib} found") else() find_library(${var} ${lib}) - find_path(${var}_INCLUDE ${_arg_list}) + if(_arg_list) + find_path(${var}_INCLUDE ${_arg_list}) + else() + set(${var}_INCLUDE FALSE) + endif() if(${var} AND ${var}_INCLUDE) include_directories(${${var}_INCLUDE}) _internal_message("${lib} found") diff --git a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp index 32153108a4..9228eff03b 100644 --- a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp +++ b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp @@ -132,6 +132,7 @@ bool CBoot::Install_WiiWAD(const char* _pFilename) if (!File::Exists(APPFileName)) { + File::CreateFullPath(APPFileName); FILE* pAPPFile = fopen(APPFileName, "wb"); if (pAPPFile == NULL) { diff --git a/Source/Core/Core/Src/HW/SI_Device.cpp b/Source/Core/Core/Src/HW/SI_Device.cpp index 100e78c3e3..c1a65ebcb8 100644 --- a/Source/Core/Core/Src/HW/SI_Device.cpp +++ b/Source/Core/Core/Src/HW/SI_Device.cpp @@ -38,11 +38,11 @@ int ISIDevice::RunBuffer(u8* _pBuffer, int _iLength) if ((num % 8) == 0) { - DEBUG_LOG(SERIALINTERFACE, szTemp); + DEBUG_LOG(SERIALINTERFACE, "%s", szTemp); szTemp[0] = '\0'; } } - DEBUG_LOG(SERIALINTERFACE, szTemp); + DEBUG_LOG(SERIALINTERFACE, "%s", szTemp); #endif return 0; }; diff --git a/Source/Core/Core/Src/HW/SI_DeviceGBA.cpp b/Source/Core/Core/Src/HW/SI_DeviceGBA.cpp index 160827612d..7df516d8a2 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceGBA.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceGBA.cpp @@ -134,7 +134,8 @@ void GBASockServer::Transfer(char* si_buffer) else if (cmd == CMD_WRITE) num_expecting = 1; if (num_received != num_expecting) - ERROR_LOG(SERIALINTERFACE, "%x:%x:%x", (u8)cmd, num_received, num_expecting); + ERROR_LOG(SERIALINTERFACE, "%x:%x:%x", (u8)cmd, + (unsigned int)num_received, (unsigned int)num_expecting); #endif si_buffer[0] = current_data[3]; diff --git a/Source/Core/VideoCommon/Src/Debugger.cpp b/Source/Core/VideoCommon/Src/Debugger.cpp index 6ed390c84f..0b8e487307 100644 --- a/Source/Core/VideoCommon/Src/Debugger.cpp +++ b/Source/Core/VideoCommon/Src/Debugger.cpp @@ -94,7 +94,7 @@ void ContinueGFXDebugger() void GFXDebuggerBase::DumpPixelShader(const char* path) { char filename[MAX_PATH]; - sprintf(filename, "%s/dump_ps.txt", path); + sprintf(filename, "%sdump_ps.txt", path); std::string output; bool useDstAlpha = bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; @@ -126,7 +126,7 @@ void GFXDebuggerBase::DumpPixelShader(const char* path) void GFXDebuggerBase::DumpVertexShader(const char* path) { char filename[MAX_PATH]; - sprintf(filename, "%s/dump_vs_consts.txt", path); + sprintf(filename, "%sdump_vs_consts.txt", path); File::CreateEmptyFile(filename); File::WriteStringToFile(true, GenerateVertexShaderCode(g_nativeVertexFmt->m_components, g_ActiveConfig.backend_info.APIType), filename); diff --git a/Source/Core/VideoUICommon/CMakeLists.txt b/Source/Core/VideoUICommon/CMakeLists.txt index ce45dcdeae..164438fb0f 100644 --- a/Source/Core/VideoUICommon/CMakeLists.txt +++ b/Source/Core/VideoUICommon/CMakeLists.txt @@ -1,5 +1,5 @@ set(SRCS Src/VideoConfigDiag.cpp - Src/DebuggerPanel.cpp) + Src/DebuggerPanel.cpp) add_library(videouicommon STATIC ${SRCS}) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") diff --git a/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp b/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp index 887f5a98ac..4271a6f901 100644 --- a/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp +++ b/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp @@ -54,7 +54,7 @@ GFXDebuggerPanel::GFXDebuggerPanel(wxWindow *parent, wxWindowID id, const wxPoin GFXDebuggerPanel::~GFXDebuggerPanel() { - SaveSettings(); + GFXDebuggerPauseFlag = false; } void GFXDebuggerPanel::OnClose(wxCloseEvent& event) @@ -249,10 +249,9 @@ void GFXDebuggerPanel::OnPauseAtNextFrameButton(wxCommandEvent& event) void GFXDebuggerPanel::OnDumpButton(wxCommandEvent& event) { char dump_path[MAX_PATH]; - sprintf(dump_path, "%sDebug/%s", File::GetUserPath(D_DUMP_IDX), globals->unique_id); - if (!File::Exists(dump_path) || !File::IsDirectory(dump_path)) - if (!File::CreateDir(dump_path)) - return; + sprintf(dump_path, "%sDebug/%s/", File::GetUserPath(D_DUMP_IDX), globals->unique_id); + if (!File::CreateFullPath(dump_path)) + return; switch (m_pDumpList->GetSelection()) {