Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new option "Copy Float (32 bit)" to Windows Debugger UI #17203

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Windows/Debugger/CtrlMemView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <tchar.h>
#include <math.h>
#include <iomanip>
#include <sstream>
#include "ext/xxhash.h"
#include "Core/Config.h"
#include "Core/MemMap.h"
Expand Down Expand Up @@ -496,6 +497,7 @@ void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) {
HMENU menu = GetContextMenu(ContextMenuID::MEMVIEW);
EnableMenuItem(menu, ID_MEMVIEW_COPYVALUE_16, enable16 ? MF_ENABLED : MF_GRAYED);
EnableMenuItem(menu, ID_MEMVIEW_COPYVALUE_32, enable32 ? MF_ENABLED : MF_GRAYED);
EnableMenuItem(menu, ID_MEMVIEW_COPYFLOAT_32, enable32 ? MF_ENABLED : MF_GRAYED);

switch (TriggerContextMenu(ContextMenuID::MEMVIEW, wnd, ContextPoint::FromEvent(lParam))) {
case ID_MEMVIEW_DUMP:
Expand Down Expand Up @@ -577,6 +579,15 @@ void CtrlMemView::onMouseUp(WPARAM wParam, LPARAM lParam, int button) {
}
break;

case ID_MEMVIEW_COPYFLOAT_32:
{
auto memLock = Memory::Lock();
std::ostringstream stream;
stream << (Memory::IsValidAddress(curAddress_) ? Memory::Read_Float(curAddress_) : NAN);
W32Util::CopyTextToClipboard(wnd, stream.str().c_str());
}
break;

case ID_MEMVIEW_EXTENTBEGIN:
{
std::vector<MemBlockInfo> memRangeInfo = FindMemInfoByFlag(highlightFlags_, curAddress_, 1);
Expand Down
1 change: 1 addition & 0 deletions Windows/ppsspp.rc
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ BEGIN
MENUITEM "Copy Value (8 bit)", ID_MEMVIEW_COPYVALUE_8
MENUITEM "Copy Value (16 bit)", ID_MEMVIEW_COPYVALUE_16
MENUITEM "Copy Value (32 bit)", ID_MEMVIEW_COPYVALUE_32
MENUITEM "Copy Float (32 bit)", ID_MEMVIEW_COPYFLOAT_32
MENUITEM "Dump...", ID_MEMVIEW_DUMP
END
POPUP "disasm"
Expand Down
1 change: 1 addition & 0 deletions Windows/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
#define ID_OPTIONS_LANGUAGE 40141
#define ID_MEMVIEW_COPYVALUE_16 40142
#define ID_MEMVIEW_COPYVALUE_32 40143
#define ID_MEMVIEW_COPYFLOAT_32 40229
#define ID_EMULATION_SWITCH_UMD 40144
#define ID_DEBUG_EXTRACTFILE 40145
#define ID_OPTIONS_IGNOREWINKEY 40146
Expand Down