Previous 199869 Revisions Next

r23299 Thursday 30th May, 2013 at 14:32:47 UTC by Miodrag Milanović
Cleaned a bit Carl's solution for optional QT debugger for Windows (nw)
[src/osd/sdl]debugqt.c
[src/osd/windows]debugwin.c debugwin.h video.c window.c windows.mak winmain.h

trunk/src/osd/windows/video.c
r23298r23299
131131
132132   // possibly create the debug window, but don't show it yet
133133   if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
134      debugwin_init_windows(machine);
134      machine.osd().init_debugger();
135135}
136136
137137
trunk/src/osd/windows/winmain.h
r23298r23299
335335   virtual void update(bool skip_redraw);
336336
337337   // debugger overridables
338//  virtual void init_debugger();
338   virtual void init_debugger();
339339   virtual void wait_for_debugger(device_t &device, bool firststop);
340340
341341   // audio overridables
trunk/src/osd/windows/debugwin.c
r23298r23299
393393//  debugwin_init_windows
394394//============================================================
395395
396void debugwin_init_windows(running_machine &machine)
396void windows_osd_interface::init_debugger()
397397{
398398   static int class_registered;
399399
r23298r23299
439439
440440      if (temp_dc != NULL)
441441      {
442         windows_options &options = downcast<windows_options &>(machine.options());
442         windows_options &options = downcast<windows_options &>(machine().options());
443443         int size = options.debugger_font_size();
444444         TCHAR *t_face;
445445
r23298r23299
469469   // get other metrics
470470   hscroll_height = GetSystemMetrics(SM_CYHSCROLL);
471471   vscroll_width = GetSystemMetrics(SM_CXVSCROLL);
472   
473   // ensure we get called on the way out
474   machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(debugwin_destroy_windows), &machine()));
472475}
473476
474477
r23298r23299
477480//  debugwin_destroy_windows
478481//============================================================
479482
480void debugwin_destroy_windows(void)
483void debugwin_destroy_windows(running_machine &machine)
481484{
482485   // loop over windows and free them
483486   while (window_list != NULL)
r23298r23299
493496
494497
495498//============================================================
496//  debugwin_show
497//============================================================
498
499void debugwin_show(int type)
500{
501   debugwin_info *info;
502
503   // loop over windows and show/hide them
504   for (info = window_list; info != NULL; info = info->next)
505      ShowWindow(info->wnd, type);
506}
507
508
509
510//============================================================
511499//  debugwin_update_during_game
512500//============================================================
513501
trunk/src/osd/windows/window.c
r23298r23299
296296{
297297   assert(GetCurrentThreadId() == main_threadid);
298298
299   // possibly kill the debug window
300   if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
301      debugwin_destroy_windows();
302
303299   // free all the windows
304300   while (win_window_list != NULL)
305301   {
trunk/src/osd/windows/debugwin.h
r23298r23299
5555//  PROTOTYPES
5656//============================================================
5757
58void debugwin_init_windows(running_machine &machine);
59void debugwin_destroy_windows(void);
60void debugwin_show(int type);
58void debugwin_destroy_windows(running_machine &machine);
6159void debugwin_update_during_game(running_machine &machine);
6260
6361#endif
trunk/src/osd/windows/windows.mak
r23298r23299
7777WINOBJ = $(OBJ)/osd/$(OSD)
7878
7979OBJDIRS += $(WINOBJ)
80ifdef USE_QTDEBUG
81OBJDIRS += $(WINOBJ)/../sdl
82endif
8083
8184
8285
r23298r23299
329332$(WINOBJ)/drawgdi.o :   $(SRC)/emu/rendersw.c
330333$(WINOBJ)/winmidi.o:    $(SRC)/osd/portmedia/pmmidi.c
331334
335ifndef USE_QTDEBUG
332336# add debug-specific files
333337OSDOBJS += \
334338   $(WINOBJ)/debugwin.o
339endif
335340
336341# add a stub resource file
337342RESFILE = $(WINOBJ)/mame.res
338343
344#-------------------------------------------------
345# QT Debug library
346#-------------------------------------------------
347ifdef USE_QTDEBUG
348QTPATH := $(dir $(shell where gcc.exe))../Qt
349LIBS += -L$(QTPATH)/lib -lqtmain -lQtGui4 -lQtCore4
350INCPATH += -I$(QTPATH)/include/QtCore -I$(QTPATH)/include/QtGui -I$(QTPATH)/include
351SDLOBJ := $(WINOBJ)/../sdl
352SDLSRC := $(WINSRC)/../sdl
339353
354MOC = @$(QTPATH)/bin/moc
355$(SDLOBJ)/%.moc.c: $(SDLSRC)/%.h
356   $(MOC) $(INCPATH) $(DEFS) $< -o $@
340357
358OSDOBJS += \
359 $(SDLOBJ)/debugqt.o \
360 $(SDLOBJ)/debugqtview.o \
361 $(SDLOBJ)/debugqtwindow.o \
362 $(SDLOBJ)/debugqtlogwindow.o \
363 $(SDLOBJ)/debugqtdasmwindow.o \
364 $(SDLOBJ)/debugqtmainwindow.o \
365 $(SDLOBJ)/debugqtmemorywindow.o \
366 $(SDLOBJ)/debugqtview.moc.o \
367 $(SDLOBJ)/debugqtwindow.moc.o \
368 $(SDLOBJ)/debugqtlogwindow.moc.o \
369 $(SDLOBJ)/debugqtdasmwindow.moc.o \
370 $(SDLOBJ)/debugqtmainwindow.moc.o \
371 $(SDLOBJ)/debugqtmemorywindow.moc.o
372endif
373
341374#-------------------------------------------------
342375# rules for building the libaries
343376#-------------------------------------------------
trunk/src/osd/sdl/debugqt.c
r23298r23299
1515#include <QtGui/QApplication>
1616
1717#include "emu.h"
18#if defined(SDL)
1819#include "osdsdl.h"
20#define xxx_osd_interface sdl_osd_interface
21#elif defined(WIN32)
22#include "winmain.h"
23#define xxx_osd_interface windows_osd_interface
24#endif
1925#include "config.h"
2026#include "debugger.h"
2127
r23298r23299
179185//  Core functionality
180186//============================================================
181187
182void sdl_osd_interface::init_debugger()
188void xxx_osd_interface::init_debugger()
183189{
184190   if (qApp == NULL)
185191   {
r23298r23299
214220extern int sdl_entered_debugger;
215221#endif
216222
217void sdl_osd_interface::wait_for_debugger(device_t &device, bool firststop)
223void xxx_osd_interface::wait_for_debugger(device_t &device, bool firststop)
218224{
225#if defined(SDL)
219226   sdl_entered_debugger = 1;
227#endif
220228
221229   // Dialog initialization
222230   if (oneShot)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team