diff --git a/include/Makefile.am b/include/Makefile.am index 4425e6ed..2e395d13 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -13,6 +13,7 @@ hardware.h \ inout.h \ joystick.h \ keyboard.h \ +logging.h \ mem.h \ mixer.h \ modules.h \ diff --git a/include/dosbox.h b/include/dosbox.h index 03205ec0..6d0696a6 100644 --- a/include/dosbox.h +++ b/include/dosbox.h @@ -63,25 +63,12 @@ class Config; extern Config * control; extern Bitu errorlevel; + +#ifndef __LOGGING_H_ +#include "logging.h" +#endif // the logging system. + #define LOG_MSG S_Warn -enum LOG_TYPES { - LOG_ALL, - LOG_VGA, LOG_VGAGFX,LOG_VGAMISC,LOG_INT10, - LOG_SB,LOG_DMA, - LOG_FPU,LOG_CPU, - LOG_FCB,LOG_FILES,LOG_IOCTL,LOG_EXEC,LOG_DOSMISC, - LOG_PIT,LOG_KEYBOARD,LOG_PIC, - LOG_MOUSE,LOG_BIOS,LOG_GUI,LOG_MISC, - LOG_MAX,LOG_ERROR=0x80 -}; - -#if C_DEBUG -extern void DEBUG_ShowMsg(Bit32u msgmask, char * msg,...); -#define LOG DEBUG_ShowMsg -#else -#define LOG -#endif /* C_DEBUG */ - #endif /* __DOSBOX_H */ diff --git a/include/logging.h b/include/logging.h new file mode 100644 index 00000000..9821ee50 --- /dev/null +++ b/include/logging.h @@ -0,0 +1,69 @@ +#ifndef __LOGGING_H_ +#define __LOGGING_H_ +enum LOG_TYPES { + LOG_ALL, + LOG_VGA, LOG_VGAGFX,LOG_VGAMISC,LOG_INT10, + LOG_SB,LOG_DMA, + LOG_FPU,LOG_CPU, + LOG_FCB,LOG_FILES,LOG_IOCTL,LOG_EXEC,LOG_DOSMISC, + LOG_PIT,LOG_KEYBOARD,LOG_PIC, + LOG_MOUSE,LOG_BIOS,LOG_GUI,LOG_MISC, + LOG_MAX +}; + +enum LOG_SEVERITIES { + LOG_NORMAL, + LOG_WARN, + LOG_ERROR +}; + +#if C_DEBUG +class LOG +{ + LOG_TYPES d_type; + LOG_SEVERITIES d_severity; +public: + + LOG (LOG_TYPES type , LOG_SEVERITIES severity): + d_type(type), + d_severity(severity) + {} + void operator() (char* buf, ...); //../src/debug/debug_gui.cpp + +}; + + +#else //C_DEBUG + +struct LOG +{ + LOG(LOG_TYPES type, LOG_SEVERITIES severity) { return;} + void operator()(char* buf) { return;} + void operator()(char* buf, double f1) { return;} + void operator()(char* buf, double f1, Bit32u u1) { return;} + void operator()(char* buf, Bitu u1, double f1) { return;} + + void operator()(char* buf, Bitu u1, Bitu u2) { return;} + void operator()(char* buf, Bits u1, Bits u2) { return;} + void operator()(char* buf, Bitu u1, Bits u2) { return;} + void operator()(char* buf, Bits u1, Bitu u2) { return;} + void operator()(char* buf, Bit32s u1) { return;} + void operator()(char* buf, Bit32u u1) { return;} + void operator()(char* buf, Bits s1) { return;} + void operator()(char* buf, Bitu u1) { return;} + + void operator()(char* buf, char* s1) { return;} + void operator()(char* buf, char* s1, Bit32u u1) { return;} + void operator()(char* buf, char* s1, Bit32u u1, Bit32u u2) { return;} + void operator()(char* buf, Bit32u u1, char* s1) { return;} + + + +}; //add missing operators to here + //try to avoid anything smaller than bit32... + +#endif //C_DEBUG + + +#endif //__LOGGING_H_ + diff --git a/visualc/dosbox.dsp b/visualc/dosbox.dsp index a901901d..be93b060 100644 --- a/visualc/dosbox.dsp +++ b/visualc/dosbox.dsp @@ -20,6 +20,7 @@ CFG=dosbox - Win32 Debug !MESSAGE "dosbox - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "dosbox - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE + # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" @@ -711,6 +712,10 @@ SOURCE=..\include\keyboard.h # End Source File # Begin Source File +SOURCE=..\include\logging.h +# End Source File +# Begin Source File + SOURCE=..\include\mem.h # End Source File # Begin Source File