diff --git a/trunk/src/drivers/win/config.cpp b/trunk/src/drivers/win/config.cpp index 04ed5a9c..66e7c96a 100644 --- a/trunk/src/drivers/win/config.cpp +++ b/trunk/src/drivers/win/config.cpp @@ -73,6 +73,7 @@ extern bool oldInputDisplay; extern bool fullSaveStateLoads; extern int frameSkipAmt; extern int32 fps_scale_frameadvance; +extern bool symbDebugEnabled; extern TASEDITOR_CONFIG taseditorConfig; extern char* recentProjectsArray[]; @@ -271,8 +272,11 @@ static CFGSTRUCT fceuconfig[] = AC(frameAdvanceLagSkip), AC(debuggerAutoload), AC(allowUDLR), + AC(symbDebugEnabled), AC(debuggerSaveLoadDEBFiles), AC(debuggerDisplayROMoffsets), + AC(debuggerFontSize), + AC(hexeditorFontSize), AC(fullSaveStateLoads), AC(frameSkipAmt), AC(fps_scale_frameadvance), diff --git a/trunk/src/drivers/win/debugger.cpp b/trunk/src/drivers/win/debugger.cpp index 43acaec3..b45e21e6 100644 --- a/trunk/src/drivers/win/debugger.cpp +++ b/trunk/src/drivers/win/debugger.cpp @@ -1560,12 +1560,12 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara //setup font 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_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_Y,WM_SETFONT,(WPARAM)debugSystem->hFixedFont,FALSE); - SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_VAL_PC,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_Y,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_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); //text limits @@ -2233,17 +2233,23 @@ void DoDebug(uint8 halt) //----------------------------------------- DebugSystem* debugSystem; +unsigned int debuggerFontSize = 15; +unsigned int hexeditorFontSize = 15; DebugSystem::DebugSystem() { - hFixedFont = CreateFont(FIXED_FONT_HEIGHT, 8, /*Height,Width*/ +} + +void DebugSystem::init() +{ + hFixedFont = CreateFont(debuggerFontSize, debuggerFontSize / 2, /*Height,Width*/ 0,0, /*escapement,orientation*/ FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/ ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/ DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/ "Courier New"); /*font name*/ - hHexeditorFont = CreateFont(14, 8, /*Height,Width*/ + hHexeditorFont = CreateFont(hexeditorFontSize, hexeditorFontSize / 2, /*Height,Width*/ 0,0, /*escapement,orientation*/ FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/ ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/ @@ -2268,7 +2274,15 @@ DebugSystem::DebugSystem() DebugSystem::~DebugSystem() { - DeleteObject(hFixedFont); - DeleteObject(hHexeditorFont); + if (hFixedFont) + { + DeleteObject(hFixedFont); + hFixedFont = 0; + } + if (hHexeditorFont) + { + DeleteObject(hHexeditorFont); + hHexeditorFont = 0; + } } diff --git a/trunk/src/drivers/win/debugger.h b/trunk/src/drivers/win/debugger.h index 2ab4d9cc..fc204a47 100644 --- a/trunk/src/drivers/win/debugger.h +++ b/trunk/src/drivers/win/debugger.h @@ -5,9 +5,6 @@ #include //#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 // Maximum number of breakpoints supported #define MAXIMUM_NUMBER_OF_BREAKPOINTS 64 @@ -25,6 +22,9 @@ extern bool debuggerAutoload; extern bool debuggerSaveLoadDEBFiles; extern bool debuggerDisplayROMoffsets; +extern unsigned int debuggerFontSize; +extern unsigned int hexeditorFontSize; + void CenterWindow(HWND hwndDlg); void DoPatcher(int address,HWND hParent); void UpdatePatcher(HWND hwndDlg); @@ -49,6 +49,8 @@ public: DebugSystem(); ~DebugSystem(); + void init(); + HFONT hFixedFont; int fixedFontWidth; int fixedFontHeight; diff --git a/trunk/src/drivers/win/debuggersp.cpp b/trunk/src/drivers/win/debuggersp.cpp index 95d563dc..7b63ec5a 100644 --- a/trunk/src/drivers/win/debuggersp.cpp +++ b/trunk/src/drivers/win/debuggersp.cpp @@ -40,7 +40,7 @@ int lastBank = -1; int loadedBank = -1; extern char LoadedRomFName[2048]; char NLfilename[2048]; -char symbDebugEnabled = 0; +bool symbDebugEnabled = false; int debuggerWasActive = 0; char temp_chr[40] = {0}; char delimiterChar[2] = "#"; diff --git a/trunk/src/drivers/win/debuggersp.h b/trunk/src/drivers/win/debuggersp.h index 1282520b..ecebe96e 100644 --- a/trunk/src/drivers/win/debuggersp.h +++ b/trunk/src/drivers/win/debuggersp.h @@ -32,7 +32,7 @@ struct Name char* comment; }; -extern char symbDebugEnabled; +extern bool symbDebugEnabled; extern std::vector bookmarks_addr; extern std::vector bookmarks_name; extern int debuggerWasActive; diff --git a/trunk/src/drivers/win/main.cpp b/trunk/src/drivers/win/main.cpp index 6f362ecc..a9db0d71 100644 --- a/trunk/src/drivers/win/main.cpp +++ b/trunk/src/drivers/win/main.cpp @@ -627,7 +627,6 @@ int main(int argc,char *argv[]) } InitCommonControls(); - debugSystem = new DebugSystem(); if(!FCEUI_Initialize()) { @@ -748,6 +747,9 @@ int main(int argc,char *argv[]) return 1; } + debugSystem = new DebugSystem(); + debugSystem->init(); + InitSpeedThrottle(); if (t) diff --git a/trunk/src/drivers/win/memview.cpp b/trunk/src/drivers/win/memview.cpp index 782a731d..b2870d5d 100644 --- a/trunk/src/drivers/win/memview.cpp +++ b/trunk/src/drivers/win/memview.cpp @@ -160,7 +160,7 @@ int MemFind_wndx, MemFind_wndy; bool MemView_HighlightActivity = true; unsigned int MemView_HighlightActivity_FadingPeriod = HIGHLIGHT_ACTIVITY_NUM_COLORS; bool MemView_HighlightActivity_FadeWhenPaused = false; -int MemViewSizeX = 580, MemViewSizeY = 248; +int MemViewSizeX = 630, MemViewSizeY = 300; static RECT newMemViewRect; static char chartable[256]; diff --git a/trunk/src/drivers/win/pref.cpp b/trunk/src/drivers/win/pref.cpp index fad9cea9..2ddcb32e 100644 --- a/trunk/src/drivers/win/pref.cpp +++ b/trunk/src/drivers/win/pref.cpp @@ -34,8 +34,6 @@ extern uint64 break_cycles_limit; extern bool break_on_instructions; extern uint64 break_instructions_limit; -extern char symbDebugEnabled; - /** * Stores debugger preferences in a file * @@ -48,9 +46,6 @@ int storeDebuggerPreferences(FILE* f) unsigned int size, len; 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 size = bookmarks_addr.size(); bookmarks_name.resize(size); @@ -232,9 +227,6 @@ int loadDebuggerPreferences(FILE* f) unsigned int i, size, len; 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 if (fread(&size, sizeof(unsigned int), 1, f) != 1) return 1; bookmarks_addr.resize(size); diff --git a/trunk/src/drivers/win/tracer.cpp b/trunk/src/drivers/win/tracer.cpp index dd9a4761..664a93ae 100644 --- a/trunk/src/drivers/win/tracer.cpp +++ b/trunk/src/drivers/win/tracer.cpp @@ -422,7 +422,7 @@ BOOL CALLBACK TracerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) tracesi.nPos -= i; if ((tracesi.nPos + (int)tracesi.nPage) > tracesi.nMax) tracesi.nPos = tracesi.nMax - tracesi.nPage; - else if (tracesi.nPos < tracesi.nMin) + if (tracesi.nPos < tracesi.nMin) tracesi.nPos = tracesi.nMin; SetScrollInfo(GetDlgItem(hTracer, IDC_SCRL_TRACER_LOG), SB_CTL, &tracesi, TRUE);