Previous 15994 Revisions Next

r1654 Sunday 3rd February, 2008 at 22:50:09 UTC by Justin Kerk
Fix compilation for u8 with DEBUG=1 and DEBUGGER=0, mainly by replacing #ifdef MAME_DEBUG with #ifdef ENABLE_DEBUGGER. This is not always ideal semantically but it's what MAME did in the analogous situations. Hopefully it will still compile with DEBUGGER=1, I haven't tested that.
[src/mess]inputx.c
[src/mess/machine]dgn_beta.c
[src/mess/osd/windows]menu.c
[src/mess/tools/messtest]testmess.c tststubs.c
[src/mess/video]dgn_beta.c m6847.c

src/mess/tools/messtest/testmess.c
r1653r1654
2020#include "messopts.h"
2121#include "deprecat.h"
2222
23#ifdef MAME_DEBUG
23#ifdef ENABLE_DEBUGGER
2424#include "debug/debugcpu.h"
25#endif /* MAME_DEBUG */
25#endif /* ENABLE_DEBUGGER */
2626
2727typedef enum
2828{
r1653r1654
903903
904904static void command_trace(void)
905905{
906#ifdef MAME_DEBUG
906#ifdef ENABLE_DEBUGGER
907907   int cpunum;
908908   FILE *file;
909909   char filename[256];
src/mess/tools/messtest/tststubs.c
r1653r1654
66#include <windows.h>
77#endif
88
9#ifdef MAME_DEBUG
9#ifdef ENABLE_DEBUGGER
1010#include "debug/debugcpu.h"
11#endif /* MAME_DEBUG */
11#endif /* ENABLE_DEBUGGER */
1212
1313#ifdef UNUSED_FUNCTION
1414int osd_create_display(const osd_create_params *params, UINT32 *rgb_components)
r1653r1654
124124}
125125#endif
126126
127#ifdef MAME_DEBUG
127#ifdef ENABLE_DEBUGGER
128128void osd_wait_for_debugger(void)
129129{
130130   debug_cpu_go(~0);
131131}
132#endif // MAME_DEBUG
132#endif // ENABLE_DEBUGGER
133133
134134#ifdef UNUSED_FUNCTION
135135int win_mess_config_init(void)
src/mess/video/dgn_beta.c
r1653r1654
8383#include "includes/dgn_beta.h"
8484#include "video/m6845.h"
8585
86#ifdef MAME_DEBUG
86#ifdef ENABLE_DEBUGGER
8787#include "debug/debugcpu.h"
8888#include "debug/debugcon.h"
8989#endif
r1653r1654
120120
121121//static BETA_VID_MODES VIDMODE = TEXT_40x25;
122122
123#ifdef MAME_DEBUG
123#ifdef ENABLE_DEBUGGER
124124static int LogRegWrites   = 0;   // Log register writes to debug console.
125125static int BoxColour      = 1;
126126static int BoxMinX      = 100;
r1653r1654
131131static int VSyncMin      = 0;
132132static int DEPos      = 0;
133133
134// Debugginc commands and handlers.
134// Debugging commands and handlers.
135135static void ToggleRegLog(int ref, int params, const char *param[]);
136136static void RegLog(int offset, int data);
137137static void FillScreen(int ref, int params, const char *param[]);
r1653r1654
139139static void VidToggle(int ref, int params, const char *param[]);
140140static void ShowVidLimits(int ref, int params, const char *param[]);
141141static void SetClkMax(int ref, int params, const char *param[]);
142#endif /* MAME_DEBUG */
142#endif /* ENABLE_DEBUGGER */
143143
144144static mame_bitmap   *bit;
145145static int MinAddr   = 0xFFFF;
r1653r1654
151151
152152static int VidAddr      = 0;   // Last address reg written
153153
154#ifdef MAME_DEBUG
154#ifdef ENABLE_DEBUGGER
155155static int NoScreen      = 0;
156#endif /* MAME_DEBUG */
156#endif /* ENABLE_DEBUGGER */
157157
158158static void beta_Set_RA(int offset, int data);
159159static void beta_Set_HSync(int offset, int data);
r1653r1654
225225void vid_set_gctrl(int data)
226226{
227227   GCtrl=data;
228#ifdef MAME_DEBUG
228#ifdef ENABLE_DEBUGGER
229229   if (LogRegWrites)
230230      debug_console_printf("I28-PB=$%2X, %2X-%s-%s-%s-%s-%s-%s PC=%4X\n",
231231                 data,
r1653r1654
272272
273273//debug_console_printf("HT=%d, HS=%d, HW=%d, (HS+HW)=%d, HT-(HS+HW)=%d\n",HT,HS,HW,(HS+HW),(HT-(HS+HW)));
274274//debug_console_printf("Scanline=%d, row=%d\n",m6845_get_scanline_counter(),m6845_get_row_counter());
275#ifdef MAME_DEBUG
275#ifdef ENABLE_DEBUGGER
276276      HSyncMin=beta_scr_x;
277277#endif
278278   }
r1653r1654
302302         Field=(Field+1) & 0x01;   /* Invert field */
303303//         debug_console_printf("Invert field=%d\n",Field);
304304      }
305#ifdef MAME_DEBUG
305#ifdef ENABLE_DEBUGGER
306306      VSyncMin=beta_scr_y;
307307#endif
308308   }
r1653r1654
314314{
315315   beta_DE = data;
316316
317#ifdef MAME_DEBUG
317#ifdef ENABLE_DEBUGGER
318318   if(beta_DE)
319319      DEPos=beta_scr_x;
320320#endif
r1653r1654
338338   DoubleY=1;
339339   DrawInterlace=INTERLACE_OFF;   /* No interlace by default */
340340
341#ifdef MAME_DEBUG
341#ifdef ENABLE_DEBUGGER
342342   /* setup debug commands */
343343   if (machine->debug_mode)
344344   {
r1653r1654
350350      debug_console_register_command("beta_vid_clkmax", CMDFLAG_NONE, 0, 0, 1,SetClkMax);
351351   }
352352   LogRegWrites=0;
353#endif /* MAME_DEBUG */
353#endif /* ENABLE_DEBUGGER */
354354}
355355
356356/**************************/
r1653r1654
726726      m6845_address_w(offset,data);
727727      VidAddr=data;            /* Record reg being written to */
728728   }
729#ifdef MAME_DEBUG
729#ifdef ENABLE_DEBUGGER
730730   if (LogRegWrites)
731731      RegLog(offset,data);
732732#endif
r1653r1654
744744 *
745745 *************************************/
746746
747#ifdef MAME_DEBUG
747#ifdef ENABLE_DEBUGGER
748748static void ToggleRegLog(int ref, int params, const char *param[])
749749{
750750   LogRegWrites=!LogRegWrites;
src/mess/video/m6847.c
r1653r1654
6767#include "m6847.h"
6868#include "deprecat.h"
6969
70#ifdef MAME_DEBUG
70#ifdef ENABLE_DEBUGGER
7171#include "debug/debugcpu.h"
7272#include "debug/debugcon.h"
7373#endif
r1653r1654
14561456}
14571457
14581458
1459#ifdef MAME_DEBUG
1459#ifdef ENABLE_DEBUGGER
14601460static int get_beamx(void)
14611461{
14621462   attotime scanline_time;
r1653r1654
16791679 *
16801680 *************************************/
16811681
1682#ifdef MAME_DEBUG
1682#ifdef ENABLE_DEBUGGER
16831683
16841684static void execute_dumpscanline(int ref, int params, const char **param)
16851685{
r1653r1654
17051705   }
17061706}
17071707
1708#endif /* MAME_DEBUG */
1708#endif /* ENABLE_DEBUGGER */
17091709
17101710
17111711
r1653r1654
19211921      logerror("\n");
19221922   }
19231923
1924#ifdef MAME_DEBUG
1924#ifdef ENABLE_DEBUGGER
19251925   /* setup debug commands */
19261926   if (Machine->debug_mode)
19271927      debug_console_register_command("m6847_dumpscanline", CMDFLAG_NONE, 0, 0, 0, execute_dumpscanline);
1928#endif /* MAME_DEBUG */
1928#endif /* ENABLE_DEBUGGER */
19291929}
19301930
19311931
src/mess/inputx.c
r1653r1654
1414#include "inptport.h"
1515#include "mame.h"
1616
17#ifdef MAME_DEBUG
17#ifdef ENABLE_DEBUGGER
1818#include "debug/debugcon.h"
19#endif /* MAME_DEBUG */
19#endif /* ENABLE_DEBUGGER */
2020
2121#define NUM_SIMUL_KEYS   (UCHAR_SHIFT_END - UCHAR_SHIFT_BEGIN + 1)
2222#define LOG_INPUTX      0
r1653r1654
593593
594594
595595
596#ifdef MAME_DEBUG
596#ifdef ENABLE_DEBUGGER
597597static void execute_input(int ref, int params, const char *param[])
598598{
599599   inputx_post_coded(param[0]);
600600}
601#endif /* MAME_DEBUG */
601#endif /* ENABLE_DEBUGGER */
602602
603603
604604
r1653r1654
646646   charqueue_empty = NULL;
647647   keybuffer = NULL;
648648
649#ifdef MAME_DEBUG
649#ifdef ENABLE_DEBUGGER
650650   if (Machine->debug_mode)
651651      debug_console_register_command("input", CMDFLAG_NONE, 0, 1, 1, execute_input);
652#endif /* MAME_DEBUG */
652#endif /* ENABLE_DEBUGGER */
653653
654654   /* posting keys directly only makes sense for a computer */
655655   if (Machine->gamedrv->flags & GAME_COMPUTER)
src/mess/osd/windows/menu.c
r1653r1654
8181   DEVOPTION_MAX
8282};
8383
84#ifdef MAME_DEBUG
85#define HAS_PROFILER   1
84#ifdef ENABLE_DEBUGGER
8685#define HAS_DEBUGGER   1
8786#else
88#define HAS_PROFILER   0
8987#define HAS_DEBUGGER   0
9088#endif
89#ifdef MAME_PROFILER
90#define HAS_PROFILER   1
91#else
92#define HAS_PROFILER   0
93#endif
9194
9295#ifdef UNDER_CE
9396#define HAS_TOGGLEMENUBAR      0
src/mess/machine/dgn_beta.c
r1653r1654
8787
8888
8989
90#ifdef MAME_DEBUG
90#ifdef ENABLE_DEBUGGER
9191#include "debug/debugcpu.h"
9292#include "debug/debugcon.h"
93#endif /* MAME_DEBUG */
93#endif /* ENABLE_DEBUGGER */
9494
95#ifdef MAME_DEBUG
95#ifdef ENABLE_DEBUGGER
9696static offs_t dgnbeta_dasm_override(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
9797static void ToggleDatLog(int ref, int params, const char *param[]);
9898static void DumpKeys(int ref, int params, const char *param[]);
9999
100100static int LogDatWrites;
101#endif /* MAME_DEBUG */
101#endif /* ENABLE_DEBUGGER */
102102
103103static READ8_HANDLER(d_pia0_pa_r);
104104static WRITE8_HANDLER(d_pia0_pa_w);
r1653r1654
263263         if (!IsIOPage(Page))
264264         {
265265            readbank = &mess_ram[MapPage*RamPageSize];
266#ifdef MAME_DEBUG
266#ifdef ENABLE_DEBUGGER
267267            if(LogDatWrites)
268268               debug_console_printf("Mapping page %X, pageno=%X, mess_ram[%X]\n",Page,MapPage,(MapPage*RamPageSize));
269269#endif
r1653r1654
309309   int      Idx;
310310
311311   LOG_DEFAULT_TASK(("SetDefaultTask()\n"));
312#ifdef MAME_DEBUG
312#ifdef ENABLE_DEBUGGER
313313   if (VERBOSE) debug_console_printf("Set Default task\n");
314314#endif
315315
r1653r1654
638638      RowShifter = (RowShifter<<1) | ((d_pia0_pb_last & KOutDat)>>4);
639639      RowShifter &= 0x3FF;
640640      LOG_KEYBOARD(("Rowshifter=$%02X Keyrow=$%02X\n",RowShifter,Keyrow));
641#ifdef MAME_DEBUG
641#ifdef ENABLE_DEBUGGER
642642      if (VERBOSE) debug_console_printf("rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",RowShifter,RowNo,Keyrow);
643643#endif
644644   }
r1653r1654
10981098   init_video(machine);
10991099
11001100   wd17xx_init(WD_TYPE_179X,dgnbeta_fdc_callback, NULL);
1101#ifdef MAME_DEBUG
1101#ifdef ENABLE_DEBUGGER
11021102   cpuintrf_set_dasm_override(0,dgnbeta_dasm_override);
1103#endif /* MAME_DEBUG */
1103#endif /* ENABLE_DEBUGGER */
11041104
11051105   add_reset_callback(machine, dgnbeta_reset);
11061106   dgnbeta_reset(machine);
1107#ifdef MAME_DEBUG
1107#ifdef ENABLE_DEBUGGER
11081108   /* setup debug commands */
11091109   if (machine->debug_mode)
11101110   {
r1653r1654
11121112      debug_console_register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, 0,DumpKeys);
11131113   }
11141114   LogDatWrites=0;
1115#endif   /* MAME_DEBUG */
1115#endif   /* ENABLE_DEBUGGER */
11161116}
11171117
11181118
r1653r1654
11211121  OS9 Syscalls for disassembly
11221122****************************************************************************/
11231123
1124#ifdef MAME_DEBUG
1124#ifdef ENABLE_DEBUGGER
11251125
11261126static const char *const os9syscalls[] =
11271127{
r1653r1654
12901290   return result;
12911291}
12921292
1293#ifdef MAME_DEBUG
1293#ifdef ENABLE_DEBUGGER
12941294static void ToggleDatLog(int ref, int params, const char *param[])
12951295{
12961296   LogDatWrites=!LogDatWrites;
r1653r1654
13091309}
13101310#endif
13111311
1312#endif /* MAME_DEBUG */
1312#endif /* ENABLE_DEBUGGER */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team