Merge pull request #2319 from Allofich/svn8

SVN commits
This commit is contained in:
Jonathan Campbell
2021-03-01 12:28:49 -08:00
committed by GitHub
4 changed files with 68 additions and 69 deletions

View File

@@ -51,9 +51,7 @@ Commit#: Reason for skipping:
4329 Conflict
4334 Conflict
4335 Conflict
(Commits in this interval are still TODO)
4347 Conflict
4357 Conflict
4360 Conflict
4367 Conflict

View File

@@ -374,14 +374,15 @@ public:
}
void ClearRelease(void) {
// clear out all cache blocks in this page
for (Bitu index=0;index<(1+DYN_PAGE_HASH);index++) {
CacheBlockDynRec * block=hash_map[index];
while (block) {
CacheBlockDynRec * nextblock=block->hash.next;
block->page.handler=0; // no need, full clear
block->Clear();
block=nextblock;
}
Bitu count=active_blocks;
CacheBlockDynRec **map=hash_map;
for (CacheBlockDynRec * block=*map;count;count--) {
while (block==NULL)
block=*++map;
CacheBlockDynRec * nextblock=block->hash.next;
block->page.handler=0; // no need, full clear
block->Clear();
block=nextblock;
}
Release(); // now can release this page
}

View File

@@ -296,8 +296,8 @@ static void SetColor(Bitu test) {
}
}
#define MAXCMDLEN 254
struct SCodeViewData {
#define MAXCMDLEN 254
struct SCodeViewData {
int cursorPos;
uint16_t firstInstSize;
uint16_t useCS;
@@ -444,7 +444,7 @@ class CDebugVar
{
public:
CDebugVar(char* _name, PhysPt _adr) { adr=_adr; safe_strncpy(name,_name,16); hasvalue = false; value = 0; };
char* GetName (void) { return name; };
PhysPt GetAdr (void) { return adr; };
void SetValue(bool has, uint16_t val) { hasvalue = has; value=val; };
@@ -457,7 +457,7 @@ private:
bool hasvalue;
uint16_t value;
public:
public:
static void InsertVariable(char* name, PhysPt adr);
static CDebugVar* FindVar (PhysPt pt);
static void DeleteAll ();
@@ -703,7 +703,7 @@ bool CBreakpoint::CheckBreakpoint(uint16_t seg, uint32_t off)
DEBUG_ShowMsg("DEBUG: Memory breakpoint %s: %04X:%04X - %02X -> %02X\n",(bp->GetType()==BKPNT_MEMORY_PROT)?"(Prot)":"",bp->GetSegment(),bp->GetOffset(),bp->GetValue(),value);
bp->SetValue(value);
return true;
}
}
}
}
#endif
@@ -740,7 +740,7 @@ bool CBreakpoint::CheckIntBreakpoint(PhysPt adr, uint8_t intNr, uint16_t ahValue
return false;
}
void CBreakpoint::DeleteAll()
void CBreakpoint::DeleteAll()
{
std::list<CBreakpoint*>::iterator i;
for(i=BPoints.begin(); i != BPoints.end(); ++i) {
@@ -752,7 +752,7 @@ void CBreakpoint::DeleteAll()
}
bool CBreakpoint::DeleteByIndex(uint16_t index)
bool CBreakpoint::DeleteByIndex(uint16_t index)
{
// Search matching breakpoint
int nr = 0;
@@ -829,7 +829,7 @@ bool CBreakpoint::DeleteBreakpoint(uint16_t seg, uint32_t off)
void CBreakpoint::ShowList(void)
{
// iterate list
// iterate list
int nr = 0;
std::list<CBreakpoint*>::iterator i;
for(i=BPoints.begin(); i != BPoints.end(); ++i) {
@@ -1183,7 +1183,7 @@ static void DrawInput(void) {
wclrtoeol(dbg.win_inp);
} else {
//TODO long lines
char* dispPtr = codeViewData.inputStr;
char* dispPtr = codeViewData.inputStr;
char* curPtr = &codeViewData.inputStr[codeViewData.inputPos];
wbkgdset(dbg.win_inp,COLOR_PAIR(PAIR_BLACK_GREY));
@@ -1236,13 +1236,13 @@ static void DrawCode(void) {
}
} else if (i == codeViewData.cursorPos) {
wbkgdset(dbg.win_code,COLOR_PAIR(PAIR_BLACK_GREY));
wattrset(dbg.win_code,COLOR_PAIR(PAIR_BLACK_GREY));
wattrset(dbg.win_code,COLOR_PAIR(PAIR_BLACK_GREY));
codeViewData.cursorSeg = codeViewData.useCS;
codeViewData.cursorOfs = disEIP;
saveSel = true;
} else if (CBreakpoint::IsBreakpoint(codeViewData.useCS, disEIP)) {
wbkgdset(dbg.win_code,COLOR_PAIR(PAIR_GREY_RED));
wattrset(dbg.win_code,COLOR_PAIR(PAIR_GREY_RED));
wattrset(dbg.win_code,COLOR_PAIR(PAIR_GREY_RED));
} else {
wbkgdset(dbg.win_code,0);
wattrset(dbg.win_code,0);
@@ -1301,7 +1301,7 @@ static void DrawCode(void) {
if (no_bytes) dline[0] = 0;
size_t dline_len = strlen(dline);
if (dline_len < 28) {
for (c = (Bitu)dline_len; c < 28; c++) dline[c] = ' ';
memset(dline + dline_len, ' ', 28 - dline_len);
dline[28] = 0;
}
waddstr(dbg.win_code,dline);
@@ -1332,7 +1332,7 @@ static void SetCodeWinStart()
if ((SegValue(cs)==codeViewData.useCS) && (reg_eip>=codeViewData.useEIP) && (reg_eip<=codeViewData.useEIPlast)) {
// in valid window - scroll ?
if (reg_eip>=codeViewData.useEIPmid) codeViewData.useEIP += codeViewData.firstInstSize;
} else {
// totally out of range.
codeViewData.useCS = SegValue(cs);
@@ -1619,7 +1619,7 @@ bool ParseCommand(char* str) {
uint32_t ofs = (uint16_t)GetHexValue(found,found); found++;
char name[16];
for (int i=0; i<16; i++) {
if (found[i] && (found[i]!=' ')) name[i] = found[i];
if (found[i] && (found[i]!=' ')) name[i] = found[i];
else { name[i] = 0; break; }
}
name[15] = 0;
@@ -1633,7 +1633,7 @@ bool ParseCommand(char* str) {
if (command == "SV") { // Save variables
char name[13];
for (int i=0; i<12; i++) {
if (found[i] && (found[i]!=' ')) name[i] = found[i];
if (found[i] && (found[i]!=' ')) name[i] = found[i];
else { name[i] = 0; break; }
}
name[12] = 0;
@@ -1645,7 +1645,7 @@ bool ParseCommand(char* str) {
if (command == "LV") { // load variables
char name[13];
for (int i=0; i<12; i++) {
if (found[i] && (found[i]!=' ')) name[i] = found[i];
if (found[i] && (found[i]!=' ')) name[i] = found[i];
else { name[i] = 0; break; }
}
name[12] = 0;
@@ -1808,9 +1808,9 @@ bool ParseCommand(char* str) {
if (command == "BPDEL") { // Delete Breakpoints
uint8_t bpNr = (uint8_t)GetHexValue(found,found);
if ((bpNr==0x00) && (*found=='*')) { // Delete all
CBreakpoint::DeleteAll();
CBreakpoint::DeleteAll();
DEBUG_ShowMsg("DEBUG: Breakpoints deleted.\n");
} else {
} else {
// delete single breakpoint
DEBUG_ShowMsg("DEBUG: Breakpoint deletion %s.\n",(CBreakpoint::DeleteByIndex(bpNr)?"success":"failure"));
}
@@ -2538,11 +2538,11 @@ bool ParseCommand(char* str) {
}
if (command == "GDT") {LogGDT(); return true;}
if (command == "LDT") {LogLDT(); return true;}
if (command == "IDT") {LogIDT(); return true;}
if (command == "PAGING") {LogPages(found); return true;}
if (command == "CPU") {LogCPUInfo(); return true;}
@@ -2579,7 +2579,7 @@ bool ParseCommand(char* str) {
}
}
if(command == "EXTEND") { //Toggle additional data.
if(command == "EXTEND") { //Toggle additional data.
showExtend = !showExtend;
return true;
}
@@ -2618,7 +2618,7 @@ bool ParseCommand(char* str) {
DEBUG_ShowMsg("BPPM [selector]:[offset]- Set pmode-memory breakpoint (memory change).\n");
DEBUG_ShowMsg("BPLM [linear address] - Set linear memory breakpoint (memory change).\n");
#endif
DEBUG_ShowMsg("BPLIST - List breakpoints.\n");
DEBUG_ShowMsg("BPLIST - List breakpoints.\n");
DEBUG_ShowMsg("BPDEL [bpNr] / * - Delete breakpoint nr / all.\n");
DEBUG_ShowMsg("C / D [segment]:[offset] - Set code / data view address.\n");
DEBUG_ShowMsg("DOS MCBS - Show Memory Control Block chain.\n");
@@ -2678,7 +2678,7 @@ bool ParseCommand(char* str) {
DEBUG_ShowMsg("Home/End - Move to begin/end of the current window.\n");
DEBUG_ShowMsg("TAB - Select next window\n");
DEBUG_EndPagedContent();
return true;
}
@@ -2687,7 +2687,7 @@ bool ParseCommand(char* str) {
char* AnalyzeInstruction(char* inst, bool saveSelector) {
static char result[256];
char instu[256];
strcpy(instu,inst);
@@ -2723,14 +2723,14 @@ char* AnalyzeInstruction(char* inst, bool saveSelector) {
adr += GetHexValue(pos,pos);
} else if (*pos=='-') {
pos++;
adr -= GetHexValue(pos,pos);
} else
adr -= GetHexValue(pos,pos);
} else
pos++;
}
uint32_t address = (uint32_t)GetAddress(seg,adr);
if (!(get_tlb_readhandler(address)->flags & PFLAG_INIT)) {
static char outmask[] = "%s:[%04X]=%02X";
if (cpu.pmode) outmask[6] = '8';
switch (DasmLastOperandSize()) {
case 8 : { uint8_t val = mem_readb(address);
@@ -3156,7 +3156,7 @@ uint32_t DEBUG_CheckKeys(void) {
if (codeViewData.inputStr[codeViewData.inputPos]) codeViewData.inputPos++;
break;
case KEY_F(6): // previous command (f1-f4 generate rubbish at my place)
case KEY_F(3): // previous command
case KEY_F(3): // previous command
if (histBuffPos == histBuff.begin()) break;
if (histBuffPos == histBuff.end()) {
// copy inputStr to suspInputStr so we can restore it
@@ -3175,7 +3175,7 @@ uint32_t DEBUG_CheckKeys(void) {
safe_strncpy(codeViewData.inputStr, codeViewData.suspInputStr, sizeof(codeViewData.inputStr));
}
codeViewData.inputPos = (int)strlen(codeViewData.inputStr);
break;
break;
case KEY_F(5): // Run Program
DrawRegistersUpdateOld();
debugging=false;
@@ -3280,7 +3280,7 @@ uint32_t DEBUG_CheckKeys(void) {
if (codeViewData.inputPos == 0) break;
codeViewData.inputPos--;
// fallthrough
case KEY_DC: // delete character
case KEY_DC: // delete character
if ((codeViewData.inputPos<0) || (codeViewData.inputPos>=MAXCMDLEN)) break;
if (codeViewData.inputStr[codeViewData.inputPos] != 0) {
codeViewData.inputStr[MAXCMDLEN] = '\0';
@@ -3296,7 +3296,7 @@ uint32_t DEBUG_CheckKeys(void) {
codeViewData.inputStr[codeViewData.inputPos] = '\0';
} else if (!codeViewData.ovrMode) {
int len = (int) strlen(codeViewData.inputStr);
if (len < MAXCMDLEN) {
if (len < MAXCMDLEN) {
for(len++;len>codeViewData.inputPos;len--)
codeViewData.inputStr[len]=codeViewData.inputStr[len-1];
codeViewData.inputStr[codeViewData.inputPos++] = char(key);
@@ -3989,13 +3989,13 @@ static void LogInstruction(uint16_t segValue, uint32_t eipValue, ofstream& out)
if (!res || !(*res)) res = empty;
Bitu reslen = strlen(res);
if (reslen < 22) {
for (Bitu i = 0; i < 22 - reslen; i++) res[reslen + i] = ' ';
memset(res + reslen, ' ', 22 - reslen);
res[22] = 0;
}
}
Bitu len = strlen(dline);
if (len < 30) {
for (Bitu i = 0; i < 30 - len; i++) dline[len + i] = ' ';
memset(dline + len, ' ', 30 - len);
dline[30] = 0;
}
@@ -4020,15 +4020,15 @@ static void LogInstruction(uint16_t segValue, uint32_t eipValue, ofstream& out)
}
out << setw(4) << SegValue(cs) << ":" << setw(8) << reg_eip << " " << dline << " " << res << " " << ibytes;
}
out << " EAX:" << setw(8) << reg_eax << " EBX:" << setw(8) << reg_ebx
out << " EAX:" << setw(8) << reg_eax << " EBX:" << setw(8) << reg_ebx
<< " ECX:" << setw(8) << reg_ecx << " EDX:" << setw(8) << reg_edx
<< " ESI:" << setw(8) << reg_esi << " EDI:" << setw(8) << reg_edi
<< " EBP:" << setw(8) << reg_ebp << " ESP:" << setw(8) << reg_esp
<< " ESI:" << setw(8) << reg_esi << " EDI:" << setw(8) << reg_edi
<< " EBP:" << setw(8) << reg_ebp << " ESP:" << setw(8) << reg_esp
<< " DS:" << setw(4) << SegValue(ds)<< " ES:" << setw(4) << SegValue(es);
if(cpuLogType == 0) {
out << " SS:" << setw(4) << SegValue(ss) << " C" << (get_CF()>0) << " Z" << (get_ZF()>0)
out << " SS:" << setw(4) << SegValue(ss) << " C" << (get_CF()>0) << " Z" << (get_ZF()>0)
<< " S" << (get_SF()>0) << " O" << (get_OF()>0) << " I" << GETFLAGBOOL(IF);
} else {
out << " FS:" << setw(4) << SegValue(fs) << " GS:" << setw(4) << SegValue(gs)
@@ -4038,8 +4038,8 @@ static void LogInstruction(uint16_t segValue, uint32_t eipValue, ofstream& out)
<< " IF:" << GETFLAGBOOL(IF);
}
if(cpuLogType == 2) {
out << " TF:" << GETFLAGBOOL(TF) << " VM:" << GETFLAGBOOL(VM) <<" FLG:" << setw(8) << reg_flags
<< " CR0:" << setw(8) << cpu.cr0;
out << " TF:" << GETFLAGBOOL(TF) << " VM:" << GETFLAGBOOL(VM) <<" FLG:" << setw(8) << reg_flags
<< " CR0:" << setw(8) << cpu.cr0;
}
out << endl;
}
@@ -4077,11 +4077,11 @@ public:
found = cmd->FindCommand(commandNr++,temp_line);
if (found) strcat(args," ");
}
// Start new shell and execute prog
// Start new shell and execute prog
active = true;
// Save cpu state....
uint16_t oldcs = SegValue(cs);
uint32_t oldeip = reg_eip;
uint32_t oldeip = reg_eip;
uint16_t oldss = SegValue(ss);
uint32_t oldesp = reg_esp;
@@ -4109,14 +4109,14 @@ void DEBUG_CheckExecuteBreakpoint(uint16_t seg, uint32_t off)
{
#if C_DEBUG
if (debugger_break_on_exec) {
CBreakpoint::AddBreakpoint(seg,off,true);
CBreakpoint::AddBreakpoint(seg,off,true);
CBreakpoint::ActivateBreakpointsExceptAt(SegPhys(cs)+reg_eip);
debugger_break_on_exec = false;
}
#endif
#if 0
if (pDebugcom && pDebugcom->IsActive()) {
CBreakpoint::AddBreakpoint(seg,off,true);
CBreakpoint::AddBreakpoint(seg,off,true);
CBreakpoint::ActivateBreakpointsExceptAt(SegPhys(cs)+reg_eip);
pDebugcom = 0;
};
@@ -4134,7 +4134,7 @@ Bitu DEBUG_EnableDebugger(void)
return 0;
}
// INIT
// INIT
void DBGBlock::set_data_view(unsigned int view) {
void DrawBars(void);
@@ -4252,7 +4252,7 @@ void CDebugVar::InsertVariable(char* name, PhysPt adr)
varList.push_back(new CDebugVar(name,adr));
}
void CDebugVar::DeleteAll(void)
void CDebugVar::DeleteAll(void)
{
std::vector<CDebugVar*>::iterator i;
for(i=varList.begin(); i != varList.end(); ++i) {
@@ -4330,7 +4330,7 @@ static void SaveMemory(uint16_t seg, uint32_t ofs1, uint32_t num) {
DEBUG_ShowMsg("DEBUG: Memory dump failed.\n");
return;
}
char buffer[128];
char temp[16];
@@ -4488,13 +4488,13 @@ void DEBUG_HeavyLogInstruction(void) {
if (!res || !(*res)) res = empty;
Bitu reslen = strlen(res);
if (reslen < 22) {
for (Bitu i = 0; i < 22 - reslen; i++) res[reslen + i] = ' ';
memset(res + reslen, ' ', 22 - reslen);
res[22] = 0;
}
}
Bitu len = strlen(dline);
if (len < 30) for (Bitu i=0; i < 30-len; i++) dline[len+i] = ' ';
if (len < 30) memset(dline + len,' ',30 - len);
dline[30] = 0;
TLogInst & inst = logInst[logCount];
@@ -4529,12 +4529,12 @@ void DEBUG_HeavyLogInstruction(void) {
void DEBUG_HeavyWriteLogInstruction(void) {
if (!logHeavy) return;
logHeavy = false;
DEBUG_ShowMsg("DEBUG: Creating cpu log LOGCPU_INT_CD.TXT\n");
ofstream out("LOGCPU_INT_CD.TXT");
if (!out.is_open()) {
DEBUG_ShowMsg("DEBUG: Failed.\n");
DEBUG_ShowMsg("DEBUG: Failed.\n");
return;
}
out << hex << noshowbase << setfill('0') << uppercase;
@@ -4542,7 +4542,7 @@ void DEBUG_HeavyWriteLogInstruction(void) {
do {
// Write Instructions
TLogInst & inst = logInst[startLog];
out << setw(4) << inst.s_cs << ":" << setw(8) << inst.eip << " "
out << setw(4) << inst.s_cs << ":" << setw(8) << inst.eip << " "
<< inst.dline << " " << inst.res << " EAX:" << setw(8)<< inst.eax
<< " EBX:" << setw(8) << inst.ebx << " ECX:" << setw(8) << inst.ecx
<< " EDX:" << setw(8) << inst.edx << " ESI:" << setw(8) << inst.esi
@@ -4560,9 +4560,9 @@ void DEBUG_HeavyWriteLogInstruction(void) {
logInst[startLog].c,logInst[startLog].z,logInst[startLog].s,logInst[startLog].o,logInst[startLog].a,logInst[startLog].p,logInst[startLog].i);*/
if (++startLog >= LOGCPUMAX) startLog = 0;
} while (startLog != logCount);
out.close();
DEBUG_ShowMsg("DEBUG: Done.\n");
DEBUG_ShowMsg("DEBUG: Done.\n");
}
bool DEBUG_HeavyIsBreakpoint(void) {
@@ -4584,7 +4584,7 @@ bool DEBUG_HeavyIsBreakpoint(void) {
if (logHeavy) DEBUG_HeavyLogInstruction();
if (zeroProtect) {
static Bitu zero_count = 0;
uint32_t value=0;
uint32_t value = 0;
if (!mem_readd_checked(SegPhys(cs)+reg_eip,&value)) {
if (value == 0) zero_count++;
else zero_count = 0;
@@ -4597,7 +4597,7 @@ bool DEBUG_HeavyIsBreakpoint(void) {
return false;
}
if (CBreakpoint::CheckBreakpoint(SegValue(cs),reg_eip)) {
return true;
return true;
}
return false;
}

View File

@@ -174,7 +174,7 @@ bool CDROM_Interface_Ioctl::mci_CDPosition(int *position) {
CDROM_Interface_Ioctl::dxPlayer CDROM_Interface_Ioctl::player = {
NULL, NULL, NULL, {0}, 0, 0, 0, false, false, false, {0} };
NULL, NULL, NULL, {0}, 0, 0, 0, false, false, false, { {0,0,0,0},{0,0,0,0} } };
CDROM_Interface_Ioctl::CDROM_Interface_Ioctl(cdioctl_cdatype ioctl_cda) {
pathname[0] = 0;