Added Goto command for Hex Editor.
This commit is contained in:
parent
4278ff2b27
commit
b7fc64fe7e
|
@ -1,3 +1,4 @@
|
|||
04-may-2010 - ugetab - Win32 - Added "Goto" command for hex editor.
|
||||
28-april-2010 - ugetab - Added microphone support option. When enabled, Port 2 Start activates the Microphone. Movies also support this.
|
||||
25-april-2010 - FatRatKnight - Fixed a potential desync that plays out an extra frame without an update to the frame count involving heavy lua use, joypad.get, and a loadstate.
|
||||
23-april-2010 - ugetab - Win32 - Added Tools>GUI option to partially disable visual themes, so the emulator can be made to look like it did in 2.1.1 and earlier releases.
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "main.h"
|
||||
#include "string.h"
|
||||
#include "help.h"
|
||||
#include "Win32InputBox.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -223,6 +224,28 @@ void UndoLastPatch(){
|
|||
return;
|
||||
}
|
||||
|
||||
void GotoAddress(HWND hwnd) {
|
||||
char* gotoaddressstring;
|
||||
int gotoaddress;
|
||||
char* gototitle;
|
||||
|
||||
gototitle = (char*)malloc(18);
|
||||
gotoaddressstring = (char*)malloc(8);
|
||||
gotoaddressstring[0] = '\0';
|
||||
sprintf(gototitle, "%s%X%s", "Goto (0-", MaxSize-1, ")");
|
||||
if(CWin32InputBox::InputBox(gototitle, "Goto which address:", gotoaddressstring, 8, false, hwnd) == IDOK)
|
||||
{
|
||||
if(EOF != sscanf(gotoaddressstring, "%x", &gotoaddress))
|
||||
{
|
||||
if (gotoaddress > (MaxSize-1))
|
||||
gotoaddress = (MaxSize-1);
|
||||
CursorStartAddy = gotoaddress;
|
||||
CursorEndAddy = -1;
|
||||
ChangeMemViewFocus(EditingMode,CursorStartAddy,-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void FlushUndoBuffer(){
|
||||
struct UNDOSTRUCT *tmp;
|
||||
while(undo_list!= 0){
|
||||
|
@ -1061,7 +1084,11 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
MemViewCallB(hMemView,WM_COMMAND,MENU_MV_EDIT_PASTE,0);
|
||||
return 0;
|
||||
case 0x5a: //Ctrl+Z
|
||||
UndoLastPatch();
|
||||
UndoLastPatch(); break;
|
||||
case 0x41: //Ctrl+A
|
||||
// Fall through to Ctrl+G
|
||||
case 0x47: //Ctrl+G
|
||||
GotoAddress(hwnd); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1479,6 +1506,10 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
KillMemView();
|
||||
return 0;
|
||||
|
||||
case MENU_MV_FILE_GOTO_ADDRESS:
|
||||
GotoAddress(hwnd);
|
||||
return 0;
|
||||
|
||||
case MENU_MV_EDIT_UNDO:
|
||||
UndoLastPatch();
|
||||
return 0;
|
||||
|
|
|
@ -261,6 +261,7 @@ BEGIN
|
|||
MENUITEM "&Ram", MENU_MV_FILE_DUMP_RAM
|
||||
MENUITEM "&PPU Memory", MENU_MV_FILE_DUMP_PPU
|
||||
END
|
||||
MENUITEM "&Goto Address\tCtrl+A", MENU_MV_FILE_GOTO_ADDRESS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Close\tAlt+F4", ID_MEMWVIEW_FILE_CLOSE
|
||||
END
|
||||
|
|
|
@ -618,6 +618,7 @@
|
|||
#define ID_FILE_CLOSECTRL40216 40216
|
||||
#define ID_MEMWVIEW_FILE_CLOSE 40217
|
||||
#define ID_FILE_CLOSE40218 40218
|
||||
#define MENU_MV_FILE_GOTO_ADDRESS 40219
|
||||
#define MENU_BASIC_BOT2 40220
|
||||
#define ID_FILE_OPENLUAWINDOW 40229
|
||||
#define ID_FILE_CLOSELUAWINDOWS 40230
|
||||
|
|
Loading…
Reference in New Issue