From 5e13e5c0e4f5549a9d684ee133144179a7acfc90 Mon Sep 17 00:00:00 2001 From: Ulf Wohlers Date: Mon, 13 Oct 2003 22:01:07 +0000 Subject: [PATCH] argh, committed good file... Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1313 --- src/debug/debug.cpp | 192 ++-------------------------------- src/debug/debug_gui.cpp | 2 +- src/dos/dos.cpp | 14 +-- src/dos/dos_ioctl.cpp | 3 +- src/dosbox.cpp | 8 +- src/gui/sdlmain.cpp | 6 +- src/hardware/memory.cpp | 17 +-- src/hardware/timer.cpp | 4 +- src/ints/ems.cpp | 1 - src/ints/xms.cpp | 3 +- src/platform/visualc/config.h | 4 +- src/shell/shell_cmds.cpp | 5 +- 12 files changed, 32 insertions(+), 227 deletions(-) diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp index fa7b762c..ba746325 100644 --- a/src/debug/debug.cpp +++ b/src/debug/debug.cpp @@ -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::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(); diff --git a/src/debug/debug_gui.cpp b/src/debug/debug_gui.cpp index 9a254378..840233ce 100644 --- a/src/debug/debug_gui.cpp +++ b/src/debug/debug_gui.cpp @@ -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 #include @@ -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,®_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 { diff --git a/src/dos/dos_ioctl.cpp b/src/dos/dos_ioctl.cpp index aaabd5f6..0f048413 100644 --- a/src/dos/dos_ioctl.cpp +++ b/src/dos/dos_ioctl.cpp @@ -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 #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); diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 2860e5c1..fb9d96a6 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -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); diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 64d33695..f3afdbc3 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -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(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); diff --git a/src/hardware/memory.cpp b/src/hardware/memory.cpp index 9d4ed17a..2da66a0c 100644 --- a/src/hardware/memory.cpp +++ b/src/hardware/memory.cpp @@ -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(sec); diff --git a/src/hardware/timer.cpp b/src/hardware/timer.cpp index 29a6ae7e..b0529155 100644 --- a/src/hardware/timer.cpp +++ b/src/hardware/timer.cpp @@ -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); diff --git a/src/ints/ems.cpp b/src/ints/ems.cpp index 68ca79f8..de226fd8 100644 --- a/src/ints/ems.cpp +++ b/src/ints/ems.cpp @@ -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; diff --git a/src/ints/xms.cpp b/src/ints/xms.cpp index 3c407157..f610ef94 100644 --- a/src/ints/xms.cpp +++ b/src/ints/xms.cpp @@ -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 */ diff --git a/src/platform/visualc/config.h b/src/platform/visualc/config.h index ef36a1bf..f05615f0 100644 --- a/src/platform/visualc/config.h +++ b/src/platform/visualc/config.h @@ -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 diff --git a/src/shell/shell_cmds.cpp b/src/shell/shell_cmds.cpp index c419489a..7c442643 100644 --- a/src/shell/shell_cmds.cpp +++ b/src/shell/shell_cmds.cpp @@ -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 @@ -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;