* improved FPS display, added a hotkey to toggle it
* Debugger: single click on any address copies this address to the "Seek To" field and "Bookmark Add" field * Debugger: "Name" button in Bookmarks, total revamp of Bookmarks * updated docs [[Split portion of a mixed commit.]]
This commit is contained in:
parent
caac39d4d0
commit
84bb3a8d1d
|
@ -1,8 +1,10 @@
|
||||||
|
26-Sep-2012 - AnS - Debugger: "Name" button in Bookmarks, total revamp of Bookmarks
|
||||||
|
26-Sep-2012 - AnS - Debugger: single click on any address copies this address to the "Seek To" field and "Bookmark Add" field
|
||||||
26-Sep-2012 - AnS - Fixed replay engine bug that doubles the last input of the movie
|
26-Sep-2012 - AnS - Fixed replay engine bug that doubles the last input of the movie
|
||||||
26-Sep-2012 - AnS - Tracer: RTS instructions output caller address/name
|
26-Sep-2012 - AnS - Tracer: RTS instructions output caller address/name
|
||||||
23-Sep-2012 - AnS - Lua: clear previous frame drawings at the beginning of every frame
|
23-Sep-2012 - AnS - Lua: clear previous frame drawings at the beginning of every frame
|
||||||
23-Sep-2012 - AnS - Debugger: fixed mouseover when using Symbolic debugging; mouseover works for the disassembly window too
|
23-Sep-2012 - AnS - Debugger: fixed mouseover when using Symbolic debug; mouseover works for the disassembly window too
|
||||||
22-Sep-2012 - AnS - Tracer: added "Symbolic tracing", "Log current Frame number", "Log emulator messages", "Log breakpoint hits" options
|
22-Sep-2012 - AnS - Tracer: added "Symbolic trace", "Log current Frame number", "Log emulator messages", "Log breakpoint hits" options
|
||||||
11-Sep-2012 - AnS - new Lua function: emu.setlagflag()
|
11-Sep-2012 - AnS - new Lua function: emu.setlagflag()
|
||||||
11-Sep-2012 - AnS - Debugger: deleting a breakpoint leaves selection in the Breakpoints list
|
11-Sep-2012 - AnS - Debugger: deleting a breakpoint leaves selection in the Breakpoints list
|
||||||
06-Sep-2012 - AnS - added "Use Custom Palette" checkbox to Palette config
|
06-Sep-2012 - AnS - added "Use Custom Palette" checkbox to Palette config
|
||||||
|
|
|
@ -885,23 +885,11 @@ void EditBreakList() {
|
||||||
SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_SETCURSEL,WP_edit,0);
|
SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_SETCURSEL,WP_edit,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FillBreakList(HWND hwndDlg) {
|
void FillBreakList(HWND hwndDlg)
|
||||||
int i;
|
{
|
||||||
|
|
||||||
for (i = 0; i < numWPs; i++) {
|
|
||||||
SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_DELETESTRING,i,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < numWPs; i++) {
|
|
||||||
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,LB_INSERTSTRING,-1,(LPARAM)(LPSTR)BreakToText(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClearBreakList(HWND hwndDlg) {
|
|
||||||
|
|
||||||
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,LB_RESETCONTENT,0,0);
|
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,LB_RESETCONTENT,0,0);
|
||||||
|
for (int i = 0; i < numWPs; i++)
|
||||||
numWPs = 0;
|
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,LB_INSERTSTRING,-1,(LPARAM)(LPSTR)BreakToText(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnableBreak(int sel)
|
void EnableBreak(int sel)
|
||||||
|
@ -1232,38 +1220,13 @@ BOOL CALLBACK DebuggerEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadGameDebuggerData(HWND hwndDlg = hDebug) {
|
void LoadGameDebuggerData(HWND hwndDlg = hDebug)
|
||||||
|
{
|
||||||
extern int loadDebugDataFailed;
|
|
||||||
|
|
||||||
if (!hwndDlg)
|
if (!hwndDlg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!loadDebugDataFailed)
|
|
||||||
{
|
|
||||||
ClearDebuggerBookmarkListbox(hwndDlg);
|
|
||||||
if (bookmarks)
|
|
||||||
{
|
|
||||||
|
|
||||||
unsigned int i;
|
|
||||||
for (i=0;i<bookmarks;i++)
|
|
||||||
{
|
|
||||||
char buffer[5];
|
|
||||||
sprintf(buffer, "%X", bookmarkData[i]);
|
|
||||||
AddDebuggerBookmark2(hwndDlg, buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ClearBreakList(hwndDlg);
|
|
||||||
|
|
||||||
numWPs = myNumWPs;
|
numWPs = myNumWPs;
|
||||||
|
FillDebuggerBookmarkListbox(hwndDlg);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bookmarks = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
FillBreakList(hwndDlg);
|
FillBreakList(hwndDlg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1273,17 +1236,15 @@ BOOL CALLBACK IDC_DEBUGGER_DISASSEMBLY_WndProc(HWND hwndDlg, UINT uMsg, WPARAM w
|
||||||
{
|
{
|
||||||
case WM_LBUTTONDBLCLK:
|
case WM_LBUTTONDBLCLK:
|
||||||
{
|
{
|
||||||
// set the selection cursor
|
|
||||||
CallWindowProc(IDC_DEBUGGER_DISASSEMBLY_oldWndProc, hwndDlg, WM_LBUTTONDOWN, wParam, lParam);
|
|
||||||
// debug_str contains the text in the disassembly window
|
// debug_str contains the text in the disassembly window
|
||||||
int sel_start, sel_end;
|
int sel_start, sel_end;
|
||||||
SendDlgItemMessage(hDebug, IDC_DEBUGGER_DISASSEMBLY, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
|
SendDlgItemMessage(hDebug, IDC_DEBUGGER_DISASSEMBLY, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
|
||||||
// find the ":" or "$" before sel_start
|
// find the ":" or "$" before sel_start
|
||||||
int i = sel_start - 1;
|
int i = sel_start - 1;
|
||||||
for (; i > sel_start - 5; i--)
|
for (; i > sel_start - 6; i--)
|
||||||
if (i >= 0 && debug_str[i] == ':' || debug_str[i] == '$')
|
if (i >= 0 && debug_str[i] == ':' || debug_str[i] == '$')
|
||||||
break;
|
break;
|
||||||
if (i > sel_start - 5)
|
if (i > sel_start - 6)
|
||||||
{
|
{
|
||||||
char offsetBuffer[5];
|
char offsetBuffer[5];
|
||||||
strncpy(offsetBuffer, debug_str + i + 1, 4);
|
strncpy(offsetBuffer, debug_str + i + 1, 4);
|
||||||
|
@ -1309,6 +1270,44 @@ BOOL CALLBACK IDC_DEBUGGER_DISASSEMBLY_WndProc(HWND hwndDlg, UINT uMsg, WPARAM w
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
{
|
||||||
|
// debug_str contains the text in the disassembly window
|
||||||
|
int sel_start, sel_end;
|
||||||
|
SendDlgItemMessage(hDebug, IDC_DEBUGGER_DISASSEMBLY, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end);
|
||||||
|
// only continue if there's no selection in the Disassembly window
|
||||||
|
if (sel_start == sel_end)
|
||||||
|
{
|
||||||
|
// find the ":" or "$" before sel_start
|
||||||
|
int i = sel_start - 1;
|
||||||
|
for (; i > sel_start - 6; i--)
|
||||||
|
if (i >= 0 && debug_str[i] == ':' || debug_str[i] == '$')
|
||||||
|
break;
|
||||||
|
if (i > sel_start - 6)
|
||||||
|
{
|
||||||
|
char offsetBuffer[5] = {0};
|
||||||
|
strncpy(offsetBuffer, debug_str + i + 1, 4);
|
||||||
|
offsetBuffer[4] = 0;
|
||||||
|
// truncate the string if a space or \r is found
|
||||||
|
char* firstspace = strstr(offsetBuffer, " ");
|
||||||
|
if (!firstspace)
|
||||||
|
firstspace = strstr(offsetBuffer, "\r");
|
||||||
|
if (firstspace)
|
||||||
|
firstspace[0] = 0;
|
||||||
|
unsigned int offset;
|
||||||
|
if (sscanf(offsetBuffer, "%4X", &offset) != EOF)
|
||||||
|
{
|
||||||
|
// select the text
|
||||||
|
SendDlgItemMessage(hDebug, IDC_DEBUGGER_DISASSEMBLY, EM_SETSEL, (WPARAM)(i + 1), (LPARAM)(i + 1 + strlen(offsetBuffer)));
|
||||||
|
// send the address to "Seek To" field
|
||||||
|
SetDlgItemText(hDebug, IDC_DEBUGGER_VAL_PCSEEK, offsetBuffer);
|
||||||
|
// send the address to "Bookmark Add" field
|
||||||
|
SetDlgItemText(hDebug, IDC_DEBUGGER_BOOKMARK, offsetBuffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
{
|
{
|
||||||
char str[256] = {0}, *ptr, dotdot[4];
|
char str[256] = {0}, *ptr, dotdot[4];
|
||||||
|
@ -1869,6 +1868,7 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
}
|
}
|
||||||
case IDC_DEBUGGER_BOOKMARK_ADD: AddDebuggerBookmark(hwndDlg); break;
|
case IDC_DEBUGGER_BOOKMARK_ADD: AddDebuggerBookmark(hwndDlg); break;
|
||||||
case IDC_DEBUGGER_BOOKMARK_DEL: DeleteDebuggerBookmark(hwndDlg); break;
|
case IDC_DEBUGGER_BOOKMARK_DEL: DeleteDebuggerBookmark(hwndDlg); break;
|
||||||
|
case IDC_DEBUGGER_BOOKMARK_NAME: NameDebuggerBookmark(hwndDlg); break;
|
||||||
case IDC_DEBUGGER_ENABLE_SYMBOLIC: UpdateDebugger(false); break;
|
case IDC_DEBUGGER_ENABLE_SYMBOLIC: UpdateDebugger(false); break;
|
||||||
|
|
||||||
// ################################## End of SP CODE ###########################
|
// ################################## End of SP CODE ###########################
|
||||||
|
|
|
@ -41,6 +41,9 @@ char NLfilename[2048];
|
||||||
char symbDebugEnabled = 0;
|
char symbDebugEnabled = 0;
|
||||||
int debuggerWasActive = 0;
|
int debuggerWasActive = 0;
|
||||||
|
|
||||||
|
extern BOOL CALLBACK nameBookmarkCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
extern char bookmarkDescription[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether a char is a valid hexadecimal character.
|
* Tests whether a char is a valid hexadecimal character.
|
||||||
*
|
*
|
||||||
|
@ -640,6 +643,10 @@ void decorateAddress(unsigned int addr, char* str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bookmarks
|
||||||
|
std::vector<unsigned int> bookmarks_addr;
|
||||||
|
std::vector<std::string> bookmarks_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the bookmark address of a CPU bookmark identified by its index.
|
* Returns the bookmark address of a CPU bookmark identified by its index.
|
||||||
* The caller must make sure that the index is valid.
|
* The caller must make sure that the index is valid.
|
||||||
|
@ -647,38 +654,12 @@ void decorateAddress(unsigned int addr, char* str)
|
||||||
* @param hwnd HWND of the debugger window
|
* @param hwnd HWND of the debugger window
|
||||||
* @param index Index of the bookmark
|
* @param index Index of the bookmark
|
||||||
**/
|
**/
|
||||||
unsigned int getBookmarkAddress(HWND hwnd, unsigned int index)
|
unsigned int getBookmarkAddress(unsigned int index)
|
||||||
{
|
{
|
||||||
int n;
|
if (index < bookmarks_addr.size())
|
||||||
char buffer[5] = {0};
|
return bookmarks_addr[index];
|
||||||
|
else
|
||||||
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_GETTEXT, index, (LPARAM)buffer);
|
return 0;
|
||||||
n = offsetStringToInt(BT_C, buffer);
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int bookmarks;
|
|
||||||
unsigned short* bookmarkData = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Stores all CPU bookmarks in a simple array to be able to store
|
|
||||||
* them between debugging sessions.
|
|
||||||
*
|
|
||||||
* @param hwnd HWND of the debugger window.
|
|
||||||
**/
|
|
||||||
void dumpBookmarks(HWND hwnd)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
if (bookmarkData)
|
|
||||||
free(bookmarkData);
|
|
||||||
|
|
||||||
bookmarks = SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_GETCOUNT, 0, 0);
|
|
||||||
bookmarkData = (unsigned short*)malloc(bookmarks * sizeof(unsigned short));
|
|
||||||
|
|
||||||
for (i=0;i<bookmarks;i++)
|
|
||||||
{
|
|
||||||
bookmarkData[i] = getBookmarkAddress(hwnd, i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -687,17 +668,16 @@ void dumpBookmarks(HWND hwnd)
|
||||||
* @param hwnd HWMD of the debugger window
|
* @param hwnd HWMD of the debugger window
|
||||||
* @param buffer Text of the debugger bookmark
|
* @param buffer Text of the debugger bookmark
|
||||||
**/
|
**/
|
||||||
void AddDebuggerBookmark2(HWND hwnd, char* buffer)
|
void AddDebuggerBookmark2(HWND hwnd, unsigned int addr)
|
||||||
{
|
{
|
||||||
if (!buffer)
|
int index = bookmarks_addr.size();
|
||||||
{
|
bookmarks_addr.push_back(addr);
|
||||||
MessageBox(0, "Error: Invalid parameter \"buffer\" in function AddDebuggerBookmark2", "Error", MB_OK | MB_ICONERROR);
|
bookmarks_name.push_back("");
|
||||||
return;
|
char buffer[256];
|
||||||
}
|
sprintf(buffer, "%04X %s", bookmarks_addr[index], bookmarks_name[index].c_str());
|
||||||
|
|
||||||
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_ADDSTRING, 0, (LPARAM)buffer);
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_ADDSTRING, 0, (LPARAM)buffer);
|
||||||
|
// select this item
|
||||||
dumpBookmarks(hwnd);
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_SETCURSEL, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -719,7 +699,7 @@ void AddDebuggerBookmark(HWND hwnd)
|
||||||
MessageBox(hwnd, "Invalid offset", "Error", MB_OK | MB_ICONERROR);
|
MessageBox(hwnd, "Invalid offset", "Error", MB_OK | MB_ICONERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AddDebuggerBookmark2(hwnd, buffer);
|
AddDebuggerBookmark2(hwnd, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -736,28 +716,75 @@ void DeleteDebuggerBookmark(HWND hwnd)
|
||||||
{
|
{
|
||||||
MessageBox(hwnd, "Please select a bookmark from the list", "Error", MB_OK | MB_ICONERROR);
|
MessageBox(hwnd, "Please select a bookmark from the list", "Error", MB_OK | MB_ICONERROR);
|
||||||
return;
|
return;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Remove the selected bookmark
|
// Erase the selected bookmark
|
||||||
|
bookmarks_addr.erase(bookmarks_addr.begin() + selectedItem);
|
||||||
|
bookmarks_name.erase(bookmarks_name.begin() + selectedItem);
|
||||||
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_DELETESTRING, selectedItem, 0);
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_DELETESTRING, selectedItem, 0);
|
||||||
dumpBookmarks(hwnd);
|
// Select next item
|
||||||
|
if (selectedItem >= (bookmarks_addr.size() - 1))
|
||||||
|
// select last item
|
||||||
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_SETCURSEL, bookmarks_addr.size() - 1, 0);
|
||||||
|
else
|
||||||
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_SETCURSEL, selectedItem, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void NameDebuggerBookmark(HWND hwnd)
|
||||||
* Removes all debugger bookmarks
|
{
|
||||||
*
|
// Get the selected bookmark
|
||||||
* @param hwnd HWND of the debugger window
|
int selectedItem = SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_GETCURSEL, 0, 0);
|
||||||
**/
|
if (selectedItem == LB_ERR || selectedItem >= (int)bookmarks_name.size())
|
||||||
void ClearDebuggerBookmarkListbox(HWND hwnd)
|
{
|
||||||
|
MessageBox(hwnd, "Please select a bookmark from the list", "Error", MB_OK | MB_ICONERROR);
|
||||||
|
return;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
strcpy(bookmarkDescription, bookmarks_name[selectedItem].c_str());
|
||||||
|
// try to find the same address in bookmarks
|
||||||
|
for (int i = bookmarks_addr.size() - 1; i>= 0; i--)
|
||||||
|
{
|
||||||
|
if (i != selectedItem && bookmarks_addr[i] == bookmarks_addr[selectedItem])
|
||||||
|
{
|
||||||
|
strcpy(bookmarkDescription, bookmarks_name[i].c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Show the bookmark name dialog
|
||||||
|
if (DialogBox(fceu_hInstance, "NAMEBOOKMARKDLG", hwnd, nameBookmarkCallB))
|
||||||
|
{
|
||||||
|
// Rename the selected bookmark
|
||||||
|
bookmarks_name[selectedItem] = bookmarkDescription;
|
||||||
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_DELETESTRING, selectedItem, 0);
|
||||||
|
char buffer[256];
|
||||||
|
sprintf(buffer, "%04X %s", bookmarks_addr[selectedItem], bookmarks_name[selectedItem].c_str());
|
||||||
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_INSERTSTRING, selectedItem, (LPARAM)buffer);
|
||||||
|
// Reselect the item (selection disappeared when it was deleted)
|
||||||
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_SETCURSEL, selectedItem, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeleteAllDebuggerBookmarks()
|
||||||
|
{
|
||||||
|
bookmarks_addr.resize(0);
|
||||||
|
bookmarks_name.resize(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FillDebuggerBookmarkListbox(HWND hwnd)
|
||||||
{
|
{
|
||||||
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_RESETCONTENT, 0, 0);
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_RESETCONTENT, 0, 0);
|
||||||
//dumpBookmarks(hwnd);
|
char buffer[256];
|
||||||
|
for (unsigned int i = 0; i < bookmarks_addr.size(); ++i)
|
||||||
|
{
|
||||||
|
sprintf(buffer, "%04X %s", bookmarks_addr[i], bookmarks_name[i].c_str());
|
||||||
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_ADDSTRING, 0, (LPARAM)buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr);
|
extern void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the code at the bookmark address in the disassembly window
|
* Shows the code at the bookmark address in the disassembly window
|
||||||
|
@ -766,13 +793,9 @@ void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr);
|
||||||
**/
|
**/
|
||||||
void GoToDebuggerBookmark(HWND hwnd)
|
void GoToDebuggerBookmark(HWND hwnd)
|
||||||
{
|
{
|
||||||
unsigned int n;
|
|
||||||
int selectedItem = SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_GETCURSEL, 0, 0);
|
int selectedItem = SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_GETCURSEL, 0, 0);
|
||||||
|
|
||||||
// If no bookmark is selected just return
|
// If no bookmark is selected just return
|
||||||
if (selectedItem == LB_ERR) return;
|
if (selectedItem == LB_ERR) return;
|
||||||
|
unsigned int n = getBookmarkAddress(selectedItem);
|
||||||
n = getBookmarkAddress(hwnd, selectedItem);
|
|
||||||
|
|
||||||
Disassemble(hwnd, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, n);
|
Disassemble(hwnd, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ struct Name
|
||||||
};
|
};
|
||||||
|
|
||||||
extern char symbDebugEnabled;
|
extern char symbDebugEnabled;
|
||||||
extern unsigned int bookmarks;
|
extern std::vector<unsigned int> bookmarks_addr;
|
||||||
extern unsigned short* bookmarkData;
|
extern std::vector<std::string> bookmarks_name;
|
||||||
extern int debuggerWasActive;
|
extern int debuggerWasActive;
|
||||||
|
|
||||||
int checkCondition(const char* buffer, int num);
|
int checkCondition(const char* buffer, int num);
|
||||||
|
@ -42,10 +42,11 @@ void loadNameFiles();
|
||||||
void decorateAddress(unsigned int addr, char* str);
|
void decorateAddress(unsigned int addr, char* str);
|
||||||
void replaceNames(Name* list, char* str);
|
void replaceNames(Name* list, char* str);
|
||||||
void AddDebuggerBookmark(HWND hwnd);
|
void AddDebuggerBookmark(HWND hwnd);
|
||||||
void AddDebuggerBookmark2(HWND hwnd, char* buffer);
|
void AddDebuggerBookmark2(HWND hwnd, unsigned int addr);
|
||||||
void DeleteDebuggerBookmark(HWND hwnd);
|
void DeleteDebuggerBookmark(HWND hwnd);
|
||||||
void ClearDebuggerBookmarkListbox(HWND hwnd);
|
void NameDebuggerBookmark(HWND hwnd);
|
||||||
|
void DeleteAllDebuggerBookmarks();
|
||||||
|
void FillDebuggerBookmarkListbox(HWND hwnd);
|
||||||
|
|
||||||
void GoToDebuggerBookmark(HWND hwnd);
|
void GoToDebuggerBookmark(HWND hwnd);
|
||||||
void dumpBookmarks(HWND hwmd);
|
|
||||||
int isHex(char c);
|
int isHex(char c);
|
||||||
|
|
Binary file not shown.
|
@ -70,8 +70,6 @@ BOOL CALLBACK nameBookmarkCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
break;
|
break;
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
case WM_QUIT:
|
case WM_QUIT:
|
||||||
// Update the bookmark description
|
|
||||||
GetDlgItemText(hwndDlg, IDC_BOOKMARK_DESCRIPTION, bookmarkDescription, 50);
|
|
||||||
EndDialog(hwndDlg, 0);
|
EndDialog(hwndDlg, 0);
|
||||||
break;
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
@ -81,11 +79,16 @@ BOOL CALLBACK nameBookmarkCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
switch(LOWORD(wParam))
|
switch(LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDOK:
|
case IDOK:
|
||||||
SendMessage(hwndDlg, WM_QUIT, 0, 0);
|
{
|
||||||
|
// Update the bookmark description
|
||||||
|
GetDlgItemText(hwndDlg, IDC_BOOKMARK_DESCRIPTION, bookmarkDescription, 50);
|
||||||
|
EndDialog(hwndDlg, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "debuggersp.h"
|
|
||||||
#include "memviewsp.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "debugger.h"
|
#include "debugger.h"
|
||||||
|
#include "debuggersp.h"
|
||||||
|
#include "memviewsp.h"
|
||||||
#include "../../debug.h"
|
#include "../../debug.h"
|
||||||
|
|
||||||
extern bool break_on_cycles;
|
extern bool break_on_cycles;
|
||||||
|
@ -44,15 +44,25 @@ extern char symbDebugEnabled;
|
||||||
int storeDebuggerPreferences(FILE* f)
|
int storeDebuggerPreferences(FILE* f)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
unsigned int size, len;
|
||||||
uint8 tmp;
|
uint8 tmp;
|
||||||
|
|
||||||
// Flag that says whether symbolic debugging should be enabled
|
// Flag that says whether symbolic debugging should be enabled
|
||||||
if (fwrite(&symbDebugEnabled, 1, 1, f) != 1) return 1;
|
if (fwrite(&symbDebugEnabled, 1, 1, f) != 1) return 1;
|
||||||
|
|
||||||
// Write the number of active CPU bookmarks
|
// Write the number of CPU bookmarks
|
||||||
if (fwrite(&bookmarks, sizeof(unsigned int), 1, f) != 1) return 1;
|
size = bookmarks_addr.size();
|
||||||
// Write the addresses of those bookmarks
|
bookmarks_name.resize(size);
|
||||||
if (fwrite(bookmarkData, sizeof(unsigned short), bookmarks, f) != bookmarks) return 1;
|
if (fwrite(&size, sizeof(unsigned int), 1, f) != 1) return 1;
|
||||||
|
// Write the data of those bookmarks
|
||||||
|
char buffer[256];
|
||||||
|
for (i = 0; i < (int)size; ++i)
|
||||||
|
{
|
||||||
|
if (fwrite(&bookmarks_addr[i], sizeof(unsigned int), 1, f) != 1) return 1;
|
||||||
|
len = bookmarks_name[i].size();
|
||||||
|
if (fwrite(&len, sizeof(unsigned int), 1, f) != 1) return 1;
|
||||||
|
if (fwrite(bookmarks_name[i].c_str(), 1, len, f) != len) return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Write all breakpoints
|
// Write all breakpoints
|
||||||
for (i=0;i<65;i++)
|
for (i=0;i<65;i++)
|
||||||
|
@ -204,18 +214,11 @@ int storePreferences(char* romname)
|
||||||
|
|
||||||
void DoDebuggerDataReload()
|
void DoDebuggerDataReload()
|
||||||
{
|
{
|
||||||
if (debuggerSaveLoadDEBFiles == false) {
|
if (debuggerSaveLoadDEBFiles == false)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
extern HWND hDebug;
|
extern HWND hDebug;
|
||||||
LoadGameDebuggerData(hDebug);
|
LoadGameDebuggerData(hDebug);
|
||||||
|
|
||||||
// if (wasinDebugger){
|
|
||||||
// DebuggerExit();
|
|
||||||
// DoDebug(0);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int myNumWPs = 0;
|
int myNumWPs = 0;
|
||||||
|
@ -229,25 +232,29 @@ int loadDebugDataFailed = 0;
|
||||||
**/
|
**/
|
||||||
int loadDebuggerPreferences(FILE* f)
|
int loadDebuggerPreferences(FILE* f)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i, size, len;
|
||||||
uint8 tmp;
|
uint8 tmp;
|
||||||
|
|
||||||
// Read flag that says if symbolic debugging is enabled
|
// Read flag that says if symbolic debugging is enabled
|
||||||
if (fread(&symbDebugEnabled, sizeof(symbDebugEnabled), 1, f) != 1) return 1;
|
if (fread(&symbDebugEnabled, sizeof(symbDebugEnabled), 1, f) != 1) return 1;
|
||||||
|
|
||||||
// Read the number of CPU bookmarks
|
// Read the number of CPU bookmarks
|
||||||
if (fread(&bookmarks, sizeof(bookmarks), 1, f) != 1) return 1;
|
if (fread(&size, sizeof(unsigned int), 1, f) != 1) return 1;
|
||||||
|
bookmarks_addr.resize(size);
|
||||||
bookmarkData = (unsigned short*)malloc(bookmarks * sizeof(unsigned short));
|
bookmarks_name.resize(size);
|
||||||
|
// Read the data of those bookmarks
|
||||||
// Read the offsets of the bookmarks
|
char buffer[256];
|
||||||
for (i=0;i<bookmarks;i++)
|
for (i = 0; i < (int)size; ++i)
|
||||||
{
|
{
|
||||||
if (fread(&bookmarkData[i], sizeof(bookmarkData[i]), 1, f) != 1) return 1;
|
if (fread(&bookmarks_addr[i], sizeof(unsigned int), 1, f) != 1) return 1;
|
||||||
|
if (fread(&len, sizeof(unsigned int), 1, f) != 1) return 1;
|
||||||
|
if (len >= 256) return 1;
|
||||||
|
if (fread(&buffer, 1, len, f) != len) return 1;
|
||||||
|
buffer[len] = 0;
|
||||||
|
bookmarks_name[i] = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
myNumWPs = 0;
|
myNumWPs = 0;
|
||||||
|
|
||||||
// Ugetab:
|
// Ugetab:
|
||||||
// This took far too long to figure out...
|
// This took far too long to figure out...
|
||||||
// Nullifying the data is better than using free(), because
|
// Nullifying the data is better than using free(), because
|
||||||
|
@ -349,7 +356,8 @@ int loadHexPreferences(FILE* f)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Read number of bookmarks
|
// Read number of bookmarks
|
||||||
fread(&nextBookmark, sizeof(nextBookmark), 1, f);
|
if (fread(&nextBookmark, sizeof(nextBookmark), 1, f) != 1) return 1;
|
||||||
|
if (nextBookmark >= 64) return 1;
|
||||||
|
|
||||||
for (i=0;i<nextBookmark;i++)
|
for (i=0;i<nextBookmark;i++)
|
||||||
{
|
{
|
||||||
|
@ -391,10 +399,22 @@ int loadPreferences(char* romname)
|
||||||
f = fopen(filename, "rb");
|
f = fopen(filename, "rb");
|
||||||
free(filename);
|
free(filename);
|
||||||
|
|
||||||
result = f ? loadDebuggerPreferences(f) || loadHexPreferences(f) : 0;
|
if (f)
|
||||||
|
{
|
||||||
if (f) {
|
result = loadDebuggerPreferences(f) || loadHexPreferences(f);
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
// there was error when loading the .deb, reset the data to default
|
||||||
|
DeleteAllDebuggerBookmarks();
|
||||||
|
myNumWPs = 0;
|
||||||
|
break_on_instructions = break_on_cycles = FCEUI_Debugger().badopbreak = false;
|
||||||
|
break_instructions_limit = break_cycles_limit = 0;
|
||||||
|
nextBookmark = 0;
|
||||||
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
result = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This prevents information from traveling between debugger interations.
|
// This prevents information from traveling between debugger interations.
|
||||||
|
|
|
@ -1076,27 +1076,27 @@ BEGIN
|
||||||
PUSHBUTTON "<",MEMW_EXPANDCOLLAPSE,1,259,11,10
|
PUSHBUTTON "<",MEMW_EXPANDCOLLAPSE,1,259,11,10
|
||||||
END
|
END
|
||||||
|
|
||||||
DEBUGGER DIALOGEX 54, 74, 540, 321
|
DEBUGGER DIALOGEX 54, 74, 541, 321
|
||||||
STYLE DS_SETFONT | DS_3DLOOK | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
STYLE DS_SETFONT | DS_3DLOOK | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||||
CAPTION "6502 Debugger"
|
CAPTION "6502 Debugger"
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
EDITTEXT IDC_DEBUGGER_DISASSEMBLY,15,5,318,300,ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | WS_HSCROLL
|
EDITTEXT IDC_DEBUGGER_DISASSEMBLY,15,5,318,300,ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | WS_HSCROLL
|
||||||
SCROLLBAR IDC_DEBUGGER_DISASSEMBLY_VSCR,334,5,11,300,SBS_VERT
|
SCROLLBAR IDC_DEBUGGER_DISASSEMBLY_VSCR,334,5,11,300,SBS_VERT
|
||||||
GROUPBOX "Status Flags",401,433,139,101,35,WS_TABSTOP
|
GROUPBOX "Status Flags",401,433,140,103,35,WS_TABSTOP
|
||||||
CONTROL "N",IDC_DEBUGGER_FLAG_N,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,439,148,18,12
|
CONTROL "N",IDC_DEBUGGER_FLAG_N,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,439,149,18,12
|
||||||
CONTROL "V",IDC_DEBUGGER_FLAG_V,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,463,148,18,12
|
CONTROL "V",IDC_DEBUGGER_FLAG_V,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,464,149,18,12
|
||||||
CONTROL "U",IDC_DEBUGGER_FLAG_U,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,487,148,18,12
|
CONTROL "U",IDC_DEBUGGER_FLAG_U,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,488,149,18,12
|
||||||
CONTROL "B",IDC_DEBUGGER_FLAG_B,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,510,148,18,12
|
CONTROL "B",IDC_DEBUGGER_FLAG_B,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,512,149,18,12
|
||||||
CONTROL "D",IDC_DEBUGGER_FLAG_D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,439,160,18,12
|
CONTROL "D",IDC_DEBUGGER_FLAG_D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,439,161,18,12
|
||||||
CONTROL "I",IDC_DEBUGGER_FLAG_I,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,463,160,18,12
|
CONTROL "I",IDC_DEBUGGER_FLAG_I,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,464,161,18,12
|
||||||
CONTROL "Z",IDC_DEBUGGER_FLAG_Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,487,160,18,12
|
CONTROL "Z",IDC_DEBUGGER_FLAG_Z,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,488,161,18,12
|
||||||
CONTROL "C",IDC_DEBUGGER_FLAG_C,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,510,160,18,12
|
CONTROL "C",IDC_DEBUGGER_FLAG_C,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,512,161,18,12
|
||||||
GROUPBOX "Breakpoints",IDC_DEBUGGER_BREAKPOINTS,433,3,101,135,WS_TABSTOP
|
GROUPBOX "Breakpoints",IDC_DEBUGGER_BREAKPOINTS,433,2,103,138,WS_TABSTOP
|
||||||
LISTBOX IDC_DEBUGGER_BP_LIST,437,13,93,91,LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL
|
LISTBOX IDC_DEBUGGER_BP_LIST,437,11,95,96,LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL
|
||||||
PUSHBUTTON "Add",IDC_DEBUGGER_BP_ADD,437,107,30,15
|
PUSHBUTTON "Add",IDC_DEBUGGER_BP_ADD,437,109,31,15
|
||||||
PUSHBUTTON "Delete",IDC_DEBUGGER_BP_DEL,469,107,30,15,WS_DISABLED
|
PUSHBUTTON "Delete",IDC_DEBUGGER_BP_DEL,470,109,31,15,WS_DISABLED
|
||||||
PUSHBUTTON "Edit",IDC_DEBUGGER_BP_EDIT,501,107,29,15,WS_DISABLED
|
PUSHBUTTON "Edit",IDC_DEBUGGER_BP_EDIT,502,109,31,15,WS_DISABLED
|
||||||
PUSHBUTTON "Run",IDC_DEBUGGER_RUN,350,5,38,14
|
PUSHBUTTON "Run",IDC_DEBUGGER_RUN,350,5,38,14
|
||||||
PUSHBUTTON "Step Into",IDC_DEBUGGER_STEP_IN,391,5,39,14
|
PUSHBUTTON "Step Into",IDC_DEBUGGER_STEP_IN,391,5,39,14
|
||||||
PUSHBUTTON "Step Out",IDC_DEBUGGER_STEP_OUT,350,21,38,14
|
PUSHBUTTON "Step Out",IDC_DEBUGGER_STEP_OUT,350,21,38,14
|
||||||
|
@ -1114,30 +1114,30 @@ BEGIN
|
||||||
PUSHBUTTON "Seek PC",IDC_DEBUGGER_SEEK_PC,391,71,39,14
|
PUSHBUTTON "Seek PC",IDC_DEBUGGER_SEEK_PC,391,71,39,14
|
||||||
PUSHBUTTON "Seek To:",IDC_DEBUGGER_SEEK_TO,350,54,38,14
|
PUSHBUTTON "Seek To:",IDC_DEBUGGER_SEEK_TO,350,54,38,14
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_PCSEEK,391,55,38,12,ES_UPPERCASE | ES_WANTRETURN
|
EDITTEXT IDC_DEBUGGER_VAL_PCSEEK,391,55,38,12,ES_UPPERCASE | ES_WANTRETURN
|
||||||
LTEXT "PPU:",65531,352,179,17,10
|
LTEXT "PPU:",65531,353,179,17,10
|
||||||
LTEXT "Sprite:",65530,352,191,20,10
|
LTEXT "Sprite:",65530,353,191,20,10
|
||||||
LTEXT "Scanline:",IDC_STATIC,352,203,31,8
|
LTEXT "Scanline:",IDC_STATIC,353,203,31,8
|
||||||
LTEXT "Pixel:",IDC_STATIC,352,216,17,8
|
LTEXT "Pixel:",IDC_STATIC,353,216,17,8
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_PPU,371,179,25,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_PPU,372,179,25,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_SPR,374,191,15,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_SPR,375,191,15,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_SLINE,383,203,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_SLINE,384,203,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER,WS_EX_TRANSPARENT
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_PPUPIXEL,372,216,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_PPUPIXEL,373,216,14,10,ES_UPPERCASE | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
||||||
GROUPBOX "",IDC_DEBUGGER_VAL_S2,349,174,50,53,WS_TABSTOP
|
GROUPBOX "",IDC_DEBUGGER_VAL_S2,349,174,51,53,WS_TABSTOP
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT,442,179,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT,443,179,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT2,489,179,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_CYCLES_COUNT2,490,179,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT,441,204,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT,442,204,46,10,ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
||||||
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT2,489,204,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
EDITTEXT IDC_DEBUGGER_VAL_INSTRUCTIONS_COUNT2,490,204,51,10,ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_TRANSPARENT
|
||||||
CONTROL "",IDC_DEBUGGER_ADDR_LINE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,4,308,341,11
|
CONTROL "",IDC_DEBUGGER_ADDR_LINE,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,4,308,341,11
|
||||||
CONTROL "Break on Bad Opcode",IDC_DEBUGGER_BREAK_ON_BAD_OP,
|
CONTROL "Break on Bad Opcodes",IDC_DEBUGGER_BREAK_ON_BAD_OP,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,125,89,10
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,439,126,90,10
|
||||||
CONTROL "Symbolic debugging",IDC_DEBUGGER_ENABLE_SYMBOLIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,442,261,80,10
|
CONTROL "Symbolic debug",IDC_DEBUGGER_ENABLE_SYMBOLIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,470,261,62,10
|
||||||
PUSHBUTTON "Reload Symbols",IDC_DEBUGGER_RELOAD_SYMS,441,272,62,14
|
PUSHBUTTON "Reload Symbols",IDC_DEBUGGER_RELOAD_SYMS,470,272,62,14
|
||||||
GROUPBOX "Address Bookmarks",45535,349,228,84,76
|
GROUPBOX "Address Bookmarks",45535,349,228,113,76
|
||||||
LISTBOX LIST_DEBUGGER_BOOKMARKS,353,238,44,63,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
LISTBOX LIST_DEBUGGER_BOOKMARKS,353,238,74,63,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||||
EDITTEXT IDC_DEBUGGER_BOOKMARK,400,238,29,14,ES_AUTOHSCROLL
|
EDITTEXT IDC_DEBUGGER_BOOKMARK,430,238,28,14,ES_AUTOHSCROLL
|
||||||
PUSHBUTTON "Add",IDC_DEBUGGER_BOOKMARK_ADD,399,254,31,14
|
PUSHBUTTON "Add",IDC_DEBUGGER_BOOKMARK_ADD,429,255,30,14
|
||||||
PUSHBUTTON "Delete",IDC_DEBUGGER_BOOKMARK_DEL,399,270,31,14
|
PUSHBUTTON "Delete",IDC_DEBUGGER_BOOKMARK_DEL,429,271,30,14
|
||||||
PUSHBUTTON "Rom Patcher",IDC_DEBUGGER_ROM_PATCHER,441,288,62,14
|
PUSHBUTTON "Rom Patcher",IDC_DEBUGGER_ROM_PATCHER,470,288,62,14
|
||||||
CONTROL "",IDC_DEBUGGER_ICONTRAY,"Static",SS_BLACKFRAME,4,5,11,300
|
CONTROL "",IDC_DEBUGGER_ICONTRAY,"Static",SS_BLACKFRAME,4,5,11,300
|
||||||
PUSHBUTTON "",IDC_DEBUGGER_RESTORESIZE,349,307,13,10
|
PUSHBUTTON "",IDC_DEBUGGER_RESTORESIZE,349,307,13,10
|
||||||
LTEXT "Default window size",IDC_STATIC,364,308,68,9
|
LTEXT "Default window size",IDC_STATIC,364,308,68,9
|
||||||
|
@ -1145,16 +1145,17 @@ BEGIN
|
||||||
PUSHBUTTON "128 Lines",IDC_DEBUGGER_RUN_FRAME2,391,37,39,14
|
PUSHBUTTON "128 Lines",IDC_DEBUGGER_RUN_FRAME2,391,37,39,14
|
||||||
CONTROL ".DEB files",DEBUGLOADDEB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,489,306,46,13
|
CONTROL ".DEB files",DEBUGLOADDEB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,489,306,46,13
|
||||||
CONTROL "Auto-open",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,306,47,13
|
CONTROL "Auto-open",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,438,306,47,13
|
||||||
LTEXT "CPU cycles:",IDC_STATIC,402,179,39,8
|
LTEXT "CPU cycles:",IDC_STATIC,403,179,39,8
|
||||||
PUSHBUTTON "Reset counters",IDC_DEBUGGER_RESET_COUNTERS,471,229,64,14
|
PUSHBUTTON "Reset counters",IDC_DEBUGGER_RESET_COUNTERS,467,229,68,14
|
||||||
CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_CYCLES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,403,191,77,10
|
CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_CYCLES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,404,191,77,10
|
||||||
EDITTEXT IDC_DEBUGGER_CYCLES_EXCEED,481,190,53,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER
|
EDITTEXT IDC_DEBUGGER_CYCLES_EXCEED,482,190,53,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER
|
||||||
LTEXT "Instructions:",IDC_STATIC,402,204,40,8
|
LTEXT "Instructions:",IDC_STATIC,403,204,40,8
|
||||||
CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_INSTRUCTIONS,
|
CONTROL "Break when exceed",IDC_DEBUGGER_BREAK_ON_INSTRUCTIONS,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,403,216,77,10
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,404,216,77,10
|
||||||
EDITTEXT IDC_DEBUGGER_INSTRUCTIONS_EXCEED,481,215,53,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER
|
EDITTEXT IDC_DEBUGGER_INSTRUCTIONS_EXCEED,482,215,53,12,ES_UPPERCASE | ES_NOHIDESEL | ES_WANTRETURN | ES_NUMBER
|
||||||
GROUPBOX "",IDC_STATIC,437,242,97,63
|
GROUPBOX "",IDC_STATIC,466,241,70,64
|
||||||
CONTROL "Display ROM offsets",IDC_DEBUGGER_ROM_OFFSETS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,442,249,82,10
|
CONTROL "ROM offsets",IDC_DEBUGGER_ROM_OFFSETS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,470,249,62,10
|
||||||
|
PUSHBUTTON "Name",IDC_DEBUGGER_BOOKMARK_NAME,429,287,30,14
|
||||||
END
|
END
|
||||||
|
|
||||||
TRACER DIALOGEX 65527, 65513, 403, 332
|
TRACER DIALOGEX 65527, 65513, 403, 332
|
||||||
|
@ -1189,7 +1190,7 @@ BEGIN
|
||||||
"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,261,243,119,10
|
"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,261,243,119,10
|
||||||
CONTROL "Log current Frame number",IDC_CHECK_LOG_FRAME_NUMBER,
|
CONTROL "Log current Frame number",IDC_CHECK_LOG_FRAME_NUMBER,
|
||||||
"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,18,256,102,10
|
"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,18,256,102,10
|
||||||
CONTROL "Symbolic tracing",IDC_CHECK_SYMBOLIC_TRACING,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,18,270,72,10
|
CONTROL "Symbolic trace",IDC_CHECK_SYMBOLIC_TRACING,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,18,270,72,10
|
||||||
CONTROL "Log emulator messages",IDC_CHECK_LOG_MESSAGES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,148,256,94,10
|
CONTROL "Log emulator messages",IDC_CHECK_LOG_MESSAGES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,148,256,94,10
|
||||||
CONTROL "Log breakpoint hits",IDC_CHECK_LOG_BREAKPOINTS,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,261,256,82,10
|
CONTROL "Log breakpoint hits",IDC_CHECK_LOG_BREAKPOINTS,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,261,256,82,10
|
||||||
END
|
END
|
||||||
|
@ -1554,11 +1555,11 @@ BEGIN
|
||||||
END
|
END
|
||||||
|
|
||||||
NAMEBOOKMARKDLG DIALOGEX 0, 0, 186, 73
|
NAMEBOOKMARKDLG DIALOGEX 0, 0, 186, 73
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Bookmark description..."
|
CAPTION "Bookmark name"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Bookmark description",-1,58,14,70,8
|
LTEXT "Bookmark name",IDC_BOOKMARK_NAME_TEXT,68,14,58,8
|
||||||
EDITTEXT IDC_BOOKMARK_DESCRIPTION,7,28,172,14,ES_AUTOHSCROLL
|
EDITTEXT IDC_BOOKMARK_DESCRIPTION,7,28,172,14,ES_AUTOHSCROLL
|
||||||
DEFPUSHBUTTON "&OK",IDOK,67,52,50,14
|
DEFPUSHBUTTON "&OK",IDOK,67,52,50,14
|
||||||
END
|
END
|
||||||
|
|
|
@ -153,6 +153,8 @@
|
||||||
#define CHEAT_CONTEXT_POKECHEATVALUE 118
|
#define CHEAT_CONTEXT_POKECHEATVALUE 118
|
||||||
#define IDC_DEBUGGER_RESET_ON_BP0 118
|
#define IDC_DEBUGGER_RESET_ON_BP0 118
|
||||||
#define IDC_CHECK_LOG_STATUSES_TO_THE_LEFT 118
|
#define IDC_CHECK_LOG_STATUSES_TO_THE_LEFT 118
|
||||||
|
#define IDC_DEBUGGER_BOOKMARK_DEL2 118
|
||||||
|
#define IDC_DEBUGGER_BOOKMARK_NAME 118
|
||||||
#define CHEAT_CONTEXT_GOTOINHEXEDITOR 119
|
#define CHEAT_CONTEXT_GOTOINHEXEDITOR 119
|
||||||
#define IDC_DEBUGGER_BREAK_ON_INSTRUCTIONS 119
|
#define IDC_DEBUGGER_BREAK_ON_INSTRUCTIONS 119
|
||||||
#define IDC_CHECK_LOG_FRAME_NUMBER 119
|
#define IDC_CHECK_LOG_FRAME_NUMBER 119
|
||||||
|
@ -1140,6 +1142,7 @@
|
||||||
#define IDC_DEBUGGER_ICONTRAY 55535
|
#define IDC_DEBUGGER_ICONTRAY 55535
|
||||||
#define MW_ValueLabel2 65423
|
#define MW_ValueLabel2 65423
|
||||||
#define MW_ValueLabel1 65426
|
#define MW_ValueLabel1 65426
|
||||||
|
#define IDC_BOOKMARK_NAME_TEXT 65535
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
|
|
|
@ -1912,8 +1912,13 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
int delta = zDelta / WHEEL_DELTA;
|
int delta = zDelta / WHEEL_DELTA;
|
||||||
if (delta < -1 || delta > 1)
|
if (delta < -1 || delta > 1)
|
||||||
delta *= PLAYBACK_WHEEL_BOOST;
|
delta *= PLAYBACK_WHEEL_BOOST;
|
||||||
int destination_frame = currFrameCounter - delta;
|
int destination_frame;
|
||||||
if (destination_frame < 0) destination_frame = 0;
|
if (FCEUI_EmulationPaused() || playback.GetPauseFrame() < 0)
|
||||||
|
destination_frame = currFrameCounter - delta;
|
||||||
|
else
|
||||||
|
destination_frame = playback.GetPauseFrame() - delta;
|
||||||
|
if (destination_frame < 0)
|
||||||
|
destination_frame = 0;
|
||||||
int lastCursor = currFrameCounter;
|
int lastCursor = currFrameCounter;
|
||||||
playback.jump(destination_frame);
|
playback.jump(destination_frame);
|
||||||
if (lastCursor != currFrameCounter)
|
if (lastCursor != currFrameCounter)
|
||||||
|
|
|
@ -51,7 +51,7 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG()
|
||||||
view_branches_tree = false;
|
view_branches_tree = false;
|
||||||
branch_scr_hud = true;
|
branch_scr_hud = true;
|
||||||
restore_position = false;
|
restore_position = false;
|
||||||
adjust_input_due_to_lag = true;
|
adjust_input_due_to_lag = false;
|
||||||
greenzone_capacity = GREENZONE_CAPACITY_DEFAULT;
|
greenzone_capacity = GREENZONE_CAPACITY_DEFAULT;
|
||||||
undo_levels = UNDO_LEVELS_DEFAULT;
|
undo_levels = UNDO_LEVELS_DEFAULT;
|
||||||
autosave_period = AUTOSAVE_PERIOD_DEFAULT;
|
autosave_period = AUTOSAVE_PERIOD_DEFAULT;
|
||||||
|
|
|
@ -1842,7 +1842,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
|
||||||
FCEUD_ToggleStatusIcon();
|
FCEUD_ToggleStatusIcon();
|
||||||
break;
|
break;
|
||||||
case ID_DISPLAY_FPS:
|
case ID_DISPLAY_FPS:
|
||||||
FCEUI_SetShowFPS(FCEUI_ShowFPS() ^ 1);
|
FCEUI_ToggleShowFPS();
|
||||||
break;
|
break;
|
||||||
case MENU_DISPLAY_BG:
|
case MENU_DISPLAY_BG:
|
||||||
case MENU_DISPLAY_OBJ:
|
case MENU_DISPLAY_OBJ:
|
||||||
|
@ -2851,6 +2851,11 @@ void UpdateMenuHotkeys()
|
||||||
combined = "&Movie status icon\t" + combo;
|
combined = "&Movie status icon\t" + combo;
|
||||||
ChangeMenuItemText(ID_DISPLAY_MOVIESTATUSICON, combined);
|
ChangeMenuItemText(ID_DISPLAY_MOVIESTATUSICON, combined);
|
||||||
|
|
||||||
|
//FPS counter
|
||||||
|
combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_FPS_DISPLAY_TOGGLE]);
|
||||||
|
combined = "FPS\t" + combo;
|
||||||
|
ChangeMenuItemText(ID_DISPLAY_FPS, combined);
|
||||||
|
|
||||||
//Graphics: BG
|
//Graphics: BG
|
||||||
combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_MISC_DISPLAY_BG_TOGGLE]);
|
combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_MISC_DISPLAY_BG_TOGGLE]);
|
||||||
combined = "Graphics: &BG\t" + combo;
|
combined = "Graphics: &BG\t" + combo;
|
||||||
|
|
|
@ -662,6 +662,7 @@ void ToggleFullscreen();
|
||||||
static void TaseditorRewindOn(void);
|
static void TaseditorRewindOn(void);
|
||||||
static void TaseditorRewindOff(void);
|
static void TaseditorRewindOff(void);
|
||||||
static void TaseditorCommand(void);
|
static void TaseditorCommand(void);
|
||||||
|
extern void FCEUI_ToggleShowFPS();
|
||||||
|
|
||||||
struct EMUCMDTABLE FCEUI_CommandTable[]=
|
struct EMUCMDTABLE FCEUI_CommandTable[]=
|
||||||
{
|
{
|
||||||
|
@ -792,6 +793,7 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
|
||||||
{ EMUCMD_TASEDITOR_SWITCH_AUTORESTORING, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Switch Auto-restore last position", EMUCMDFLAG_TASEDITOR },
|
{ EMUCMD_TASEDITOR_SWITCH_AUTORESTORING, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Switch Auto-restore last position", EMUCMDFLAG_TASEDITOR },
|
||||||
{ EMUCMD_TASEDITOR_SWITCH_MULTITRACKING, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Switch current Multitracking mode", EMUCMDFLAG_TASEDITOR },
|
{ EMUCMD_TASEDITOR_SWITCH_MULTITRACKING, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Switch current Multitracking mode", EMUCMDFLAG_TASEDITOR },
|
||||||
{ EMUCMD_TASEDITOR_RUN_MANUAL_LUA, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Run Manual Lua function", EMUCMDFLAG_TASEDITOR },
|
{ EMUCMD_TASEDITOR_RUN_MANUAL_LUA, EMUCMDTYPE_TASEDITOR, TaseditorCommand, 0, 0, "Run Manual Lua function", EMUCMDFLAG_TASEDITOR },
|
||||||
|
{ EMUCMD_FPS_DISPLAY_TOGGLE, EMUCMDTYPE_MISC, FCEUI_ToggleShowFPS, 0, 0, "Toggle FPS Display", EMUCMDFLAG_TASEDITOR },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
|
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
|
||||||
|
|
|
@ -237,9 +237,10 @@ enum EMUCMD
|
||||||
EMUCMD_TASEDITOR_CANCEL_SEEKING,
|
EMUCMD_TASEDITOR_CANCEL_SEEKING,
|
||||||
EMUCMD_TASEDITOR_SWITCH_AUTORESTORING,
|
EMUCMD_TASEDITOR_SWITCH_AUTORESTORING,
|
||||||
EMUCMD_TASEDITOR_SWITCH_MULTITRACKING,
|
EMUCMD_TASEDITOR_SWITCH_MULTITRACKING,
|
||||||
|
EMUCMD_TASEDITOR_RUN_MANUAL_LUA,
|
||||||
//-----------------------------
|
//-----------------------------
|
||||||
//keep adding these in order of newness or else the hotkey binding configs will get messed up...
|
//keep adding these in order of newness or else the hotkey binding configs will get messed up...
|
||||||
EMUCMD_TASEDITOR_RUN_MANUAL_LUA,
|
EMUCMD_FPS_DISPLAY_TOGGLE,
|
||||||
|
|
||||||
EMUCMD_MAX
|
EMUCMD_MAX
|
||||||
};
|
};
|
||||||
|
|
|
@ -747,6 +747,10 @@ void FCEUI_SetShowFPS(bool showFPS)
|
||||||
{
|
{
|
||||||
Show_FPS = showFPS;
|
Show_FPS = showFPS;
|
||||||
}
|
}
|
||||||
|
void FCEUI_ToggleShowFPS()
|
||||||
|
{
|
||||||
|
Show_FPS ^= 1;
|
||||||
|
}
|
||||||
|
|
||||||
static uint64 boop[60];
|
static uint64 boop[60];
|
||||||
static int boopcount = 0;
|
static int boopcount = 0;
|
||||||
|
@ -760,8 +764,8 @@ void ShowFPS(void)
|
||||||
int booplimit = PAL?50:60;
|
int booplimit = PAL?50:60;
|
||||||
boop[boopcount] = FCEUD_GetTime();
|
boop[boopcount] = FCEUD_GetTime();
|
||||||
|
|
||||||
sprintf(fpsmsg, "%7.1f",(double)booplimit / ((double)da / FCEUD_GetTimeFreq()));
|
sprintf(fpsmsg, "%.1f", (double)booplimit / ((double)da / FCEUD_GetTimeFreq()));
|
||||||
DrawTextTrans(ClipSidesOffset + XBuf + ((256 - 2 * ClipSidesOffset) - 7 * 8) + (FSettings.FirstSLine+4)*256, 256, (uint8*)fpsmsg, 7);
|
DrawTextTrans(XBuf + ((256 - ClipSidesOffset) - 40) + (FSettings.FirstSLine + 4) * 256, 256, (uint8*)fpsmsg, 0xA0);
|
||||||
// It's not averaging FPS over exactly 1 second, but it's close enough.
|
// It's not averaging FPS over exactly 1 second, but it's close enough.
|
||||||
boopcount = (boopcount + 1) % booplimit;
|
boopcount = (boopcount + 1) % booplimit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ std::string FCEUI_GetSnapshotAsName();
|
||||||
void FCEUI_SetSnapshotAsName(std::string name);
|
void FCEUI_SetSnapshotAsName(std::string name);
|
||||||
bool FCEUI_ShowFPS();
|
bool FCEUI_ShowFPS();
|
||||||
void FCEUI_SetShowFPS(bool showFPS);
|
void FCEUI_SetShowFPS(bool showFPS);
|
||||||
|
void FCEUI_ToggleShowFPS();
|
||||||
void ShowFPS();
|
void ShowFPS();
|
||||||
void snapAVI();
|
void snapAVI();
|
||||||
#endif
|
#endif
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue