trunk/src/osd/modules/debugger/debugint.c
| r243106 | r243107 | |
| 10 | 10 | *********************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | | #include "debugint.h" |
| 14 | 13 | #include "ui/ui.h" |
| 15 | 14 | #include "rendfont.h" |
| 16 | 15 | #include "uiinput.h" |
| r243106 | r243107 | |
| 22 | 21 | #include "debug/debugcon.h" |
| 23 | 22 | #include "debug/debugcpu.h" |
| 24 | 23 | |
| 24 | #include "debug_module.h" |
| 25 | #include "modules/osdmodule.h" |
| 25 | 26 | |
| 27 | class debug_internal : public osd_module, public debug_module |
| 28 | { |
| 29 | public: |
| 30 | debug_internal() |
| 31 | : osd_module(OSD_DEBUG_PROVIDER, "internal"), debug_module(), |
| 32 | m_machine(NULL) |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | virtual ~debug_internal() { } |
| 37 | |
| 38 | virtual int init() { return 0;} |
| 39 | virtual void exit(); |
| 40 | |
| 41 | virtual void init_debugger(running_machine &machine); |
| 42 | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 43 | virtual void debugger_update(); |
| 44 | |
| 45 | private: |
| 46 | running_machine *m_machine; |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | |
| 26 | 51 | /*************************************************************************** |
| 27 | 52 | CONSTANTS |
| 28 | 53 | ***************************************************************************/ |
| 29 | 54 | |
| 30 | | const osd_debugger_type OSD_DEBUGGER_INTERNAL = &osd_debugger_creator<debugger_internal>; |
| 31 | | |
| 32 | 55 | #define BORDER_YTHICKNESS 1 |
| 33 | 56 | #define BORDER_XTHICKNESS 1 |
| 34 | 57 | #define HSB_HEIGHT 20 |
| r243106 | r243107 | |
| 239 | 262 | LOCAL VARIABLES |
| 240 | 263 | ***************************************************************************/ |
| 241 | 264 | |
| 242 | | static render_font * debug_font; |
| 265 | static render_font * debug_font = NULL; |
| 243 | 266 | static int debug_font_width; |
| 244 | 267 | static int debug_font_height; |
| 245 | 268 | static float debug_font_aspect; |
| 246 | | static DView * list; |
| 269 | static DView * list = NULL; |
| 247 | 270 | static DView * focus_view; |
| 248 | 271 | |
| 249 | 272 | static ui_menu * menu; |
| r243106 | r243107 | |
| 841 | 864 | #endif |
| 842 | 865 | } |
| 843 | 866 | |
| 844 | | void debugger_internal::debugger_exit() |
| 867 | void debug_internal::exit() |
| 845 | 868 | { |
| 846 | 869 | for (DView *ndv = list; ndv != NULL; ) |
| 847 | 870 | { |
| r243106 | r243107 | |
| 858 | 881 | global_free(menu); |
| 859 | 882 | } |
| 860 | 883 | |
| 861 | | void debugger_internal::init_debugger(running_machine &machine) |
| 884 | void debug_internal::init_debugger(running_machine &machine) |
| 862 | 885 | { |
| 863 | 886 | unicode_char ch; |
| 864 | 887 | int chw; |
| r243106 | r243107 | |
| 1410 | 1433 | } |
| 1411 | 1434 | |
| 1412 | 1435 | |
| 1413 | | void debugger_internal::wait_for_debugger(device_t &device, bool firststop) |
| 1436 | void debug_internal::wait_for_debugger(device_t &device, bool firststop) |
| 1414 | 1437 | { |
| 1415 | 1438 | if (firststop && list == NULL) |
| 1416 | 1439 | { |
| r243106 | r243107 | |
| 1443 | 1466 | |
| 1444 | 1467 | } |
| 1445 | 1468 | |
| 1446 | | void debugger_internal::debugger_update() |
| 1469 | void debug_internal::debugger_update() |
| 1447 | 1470 | { |
| 1448 | | if (!debug_cpu_is_stopped(*m_machine) && m_machine->phase() == MACHINE_PHASE_RUNNING) |
| 1471 | if ((m_machine != NULL) && (!debug_cpu_is_stopped(*m_machine)) && (m_machine->phase() == MACHINE_PHASE_RUNNING)) |
| 1449 | 1472 | { |
| 1450 | 1473 | update_views(); |
| 1451 | 1474 | } |
| 1452 | 1475 | } |
| 1453 | 1476 | |
| 1454 | | //------------------------------------------------- |
| 1455 | | // debugger_internal - constructor |
| 1456 | | //------------------------------------------------- |
| 1457 | | debugger_internal::debugger_internal() |
| 1458 | | : debug_module(), m_machine(NULL) |
| 1459 | | { |
| 1460 | | } |
| 1477 | MODULE_DEFINITION(DEBUG_INTERNAL, debug_internal) |
trunk/src/osd/modules/debugger/debugint.h
| r243106 | r243107 | |
| 1 | | /********************************************************************* |
| 2 | | |
| 3 | | debugint.c |
| 4 | | |
| 5 | | Internal debugger frontend using render interface. |
| 6 | | |
| 7 | | Copyright Nicola Salmoria and the MAME Team. |
| 8 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | | |
| 10 | | *********************************************************************/ |
| 11 | | |
| 12 | | #pragma once |
| 13 | | |
| 14 | | #ifndef __DEBUGGER_INTERNAL_H__ |
| 15 | | #define __DEBUGGER_INTERNAL_H__ |
| 16 | | |
| 17 | | #include "osdepend.h" |
| 18 | | #include "modules/lib/osdobj_common.h" |
| 19 | | #include "debug_module.h" |
| 20 | | |
| 21 | | class debugger_internal : public debug_module |
| 22 | | { |
| 23 | | public: |
| 24 | | // construction/destruction |
| 25 | | debugger_internal(); |
| 26 | | virtual ~debugger_internal() { } |
| 27 | | |
| 28 | | virtual void init_debugger(running_machine &machine); |
| 29 | | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 30 | | virtual void debugger_update(); |
| 31 | | virtual void debugger_exit(); |
| 32 | | private: |
| 33 | | running_machine *m_machine; |
| 34 | | }; |
| 35 | | |
| 36 | | extern const osd_debugger_type OSD_DEBUGGER_INTERNAL; |
| 37 | | |
| 38 | | #endif /* __DEBUGGER_INTERNAL_H__ */ |
trunk/src/osd/modules/debugger/debugosx.m
| r243106 | r243107 | |
| 42 | 42 | // MAMEOS headers |
| 43 | 43 | #include "debugosx.h" |
| 44 | 44 | #include "osdsdl.h" |
| 45 | #include "debug_module.h" |
| 45 | 46 | |
| 47 | //============================================================ |
| 48 | // MODULE SUPPORT |
| 49 | //============================================================ |
| 46 | 50 | |
| 51 | static MAMEDebugConsole *main_console = nil; |
| 47 | 52 | |
| 53 | class debugger_osx : public osd_module, public debug_module |
| 54 | { |
| 55 | public: |
| 56 | debugger_osx() |
| 57 | : osd_module(OSD_DEBUG_PROVIDER, "osx"), debug_module(), |
| 58 | m_machine(NULL) |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | virtual ~debugger_osx() { } |
| 63 | |
| 64 | virtual int init() { return 0;} |
| 65 | virtual void exit() |
| 66 | { |
| 67 | } |
| 68 | |
| 69 | virtual void init_debugger(running_machine &machine); |
| 70 | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 71 | virtual void debugger_update(); |
| 72 | |
| 73 | private: |
| 74 | running_machine *m_machine; |
| 75 | }; |
| 76 | |
| 77 | MODULE_DEFINITION(DEBUG_OSX, debugger_osx) |
| 78 | |
| 48 | 79 | //============================================================ |
| 49 | 80 | // LOCAL VARIABLES |
| 50 | 81 | //============================================================ |
| 51 | 82 | |
| 52 | | static MAMEDebugConsole *main_console = nil; |
| 53 | 83 | |
| 54 | 84 | static BOOL waiting_for_debugger = NO; |
| 55 | 85 | |
| r243106 | r243107 | |
| 67 | 97 | |
| 68 | 98 | static void console_create_window(running_machine &machine); |
| 69 | 99 | |
| 70 | | const osd_debugger_type OSD_DEBUGGER_OSX = &osd_debugger_creator<debugger_osx>; |
| 71 | | |
| 72 | | //------------------------------------------------- |
| 73 | | // debugger_osx - constructor |
| 74 | | //------------------------------------------------- |
| 75 | | debugger_osx::debugger_osx(const osd_interface &osd) |
| 76 | | : osd_debugger_interface(osd), m_machine(NULL) |
| 77 | | { |
| 78 | | } |
| 79 | | |
| 80 | 100 | //============================================================ |
| 81 | 101 | // debugger_osx::init_debugger |
| 82 | 102 | //============================================================ |
| r243106 | r243107 | |
| 131 | 151 | } |
| 132 | 152 | |
| 133 | 153 | //============================================================ |
| 134 | | // debugger_exit |
| 135 | | //============================================================ |
| 136 | | |
| 137 | | void debugger_osx::debugger_exit() |
| 138 | | { |
| 139 | | } |
| 140 | | |
| 141 | | //============================================================ |
| 142 | 154 | // debugwin_view_update |
| 143 | 155 | //============================================================ |
| 144 | 156 | |
trunk/src/osd/modules/debugger/debugqt.c
| r243106 | r243107 | |
| 11 | 11 | |
| 12 | 12 | #define NO_MEM_TRACKING |
| 13 | 13 | |
| 14 | #include "debug_module.h" |
| 15 | #include "modules/osdmodule.h" |
| 16 | |
| 17 | #if (USE_QTDEBUG) |
| 18 | |
| 14 | 19 | #include <vector> |
| 15 | 20 | |
| 16 | 21 | #include <QtGui/QtGui> |
| r243106 | r243107 | |
| 28 | 33 | #include "qt/debugqtbreakpointswindow.h" |
| 29 | 34 | #include "qt/debugqtdeviceswindow.h" |
| 30 | 35 | #include "qt/debugqtdeviceinformationwindow.h" |
| 31 | | #include "debugqt.h" |
| 32 | 36 | |
| 33 | | |
| 34 | | debug_module *qt_osd_debugger_creator() |
| 37 | class debug_qt : public osd_module, public debug_module |
| 35 | 38 | { |
| 36 | | return new debugger_qt(); |
| 37 | | } |
| 38 | | const osd_debugger_type OSD_DEBUGGER_QT = &qt_osd_debugger_creator; |
| 39 | public: |
| 40 | debug_qt() |
| 41 | : osd_module(OSD_DEBUG_PROVIDER, "qt"), debug_module(), |
| 42 | m_machine(NULL) |
| 43 | { |
| 44 | } |
| 39 | 45 | |
| 46 | virtual ~debug_qt() { } |
| 47 | |
| 48 | virtual int init() { return 0;} |
| 49 | virtual void exit() { } |
| 50 | |
| 51 | virtual void init_debugger(running_machine &machine); |
| 52 | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 53 | virtual void debugger_update(); |
| 54 | |
| 55 | private: |
| 56 | running_machine *m_machine; |
| 57 | }; |
| 58 | |
| 40 | 59 | //============================================================ |
| 41 | 60 | // "Global" variables to make QT happy |
| 42 | 61 | //============================================================ |
| r243106 | r243107 | |
| 47 | 66 | bool oneShot = true; |
| 48 | 67 | static MainWindow* mainQtWindow = NULL; |
| 49 | 68 | |
| 50 | | //------------------------------------------------- |
| 51 | | // debugger_qt - constructor |
| 52 | | //------------------------------------------------- |
| 53 | | debugger_qt::debugger_qt() |
| 54 | | : debug_module(), m_machine(NULL) |
| 55 | | { |
| 56 | | } |
| 57 | | |
| 58 | | debugger_qt::~debugger_qt() |
| 59 | | { |
| 60 | | } |
| 61 | | |
| 62 | 69 | //============================================================ |
| 63 | 70 | // XML configuration save/load |
| 64 | 71 | //============================================================ |
| r243106 | r243107 | |
| 228 | 235 | bool winwindow_qt_filter(void *message); |
| 229 | 236 | #endif |
| 230 | 237 | |
| 231 | | void debugger_qt::init_debugger(running_machine &machine) |
| 238 | void debug_qt::init_debugger(running_machine &machine) |
| 232 | 239 | { |
| 233 | 240 | if (qApp == NULL) |
| 234 | 241 | { |
| r243106 | r243107 | |
| 269 | 276 | void winwindow_update_cursor_state(running_machine &machine); |
| 270 | 277 | #endif |
| 271 | 278 | |
| 272 | | void debugger_qt::wait_for_debugger(device_t &device, bool firststop) |
| 279 | void debug_qt::wait_for_debugger(device_t &device, bool firststop) |
| 273 | 280 | { |
| 274 | 281 | #if defined(SDLMAME_UNIX) || defined(SDLMAME_WIN32) |
| 275 | 282 | sdl_entered_debugger = 1; |
| r243106 | r243107 | |
| 344 | 351 | // Available for video.* |
| 345 | 352 | //============================================================ |
| 346 | 353 | |
| 347 | | void debugger_qt::debugger_update() |
| 354 | void debug_qt::debugger_update() |
| 348 | 355 | { |
| 349 | 356 | qApp->processEvents(QEventLoop::AllEvents, 1); |
| 350 | 357 | } |
| 351 | 358 | |
| 352 | | void debugger_qt::debugger_exit() |
| 353 | | { |
| 354 | | } |
| 359 | #else /* SDLMAME_UNIX */ |
| 360 | MODULE_NOT_SUPPORTED(debug_qt, OSD_DEBUG_PROVIDER, "qt") |
| 361 | #endif |
| 362 | |
| 363 | MODULE_DEFINITION(DEBUG_QT, debug_qt) |
trunk/src/osd/modules/debugger/debugqt.h
| r243106 | r243107 | |
| 1 | | //============================================================ |
| 2 | | // |
| 3 | | // debugqt.h - SDL/QT debug window handling |
| 4 | | // |
| 5 | | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. |
| 6 | | // Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | | // |
| 8 | | // SDLMAME by Olivier Galibert and R. Belmont |
| 9 | | // |
| 10 | | //============================================================ |
| 11 | | |
| 12 | | #pragma once |
| 13 | | |
| 14 | | #ifndef __DEBUGGER_QT_H__ |
| 15 | | #define __DEBUGGER_QT_H__ |
| 16 | | |
| 17 | | #include "emu.h" |
| 18 | | #include "debug_module.h" |
| 19 | | |
| 20 | | class debugger_qt : public debug_module |
| 21 | | { |
| 22 | | public: |
| 23 | | // construction/destruction |
| 24 | | debugger_qt(); |
| 25 | | virtual ~debugger_qt(); |
| 26 | | |
| 27 | | virtual void init_debugger(running_machine &machine); |
| 28 | | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 29 | | virtual void debugger_update(); |
| 30 | | virtual void debugger_exit(); |
| 31 | | |
| 32 | | private: |
| 33 | | running_machine *m_machine; |
| 34 | | }; |
| 35 | | |
| 36 | | extern const osd_debugger_type OSD_DEBUGGER_QT; |
| 37 | | |
| 38 | | #endif /* __DEBUGGER_QT_H__ */ |
trunk/src/osd/modules/debugger/debugwin.c
| r243106 | r243107 | |
| 6 | 6 | // |
| 7 | 7 | //============================================================ |
| 8 | 8 | |
| 9 | #include "debug_module.h" |
| 10 | #include "modules/osdmodule.h" |
| 11 | |
| 12 | #if defined(OSD_WINDOWS) /*|| defined(SDLMAME_WIN32)*/ |
| 13 | |
| 9 | 14 | // standard windows headers |
| 10 | 15 | #define WIN32_LEAN_AND_MEAN |
| 11 | 16 | #include <windows.h> |
| r243106 | r243107 | |
| 36 | 41 | #include "strconv.h" |
| 37 | 42 | #include "winutf8.h" |
| 38 | 43 | |
| 39 | | #include "debugwin.h" |
| 44 | class debugger_windows : public osd_module, public debug_module |
| 45 | { |
| 46 | public: |
| 47 | debugger_windows() |
| 48 | : osd_module(OSD_DEBUG_PROVIDER, "windows"), debug_module(), |
| 49 | m_machine(NULL) |
| 50 | { |
| 51 | } |
| 40 | 52 | |
| 41 | | const osd_debugger_type OSD_DEBUGGER_WINDOWS = &osd_debugger_creator<debugger_windows>; |
| 53 | virtual ~debugger_windows() { } |
| 42 | 54 | |
| 55 | virtual int init() { return 0;} |
| 56 | virtual void exit(); |
| 57 | |
| 58 | virtual void init_debugger(running_machine &machine); |
| 59 | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 60 | virtual void debugger_update(); |
| 61 | |
| 62 | private: |
| 63 | running_machine *m_machine; |
| 64 | }; |
| 43 | 65 | //============================================================ |
| 44 | 66 | // PARAMETERS |
| 45 | 67 | //============================================================ |
| r243106 | r243107 | |
| 174 | 196 | // LOCAL VARIABLES |
| 175 | 197 | //============================================================ |
| 176 | 198 | |
| 177 | | static debugwin_info *window_list; |
| 199 | static debugwin_info *window_list = NULL; |
| 178 | 200 | static debugwin_info *main_console; |
| 179 | 201 | static UINT32 main_console_regwidth; |
| 180 | 202 | |
| r243106 | r243107 | |
| 239 | 261 | static void image_update_menu(debugwin_info *info); |
| 240 | 262 | |
| 241 | 263 | |
| 242 | | //------------------------------------------------- |
| 243 | | // debugger_windows - constructor |
| 244 | | //------------------------------------------------- |
| 245 | | debugger_windows::debugger_windows(const osd_interface &osd) |
| 246 | | : osd_debugger_interface(osd) |
| 247 | | { |
| 248 | | } |
| 249 | | |
| 250 | 264 | //============================================================ |
| 251 | 265 | // wait_for_debugger |
| 252 | 266 | //============================================================ |
| r243106 | r243107 | |
| 453 | 467 | // debugwin_destroy_windows |
| 454 | 468 | //============================================================ |
| 455 | 469 | |
| 456 | | void debugger_windows::debugger_exit() |
| 470 | void debugger_windows::exit() |
| 457 | 471 | { |
| 458 | 472 | // loop over windows and free them |
| 459 | 473 | while (window_list != NULL) |
| r243106 | r243107 | |
| 3079 | 3093 | for (info = window_list; info != NULL; info = info->next) |
| 3080 | 3094 | smart_show_window(info->wnd, show); |
| 3081 | 3095 | } |
| 3096 | #else /* not windows */ |
| 3097 | MODULE_NOT_SUPPORTED(debugger_windows, OSD_DEBUG_PROVIDER, "windows") |
| 3098 | #endif |
| 3099 | |
| 3100 | MODULE_DEFINITION(DEBUG_WINDOWS, debugger_windows) |
trunk/src/osd/modules/debugger/debugwin.h
| r243106 | r243107 | |
| 1 | | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Aaron Giles |
| 3 | | //============================================================ |
| 4 | | // |
| 5 | | // debugwin.h - Win32 debug window handling |
| 6 | | // |
| 7 | | //============================================================ |
| 8 | | |
| 9 | | |
| 10 | | #pragma once |
| 11 | | |
| 12 | | #ifndef __DEBUGGER_WINDOWS_H__ |
| 13 | | #define __DEBUGGER_WINDOWS_H__ |
| 14 | | |
| 15 | | #include "osdepend.h" |
| 16 | | #include "modules/lib/osdobj_common.h" |
| 17 | | |
| 18 | | class debugger_windows : public osd_debugger_interface |
| 19 | | { |
| 20 | | public: |
| 21 | | // construction/destruction |
| 22 | | debugger_windows(const osd_interface &osd); |
| 23 | | virtual ~debugger_windows() { } |
| 24 | | |
| 25 | | virtual void init_debugger(running_machine &machine); |
| 26 | | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 27 | | virtual void debugger_update(); |
| 28 | | virtual void debugger_exit(); |
| 29 | | private: |
| 30 | | running_machine *m_machine; |
| 31 | | }; |
| 32 | | |
| 33 | | extern const osd_debugger_type OSD_DEBUGGER_WINDOWS; |
| 34 | | |
| 35 | | #endif /* __DEBUGGER_WINDOWS_H__ */ |
trunk/src/osd/modules/debugger/none.c
| r243106 | r243107 | |
| 4 | 4 | // |
| 5 | 5 | //============================================================ |
| 6 | 6 | |
| 7 | | #include "none.h" |
| 7 | #include "debug_module.h" |
| 8 | #include "modules/osdmodule.h" |
| 9 | |
| 8 | 10 | #include "debug/debugcpu.h" |
| 9 | 11 | |
| 10 | | const osd_debugger_type OSD_DEBUGGER_NONE = &osd_debugger_creator<debugger_none>; |
| 11 | | |
| 12 | | //------------------------------------------------- |
| 13 | | // debugger_none - constructor |
| 14 | | //------------------------------------------------- |
| 15 | | debugger_none::debugger_none() |
| 16 | | : debug_module(), m_machine(NULL) |
| 12 | class debug_none : public osd_module, public debug_module |
| 17 | 13 | { |
| 18 | | } |
| 14 | public: |
| 15 | debug_none() |
| 16 | : osd_module(OSD_DEBUG_PROVIDER, "none"), debug_module(), |
| 17 | m_machine(NULL) |
| 18 | { |
| 19 | } |
| 19 | 20 | |
| 20 | | void debugger_none::init_debugger(running_machine &machine) |
| 21 | virtual ~debug_none() { } |
| 22 | |
| 23 | virtual int init() { return 0;} |
| 24 | virtual void exit() { } |
| 25 | |
| 26 | virtual void init_debugger(running_machine &machine); |
| 27 | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 28 | virtual void debugger_update(); |
| 29 | |
| 30 | private: |
| 31 | running_machine *m_machine; |
| 32 | }; |
| 33 | |
| 34 | void debug_none::init_debugger(running_machine &machine) |
| 21 | 35 | { |
| 22 | 36 | m_machine = &machine; |
| 23 | 37 | } |
| 24 | 38 | |
| 25 | | void debugger_none::wait_for_debugger(device_t &device, bool firststop) |
| 39 | void debug_none::wait_for_debugger(device_t &device, bool firststop) |
| 26 | 40 | { |
| 27 | 41 | debug_cpu_get_visible_cpu(*m_machine)->debug()->go(); |
| 28 | 42 | } |
| 29 | 43 | |
| 30 | | void debugger_none::debugger_update() |
| 44 | void debug_none::debugger_update() |
| 31 | 45 | { |
| 32 | 46 | } |
| 33 | 47 | |
| 34 | | void debugger_none::debugger_exit() |
| 35 | | { |
| 36 | | } |
| 48 | MODULE_DEFINITION(DEBUG_NONE, debug_none) |
trunk/src/osd/modules/debugger/none.h
| r243106 | r243107 | |
| 1 | | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Miodrag Milanovic |
| 3 | | /*************************************************************************** |
| 4 | | |
| 5 | | none.h |
| 6 | | |
| 7 | | Dummy debugger interface. |
| 8 | | |
| 9 | | *******************************************************************c********/ |
| 10 | | |
| 11 | | #pragma once |
| 12 | | |
| 13 | | #ifndef __DEBUGGER_NONE_H__ |
| 14 | | #define __DEBUGGER_NONE_H__ |
| 15 | | |
| 16 | | #include "osdepend.h" |
| 17 | | #include "debug_module.h" |
| 18 | | #include "modules/lib/osdobj_common.h" |
| 19 | | |
| 20 | | class debugger_none : public debug_module |
| 21 | | { |
| 22 | | public: |
| 23 | | // construction/destruction |
| 24 | | debugger_none(); |
| 25 | | virtual ~debugger_none() { } |
| 26 | | |
| 27 | | virtual void init_debugger(running_machine &machine); |
| 28 | | virtual void wait_for_debugger(device_t &device, bool firststop); |
| 29 | | virtual void debugger_update(); |
| 30 | | virtual void debugger_exit(); |
| 31 | | private: |
| 32 | | running_machine *m_machine; |
| 33 | | }; |
| 34 | | |
| 35 | | extern const osd_debugger_type OSD_DEBUGGER_NONE; |
| 36 | | |
| 37 | | #endif /* __DEBUGGER_NONE_H__ */ |
trunk/src/osd/modules/font/font_windows.c
| r243106 | r243107 | |
| 26 | 26 | //#define POINT_SIZE 144.0 |
| 27 | 27 | #define DEFAULT_FONT_HEIGHT (200) |
| 28 | 28 | |
| 29 | | #if 0 |
| 30 | | //============================================================ |
| 31 | | // wstring_from_utf8 |
| 32 | | //============================================================ |
| 33 | | |
| 34 | | // FIXME: defined in multiple locations ... FIXME |
| 35 | | |
| 36 | | WCHAR *wstring_from_utf8(const char *utf8string) |
| 37 | | { |
| 38 | | int char_count; |
| 39 | | WCHAR *result; |
| 40 | | |
| 41 | | // convert MAME string (UTF-8) to UTF-16 |
| 42 | | char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); |
| 43 | | result = (WCHAR *)osd_malloc_array(char_count * sizeof(*result)); |
| 44 | | if (result != NULL) |
| 45 | | MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); |
| 46 | | |
| 47 | | return result; |
| 48 | | } |
| 49 | | |
| 50 | | |
| 51 | | //============================================================ |
| 52 | | // utf8_from_wstring |
| 53 | | //============================================================ |
| 54 | | |
| 55 | | char *utf8_from_wstring(const WCHAR *wstring) |
| 56 | | { |
| 57 | | int char_count; |
| 58 | | char *result; |
| 59 | | |
| 60 | | // convert UTF-16 to MAME string (UTF-8) |
| 61 | | char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, NULL, 0, NULL, NULL); |
| 62 | | result = (char *)osd_malloc_array(char_count * sizeof(*result)); |
| 63 | | if (result != NULL) |
| 64 | | WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, NULL, NULL); |
| 65 | | |
| 66 | | return result; |
| 67 | | } |
| 68 | | #endif |
| 69 | | |
| 70 | 29 | //------------------------------------------------- |
| 71 | 30 | // font_open - attempt to "open" a handle to the |
| 72 | 31 | // font with the given name |
trunk/src/osd/modules/lib/osdobj_common.c
| r243106 | r243107 | |
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | 13 | #include "osdepend.h" |
| 14 | | #include "modules/debugger/none.h" |
| 15 | | #include "modules/debugger/debugint.h" |
| 16 | 14 | #include "modules/lib/osdobj_common.h" |
| 17 | 15 | |
| 18 | 16 | extern bool g_print_verbose; |
| r243106 | r243107 | |
| 123 | 121 | REGISTER_MODULE(m_mod_man, SOUND_SDL); |
| 124 | 122 | REGISTER_MODULE(m_mod_man, SOUND_NONE); |
| 125 | 123 | |
| 124 | #ifdef SDLMAME_MACOSX |
| 125 | REGISTER_MODULE(m_mod_man, DEBUG_OSX); |
| 126 | #endif |
| 127 | REGISTER_MODULE(m_mod_man, DEBUG_WINDOWS); |
| 128 | REGISTER_MODULE(m_mod_man, DEBUG_QT); |
| 129 | REGISTER_MODULE(m_mod_man, DEBUG_INTERNAL); |
| 130 | REGISTER_MODULE(m_mod_man, DEBUG_NONE); |
| 131 | |
| 126 | 132 | // after initialization we know which modules are supported |
| 127 | 133 | |
| 128 | 134 | const char *names[20]; |
| r243106 | r243107 | |
| 139 | 145 | dnames.append(names[i]); |
| 140 | 146 | update_option(OSD_SOUND_PROVIDER, dnames); |
| 141 | 147 | |
| 148 | // Register debugger options and update options |
| 149 | m_mod_man.get_module_names(OSD_DEBUG_PROVIDER, 20, &num, names); |
| 150 | dnames.reset(); |
| 151 | for (int i = 0; i < num; i++) |
| 152 | dnames.append(names[i]); |
| 153 | update_option(OSD_DEBUG_PROVIDER, dnames); |
| 154 | |
| 142 | 155 | // Register video options and update options |
| 143 | 156 | video_options_add("none", NULL); |
| 144 | 157 | video_register(); |
| 145 | 158 | update_option(OSDOPTION_VIDEO, m_video_names); |
| 146 | | |
| 147 | | // Register debugger options and update options |
| 148 | | debugger_options_add("none", OSD_DEBUGGER_NONE); |
| 149 | | debugger_options_add("internal", OSD_DEBUGGER_INTERNAL); |
| 150 | | debugger_register(); |
| 151 | | update_option(OSDOPTION_DEBUGGER, m_debugger_names); |
| 152 | 159 | } |
| 153 | 160 | |
| 154 | 161 | void osd_common_t::update_option(const char * key, dynamic_array<const char *> &values) |
| r243106 | r243107 | |
| 180 | 187 | for(int i= 0; i < m_video_names.count(); ++i) |
| 181 | 188 | osd_free(const_cast<char*>(m_video_names[i])); |
| 182 | 189 | //m_video_options,reset(); |
| 183 | | |
| 184 | | for(int i= 0; i < m_debugger_names.count(); ++i) |
| 185 | | osd_free(const_cast<char*>(m_debugger_names[i])); |
| 186 | | m_debugger_options.reset(); |
| 187 | 190 | } |
| 188 | 191 | |
| 189 | 192 | |
| r243106 | r243107 | |
| 264 | 267 | // is active. This gives any OSD debugger interface a chance to |
| 265 | 268 | // create all of its structures. |
| 266 | 269 | // |
| 267 | | osd_debugger_type debugger = m_debugger_options.find(options().debugger()); |
| 268 | | if (debugger==NULL) |
| 269 | | { |
| 270 | | osd_printf_warning("debugger_init: option %s not found switching to auto\n",options().debugger()); |
| 271 | | debugger = m_debugger_options.find("auto"); |
| 272 | | } |
| 273 | | m_debugger = (*debugger)(); |
| 274 | | |
| 275 | 270 | m_debugger->init_debugger(machine()); |
| 276 | 271 | } |
| 277 | 272 | |
| r243106 | r243107 | |
| 297 | 292 | if (m_debugger) m_debugger->debugger_update(); |
| 298 | 293 | } |
| 299 | 294 | |
| 300 | | void osd_common_t::debugger_exit() |
| 301 | | { |
| 302 | | if (m_debugger) |
| 303 | | { |
| 304 | | m_debugger->debugger_exit(); |
| 305 | | global_free(m_debugger); |
| 306 | | m_debugger = NULL; |
| 307 | | } |
| 308 | | } |
| 309 | 295 | |
| 310 | 296 | //------------------------------------------------- |
| 311 | 297 | // update_audio_stream - update the stereo audio |
| r243106 | r243107 | |
| 457 | 443 | m_sound->m_sample_rate = options().sample_rate(); |
| 458 | 444 | m_sound->m_audio_latency = options().audio_latency(); |
| 459 | 445 | |
| 446 | m_debugger = select_module_options<debug_module *>(options(), OSD_DEBUG_PROVIDER); |
| 447 | |
| 460 | 448 | m_mod_man.init(); |
| 461 | 449 | |
| 462 | 450 | } |
| r243106 | r243107 | |
| 480 | 468 | { |
| 481 | 469 | } |
| 482 | 470 | |
| 483 | | void osd_common_t::debugger_register() |
| 484 | | { |
| 485 | | } |
| 486 | | |
| 487 | 471 | bool osd_common_t::input_init() |
| 488 | 472 | { |
| 489 | 473 | return true; |
| r243106 | r243107 | |
| 516 | 500 | network_exit(); |
| 517 | 501 | #endif |
| 518 | 502 | midi_exit(); |
| 519 | | debugger_exit(); |
| 520 | 503 | } |
| 521 | 504 | |
| 522 | 505 | void osd_common_t::video_exit() |
| r243106 | r243107 | |
| 552 | 535 | m_video_names.append(core_strdup(name)); |
| 553 | 536 | } |
| 554 | 537 | |
| 555 | | void osd_common_t::debugger_options_add(const char *name, osd_debugger_type type) |
| 556 | | { |
| 557 | | m_debugger_options.add(name, type, false); |
| 558 | | m_debugger_names.append(core_strdup(name)); |
| 559 | | } |
| 560 | | |
| 561 | 538 | bool osd_common_t::midi_init() |
| 562 | 539 | { |
| 563 | 540 | // this should be done on the OS_level |
trunk/src/osd/modules/lib/osdobj_common.h
| r243106 | r243107 | |
| 105 | 105 | static const options_entry s_option_entries[]; |
| 106 | 106 | }; |
| 107 | 107 | |
| 108 | | // a osd_sound_type is simply a pointer to its alloc function |
| 109 | | typedef debug_module *(*osd_debugger_type)(); |
| 110 | | |
| 111 | | |
| 112 | 108 | // ======================> osd_interface |
| 113 | 109 | |
| 114 | 110 | // description of the currently-running machine |
| r243106 | r243107 | |
| 159 | 155 | |
| 160 | 156 | |
| 161 | 157 | virtual void debugger_update(); |
| 162 | | virtual void debugger_exit(); |
| 163 | | virtual void debugger_register(); |
| 164 | 158 | |
| 165 | 159 | virtual void init_subsystems(); |
| 166 | 160 | |
| r243106 | r243107 | |
| 184 | 178 | virtual void osd_exit(); |
| 185 | 179 | |
| 186 | 180 | virtual void video_options_add(const char *name, void *type); |
| 187 | | virtual void debugger_options_add(const char *name, osd_debugger_type type); |
| 188 | 181 | |
| 189 | 182 | osd_options &options() { return m_options; } |
| 190 | 183 | |
| r243106 | r243107 | |
| 227 | 220 | private: |
| 228 | 221 | //tagmap_t<osd_video_type> m_video_options; |
| 229 | 222 | dynamic_array<const char *> m_video_names; |
| 230 | | tagmap_t<osd_debugger_type> m_debugger_options; |
| 231 | | dynamic_array<const char *> m_debugger_names; |
| 232 | 223 | }; |
| 233 | 224 | |
| 234 | 225 | |
trunk/src/osd/sdl/sdl.mak
| r243106 | r243107 | |
| 210 | 210 | BASE_TARGETOS = unix |
| 211 | 211 | SYNC_IMPLEMENTATION = tc |
| 212 | 212 | SDL_NETWORK = taptun |
| 213 | #SDL_NETWORK = pcap |
| 213 | 214 | |
| 214 | 215 | ifndef NO_USE_MIDI |
| 215 | 216 | INCPATH += `pkg-config --cflags alsa` |
| r243106 | r243107 | |
| 706 | 707 | $(MOC) $(MOCINCPATH) $(DEFS) $< -o $@ |
| 707 | 708 | |
| 708 | 709 | DEBUGOBJS = \ |
| 709 | | $(OSDOBJ)/modules/debugger/debugqt.o \ |
| 710 | 710 | $(OSDOBJ)/modules/debugger/qt/debugqtview.o \ |
| 711 | 711 | $(OSDOBJ)/modules/debugger/qt/debugqtwindow.o \ |
| 712 | 712 | $(OSDOBJ)/modules/debugger/qt/debugqtlogwindow.o \ |
| r243106 | r243107 | |
| 725 | 725 | $(OSDOBJ)/modules/debugger/qt/debugqtbreakpointswindow.moc.o \ |
| 726 | 726 | $(OSDOBJ)/modules/debugger/qt/debugqtdeviceswindow.moc.o \ |
| 727 | 727 | $(OSDOBJ)/modules/debugger/qt/debugqtdeviceinformationwindow.moc.o |
| 728 | |
| 729 | DEFS += -DUSE_QTDEBUG=1 |
| 730 | |
| 731 | else |
| 732 | DEFS += -DUSE_QTDEBUG=0 |
| 728 | 733 | endif |
| 729 | 734 | |
| 735 | DEBUGOBJS += \ |
| 736 | $(OSDOBJ)/modules/debugger/none.o \ |
| 737 | $(OSDOBJ)/modules/debugger/debugint.o \ |
| 738 | $(OSDOBJ)/modules/debugger/debugwin.o \ |
| 739 | $(OSDOBJ)/modules/debugger/debugqt.o \ |
| 740 | |
| 730 | 741 | ifeq ($(NO_DEBUGGER),1) |
| 731 | 742 | DEFS += -DNO_DEBUGGER |
| 732 | 743 | else |
trunk/src/osd/sdl/sdlmain.c
| r243106 | r243107 | |
| 57 | 57 | #include "osdsdl.h" |
| 58 | 58 | #include "modules/lib/osdlib.h" |
| 59 | 59 | |
| 60 | | #if !defined(NO_DEBUGGER) |
| 61 | | #include "modules/debugger/debugqt.h" |
| 62 | | #endif |
| 63 | | #include "modules/debugger/none.h" |
| 64 | | #if defined(SDLMAME_MACOSX) |
| 65 | | #include "modules/debugger/debugosx.h" |
| 66 | | #endif |
| 67 | 60 | // we override SDL's normal startup on Win32 |
| 68 | 61 | // please see sdlprefix.h as well |
| 69 | 62 | |
| r243106 | r243107 | |
| 531 | 524 | } |
| 532 | 525 | |
| 533 | 526 | //============================================================ |
| 534 | | // debugger_register |
| 535 | | //============================================================ |
| 536 | | |
| 537 | | void sdl_osd_interface::debugger_register() |
| 538 | | { |
| 539 | | #if defined(NO_DEBUGGER) |
| 540 | | debugger_options_add("auto", OSD_DEBUGGER_NONE); |
| 541 | | #else |
| 542 | | #if defined(SDLMAME_MACOSX) |
| 543 | | debugger_options_add("osx", OSD_DEBUGGER_OSX); |
| 544 | | debugger_options_add("auto", OSD_DEBUGGER_OSX); // making OSX debugger default one |
| 545 | | #else |
| 546 | | debugger_options_add("qt", OSD_DEBUGGER_QT); |
| 547 | | debugger_options_add("auto", OSD_DEBUGGER_QT); // making QT debugger default one |
| 548 | | #endif // SDLMAME_MACOSX |
| 549 | | #endif // NO_DEBUGGER |
| 550 | | } |
| 551 | | |
| 552 | | //============================================================ |
| 553 | 527 | // init |
| 554 | 528 | //============================================================ |
| 555 | 529 | |
trunk/src/osd/windows/windows.mak
| r243106 | r243107 | |
| 408 | 408 | |
| 409 | 409 | # add debug-specific files |
| 410 | 410 | OSDOBJS += \ |
| 411 | | $(OSDOBJ)/modules/debugger/debugwin.o |
| 411 | $(OSDOBJ)/modules/debugger/debugwin.o \ |
| 412 | $(OSDOBJ)/modules/debugger/debugint.o \ |
| 413 | $(OSDOBJ)/modules/debugger/debugqt.o \ |
| 414 | $(OSDOBJ)/modules/debugger/none.o \ |
| 412 | 415 | |
| 413 | 416 | # add a stub resource file |
| 414 | 417 | RESFILE = $(WINOBJ)/mame.res |
| r243106 | r243107 | |
| 421 | 424 | QT_LIBS := -L$(shell qmake -query QT_INSTALL_LIBS) |
| 422 | 425 | LIBS += $(QT_LIBS) -lqtmain -lQtGui4 -lQtCore4 |
| 423 | 426 | INCPATH += -I$(QT_INSTALL_HEADERS)/QtCore -I$(QT_INSTALL_HEADERS)/QtGui -I$(QT_INSTALL_HEADERS) |
| 424 | | CFLAGS += -DUSE_QTDEBUG |
| 425 | 427 | |
| 426 | 428 | MOC = @moc |
| 427 | 429 | $(OSDOBJ)/%.moc.c: $(OSDSRC)/%.h |
| 428 | 430 | $(MOC) $(INCPATH) $(DEFS) $< -o $@ |
| 429 | 431 | |
| 430 | 432 | OSDOBJS += \ |
| 431 | | $(OSDOBJ)/modules/debugger/debugqt.o \ |
| 432 | 433 | $(OSDOBJ)/modules/debugger/qt/debugqtview.o \ |
| 433 | 434 | $(OSDOBJ)/modules/debugger/qt/debugqtwindow.o \ |
| 434 | 435 | $(OSDOBJ)/modules/debugger/qt/debugqtlogwindow.o \ |
trunk/src/osd/windows/winmain.c
| r243106 | r243107 | |
| 39 | 39 | #include "debugger.h" |
| 40 | 40 | #include "winfile.h" |
| 41 | 41 | |
| 42 | | #include "modules/debugger/debugwin.h" |
| 43 | | |
| 44 | | #if (USE_QTDEBUG) |
| 45 | | #include "modules/debugger/debugqt.h" |
| 46 | | #endif |
| 47 | 42 | #define DEBUG_SLOW_LOCKS 0 |
| 48 | 43 | |
| 49 | | |
| 50 | 44 | //************************************************************************** |
| 51 | 45 | // MACROS |
| 52 | 46 | //************************************************************************** |
| r243106 | r243107 | |
| 536 | 530 | } |
| 537 | 531 | |
| 538 | 532 | //============================================================ |
| 539 | | // debugger_register |
| 540 | | //============================================================ |
| 541 | | |
| 542 | | void windows_osd_interface::debugger_register() |
| 543 | | { |
| 544 | | debugger_options_add("windows", OSD_DEBUGGER_WINDOWS); |
| 545 | | #if (USE_QTDEBUG) |
| 546 | | debugger_options_add("qt", OSD_DEBUGGER_QT); |
| 547 | | #endif |
| 548 | | debugger_options_add("auto", OSD_DEBUGGER_WINDOWS); // making windows debugger default one |
| 549 | | } |
| 550 | | |
| 551 | | //============================================================ |
| 552 | 533 | // init |
| 553 | 534 | //============================================================ |
| 554 | 535 | |