From 6403c0e6edf8565d386a157a2498ee40ded6709a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Thu, 19 Jul 2007 18:58:39 +0000 Subject: [PATCH] reduce logging a bit Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2924 --- src/dos/dos_mscdex.cpp | 6 +++--- src/hardware/memory.cpp | 18 +++++++++++++++++- src/hardware/serialport/softmodem.cpp | 10 ++++++++-- src/hardware/serialport/softmodem.h | 26 +++++++++++++++++++++----- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/src/dos/dos_mscdex.cpp b/src/dos/dos_mscdex.cpp index 2d582c7a..9f7f2742 100644 --- a/src/dos/dos_mscdex.cpp +++ b/src/dos/dos_mscdex.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_mscdex.cpp,v 1.48 2007-06-27 19:14:59 qbix79 Exp $ */ +/* $Id: dos_mscdex.cpp,v 1.49 2007-07-19 18:58:39 c2woody Exp $ */ #include #include @@ -877,7 +877,7 @@ static Bit16u MSCDEX_IOCTL_Input(PhysPt buffer,Bit8u drive_unit) { Bit8u addr_mode = mem_readb(buffer+1); if (addr_mode==0) { // HSG Bit32u frames=MSF_TO_FRAMES(pos.min, pos.sec, pos.fr); - if (frames<150) LOG_MSG("MSCDEX: Get position: invalid position %d:%d:%d", pos.min, pos.sec, pos.fr); + if (frames<150) MSCDEX_LOG("MSCDEX: Get position: invalid position %d:%d:%d", pos.min, pos.sec, pos.fr); else frames-=150; mem_writed(buffer+2,frames); } else if (addr_mode==1) { // Red book @@ -886,7 +886,7 @@ static Bit16u MSCDEX_IOCTL_Input(PhysPt buffer,Bit8u drive_unit) { mem_writeb(buffer+4,pos.min); mem_writeb(buffer+5,0x00); } else { - LOG_MSG("MSCDEX: Get position: invalid address mode %x",addr_mode); + MSCDEX_LOG("MSCDEX: Get position: invalid address mode %x",addr_mode); return 0x03; // invalid function } }break; diff --git a/src/hardware/memory.cpp b/src/hardware/memory.cpp index 64c0743c..b0769130 100644 --- a/src/hardware/memory.cpp +++ b/src/hardware/memory.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: memory.cpp,v 1.50 2007-06-14 08:23:46 qbix79 Exp $ */ +/* $Id: memory.cpp,v 1.51 2007-07-19 18:58:39 c2woody Exp $ */ #include "dosbox.h" #include "mem.h" @@ -63,11 +63,27 @@ public: flags=PFLAG_INIT|PFLAG_NOCODE; } Bitu readb(PhysPt addr) { +#if C_DEBUG LOG_MSG("Illegal read from %x, CS:IP %8x:%8x",addr,SegValue(cs),reg_eip); +#else + static Bits lcount=0; + if (lcount<1000) { + lcount++; + LOG_MSG("Illegal read from %x, CS:IP %8x:%8x",addr,SegValue(cs),reg_eip); + } +#endif return 0; } void writeb(PhysPt addr,Bitu val) { +#if C_DEBUG LOG_MSG("Illegal write to %x, CS:IP %8x:%8x",addr,SegValue(cs),reg_eip); +#else + static Bits lcount=0; + if (lcount<1000) { + lcount++; + LOG_MSG("Illegal write to %x, CS:IP %8x:%8x",addr,SegValue(cs),reg_eip); + } +#endif } }; diff --git a/src/hardware/serialport/softmodem.cpp b/src/hardware/serialport/softmodem.cpp index 112a0cfe..1b08c4f6 100644 --- a/src/hardware/serialport/softmodem.cpp +++ b/src/hardware/serialport/softmodem.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: softmodem.cpp,v 1.7 2007-01-13 08:35:49 qbix79 Exp $ */ +/* $Id: softmodem.cpp,v 1.8 2007-07-19 18:58:39 c2woody Exp $ */ #include "dosbox.h" @@ -90,7 +90,13 @@ void CSerialModem::handleUpperEvent(Bit16u type) { if(tqueue->left() < 2) { CSerial::setCTS(false); } - } else LOG_MSG("MODEM: TX Buffer overflow!"); + } else { + static Bits lcount=0; + if (lcount<1000) { + lcount++; + LOG_MSG("MODEM: TX Buffer overflow!"); + } + } ByteTransmitted(); break; diff --git a/src/hardware/serialport/softmodem.h b/src/hardware/serialport/softmodem.h index c51d915e..2c128f82 100644 --- a/src/hardware/serialport/softmodem.h +++ b/src/hardware/serialport/softmodem.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: softmodem.h,v 1.7 2007-01-13 08:35:49 qbix79 Exp $ */ +/* $Id: softmodem.h,v 1.8 2007-07-19 18:58:39 c2woody Exp $ */ #ifndef DOSBOX_SERIALMODEM_H #define DOSBOX_SERIALMODEM_H @@ -73,7 +73,11 @@ public: void addb(Bit8u _val) { if(used>=size) { - LOG_MSG("FIFO Overflow!"); + static Bits lcount=0; + if (lcount<1000) { + lcount++; + LOG_MSG("MODEM: FIFO Overflow! (addb)"); + } return; } //assert(usedsize) { - LOG_MSG("FIFO Overflow!"); + static Bits lcount=0; + if (lcount<1000) { + lcount++; + LOG_MSG("MODEM: FIFO Overflow! (adds len %d)",_len); + } return; } @@ -100,7 +108,11 @@ public: } Bit8u getb(void) { if (!used) { - LOG_MSG("MODEM: FIFO UNDERFLOW!"); + static Bits lcount=0; + if (lcount<1000) { + lcount++; + LOG_MSG("MODEM: FIFO UNDERFLOW! (getb)"); + } return data[pos]; } Bitu where=pos; @@ -111,7 +123,11 @@ public: } void gets(Bit8u * _str,Bitu _len) { if (!used) { - LOG_MSG("MODEM: FIFO UNDERFLOW!"); + static Bits lcount=0; + if (lcount<1000) { + lcount++; + LOG_MSG("MODEM: FIFO UNDERFLOW! (gets len %d)",_len); + } return; } //assert(used>=_len);