1
0
Fork 0

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
This commit is contained in:
Peter Veenstra 2015-08-17 14:00:40 +00:00
parent 59c9ae1d60
commit 64ad48ee52
2 changed files with 31 additions and 27 deletions

View file

@ -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<unsigned char*>(&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);
}

View file

@ -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<Section_prop *>(sec);
const char * blah=sect->Get_string("logfile");
if(blah && blah[0] &&(debuglog = fopen(blah,"wt+"))){
}else{
debuglog=0;
Section_prop * sect = static_cast<Section_prop *>(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;i<LOG_MAX;i++) {
strcpy(buf,loggrp[i].front);
buf[strlen(buf)]=0;
char buf[64];
for (Bitu i = LOG_ALL + 1;i < LOG_MAX;i++) { //Skip LOG_ALL, it is always enabled
safe_strncpy(buf,loggrp[i].front,sizeof(buf));
lowcase(buf);
loggrp[i].enabled=sect->Get_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;i<LOG_MAX;i++) {
strcpy(buf,loggrp[i].front);
char buf[64];
for (Bitu i = LOG_ALL + 1;i < LOG_MAX;i++) {
safe_strncpy(buf,loggrp[i].front, sizeof(buf));
lowcase(buf);
Prop_bool* Pbool = sect->Add_bool(buf,Property::Changeable::Always,true);
Pbool->Set_help("Enable/Disable logging of this type.");