mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-07 14:19:19 +00:00
sceKernelPrintf improvement, QOL adjustments
This commit is contained in:
parent
cf1d8ec4bc
commit
5bf22c15d0
@ -19,6 +19,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include "Common/Thread/ParallelLoop.h"
|
#include "Common/Thread/ParallelLoop.h"
|
||||||
#include "Core/CoreTiming.h"
|
#include "Core/CoreTiming.h"
|
||||||
@ -1100,6 +1101,8 @@ static int sceKernelPrintf(const char *formatString)
|
|||||||
char tempStr[24];
|
char tempStr[24];
|
||||||
char tempFormat[24] = {'%'};
|
char tempFormat[24] = {'%'};
|
||||||
std::string result, format = formatString;
|
std::string result, format = formatString;
|
||||||
|
std::stringstream stream;
|
||||||
|
float f_arg;
|
||||||
|
|
||||||
// Each printf is a separate line already in the log, so don't double space.
|
// Each printf is a separate line already in the log, so don't double space.
|
||||||
// This does mean we break up strings, unfortunately.
|
// This does mean we break up strings, unfortunately.
|
||||||
@ -1172,6 +1175,18 @@ static int sceKernelPrintf(const char *formatString)
|
|||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'f':
|
||||||
|
static_assert(sizeof(float) == 4, "sizeof(float) != sizeof(u32)!");
|
||||||
|
|
||||||
|
// Maybe worth replacing with std::bit_cast when (if) we move to C++20
|
||||||
|
std::memcpy(&f_arg, &PARAM(param++), sizeof(u32));
|
||||||
|
stream << f_arg;
|
||||||
|
result += stream.str();
|
||||||
|
|
||||||
|
++i;
|
||||||
|
stream.str(std::string()); // Reset the stream
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
supported = false;
|
supported = false;
|
||||||
break;
|
break;
|
||||||
|
@ -584,7 +584,8 @@ void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) {
|
|||||||
auto memLock = Memory::Lock();
|
auto memLock = Memory::Lock();
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
stream << (Memory::IsValidAddress(curAddress_) ? Memory::Read_Float(curAddress_) : NAN);
|
stream << (Memory::IsValidAddress(curAddress_) ? Memory::Read_Float(curAddress_) : NAN);
|
||||||
W32Util::CopyTextToClipboard(wnd, stream.str().c_str());
|
auto temp_string = stream.str();
|
||||||
|
W32Util::CopyTextToClipboard(wnd, temp_string.c_str());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -776,7 +776,7 @@ namespace MainWindow {
|
|||||||
|
|
||||||
case ID_DEBUG_MEMORYBASE:
|
case ID_DEBUG_MEMORYBASE:
|
||||||
{
|
{
|
||||||
W32Util::CopyTextToClipboard(hWnd, ConvertUTF8ToWString(StringFromFormat("%016llx", (uintptr_t)Memory::base)));
|
W32Util::CopyTextToClipboard(hWnd, ConvertUTF8ToWString(StringFromFormat("%016llx", (uint64_t)(uintptr_t)Memory::base)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -555,7 +555,7 @@ BEGIN
|
|||||||
MENUITEM "GE Debugger...", ID_DEBUG_GEDEBUGGER
|
MENUITEM "GE Debugger...", ID_DEBUG_GEDEBUGGER
|
||||||
MENUITEM "Extract File...", ID_DEBUG_EXTRACTFILE
|
MENUITEM "Extract File...", ID_DEBUG_EXTRACTFILE
|
||||||
MENUITEM "Log Console", ID_DEBUG_LOG
|
MENUITEM "Log Console", ID_DEBUG_LOG
|
||||||
MENUITEM "Copy PSP memory base pointer", ID_DEBUG_MEMORYBASE
|
MENUITEM "Copy PSP memory base address", ID_DEBUG_MEMORYBASE
|
||||||
MENUITEM "Memory View...", ID_DEBUG_MEMORYVIEW
|
MENUITEM "Memory View...", ID_DEBUG_MEMORYVIEW
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -715,10 +715,11 @@ BEGIN
|
|||||||
MENUITEM "Go to Extent Begin", ID_MEMVIEW_EXTENTBEGIN
|
MENUITEM "Go to Extent Begin", ID_MEMVIEW_EXTENTBEGIN
|
||||||
MENUITEM "Go to Extent End", ID_MEMVIEW_EXTENTEND
|
MENUITEM "Go to Extent End", ID_MEMVIEW_EXTENTEND
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
|
MENUITEM "Copy Float (32 bit)", ID_MEMVIEW_COPYFLOAT_32
|
||||||
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Copy Value (8 bit)", ID_MEMVIEW_COPYVALUE_8
|
MENUITEM "Copy Value (8 bit)", ID_MEMVIEW_COPYVALUE_8
|
||||||
MENUITEM "Copy Value (16 bit)", ID_MEMVIEW_COPYVALUE_16
|
MENUITEM "Copy Value (16 bit)", ID_MEMVIEW_COPYVALUE_16
|
||||||
MENUITEM "Copy Value (32 bit)", ID_MEMVIEW_COPYVALUE_32
|
MENUITEM "Copy Value (32 bit)", ID_MEMVIEW_COPYVALUE_32
|
||||||
MENUITEM "Copy Float (32 bit)", ID_MEMVIEW_COPYFLOAT_32
|
|
||||||
MENUITEM "Dump...", ID_MEMVIEW_DUMP
|
MENUITEM "Dump...", ID_MEMVIEW_DUMP
|
||||||
END
|
END
|
||||||
POPUP "disasm"
|
POPUP "disasm"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user