Skip to content

Commit

Permalink
MemoryView: split base address / current address; context menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
nzeemin committed Mar 4, 2021
1 parent 39bbff5 commit 1de6ada
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 251 deletions.
8 changes: 4 additions & 4 deletions emulator/DisasmView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ LRESULT CALLBACK DisasmViewViewerWndProc(HWND hWnd, UINT message, WPARAM wParam,
::InvalidateRect(hWnd, NULL, TRUE);
break;
case WM_COMMAND:
if (wParam == ID_DISASM_COPY_ADDRESS || wParam == ID_DISASM_COPY_VALUE)
if (wParam == ID_DEBUG_COPY_ADDRESS || wParam == ID_DEBUG_COPY_VALUE)
DisasmView_CopyToClipboard(wParam);
else
return DefWindowProc(hWnd, message, wParam, lParam);
Expand Down Expand Up @@ -297,8 +297,8 @@ void DisasmView_OnRButtonDown(WPARAM /*wParam*/, int mousex, int mousey)
::SetFocus(m_hwndDisasmViewer);

HMENU hMenu = ::CreatePopupMenu();
::AppendMenu(hMenu, 0, ID_DISASM_COPY_ADDRESS, _T("Copy Address"));
::AppendMenu(hMenu, 0, ID_DISASM_COPY_VALUE, _T("Copy Value"));
::AppendMenu(hMenu, 0, ID_DEBUG_COPY_ADDRESS, _T("Copy Address"));
::AppendMenu(hMenu, 0, ID_DEBUG_COPY_VALUE, _T("Copy Value"));

POINT pt = { mousex, mousey };
::ClientToScreen(m_hwndDisasmViewer, &pt);
Expand All @@ -317,7 +317,7 @@ void DisasmView_CopyToClipboard(WPARAM command)
return;

WORD value;
if (command == ID_DISASM_COPY_ADDRESS)
if (command == ID_DEBUG_COPY_ADDRESS)
value = pLineItem->address;
else
value = pLineItem->value;
Expand Down
2 changes: 2 additions & 0 deletions emulator/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ void Settings_SetDebugMemoryMode(WORD mode);
WORD Settings_GetDebugMemoryMode();
void Settings_SetDebugMemoryAddress(WORD address);
WORD Settings_GetDebugMemoryAddress();
void Settings_SetDebugMemoryBase(WORD address);
WORD Settings_GetDebugMemoryBase();
BOOL Settings_GetDebugMemoryByte();
void Settings_SetDebugMemoryByte(BOOL flag);
void Settings_SetAutostart(BOOL flag);
Expand Down
4 changes: 2 additions & 2 deletions emulator/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ void MainWindow_DoFileScreenshotToClipboard()
HGLOBAL hDIB = ScreenView_GetScreenshotAsDIB(screenshotMode);
if (hDIB != NULL)
{
::OpenClipboard(0);
::OpenClipboard(g_hwnd);
::EmptyClipboard();
::SetClipboardData(CF_DIB, hDIB);
::CloseClipboard();
Expand Down Expand Up @@ -1438,7 +1438,7 @@ void MainWindow_DoFileScreenToClipboard()
GlobalUnlock(hMem);

// Put text to Clipboard
OpenClipboard(0);
OpenClipboard(g_hwnd);
EmptyClipboard();
SetClipboardData(CF_UNICODETEXT, hMem);
CloseClipboard();
Expand Down
Loading

0 comments on commit 1de6ada

Please sign in to comment.