From 64ad48ee52dc349f2387ab6d4ed1c0428d5f6a40 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 17 Aug 2015 14:00:40 +0000 Subject: [PATCH] Slight compression, so that we have more space at the bottom for height restricted screens. Add some colours to the prompt, so it is more visible. General improvements to the section parsing Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3928 --- src/debug/debug.cpp | 13 +++++++----- src/debug/debug_gui.cpp | 45 +++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp index b215c301..a9816ad5 100644 --- a/src/debug/debug.cpp +++ b/src/debug/debug.cpp @@ -686,14 +686,14 @@ static void DrawData(void) { /* Data win */ for (int y=0; y<8; y++) { // Address - if (add<0x10000) mvwprintw (dbg.win_data,1+y,0,"%04X:%04X ",dataSeg,add); - else mvwprintw (dbg.win_data,1+y,0,"%04X:%08X ",dataSeg,add); + if (add<0x10000) mvwprintw (dbg.win_data,y,0,"%04X:%04X ",dataSeg,add); + else mvwprintw (dbg.win_data,y,0,"%04X:%08X ",dataSeg,add); for (int x=0; x<16; x++) { address = GetAddress(dataSeg,add); if (mem_readb_checked(address,&ch)) ch=0; - mvwprintw (dbg.win_data,1+y,14+3*x,"%02X",ch); + mvwprintw (dbg.win_data,y,14+3*x,"%02X",ch); if (ch<32 || !isprint(*reinterpret_cast(&ch))) ch='.'; - mvwprintw (dbg.win_data,1+y,63+x,"%c",ch); + mvwprintw (dbg.win_data,y,63+x,"%c",ch); add++; }; } @@ -849,8 +849,9 @@ static void DrawCode(void) { codeViewData.useEIPlast = disEIP; - wattrset(dbg.win_code,0); + wattrset(dbg.win_code,0); if (!debugging) { + if (has_colors()) wattrset(dbg.win_code,COLOR_PAIR(PAIR_GREEN_BLACK)); mvwprintw(dbg.win_code,10,0,"%s","(Running)"); wclrtoeol(dbg.win_code); } else { @@ -860,11 +861,13 @@ static void DrawCode(void) { mvwprintw(dbg.win_code,10,0,"%c-> %s%c", (codeViewData.ovrMode?'O':'I'),dispPtr,(*curPtr?' ':'_')); wclrtoeol(dbg.win_code); // not correct in pdcurses if full line + mvwchgat(dbg.win_code,10,0,3,0,(PAIR_BLACK_GREY),NULL); if (*curPtr) { mvwchgat(dbg.win_code,10,(curPtr-dispPtr+4),1,0,(PAIR_BLACK_GREY),NULL); } } + wattrset(dbg.win_code,0); wrefresh(dbg.win_code); } diff --git a/src/debug/debug_gui.cpp b/src/debug/debug_gui.cpp index ca9e202b..be122582 100644 --- a/src/debug/debug_gui.cpp +++ b/src/debug/debug_gui.cpp @@ -146,15 +146,15 @@ static void DrawBars(void) { attrset(COLOR_PAIR(PAIR_BLACK_BLUE)); } /* Show the Register bar */ - mvaddstr(1-1,0, "---(Register Overview )---"); + mvaddstr(1-1,0, "-----(Register Overview )----- "); /* Show the Data Overview bar perhaps with more special stuff in the end */ - mvaddstr(6-1,0,"---(Data Overview Scroll: page up/down)---"); - /* Show the Code Overview perhaps with special stuff in bar too */ - mvaddstr(17-1,0,"---(Code Overview Scroll: up/down )---"); + mvaddstr(6-1,0, "-----(Data Overview Scroll: page up/down)----- "); + /* Show the Code Overview perhaps with special stuff in bar too */ + mvaddstr(15-1,0,"-----(Code Overview Scroll: up/down )----- "); /* Show the Variable Overview bar */ - mvaddstr(29-1,0, "---(Variable Overview )---"); + mvaddstr(27-1,0,"-----(Variable Overview )----- "); /* Show the Output OverView */ - mvaddstr(34-1,0, "---(Output Scroll: home/end )---"); + mvaddstr(32-1,0,"-----(Output Scroll: home/end )----- "); attrset(0); //Match values with below. So we don't need to touch the internal window structures } @@ -170,14 +170,14 @@ static void MakeSubWindows(void) { dbg.win_reg=subwin(dbg.win_main,4,win_main_maxx,outy,0); outy+=5; // 6 /* The Data Window */ - dbg.win_data=subwin(dbg.win_main,10,win_main_maxx,outy,0); - outy+=11; // 17 + dbg.win_data=subwin(dbg.win_main,8,win_main_maxx,outy,0); + outy+=9; // 15 /* The Code Window */ dbg.win_code=subwin(dbg.win_main,11,win_main_maxx,outy,0); - outy+=12; // 29 + outy+=12; // 27 /* The Variable Window */ dbg.win_var=subwin(dbg.win_main,4,win_main_maxx,outy,0); - outy+=5; // 34 + outy+=5; // 32 /* The Output Window */ dbg.win_out=subwin(dbg.win_main,win_main_maxy-outy,win_main_maxx,outy,0); if(!dbg.win_reg ||!dbg.win_data || !dbg.win_code || !dbg.win_var || !dbg.win_out) E_Exit("Setting up windows failed"); @@ -197,20 +197,21 @@ static void MakePairs(void) { } static void LOG_Destroy(Section*) { if(debuglog) fclose(debuglog); + debuglog = 0; } static void LOG_Init(Section * sec) { - Section_prop * sect=static_cast(sec); - const char * blah=sect->Get_string("logfile"); - if(blah && blah[0] &&(debuglog = fopen(blah,"wt+"))){ - }else{ - debuglog=0; + Section_prop * sect = static_cast(sec); + const char * blah = sect->Get_string("logfile"); + if(blah && blah[0] && (debuglog = fopen(blah,"wt+"))){ + ; + } else { + debuglog = 0; } sect->AddDestroyFunction(&LOG_Destroy); - char buf[1024]; - for (Bitu i=1;iGet_bool(buf); } @@ -253,9 +254,9 @@ void LOG_StartUp(void) { Section_prop * sect=control->AddSection_prop("log",LOG_Init); Prop_string* Pstring = sect->Add_string("logfile",Property::Changeable::Always,""); Pstring->Set_help("file where the log messages will be saved to"); - char buf[1024]; - for (Bitu i=1;iAdd_bool(buf,Property::Changeable::Always,true); Pbool->Set_help("Enable/Disable logging of this type.");