1. Debugger no longer reloads itself to load new game .DEB data
2. Added checkbox for .DEB loading 3. Updated Symbolic Debugging info in help documents 4. Made bookmarks work (need to check the rest of the //MBG TODO items too)
This commit is contained in:
parent
62628250b2
commit
05c76ec6c2
|
@ -657,11 +657,22 @@ void EditBreakList() {
|
||||||
void FillBreakList(HWND hwndDlg) {
|
void FillBreakList(HWND hwndDlg) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < numWPs; i++) {
|
||||||
|
SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_DELETESTRING,i,0);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < numWPs; i++) {
|
for (i = 0; i < numWPs; i++) {
|
||||||
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,LB_INSERTSTRING,-1,(LPARAM)(LPSTR)BreakToText(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);
|
||||||
|
|
||||||
|
numWPs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void EnableBreak(int sel) {
|
void EnableBreak(int sel) {
|
||||||
watchpoint[sel].flags^=WP_E;
|
watchpoint[sel].flags^=WP_E;
|
||||||
SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_DELETESTRING,sel,0);
|
SendDlgItemMessage(hDebug,IDC_DEBUGGER_BP_LIST,LB_DELETESTRING,sel,0);
|
||||||
|
@ -945,6 +956,46 @@ BOOL CALLBACK DebuggerEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LoadGameDebuggerData(HWND hwndDlg = hDebug) {
|
||||||
|
|
||||||
|
extern int loadDebugDataFailed;
|
||||||
|
|
||||||
|
if (!hwndDlg)
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (symbDebugEnabled)
|
||||||
|
{
|
||||||
|
CheckDlgButton(hwndDlg, IDC_DEBUGGER_ENABLE_SYMBOLIC, BST_CHECKED);
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearBreakList(hwndDlg);
|
||||||
|
|
||||||
|
numWPs = myNumWPs;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bookmarks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
FillBreakList(hwndDlg);
|
||||||
|
}
|
||||||
|
|
||||||
BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||||
RECT wrect;
|
RECT wrect;
|
||||||
char str[256]={0},*ptr,dotdot[4];
|
char str[256]={0},*ptr,dotdot[4];
|
||||||
|
@ -956,8 +1007,8 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
//these messages get handled at any time
|
//these messages get handled at any time
|
||||||
switch(uMsg) {
|
switch(uMsg) {
|
||||||
case WM_INITDIALOG: {
|
case WM_INITDIALOG: {
|
||||||
|
CheckDlgButton(hwndDlg, DEBUGLOADDEB, debuggerSaveLoadDEBFiles ? MF_CHECKED : MF_UNCHECKED);
|
||||||
CheckDlgButton(hwndDlg, DEBUGAUTOLOAD, debuggerAutoload ? MF_CHECKED : MF_UNCHECKED);
|
CheckDlgButton(hwndDlg, DEBUGAUTOLOAD, debuggerAutoload ? MF_CHECKED : MF_UNCHECKED);
|
||||||
extern int loadDebugDataFailed;
|
|
||||||
if (DbgPosX==-32000) DbgPosX=0; //Just in case
|
if (DbgPosX==-32000) DbgPosX=0; //Just in case
|
||||||
if (DbgPosY==-32000) DbgPosY=0;
|
if (DbgPosY==-32000) DbgPosY=0;
|
||||||
SetWindowPos(hwndDlg,0,DbgPosX,DbgPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER);
|
SetWindowPos(hwndDlg,0,DbgPosX,DbgPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER);
|
||||||
|
@ -1001,31 +1052,7 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
|
|
||||||
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BOOKMARK,EM_SETLIMITTEXT,4,0);
|
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BOOKMARK,EM_SETLIMITTEXT,4,0);
|
||||||
|
|
||||||
if (!loadDebugDataFailed)
|
LoadGameDebuggerData(hwndDlg);
|
||||||
{
|
|
||||||
if (bookmarks)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
for (i=0;i<bookmarks;i++)
|
|
||||||
{
|
|
||||||
char buffer[5];
|
|
||||||
sprintf(buffer, "%X", bookmarkData[i]);
|
|
||||||
AddDebuggerBookmark2(hwndDlg, buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (symbDebugEnabled)
|
|
||||||
{
|
|
||||||
CheckDlgButton(hwndDlg, IDC_DEBUGGER_ENABLE_SYMBOLIC, BST_CHECKED);
|
|
||||||
}
|
|
||||||
|
|
||||||
numWPs = myNumWPs;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bookmarks = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
debuggerWasActive = 1;
|
debuggerWasActive = 1;
|
||||||
|
|
||||||
|
@ -1034,7 +1061,6 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
FCEUI_Debugger().badopbreak = false;
|
FCEUI_Debugger().badopbreak = false;
|
||||||
debugger_open = 1;
|
debugger_open = 1;
|
||||||
inDebugger = true;
|
inDebugger = true;
|
||||||
FillBreakList(hwndDlg);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1099,6 +1125,10 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
case DEBUGAUTOLOAD:
|
case DEBUGAUTOLOAD:
|
||||||
debuggerAutoload ^= 1;
|
debuggerAutoload ^= 1;
|
||||||
break;
|
break;
|
||||||
|
case DEBUGLOADDEB:
|
||||||
|
debuggerSaveLoadDEBFiles = !debuggerSaveLoadDEBFiles;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1472,6 +1502,15 @@ void UpdatePatcher(HWND hwndDlg){
|
||||||
else EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_BTN_SAVE),TRUE);
|
else EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_BTN_SAVE),TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Updates debugger controls that should be enabled/disabled if a game is loaded.
|
||||||
|
/// @param enable Flag that indicates whether the menus should be enabled (1) or disabled (0).
|
||||||
|
void updateGameDependentMenusDebugger(unsigned int enable) {
|
||||||
|
if (!hDebug)
|
||||||
|
return;
|
||||||
|
|
||||||
|
EnableWindow(GetDlgItem(hDebug,DEBUGLOADDEB),(enable ? 0 : 1));
|
||||||
|
}
|
||||||
|
|
||||||
void DoDebug(uint8 halt) {
|
void DoDebug(uint8 halt) {
|
||||||
if (!debugger_open) {
|
if (!debugger_open) {
|
||||||
hDebug = CreateDialog(fceu_hInstance,"DEBUGGER",NULL,DebuggerCallB);
|
hDebug = CreateDialog(fceu_hInstance,"DEBUGGER",NULL,DebuggerCallB);
|
||||||
|
@ -1480,6 +1519,9 @@ void DoDebug(uint8 halt) {
|
||||||
}
|
}
|
||||||
if (hDebug) {
|
if (hDebug) {
|
||||||
SetWindowPos(hDebug,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);
|
SetWindowPos(hDebug,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);
|
||||||
|
|
||||||
|
updateGameDependentMenusDebugger(GameInfo != 0);
|
||||||
|
|
||||||
if (GameInfo) UpdateDebugger();
|
if (GameInfo) UpdateDebugger();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@ void UpdateDebugger();
|
||||||
void DoDebug(uint8 halt);
|
void DoDebug(uint8 halt);
|
||||||
void DebuggerExit();
|
void DebuggerExit();
|
||||||
|
|
||||||
|
void LoadGameDebuggerData(HWND hwndDlg);
|
||||||
|
void updateGameDependentMenusDebugger(unsigned int enable);
|
||||||
|
|
||||||
extern bool inDebugger;
|
extern bool inDebugger;
|
||||||
|
|
||||||
extern class DebugSystem {
|
extern class DebugSystem {
|
||||||
|
|
|
@ -772,6 +772,17 @@ void DeleteDebuggerBookmark(HWND hwnd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all debugger bookmarks
|
||||||
|
*
|
||||||
|
* @param hwnd HWND of the debugger window
|
||||||
|
**/
|
||||||
|
void ClearDebuggerBookmarkListbox(HWND hwnd)
|
||||||
|
{
|
||||||
|
SendDlgItemMessage(hwnd, LIST_DEBUGGER_BOOKMARKS, LB_RESETCONTENT, 0, 0);
|
||||||
|
//dumpBookmarks(hwnd);
|
||||||
|
}
|
||||||
|
|
||||||
void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr);
|
void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -789,6 +800,5 @@ void GoToDebuggerBookmark(HWND hwnd)
|
||||||
|
|
||||||
n = getBookmarkAddress(hwnd, selectedItem);
|
n = getBookmarkAddress(hwnd, selectedItem);
|
||||||
|
|
||||||
//Disassemble(hwnd, 300, 301, n);
|
Disassemble(hwnd, IDC_DEBUGGER_DISASSEMBLY, IDC_DEBUGGER_DISASSEMBLY_VSCR, n);
|
||||||
//MBG TODO
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,8 @@ void replaceNames(Name* list, char* str);
|
||||||
void AddDebuggerBookmark(HWND hwnd);
|
void AddDebuggerBookmark(HWND hwnd);
|
||||||
void AddDebuggerBookmark2(HWND hwnd, char* buffer);
|
void AddDebuggerBookmark2(HWND hwnd, char* buffer);
|
||||||
void DeleteDebuggerBookmark(HWND hwnd);
|
void DeleteDebuggerBookmark(HWND hwnd);
|
||||||
|
void ClearDebuggerBookmarkListbox(HWND hwnd);
|
||||||
|
|
||||||
void GoToDebuggerBookmark(HWND hwnd);
|
void GoToDebuggerBookmark(HWND hwnd);
|
||||||
void dumpBookmarks(HWND hwmd);
|
void dumpBookmarks(HWND hwmd);
|
||||||
int isHex(char c);
|
int isHex(char c);
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "../../debug.h"
|
#include "../../debug.h"
|
||||||
|
|
||||||
extern char symbDebugEnabled;
|
extern char symbDebugEnabled;
|
||||||
bool wasinDebugger = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores debugger preferences in a file
|
* Stores debugger preferences in a file
|
||||||
|
@ -135,11 +134,6 @@ int storePreferences(char* romname)
|
||||||
int result;
|
int result;
|
||||||
int Counter = 0;
|
int Counter = 0;
|
||||||
|
|
||||||
// Prevent any attempts at file usage if the debugger is open
|
|
||||||
//if (inDebugger) return 0;
|
|
||||||
|
|
||||||
wasinDebugger = inDebugger;
|
|
||||||
|
|
||||||
// Prevent any attempts at file usage if the debugger is open
|
// Prevent any attempts at file usage if the debugger is open
|
||||||
// Moved debugger exit code due to complaints and the Debugger menu option being enabled
|
// Moved debugger exit code due to complaints and the Debugger menu option being enabled
|
||||||
|
|
||||||
|
@ -182,16 +176,20 @@ int storePreferences(char* romname)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoDebuggerRunCheck()
|
void DoDebuggerDataReload()
|
||||||
{
|
{
|
||||||
if (debuggerSaveLoadDEBFiles == false) {
|
if (debuggerSaveLoadDEBFiles == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wasinDebugger){
|
extern HWND hDebug;
|
||||||
DebuggerExit();
|
LoadGameDebuggerData(hDebug);
|
||||||
DoDebug(0);
|
|
||||||
}
|
// if (wasinDebugger){
|
||||||
|
// DebuggerExit();
|
||||||
|
// DoDebug(0);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int myNumWPs = 0;
|
int myNumWPs = 0;
|
||||||
|
@ -231,9 +229,9 @@ int loadDebuggerPreferences(FILE* f)
|
||||||
// conditional text loading when reusing a used condText.
|
// conditional text loading when reusing a used condText.
|
||||||
for (i=0;i<65;i++)
|
for (i=0;i<65;i++)
|
||||||
{
|
{
|
||||||
watchpoint[i].cond = NULL;
|
watchpoint[i].cond = 0;
|
||||||
watchpoint[i].condText = NULL;
|
watchpoint[i].condText = 0;
|
||||||
watchpoint[i].desc = NULL;
|
watchpoint[i].desc = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the breakpoints
|
// Read the breakpoints
|
||||||
|
|
|
@ -25,4 +25,4 @@ extern bool inDebugger;
|
||||||
|
|
||||||
int storePreferences(char* romname);
|
int storePreferences(char* romname);
|
||||||
int loadPreferences(char* romname);
|
int loadPreferences(char* romname);
|
||||||
void DoDebuggerRunCheck();
|
void DoDebuggerDataReload();
|
||||||
|
|
|
@ -1038,6 +1038,7 @@ BEGIN
|
||||||
PUSHBUTTON "Run Line",IDC_DEBUGGER_RUN_LINE,349,39,37,14
|
PUSHBUTTON "Run Line",IDC_DEBUGGER_RUN_LINE,349,39,37,14
|
||||||
PUSHBUTTON "128 Lines",IDC_DEBUGGER_RUN_FRAME2,389,39,37,14
|
PUSHBUTTON "128 Lines",IDC_DEBUGGER_RUN_FRAME2,389,39,37,14
|
||||||
LTEXT "Scanline: PPU Pixel:",IDC_STATIC,436,191,78,8
|
LTEXT "Scanline: PPU Pixel:",IDC_STATIC,436,191,78,8
|
||||||
|
CONTROL "Load .DEB",DEBUGLOADDEB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,495,297,46,10
|
||||||
CONTROL "Auto-load",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,495,308,46,10
|
CONTROL "Auto-load",DEBUGAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,495,308,46,10
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -470,6 +470,7 @@
|
||||||
#define IDC_LUACONSOLE_CHOOSEFONT 1255
|
#define IDC_LUACONSOLE_CHOOSEFONT 1255
|
||||||
#define IDC_EDIT_LUAARGS 1256
|
#define IDC_EDIT_LUAARGS 1256
|
||||||
#define CB_PARTIALVISUALTHEME 1257
|
#define CB_PARTIALVISUALTHEME 1257
|
||||||
|
#define DEBUGLOADDEB 1258
|
||||||
#define MENU_NETWORK 40040
|
#define MENU_NETWORK 40040
|
||||||
#define MENU_PALETTE 40041
|
#define MENU_PALETTE 40041
|
||||||
#define MENU_SOUND 40042
|
#define MENU_SOUND 40042
|
||||||
|
|
|
@ -1005,6 +1005,7 @@ void CloseGame()
|
||||||
FCEUI_CloseGame();
|
FCEUI_CloseGame();
|
||||||
KillMemView();
|
KillMemView();
|
||||||
updateGameDependentMenus(GameInfo != 0);
|
updateGameDependentMenus(GameInfo != 0);
|
||||||
|
updateGameDependentMenusDebugger(GameInfo != 0);
|
||||||
SetWindowText(hAppWnd, FCEU_NAME_AND_VERSION);
|
SetWindowText(hAppWnd, FCEU_NAME_AND_VERSION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1067,6 +1068,7 @@ bool ALoad(char *nameo, char* innerFilename)
|
||||||
ParseGIInput(GameInfo);
|
ParseGIInput(GameInfo);
|
||||||
|
|
||||||
updateGameDependentMenus(GameInfo != 0);
|
updateGameDependentMenus(GameInfo != 0);
|
||||||
|
updateGameDependentMenusDebugger(GameInfo != 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2272,6 +2274,7 @@ int CreateMainWindow()
|
||||||
UpdateMovieRMenu(recentmoviemenu, recent_movie, MENU_MOVIE_RECENT, MOVIE_FIRST_RECENT_FILE);
|
UpdateMovieRMenu(recentmoviemenu, recent_movie, MENU_MOVIE_RECENT, MOVIE_FIRST_RECENT_FILE);
|
||||||
|
|
||||||
updateGameDependentMenus(0);
|
updateGameDependentMenus(0);
|
||||||
|
updateGameDependentMenusDebugger(0);
|
||||||
if (MainWindow_wndx==-32000) MainWindow_wndx=0; //Just in case
|
if (MainWindow_wndx==-32000) MainWindow_wndx=0; //Just in case
|
||||||
if (MainWindow_wndy==-32000) MainWindow_wndy=0;
|
if (MainWindow_wndy==-32000) MainWindow_wndy=0;
|
||||||
hAppWnd = CreateWindowEx(
|
hAppWnd = CreateWindowEx(
|
||||||
|
|
|
@ -34,7 +34,6 @@ void UpdateCheckedMenuItems();
|
||||||
bool ALoad(char* nameo, char* innerFilename=0);
|
bool ALoad(char* nameo, char* innerFilename=0);
|
||||||
void LoadNewGamey(HWND hParent, const char *initialdir);
|
void LoadNewGamey(HWND hParent, const char *initialdir);
|
||||||
int BrowseForFolder(HWND hParent, const char *htext, char *buf);
|
int BrowseForFolder(HWND hParent, const char *htext, char *buf);
|
||||||
void UpdateCheckedMenuItems();
|
|
||||||
void SetMainWindowStuff();
|
void SetMainWindowStuff();
|
||||||
void GetMouseData(uint32 (&md)[3]);
|
void GetMouseData(uint32 (&md)[3]);
|
||||||
//void ChangeMenuItemText(int menuitem, string text);
|
//void ChangeMenuItemText(int menuitem, string text);
|
||||||
|
|
|
@ -485,7 +485,7 @@ endlseq:
|
||||||
FCEU_LoadGameCheats(0);
|
FCEU_LoadGameCheats(0);
|
||||||
|
|
||||||
#if defined (WIN32) || defined (WIN64)
|
#if defined (WIN32) || defined (WIN64)
|
||||||
DoDebuggerRunCheck(); //Can't safely do it in loadPreferences
|
DoDebuggerDataReload(); // Reloads data without reopening window
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return GameInfo;
|
return GameInfo;
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue