* Debugger: "Symbolic Debug" state is now saved in global fceux.cfg instead of different .deb files

* Debugger: debuggerFontSize can be specified in fceux.cfg
* Hexeditor: hexeditorFontSize can be specified in fceux.cfg
This commit is contained in:
ansstuff 2013-09-13 13:30:31 +00:00
parent df5132609e
commit a6c62b4b5f
9 changed files with 39 additions and 25 deletions

View File

@ -73,6 +73,7 @@ extern bool oldInputDisplay;
extern bool fullSaveStateLoads; extern bool fullSaveStateLoads;
extern int frameSkipAmt; extern int frameSkipAmt;
extern int32 fps_scale_frameadvance; extern int32 fps_scale_frameadvance;
extern bool symbDebugEnabled;
extern TASEDITOR_CONFIG taseditorConfig; extern TASEDITOR_CONFIG taseditorConfig;
extern char* recentProjectsArray[]; extern char* recentProjectsArray[];
@ -271,8 +272,11 @@ static CFGSTRUCT fceuconfig[] =
AC(frameAdvanceLagSkip), AC(frameAdvanceLagSkip),
AC(debuggerAutoload), AC(debuggerAutoload),
AC(allowUDLR), AC(allowUDLR),
AC(symbDebugEnabled),
AC(debuggerSaveLoadDEBFiles), AC(debuggerSaveLoadDEBFiles),
AC(debuggerDisplayROMoffsets), AC(debuggerDisplayROMoffsets),
AC(debuggerFontSize),
AC(hexeditorFontSize),
AC(fullSaveStateLoads), AC(fullSaveStateLoads),
AC(frameSkipAmt), AC(frameSkipAmt),
AC(fps_scale_frameadvance), AC(fps_scale_frameadvance),

View File

@ -1560,12 +1560,12 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
//setup font //setup font
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_DISASSEMBLY,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_DISASSEMBLY,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_DISASSEMBLY_LEFT_PANEL,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_DISASSEMBLY_LEFT_PANEL,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_A,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); //SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_A,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_X,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); //SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_X,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_Y,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); //SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_Y,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_PC,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); //SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_PC,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_STACK_CONTENTS,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_STACK_CONTENTS,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_PCSEEK,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); //SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_PCSEEK,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE);
//text limits //text limits
@ -2233,17 +2233,23 @@ void DoDebug(uint8 halt)
//----------------------------------------- //-----------------------------------------
DebugSystem* debugSystem; DebugSystem* debugSystem;
unsigned int debuggerFontSize = 15;
unsigned int hexeditorFontSize = 15;
DebugSystem::DebugSystem() DebugSystem::DebugSystem()
{ {
hFixedFont = CreateFont(FIXED_FONT_HEIGHT, 8, /*Height,Width*/ }
void DebugSystem::init()
{
hFixedFont = CreateFont(debuggerFontSize, debuggerFontSize / 2, /*Height,Width*/
0,0, /*escapement,orientation*/ 0,0, /*escapement,orientation*/
FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/ FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/
ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/ ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/ DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
"Courier New"); /*font name*/ "Courier New"); /*font name*/
hHexeditorFont = CreateFont(14, 8, /*Height,Width*/ hHexeditorFont = CreateFont(hexeditorFontSize, hexeditorFontSize / 2, /*Height,Width*/
0,0, /*escapement,orientation*/ 0,0, /*escapement,orientation*/
FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/ FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/
ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/ ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
@ -2268,7 +2274,15 @@ DebugSystem::DebugSystem()
DebugSystem::~DebugSystem() DebugSystem::~DebugSystem()
{ {
DeleteObject(hFixedFont); if (hFixedFont)
DeleteObject(hHexeditorFont); {
DeleteObject(hFixedFont);
hFixedFont = 0;
}
if (hHexeditorFont)
{
DeleteObject(hHexeditorFont);
hHexeditorFont = 0;
}
} }

View File

@ -5,9 +5,6 @@
#include <windows.h> #include <windows.h>
//#include "debug.h" //#include "debug.h"
// this is default value, but use debugSystem->fixedFontHeight in calculations
#define FIXED_FONT_HEIGHT 14
// TODO: Maybe change breakpoint array to std::vector // TODO: Maybe change breakpoint array to std::vector
// Maximum number of breakpoints supported // Maximum number of breakpoints supported
#define MAXIMUM_NUMBER_OF_BREAKPOINTS 64 #define MAXIMUM_NUMBER_OF_BREAKPOINTS 64
@ -25,6 +22,9 @@ extern bool debuggerAutoload;
extern bool debuggerSaveLoadDEBFiles; extern bool debuggerSaveLoadDEBFiles;
extern bool debuggerDisplayROMoffsets; extern bool debuggerDisplayROMoffsets;
extern unsigned int debuggerFontSize;
extern unsigned int hexeditorFontSize;
void CenterWindow(HWND hwndDlg); void CenterWindow(HWND hwndDlg);
void DoPatcher(int address,HWND hParent); void DoPatcher(int address,HWND hParent);
void UpdatePatcher(HWND hwndDlg); void UpdatePatcher(HWND hwndDlg);
@ -49,6 +49,8 @@ public:
DebugSystem(); DebugSystem();
~DebugSystem(); ~DebugSystem();
void init();
HFONT hFixedFont; HFONT hFixedFont;
int fixedFontWidth; int fixedFontWidth;
int fixedFontHeight; int fixedFontHeight;

View File

@ -40,7 +40,7 @@ int lastBank = -1;
int loadedBank = -1; int loadedBank = -1;
extern char LoadedRomFName[2048]; extern char LoadedRomFName[2048];
char NLfilename[2048]; char NLfilename[2048];
char symbDebugEnabled = 0; bool symbDebugEnabled = false;
int debuggerWasActive = 0; int debuggerWasActive = 0;
char temp_chr[40] = {0}; char temp_chr[40] = {0};
char delimiterChar[2] = "#"; char delimiterChar[2] = "#";

View File

@ -32,7 +32,7 @@ struct Name
char* comment; char* comment;
}; };
extern char symbDebugEnabled; extern bool symbDebugEnabled;
extern std::vector<unsigned int> bookmarks_addr; extern std::vector<unsigned int> bookmarks_addr;
extern std::vector<std::string> bookmarks_name; extern std::vector<std::string> bookmarks_name;
extern int debuggerWasActive; extern int debuggerWasActive;

View File

@ -627,7 +627,6 @@ int main(int argc,char *argv[])
} }
InitCommonControls(); InitCommonControls();
debugSystem = new DebugSystem();
if(!FCEUI_Initialize()) if(!FCEUI_Initialize())
{ {
@ -748,6 +747,9 @@ int main(int argc,char *argv[])
return 1; return 1;
} }
debugSystem = new DebugSystem();
debugSystem->init();
InitSpeedThrottle(); InitSpeedThrottle();
if (t) if (t)

