1
0
Fork 0

argh, committed good file...

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1313
This commit is contained in:
Ulf Wohlers 2003-10-13 22:01:07 +00:00
parent 55591a56da
commit 5e13e5c0e4
12 changed files with 32 additions and 227 deletions

View file

@ -369,14 +369,6 @@ bool CBreakpoint::CheckIntBreakpoint(PhysPt adr, Bit8u intNr, Bit16u ahValue)
} else
ignoreAddressOnce = 0;
// TEMP
static bool once = false;
if (!once) {
if ((intNr==0x21) && (reg_ah==0x3f) && (reg_cx==8450)) {
once = true;
return true;
}
}
// Search matching breakpoint
std::list<CBreakpoint*>::iterator i;
CBreakpoint* bp;
@ -637,10 +629,8 @@ static void DrawRegisters(void) {
oldflags=flags.word;
if (cpu.pmode) {
if (cpu.code.big) mvwprintw(dbg.win_reg,0,76,"Pr32");
else mvwprintw(dbg.win_reg,0,76,"Pr16");
} else mvwprintw(dbg.win_reg,0,76,"Real");
if (cpu.pmode) mvwprintw(dbg.win_reg,0,76,"Prot");
else mvwprintw(dbg.win_reg,0,76,"Real");
// Selector info, if available
if ((cpu.pmode) && curSelectorName[0]) {
@ -887,13 +877,6 @@ bool ParseCommand(char* str)
return true;
}
found = strstr(str,"SR ");
if (found) { // Set register value
found+=2;
if (ChangeRegister(found)) DEBUG_ShowMsg("DEBUG: Set Register success.");
else DEBUG_ShowMsg("DEBUG: Set Register failure.");
return true;
}
found = strstr(str,"BP ");
if (found) { // Add new breakpoint
found+=3;
@ -975,6 +958,13 @@ bool ParseCommand(char* str)
DEBUG_ShowMsg("DEBUG: Logfile LOGCPU.TXT created.");
return true;
}
found = strstr(str,"SR ");
if (found) { // Set register value
found+=2;
if (ChangeRegister(found)) DEBUG_ShowMsg("DEBUG: Set Register success.");
else DEBUG_ShowMsg("DEBUG: Set Register failure.");
return true;
}
found = strstr(str,"SM ");
if (found) { // Set memory with following values
found+=3;
@ -1624,7 +1614,7 @@ void SaveMemory(Bit16u seg, Bit16u ofs1, Bit32s num)
#if C_HEAVY_DEBUG
const Bit32u LOGCPUMAX = 100000;
const Bit32u LOGCPUMAX = 20000;
static Bit16u logCpuCS [LOGCPUMAX];
static Bit32u logCpuEIP[LOGCPUMAX];
@ -1679,168 +1669,8 @@ bool DEBUG_HeavyIsBreakpoint(void)
skipFirstInstruction = false;
return false;
}
static bool once = false;
static Bit8u oldValue = 0;
/* if (!once && (mem_readb(0x276000)==205)) {
LOG(LOG_MISC,LOG_ERROR)("Changed to 205");
DEBUG_HeavyWriteLogInstruction();
once = true;
exitLoop = true;
DEBUG_Enable();
return true;
}
/*
if (cpu.pmode) {
if ((SegValue(cs)==0x010F) && (reg_eip==0x45941)) {
LOG(LOG_MISC,LOG_ERROR)("REP MOVSB DS:ESI=%04X:%08X ES:EDI=%04X:%08X ECX=%08X",SegValue(ds),reg_esi,SegValue(es),reg_edi,reg_ecx);
}
Descriptor desc;
if (cpu.gdt.GetDescriptor(0x10F,desc)) {
Bit8u newValue = mem_readb(desc.GetBase()+0x45941);
if (oldValue!=newValue) {
LOG(LOG_MISC,LOG_ERROR)("Value changed from %02X to %02X",oldValue,newValue);
DEBUG_HeavyWriteLogInstruction();
once = true;
exitLoop = true;
DEBUG_Enable();
oldValue = newValue;
return true;
}
};
};
/* if (!once && cpu.pmode) {
// if (mem_readw(0x779e64+0x2A5A)==0x05d4) {
if (mem_readw(0x74cef0+0x0786)==0x05d4) {
LOG(LOG_MISC,LOG_ERROR)("Compare value set to 0x05d4");
DEBUG_HeavyWriteLogInstruction();
once = true;
exitLoop = true;
DEBUG_Enable();
return true;
}
}
/*
Descriptor desc;
if (!once && cpu.gdt.GetDescriptor(0x43c,desc)) {
// if (mem_readw(desc.GetBase()+0x97B4)==0x018C) {
if (mem_readw(desc.GetBase()+0x2E10)==0x0000) {
LOG(LOG_MISC,LOG_ERROR)("Index set ot 0x018C");
//once = true;
mem_writew(desc.GetBase()+0x2E10,0x0010);
exitLoop = true;
DEBUG_Enable();
return true;
};
}
}
/* static Bitu lastval = 0;
// if (mem_readd(0x11F000+0xB856)!=lastval) {
if (mem_readd(0x11F000)!=lastval) {
// lastval = mem_readd(0x11F000+0xB856);
lastval = mem_readd(0x11F000);
LOG(LOG_MISC,LOG_ERROR)("Changed to %08X",lastval);
if (lastval==0) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
return true;
};
}
if (cpu.pmode) {
if (mem_readd(SegPhys(cs)+reg_eip)==0) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
return true;
}
}
*/
/* if (cpu.pmode) {
if ((SegValue(cs)==0x397) && (reg_eip==0x23B)) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
return true;
}
}
*/
/* if (cpu.pmode) {
if (mem_readd(0x23602c)==0x00236030) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
return true;
}
}
*/
// if (!once && cpu.pmode) {
/* if (mem_readw(0x007f6904+2)==0xFEF0) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
once = true;
return true;
};
/* Descriptor desc;
if (cpu.gdt.GetDescriptor(0x0514,desc) && desc.saved.seg.p) {
// if (desc.GetBase()!=0) { //6EEC1F1) {
if (mem_readw(desc.GetBase()+0x000095a4)==0x006F) { //6EEC1F1) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
once = true;
return true;
}
}
/* if ((SegValue(cs)==0x01B) && (reg_eip==0x018C) && (reg_ax==0x0267)) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
once = true;
return true;
}*/
/* if ((SegValue(cs)==0x01B) && (reg_eip==0x018C) && (((reg_cx<<16)+reg_dx)==0x20)) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
once = true;
return true;
}*/
// }
/* if (!once && cpu.pmode) {
if ((SegValue(cs)==0x001B) && (reg_eip==0x018C) && (reg_ax==0x0008) && (((reg_cx<<16)+reg_dx)==0x20)) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
once = true;
return true;
}
}
*/
/* if (SegValue(es)==0xFD5D) {
DEBUG_HeavyWriteLogInstruction();
exitLoop = true;
DEBUG_Enable();
return true;
};
*/
PhysPt where = SegPhys(cs)+reg_eip;
if (CBreakpoint::CheckBreakpoint(SegValue(cs),reg_eip)) {
// exitLoop = true;
// DEBUG_Enable();

View file

@ -196,7 +196,7 @@ void LOG_StartUp(void) {
/* Register the log section */
Section_prop * sect=control->AddSection_prop("log",LOG_Init);
sect->Add_string("logfile","log.txt");
sect->Add_string("logfile","");
char buf[1024];
for (Bitu i=1;i<LOG_MAX;i++) {
strcpy(buf,loggrp[i].front);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos.cpp,v 1.54 2003-10-13 19:44:46 finsterr Exp $ */
/* $Id: dos.cpp,v 1.55 2003-10-13 21:56:25 finsterr Exp $ */
#include <stdio.h>
#include <stdlib.h>
@ -38,8 +38,6 @@ Bit8u dos_copybuf[0x10000];
static Bitu call_20,call_21,call_25,call_26,call_27,call_28,call_29;
static Bitu call_casemap;
void DEBUG_HeavyWriteLogInstruction(void);
void DOS_SetError(Bit16u code) {
dos.errorcode=code;
}
@ -50,8 +48,6 @@ static Bitu DOS_21Handler(void) {
DOS_PSP psp(dos.psp);
psp.SetStack(RealMake(SegValue(ss),reg_sp));
LOG(LOG_MISC,LOG_ERROR)("DOS: Call %04X %04X %04X %04X",reg_ax,reg_bx,reg_cx,reg_dx);
char name1[DOSNAMEBUF+1];
char name2[DOSNAMEBUF+1];
switch (reg_ah) {
@ -274,8 +270,6 @@ static Bitu DOS_21Handler(void) {
dos.dta=RealMakeSeg(ds,reg_dx);
DOS_PSP psp(dos.psp);
psp.SetDTA(dos.dta);
DOS_DTA dta(dos.dta);
LOG(LOG_MISC,LOG_ERROR)("DOS:1A:Set DTA %04X:%04X (ID:%04X)",SegValue(ds),reg_dx,dta.GetDirID());
}
break;
case 0x25: /* Set Interrupt Vector */
@ -327,7 +321,6 @@ static Bitu DOS_21Handler(void) {
case 0x2f: /* Get Disk Transfer Area */
SegSet16(es,RealSeg(dos.dta));
reg_bx=RealOff(dos.dta);
LOG(LOG_DOSMISC,LOG_ERROR)("DOS:2F:Get DTA: %04X:%04X",SegValue(es),reg_bx);
break;
case 0x30: /* Get DOS Version */
if (reg_al==0) reg_bh=0xFF; /* Fake Microsoft DOS */
@ -338,7 +331,6 @@ static Bitu DOS_21Handler(void) {
case 0x31: /* Terminate and stay resident */
//TODO First get normal files executing
// Important: This service does not set the carry flag!
LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Terminated.");
DOS_ResizeMemory(dos.psp,&reg_dx);
DOS_Terminate(true);
dos.return_code=reg_al;
@ -535,7 +527,7 @@ static Bitu DOS_21Handler(void) {
break;
case 0x01: /* Set */
LOG(LOG_MISC,LOG_ERROR)("DOS:Set File Attributes for %s not supported",name1);
CALLBACK_SCF(true);
CALLBACK_SCF(false);
break;
default:
LOG(LOG_MISC,LOG_ERROR)("DOS:0x43:Illegal subfunction %2X",reg_al);
@ -626,8 +618,6 @@ static Bitu DOS_21Handler(void) {
case 0x4c: /* EXIT Terminate with return code */
{
DEBUG_HeavyWriteLogInstruction();
LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Terminated 0x4C.");
if (DOS_Terminate(false)) {
/* This can't ever return false normally */
} else {

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_ioctl.cpp,v 1.14 2003-10-13 19:44:46 finsterr Exp $ */
/* $Id: dos_ioctl.cpp,v 1.15 2003-10-13 21:56:25 finsterr Exp $ */
#include <string.h>
#include "dosbox.h"
@ -28,7 +28,6 @@
bool DOS_IOCTL(void) {
Bitu handle;Bit8u drive;
if (reg_al<8) { /* call 0-7 use a file handle */
Bitu what = reg_bx;
handle=RealHandle(reg_bx);
if (handle>=DOS_FILES) {
DOS_SetError(DOSERR_INVALID_HANDLE);

View file

@ -186,7 +186,7 @@ void DOSBOX_Init(void) {
secprop->AddInitFunction(&IO_Init);
secprop->AddInitFunction(&PAGING_Init);
secprop->AddInitFunction(&MEM_Init);
secprop->Add_int("memsize",16); //We Default to 8 mb seems okay for now
secprop->Add_int("memsize",8); //We Default to 8 mb seems okay for now
secprop->AddInitFunction(&CALLBACK_Init);
secprop->AddInitFunction(&PIC_Init);
secprop->AddInitFunction(&PROGRAMS_Init);
@ -198,10 +198,10 @@ void DOSBOX_Init(void) {
secprop->Add_int("frameskip",0);
secprop->Add_bool("keepsmall",false);
secprop->Add_string("snapshots","snaps");
secprop->Add_string("scaler","scale2x");
secprop->Add_string("scaler","none");
secprop=control->AddSection_prop("cpu",&CPU_Init);
secprop->Add_int("cycles",8000);
secprop->Add_int("cycles",1800);
#if C_FPU
secprop->AddInitFunction(&FPU_Init);
#endif
@ -270,7 +270,7 @@ void DOSBOX_Init(void) {
secprop->Add_hex("comport",2);
secprop->Add_int("listenport",23);
#endif
// Mscdex
secprop->AddInitFunction(&MSCDEX_Init);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdlmain.cpp,v 1.46 2003-10-13 19:44:46 finsterr Exp $ */
/* $Id: sdlmain.cpp,v 1.47 2003-10-13 21:56:53 finsterr Exp $ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -284,7 +284,7 @@ static void GUI_StartUp(Section * sec) {
Section_prop * section=static_cast<Section_prop *>(sec);
sdl.active=false;
sdl.full_screen=false;
sdl.nowait=false; //section->Get_bool("nowait");
sdl.nowait=section->Get_bool("nowait");
sdl.mouse.locked=false;
sdl.mouse.requestlock=false;
sdl.mouse.autoenable=section->Get_bool("autolock");
@ -300,7 +300,7 @@ static void GUI_StartUp(Section * sec) {
/* Initialize screen for first time */
GFX_SetSize(640,400,8,0,0,0);
SDL_EnableKeyRepeat(250,30);
SDL_EnableUNICODE(0);
SDL_EnableUNICODE(1);
/* Get some Keybinds */
KEYBOARD_AddEvent(KBD_f9,KBD_MOD_CTRL,KillSwitch);
KEYBOARD_AddEvent(KBD_f10,KBD_MOD_CTRL,CaptureMouse);

View file

@ -242,20 +242,14 @@ void mem_memcpy(PhysPt dest,PhysPt src,Bitu size) {
void MEM_BlockRead(PhysPt pt,void * data,Bitu size) {
Bit8u * write=(Bit8u *) data;
while (size--) {
// *write++=mem_readb_inline(pt++);
*write = mem_readb(pt);
write++;
pt++;
*write++=mem_readb_inline(pt++);
}
}
void MEM_BlockWrite(PhysPt pt,void * data,Bitu size) {
Bit8u * read=(Bit8u *) data;
while (size--) {
// mem_writeb_inline(pt++,*read++);
mem_writeb(pt,*read);
pt++;
read++;
mem_writeb_inline(pt++,*read++);
}
}
@ -816,7 +810,7 @@ HostPt MEM_GetBlockPage(void) {
memory.block.cur_page+=4096;
} else {
AllocBlock * newblock=new AllocBlock;
memset(newblock,0xcd,sizeof(AllocBlock)); //zero new allocated memory
memset(newblock,0,sizeof(AllocBlock)); //zero new allocated memory
newblock->next=memory.block.cur_block;
memory.block.cur_block=newblock;
@ -836,11 +830,6 @@ static void MEM_ShutDown(Section * sec) {
}
}
void MEM_SetRemainingMem(Bitu remaining)
{
};
void MEM_Init(Section * sec) {
Bitu i;
Section_prop * section=static_cast<Section_prop *>(sec);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: timer.cpp,v 1.17 2003-10-13 19:44:47 finsterr Exp $ */
/* $Id: timer.cpp,v 1.18 2003-10-13 21:57:35 finsterr Exp $ */
#include "dosbox.h"
#include "inout.h"
@ -116,7 +116,7 @@ static void write_latch(Bit32u port,Bit8u val) {
case 0x00: /* Timer hooked to IRQ 0 */
PIC_RemoveEvents(PIT0_Event);
PIC_AddEvent(PIT0_Event,p->micro);
// LOG(LOG_PIT,LOG_NORMAL)("PIT 0 Timer at %.3g Hz mode %d",PIT_TICK_RATE/(double)p->cntr,(Bit32u)p->mode);
LOG(LOG_PIT,LOG_NORMAL)("PIT 0 Timer at %.3g Hz mode %d",PIT_TICK_RATE/(double)p->cntr,(Bit32u)p->mode);
break;
case 0x02: /* Timer hooked to PC-Speaker */
// LOG(LOG_PIT,"PIT 2 Timer at %.3g Hz mode %d",PIT_TICK_RATE/(double)p->cntr,p->mode);

View file

@ -438,7 +438,6 @@ static Bit8u MemoryRegion(void) {
static Bitu INT67_Handler(void) {
Bitu i;
LOG(LOG_MISC,LOG_ERROR)("EMS: Call %04X %04X %04X %04X",reg_ax,reg_bx,reg_cx,reg_dx);
switch (reg_ah) {
case 0x40: /* Get Status */
reg_ah=EMM_NO_ERROR;

View file

@ -107,7 +107,6 @@ static INLINE bool InvalidHandle(Bitu handle) {
Bitu XMS_QueryFreeMemory(Bit16u& largestFree, Bit16u& totalFree) {
/* Scan the tree for free memory and find largest free block */
totalFree=(Bit16u)(MEM_FreeTotal()*4);
largestFree=(Bit16u)(MEM_FreeLargest()*4);
if (!totalFree) return XMS_OUT_OF_SPACE;
@ -246,7 +245,7 @@ static bool multiplex_xms(void) {
};
Bitu XMS_Handler(void) {
LOG(LOG_MISC,LOG_ERROR)("XMS: CALL %02X",reg_ah);
// LOG(LOG_MISC,LOG_ERROR)("XMS: CALL %02X",reg_ah);
switch (reg_ah) {
case XMS_GET_VERSION: /* 00 */

View file

@ -3,7 +3,7 @@
#define VERSION "0.60"
/* Define to 1 to enable internal debugger, requires libcurses */
#define C_DEBUG 1
#define C_DEBUG 0
/* Define to 1 to enable screenshots, requires libpng */
#define C_SSHOT 1
@ -12,7 +12,7 @@
#define C_MODEM 1
/* Enable some heavy debugging options */
#define C_HEAVY_DEBUG 1
#define C_HEAVY_DEBUG 0
/* Enable memory function inlining in */
#define C_CORE_INLINE 0

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell_cmds.cpp,v 1.30 2003-10-13 19:44:47 finsterr Exp $ */
/* $Id: shell_cmds.cpp,v 1.31 2003-10-13 22:01:07 finsterr Exp $ */
#include <string.h>
@ -265,8 +265,7 @@ void DOS_Shell::CMD_DIR(char * args) {
WriteOut(MSG_Get("SHELL_CMD_DIR_INTRO"),path);
DOS_DTA dta(dos.dta);
// bool ret=DOS_FindFirst(args,0xffff & ~DOS_ATTR_VOLUME);
bool ret=DOS_FindFirst(args,0xffff);
bool ret=DOS_FindFirst(args,0xffff & ~DOS_ATTR_VOLUME);
if (!ret) {
WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),args);
return;