From 4ea9df02a1daf1893246a01e21ffe201781f9266 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 11 Mar 2014 15:54:58 +0000 Subject: Moved core template container classes up from emutempl.h to coretmpl.h: [Aaron Giles] * these classes now no longer take a resource_pool; everything is managed globally -- this means that objects added to lists must be allocated with global_alloc * added new auto_pointer<> template which wraps a pointer and auto-frees it upon destruction; it also defaults to NULL so it doesn't need to be explicitly initialized * moved tagged_list template to tagmap.h Redo of the low-level memory tracking system: [Aaron Giles] * moved low-level tracking out of emu\emualloc into lib\util\corealloc so it can be shared among all components and used by core libraries * global_alloc and friends no longer use a resource pool to track allocations; turns out this was a wholly redundant system that wasted a lot of memory * removed global_resource_pool entirely * added global_free_array to delete arrays allocated with global_alloc_array * added tracking of object versus array allocation; we will now error if you use global_free on an array, or global_free_array on an object Added new utility helper const_string_pool which can be used to efficiently accumulate strings that are not intended to be modified. Used by updated makelist and software list code. [Aaron Giles] Updated png2bdc and makelist tools to not leak memory and use more modern techniques (no more MAX_DRIVERS in makelist, for example). [Aaron Giles] Deprecated auto_strdup and removed all uses by way of caller-managed astrings and the software list rewrite. [Aaron Giles] Rewrote software list management: [Aaron Giles] * removed the notion of a software_list that is separate from a software_list_device; they are one and the same now * moved several functions into device_image_interface since they really didn't belong in the core software list class * lots of simplification as a result of the above changes Additional notes (no whatsnew): Moved definition of FPTR to osdcomm.h. Some changes happened in the OSD code to fix issues, especially regarding freeing arrays. SDL folks may need to fix up some of these. The following devices still are using tokens and should be modernized (I found them because they kept their token as void * and tried to delete it, which you can't): namco_52xx_device (mame/audio/namco52.c) namco_54xx_device (mame/audio/namco54.c) namco_06xx_device (mame/machine/namco06.c) namco_50xx_device (mame/machine/namco50.c) namco_51xx_device (mame/machine/namco51.c) namco_53xx_device (mame/machine/namco53.c) voodoo_device (emu/video/voodoo.c) mos6581_device (emu/sound/mos6581.c) aica_device (emu/sound/aica.c) scsp_device (emu/sound/scsp.c) dmadac_sound_device (emu/sound/dmadac.c) s3c2440_device (emu/machine/s3c2440.c) wd1770_device (emu/machine/wd17xx.c) latch8_device (emu/machine/latch8.c) duart68681_device (emu/machine/68681.c) s3c2400_device (emu/machine/s3c2400.c) s3c2410_device (emu/machine/s3c2410.c) strataflash_device (mess/machine/strata.c) hd63450_device (mess/machine/hd63450.c) tap_990_device (mess/machine/ti99/990_tap.c) omti8621_device (mess/machine/omti8621.c) vdt911_device (mess/video/911_vdt.c) apollo_graphics_15i (mess/video/apollo.c) asr733_device (mess/video/733_asr.c) --- src/emu/debug/debugvw.h | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) (limited to 'src/emu/debug/debugvw.h') diff --git a/src/emu/debug/debugvw.h b/src/emu/debug/debugvw.h index 50f84dd6b57..70db5910448 100644 --- a/src/emu/debug/debugvw.h +++ b/src/emu/debug/debugvw.h @@ -113,7 +113,7 @@ class debug_view_source { DISABLE_COPYING(debug_view_source); - friend class debug_view_source_list; + friend class simple_list; public: // construction/destruction @@ -135,38 +135,6 @@ private: }; -// a debug_view_source_list contains a list of debug_view_sources -class debug_view_source_list -{ - DISABLE_COPYING(debug_view_source_list); - -public: - // construction/destruction - debug_view_source_list(running_machine &machine); - ~debug_view_source_list(); - - // getters - running_machine &machine() const { return m_machine; } - const debug_view_source *head() const { return m_head; } - int count() const { return m_count; } - int index(const debug_view_source &source) const; - const debug_view_source *by_index(int index) const; - - // operations - void reset(); - void append(debug_view_source &view_source); - const debug_view_source *match_device(device_t *device) const; - int match_device_index(device_t *device) const { return index(*match_device(device)); } - -private: - // internal state - running_machine & m_machine; // reference to our machine - debug_view_source * m_head; // head of the list - debug_view_source * m_tail; // end of the tail - UINT32 m_count; // number of items in the list -}; - - // debug_view describes a single text-based view class debug_view { @@ -190,7 +158,8 @@ public: bool cursor_supported() { flush_updates(); return m_supports_cursor; } bool cursor_visible() { flush_updates(); return m_cursor_visible; } const debug_view_source *source() const { return m_source; } - const debug_view_source_list &source_list() const { return m_source_list; } + const debug_view_source *first_source() { return m_source_list.first(); } + const simple_list &source_list() const { return m_source_list; } // setters void set_size(int width, int height); @@ -199,8 +168,11 @@ public: void set_cursor_position(debug_view_xy pos); void set_cursor_visible(bool visible = true); void set_source(const debug_view_source &source); + + // helpers void process_char(int character) { view_char(character); } void process_click(int button, debug_view_xy pos) { view_click(button, pos); } + const debug_view_source *source_for_device(device_t *device) const; protected: // internal updating helpers @@ -225,7 +197,7 @@ protected: debug_view * m_next; // link to the next view debug_view_type m_type; // type of view const debug_view_source *m_source; // currently selected data source - debug_view_source_list m_source_list; // list of available data sources + simple_list m_source_list; // list of available data sources // OSD data debug_view_osd_update_func m_osdupdate; // callback for the update -- cgit v1.2.3-70-g09d2