mirror of
https://github.com/holub/mame
synced 2025-07-07 10:58:41 +03:00
Cleaned a bit Carl's solution for optional QT debugger for Windows (nw)
This commit is contained in:
parent
ff753045ef
commit
89834d2946
@ -15,7 +15,13 @@
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
#include "emu.h"
|
||||
#if defined(SDL)
|
||||
#include "osdsdl.h"
|
||||
#define xxx_osd_interface sdl_osd_interface
|
||||
#elif defined(WIN32)
|
||||
#include "winmain.h"
|
||||
#define xxx_osd_interface windows_osd_interface
|
||||
#endif
|
||||
#include "config.h"
|
||||
#include "debugger.h"
|
||||
|
||||
@ -179,7 +185,7 @@ static void bring_main_window_to_front()
|
||||
// Core functionality
|
||||
//============================================================
|
||||
|
||||
void sdl_osd_interface::init_debugger()
|
||||
void xxx_osd_interface::init_debugger()
|
||||
{
|
||||
if (qApp == NULL)
|
||||
{
|
||||
@ -214,9 +220,11 @@ void sdl_osd_interface::init_debugger()
|
||||
extern int sdl_entered_debugger;
|
||||
#endif
|
||||
|
||||
void sdl_osd_interface::wait_for_debugger(device_t &device, bool firststop)
|
||||
void xxx_osd_interface::wait_for_debugger(device_t &device, bool firststop)
|
||||
{
|
||||
#if defined(SDL)
|
||||
sdl_entered_debugger = 1;
|
||||
#endif
|
||||
|
||||
// Dialog initialization
|
||||
if (oneShot)
|
||||
|
@ -393,7 +393,7 @@ static int debugwin_seq_pressed(running_machine &machine)
|
||||
// debugwin_init_windows
|
||||
//============================================================
|
||||
|
||||
void debugwin_init_windows(running_machine &machine)
|
||||
void windows_osd_interface::init_debugger()
|
||||
{
|
||||
static int class_registered;
|
||||
|
||||
@ -439,7 +439,7 @@ void debugwin_init_windows(running_machine &machine)
|
||||
|
||||
if (temp_dc != NULL)
|
||||
{
|
||||
windows_options &options = downcast<windows_options &>(machine.options());
|
||||
windows_options &options = downcast<windows_options &>(machine().options());
|
||||
int size = options.debugger_font_size();
|
||||
TCHAR *t_face;
|
||||
|
||||
@ -469,6 +469,9 @@ void debugwin_init_windows(running_machine &machine)
|
||||
// get other metrics
|
||||
hscroll_height = GetSystemMetrics(SM_CYHSCROLL);
|
||||
vscroll_width = GetSystemMetrics(SM_CXVSCROLL);
|
||||
|
||||
// ensure we get called on the way out
|
||||
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(debugwin_destroy_windows), &machine()));
|
||||
}
|
||||
|
||||
|
||||
@ -477,7 +480,7 @@ void debugwin_init_windows(running_machine &machine)
|
||||
// debugwin_destroy_windows
|
||||
//============================================================
|
||||
|
||||
void debugwin_destroy_windows(void)
|
||||
void debugwin_destroy_windows(running_machine &machine)
|
||||
{
|
||||
// loop over windows and free them
|
||||
while (window_list != NULL)
|
||||
@ -492,21 +495,6 @@ void debugwin_destroy_windows(void)
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// debugwin_show
|
||||
//============================================================
|
||||
|
||||
void debugwin_show(int type)
|
||||
{
|
||||
debugwin_info *info;
|
||||
|
||||
// loop over windows and show/hide them
|
||||
for (info = window_list; info != NULL; info = info->next)
|
||||
ShowWindow(info->wnd, type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// debugwin_update_during_game
|
||||
//============================================================
|
||||
|
@ -55,9 +55,7 @@
|
||||
// PROTOTYPES
|
||||
//============================================================
|
||||
|
||||
void debugwin_init_windows(running_machine &machine);
|
||||
void debugwin_destroy_windows(void);
|
||||
void debugwin_show(int type);
|
||||
void debugwin_destroy_windows(running_machine &machine);
|
||||
void debugwin_update_during_game(running_machine &machine);
|
||||
|
||||
#endif
|
||||
|
@ -131,7 +131,7 @@ void winvideo_init(running_machine &machine)
|
||||
|
||||
// possibly create the debug window, but don't show it yet
|
||||
if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||
debugwin_init_windows(machine);
|
||||
machine.osd().init_debugger();
|
||||
}
|
||||
|
||||
|
||||
|
@ -296,10 +296,6 @@ static void winwindow_exit(running_machine &machine)
|
||||
{
|
||||
assert(GetCurrentThreadId() == main_threadid);
|
||||
|
||||
// possibly kill the debug window
|
||||
if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
|
||||
debugwin_destroy_windows();
|
||||
|
||||
// free all the windows
|
||||
while (win_window_list != NULL)
|
||||
{
|
||||
|
@ -77,6 +77,9 @@ WINSRC = $(SRC)/osd/$(OSD)
|
||||
WINOBJ = $(OBJ)/osd/$(OSD)
|
||||
|
||||
OBJDIRS += $(WINOBJ)
|
||||
ifdef USE_QTDEBUG
|
||||
OBJDIRS += $(WINOBJ)/../sdl
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@ -329,14 +332,44 @@ $(WINOBJ)/drawdd.o : $(SRC)/emu/rendersw.c
|
||||
$(WINOBJ)/drawgdi.o : $(SRC)/emu/rendersw.c
|
||||
$(WINOBJ)/winmidi.o: $(SRC)/osd/portmedia/pmmidi.c
|
||||
|
||||
ifndef USE_QTDEBUG
|
||||
# add debug-specific files
|
||||
OSDOBJS += \
|
||||
$(WINOBJ)/debugwin.o
|
||||
endif
|
||||
|
||||
# add a stub resource file
|
||||
RESFILE = $(WINOBJ)/mame.res
|
||||
|
||||
#-------------------------------------------------
|
||||
# QT Debug library
|
||||
#-------------------------------------------------
|
||||
ifdef USE_QTDEBUG
|
||||
QTPATH := $(dir $(shell where gcc.exe))../Qt
|
||||
LIBS += -L$(QTPATH)/lib -lqtmain -lQtGui4 -lQtCore4
|
||||
INCPATH += -I$(QTPATH)/include/QtCore -I$(QTPATH)/include/QtGui -I$(QTPATH)/include
|
||||
SDLOBJ := $(WINOBJ)/../sdl
|
||||
SDLSRC := $(WINSRC)/../sdl
|
||||
|
||||
MOC = @$(QTPATH)/bin/moc
|
||||
$(SDLOBJ)/%.moc.c: $(SDLSRC)/%.h
|
||||
$(MOC) $(INCPATH) $(DEFS) $< -o $@
|
||||
|
||||
OSDOBJS += \
|
||||
$(SDLOBJ)/debugqt.o \
|
||||
$(SDLOBJ)/debugqtview.o \
|
||||
$(SDLOBJ)/debugqtwindow.o \
|
||||
$(SDLOBJ)/debugqtlogwindow.o \
|
||||
$(SDLOBJ)/debugqtdasmwindow.o \
|
||||
$(SDLOBJ)/debugqtmainwindow.o \
|
||||
$(SDLOBJ)/debugqtmemorywindow.o \
|
||||
$(SDLOBJ)/debugqtview.moc.o \
|
||||
$(SDLOBJ)/debugqtwindow.moc.o \
|
||||
$(SDLOBJ)/debugqtlogwindow.moc.o \
|
||||
$(SDLOBJ)/debugqtdasmwindow.moc.o \
|
||||
$(SDLOBJ)/debugqtmainwindow.moc.o \
|
||||
$(SDLOBJ)/debugqtmemorywindow.moc.o
|
||||
endif
|
||||
|
||||
#-------------------------------------------------
|
||||
# rules for building the libaries
|
||||
|
@ -335,7 +335,7 @@ public:
|
||||
virtual void update(bool skip_redraw);
|
||||
|
||||
// debugger overridables
|
||||
// virtual void init_debugger();
|
||||
virtual void init_debugger();
|
||||
virtual void wait_for_debugger(device_t &device, bool firststop);
|
||||
|
||||
// audio overridables
|
||||
|
Loading…
Reference in New Issue
Block a user