View File

@ -160,7 +160,7 @@ int MemFind_wndx, MemFind_wndy;
bool MemView_HighlightActivity = true; bool MemView_HighlightActivity = true;
unsigned int MemView_HighlightActivity_FadingPeriod = HIGHLIGHT_ACTIVITY_NUM_COLORS; unsigned int MemView_HighlightActivity_FadingPeriod = HIGHLIGHT_ACTIVITY_NUM_COLORS;
bool MemView_HighlightActivity_FadeWhenPaused = false; bool MemView_HighlightActivity_FadeWhenPaused = false;
int MemViewSizeX = 580, MemViewSizeY = 248; int MemViewSizeX = 630, MemViewSizeY = 300;
static RECT newMemViewRect; static RECT newMemViewRect;
static char chartable[256]; static char chartable[256];

View File

@ -34,8 +34,6 @@ extern uint64 break_cycles_limit;
extern bool break_on_instructions; extern bool break_on_instructions;
extern uint64 break_instructions_limit; extern uint64 break_instructions_limit;
extern char symbDebugEnabled;
/** /**
* Stores debugger preferences in a file * Stores debugger preferences in a file
* *
@ -48,9 +46,6 @@ int storeDebuggerPreferences(FILE* f)
unsigned int size, len; unsigned int size, len;
uint8 tmp; uint8 tmp;
// Flag that says whether symbolic debugging should be enabled
if (fwrite(&symbDebugEnabled, 1, 1, f) != 1) return 1;
// Write the number of CPU bookmarks // Write the number of CPU bookmarks
size = bookmarks_addr.size(); size = bookmarks_addr.size();
bookmarks_name.resize(size); bookmarks_name.resize(size);
@ -232,9 +227,6 @@ int loadDebuggerPreferences(FILE* f)
unsigned int i, size, len; unsigned int i, size, len;
uint8 tmp; uint8 tmp;
// Read flag that says if symbolic debugging is enabled
if (fread(&symbDebugEnabled, sizeof(symbDebugEnabled), 1, f) != 1) return 1;
// Read the number of CPU bookmarks // Read the number of CPU bookmarks
if (fread(&size, sizeof(unsigned int), 1, f) != 1) return 1; if (fread(&size, sizeof(unsigned int), 1, f) != 1) return 1;
bookmarks_addr.resize(size); bookmarks_addr.resize(size);

View File

@ -422,7 +422,7 @@ BOOL CALLBACK TracerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
tracesi.nPos -= i; tracesi.nPos -= i;
if ((tracesi.nPos + (int)tracesi.nPage) > tracesi.nMax) if ((tracesi.nPos + (int)tracesi.nPage) > tracesi.nMax)
tracesi.nPos = tracesi.nMax - tracesi.nPage; tracesi.nPos = tracesi.nMax - tracesi.nPage;
else if (tracesi.nPos < tracesi.nMin) if (tracesi.nPos < tracesi.nMin)
tracesi.nPos = tracesi.nMin; tracesi.nPos = tracesi.nMin;
SetScrollInfo(GetDlgItem(hTracer, IDC_SCRL_TRACER_LOG), SB_CTL, &tracesi, TRUE); SetScrollInfo(GetDlgItem(hTracer, IDC_SCRL_TRACER_LOG), SB_CTL, &tracesi, TRUE);