Index: svn/src/devices/oprom/include/x86emu/x86emu.h
===================================================================
--- svn.orig/src/devices/oprom/include/x86emu/x86emu.h
+++ svn/src/devices/oprom/include/x86emu/x86emu.h
@@ -45,7 +45,7 @@
 #include <stddef.h>
 #include <console/console.h>
 #if CONFIG_X86EMU_DEBUG
-#define DEBUG
+#define DEBUG_EMU
 #endif
 
 #include "types.h"
Index: svn/src/devices/oprom/x86emu/debug.c
===================================================================
--- svn.orig/src/devices/oprom/x86emu/debug.c
+++ svn/src/devices/oprom/x86emu/debug.c
@@ -41,7 +41,7 @@
 
 /*----------------------------- Implementation ----------------------------*/
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static void     print_encoded_bytes (u16 s, u16 o);
 static void     print_decoded_instruction (void);
@@ -93,7 +93,7 @@ void disassemble_forward (u16 seg, u16 o
      * flag associated with the "execution", and we are using a copy
      * of the register struct.  All the major opcodes, once fully
      * decoded, have the following two steps: TRACE_REGS(r,m);
-     * SINGLE_STEP(r,m); which disappear if DEBUG is not defined to
+     * SINGLE_STEP(r,m); which disappear if DEBUG_EMU is not defined to
      * the preprocessor.  The TRACE_REGS macro expands to:
      *
      * if (debug&DEBUG_DISASSEMBLE)
@@ -363,7 +363,7 @@ int parse_line (char *s, int *ps, int *n
 #endif
 }
 
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 void x86emu_dump_regs (void)
 {
Index: svn/src/devices/oprom/x86emu/debug.h
===================================================================
--- svn.orig/src/devices/oprom/x86emu/debug.h
+++ svn/src/devices/oprom/x86emu/debug.h
@@ -54,7 +54,7 @@
 #define CHECK_MEM_ACCESS_F              0x4 /*using regular linear pointer */
 #define CHECK_DATA_ACCESS_F             0x8 /*using segment:offset*/
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 # define CHECK_IP_FETCH()              	(M.x86.check & CHECK_IP_FETCH_F)
 # define CHECK_SP_ACCESS()             	(M.x86.check & CHECK_SP_ACCESS_F)
 # define CHECK_MEM_ACCESS()            	(M.x86.check & CHECK_MEM_ACCESS_F)
@@ -66,7 +66,7 @@
 # define CHECK_DATA_ACCESS()
 #endif
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 # define DEBUG_INSTRUMENT()    	(M.x86.debug & DEBUG_INSTRUMENT_F)
 # define DEBUG_DECODE()        	(M.x86.debug & DEBUG_DECODE_F)
 # define DEBUG_TRACE()         	(M.x86.debug & DEBUG_TRACE_F)
@@ -109,7 +109,7 @@
 # define DEBUG_DECODE_NOPRINT() 0
 #endif
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 # define DECODE_PRINTF(x)     	if (DEBUG_DECODE()) \
 									x86emu_decode_printf(x)
@@ -139,7 +139,7 @@
 # define SAVE_IP_CS(x,y)
 #endif
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 #define TRACE_REGS()                                   		\
 	if (DEBUG_DISASSEMBLE()) {                         		\
 		x86emu_just_disassemble();                        	\
@@ -150,7 +150,7 @@
 # define TRACE_REGS()
 #endif
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 # define SINGLE_STEP()		if (DEBUG_STEP()) x86emu_single_step()
 #else
 # define SINGLE_STEP()
@@ -160,7 +160,7 @@
 	TRACE_REGS();			\
 	SINGLE_STEP()
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 # define START_OF_INSTR()
 # define END_OF_INSTR()		EndOfTheInstructionProcedure: x86emu_end_instr();
 # define END_OF_INSTR_NO_TRACE()	x86emu_end_instr();
@@ -170,7 +170,7 @@
 # define END_OF_INSTR_NO_TRACE()
 #endif
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 # define  CALL_TRACE(u,v,w,x,s)                                 \
 	if (DEBUG_TRACECALLREGS())									\
 		x86emu_dump_regs();                                     \
@@ -192,7 +192,7 @@
 # define  JMP_TRACE(u,v,w,x,s)
 #endif
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 #define	DB(x)	x
 #else
 #define	DB(x)
Index: svn/src/devices/oprom/x86emu/decode.c
===================================================================
--- svn.orig/src/devices/oprom/x86emu/decode.c
+++ svn/src/devices/oprom/x86emu/decode.c
@@ -285,7 +285,7 @@ _INLINE u32 get_data_segment(void)
       case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
         return  M.x86.R_SS;
       default:
-#ifdef  DEBUG
+#ifdef  DEBUG_EMU
         printf("error: should not happen:  multiple overrides.\n");
 #endif
         HALT_SYS();
@@ -305,7 +305,7 @@ NOTE: Do not inline this function as (*s
 u8 fetch_data_byte(
     uint offset)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access((u16)get_data_segment(), offset);
 #endif
@@ -324,7 +324,7 @@ NOTE: Do not inline this function as (*s
 u16 fetch_data_word(
     uint offset)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access((u16)get_data_segment(), offset);
 #endif
@@ -343,7 +343,7 @@ NOTE: Do not inline this function as (*s
 u32 fetch_data_long(
     uint offset)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access((u16)get_data_segment(), offset);
 #endif
@@ -364,7 +364,7 @@ u8 fetch_data_byte_abs(
     uint segment,
     uint offset)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access(segment, offset);
 #endif
@@ -385,7 +385,7 @@ u16 fetch_data_word_abs(
     uint segment,
     uint offset)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access(segment, offset);
 #endif
@@ -406,7 +406,7 @@ u32 fetch_data_long_abs(
     uint segment,
     uint offset)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access(segment, offset);
 #endif
@@ -428,7 +428,7 @@ void store_data_byte(
     uint offset,
     u8 val)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access((u16)get_data_segment(), offset);
 #endif
@@ -450,7 +450,7 @@ void store_data_word(
     uint offset,
     u16 val)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access((u16)get_data_segment(), offset);
 #endif
@@ -472,7 +472,7 @@ void store_data_long(
     uint offset,
     u32 val)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access((u16)get_data_segment(), offset);
 #endif
@@ -495,7 +495,7 @@ void store_data_byte_abs(
     uint offset,
     u8 val)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access(segment, offset);
 #endif
@@ -518,7 +518,7 @@ void store_data_word_abs(
     uint offset,
     u16 val)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access(segment, offset);
 #endif
@@ -541,7 +541,7 @@ void store_data_long_abs(
     uint offset,
     u32 val)
 {
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (CHECK_DATA_ACCESS())
         x86emu_check_data_access(segment, offset);
 #endif
Index: svn/src/devices/oprom/x86emu/fpu.c
===================================================================
--- svn.orig/src/devices/oprom/x86emu/fpu.c
+++ svn/src/devices/oprom/x86emu/fpu.c
@@ -50,7 +50,7 @@ void x86emuOp_esc_coprocess_d8(u8 X86EMU
     END_OF_INSTR_NO_TRACE();
 }
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static const char *x86emu_fpu_op_d9_tab[] = {
     "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
@@ -89,7 +89,7 @@ static const char *x86emu_fpu_op_d9_tab1
     "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
 };
 
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 /* opcode=0xd9 */
 void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
@@ -100,7 +100,7 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU
 
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (mod != 3) {
         DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
     } else {
@@ -294,7 +294,7 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU
     END_OF_INSTR_NO_TRACE();
 }
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static const char *x86emu_fpu_op_da_tab[] = {
     "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
@@ -316,7 +316,7 @@ static const char *x86emu_fpu_op_da_tab[
     "ESC_DA     ", "ESC_DA ", "ESC_DA   ", "ESC_DA ",
 };
 
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 /* opcode=0xda */
 void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
@@ -384,7 +384,7 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU
     END_OF_INSTR_NO_TRACE();
 }
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static const char *x86emu_fpu_op_db_tab[] = {
     "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
@@ -397,7 +397,7 @@ static const char *x86emu_fpu_op_db_tab[
     "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
 };
 
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 /* opcode=0xdb */
 void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
@@ -407,7 +407,7 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU
 
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (mod != 3) {
         DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
     } else if (rh == 4) {       /* === 11 10 0 nnn */
@@ -428,7 +428,7 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU
     } else {
         DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl));
     }
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
     switch (mod) {
       case 0:
         destoffset = decode_rm00_address(rl);
@@ -504,7 +504,7 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU
     END_OF_INSTR_NO_TRACE();
 }
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 static const char *x86emu_fpu_op_dc_tab[] = {
     "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
     "FCOMP\tQWORD PTR ",
@@ -524,7 +524,7 @@ static const char *x86emu_fpu_op_dc_tab[
     "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
     "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
 };
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 /* opcode=0xdc */
 void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
@@ -618,7 +618,7 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU
     END_OF_INSTR_NO_TRACE();
 }
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static const char *x86emu_fpu_op_dd_tab[] = {
     "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
@@ -634,7 +634,7 @@ static const char *x86emu_fpu_op_dd_tab[
     "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
 };
 
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 /* opcode=0xdd */
 void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
@@ -718,7 +718,7 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU
     END_OF_INSTR_NO_TRACE();
 }
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static const char *x86emu_fpu_op_de_tab[] =
 {
@@ -741,7 +741,7 @@ static const char *x86emu_fpu_op_de_tab[
     "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
 };
 
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 /* opcode=0xde */
 void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
@@ -837,7 +837,7 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU
     END_OF_INSTR_NO_TRACE();
 }
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static const char *x86emu_fpu_op_df_tab[] = {
     /* mod == 00 */
@@ -860,7 +860,7 @@ static const char *x86emu_fpu_op_df_tab[
     "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
 };
 
-#endif /* DEBUG */
+#endif /* DEBUG_EMU */
 
 /* opcode=0xdf */
 void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
Index: svn/src/devices/oprom/x86emu/ops.c
===================================================================
--- svn.orig/src/devices/oprom/x86emu/ops.c
+++ svn/src/devices/oprom/x86emu/ops.c
@@ -76,7 +76,7 @@
 
 /* constant arrays to do several instructions in just one function */
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 static const char *x86emu_GenOpName[8] = {
     "ADD", "OR", "ADC", "SBB", "AND", "SUB", "XOR", "CMP"};
 #endif
@@ -157,7 +157,7 @@ static u32 (*opcD1_long_operation[])(u32
     sar_long,
 };
 
-#ifdef DEBUG
+#ifdef DEBUG_EMU
 
 static const char *opF6_names[8] =
   { "TEST\t", "", "NOT\t", "NEG\t", "MUL\t", "IMUL\t", "DIV\t", "IDIV\t" };
@@ -1285,7 +1285,7 @@ static void x86emuOp_opc80_byte_RM_IMM(u
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -1361,7 +1361,7 @@ static void x86emuOp_opc81_word_RM_IMM(u
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -1471,7 +1471,7 @@ static void x86emuOp_opc82_byte_RM_IMM(u
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -1545,7 +1545,7 @@ static void x86emuOp_opc83_word_RM_IMM(u
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -3127,7 +3127,7 @@ static void x86emuOp_opcC0_byte_RM_MEM(u
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -3202,7 +3202,7 @@ static void x86emuOp_opcC1_word_RM_MEM(u
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -3679,7 +3679,7 @@ static void x86emuOp_opcD0_byte_RM_1(u8 
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -3750,7 +3750,7 @@ static void x86emuOp_opcD1_word_RM_1(u8 
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -3852,7 +3852,7 @@ static void x86emuOp_opcD2_byte_RM_CL(u8
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -3925,7 +3925,7 @@ static void x86emuOp_opcD3_word_RM_CL(u8
      */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -4928,7 +4928,7 @@ static void x86emuOp_opcFE_byte_RM(u8 X8
     /* Yet another special case instruction. */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
@@ -4994,7 +4994,7 @@ static void x86emuOp_opcFF_word_RM(u8 X8
     /* Yet another special case instruction. */
     START_OF_INSTR();
     FETCH_DECODE_MODRM(mod, rh, rl);
-#ifdef DEBUG
+#ifdef DEBUG_EMU
     if (DEBUG_DECODE()) {
         /* XXX DECODE_PRINTF may be changed to something more
            general, so that it is important to leave the strings
Index: svn/src/devices/oprom/yabel/debug.h
===================================================================
--- svn.orig/src/devices/oprom/yabel/debug.h
+++ svn/src/devices/oprom/yabel/debug.h
@@ -98,7 +98,7 @@ static inline void set_ci(void) {};
 #define DEBUG_PRINTF_DISK(_x...)
 #define DEBUG_PRINTF_PNP(_x...)
 
-#endif				//DEBUG
+#endif				//CONFIG_X86EMU_DEBUG
 
 void dump(u8 * addr, u32 len);
 
