From a440a8e0200a36491ae540f6f00beae59c148549 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 11 Feb 2013 07:44:56 +0000 Subject: Cleanups and version bump --- src/emu/debug/debugvw.c | 58 +++++++++++----------- src/emu/debug/debugvw.h | 122 +++++++++++++++++++++++------------------------ src/emu/debug/dvdisasm.c | 38 +++++++-------- src/emu/debug/dvdisasm.h | 32 ++++++------- src/emu/debug/dvmemory.c | 82 +++++++++++++++---------------- src/emu/debug/dvmemory.h | 46 +++++++++--------- 6 files changed, 189 insertions(+), 189 deletions(-) (limited to 'src/emu/debug') diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c index 7cf655d908f..307d9575fe8 100644 --- a/src/emu/debug/debugvw.c +++ b/src/emu/debug/debugvw.c @@ -61,9 +61,9 @@ debug_view_source::debug_view_source(const char *name, device_t *device) : m_next(NULL), - m_name(name), - m_device(device), - m_is_octal(false) + m_name(name), + m_device(device), + m_is_octal(false) { device_execute_interface *intf; if (device && device->interface(intf)) @@ -92,9 +92,9 @@ debug_view_source::~debug_view_source() debug_view_source_list::debug_view_source_list(running_machine &machine) : m_machine(machine), - m_head(NULL), - m_tail(NULL), - m_count(0) + m_head(NULL), + m_tail(NULL), + m_count(0) { } @@ -206,24 +206,24 @@ const debug_view_source *debug_view_source_list::match_device(device_t *device) debug_view::debug_view(running_machine &machine, debug_view_type type, debug_view_osd_update_func osdupdate, void *osdprivate) : m_next(NULL), - m_type(type), - m_source(NULL), - m_source_list(machine), - m_osdupdate(osdupdate), - m_osdprivate(osdprivate), - m_visible(10,10), - m_total(10,10), - m_topleft(0,0), - m_cursor(0,0), - m_supports_cursor(false), - m_cursor_visible(false), - m_recompute(true), - m_update_level(0), - m_update_pending(true), - m_osd_update_pending(true), - m_viewdata(NULL), - m_viewdata_size(0), - m_machine(machine) + m_type(type), + m_source(NULL), + m_source_list(machine), + m_osdupdate(osdupdate), + m_osdprivate(osdprivate), + m_visible(10,10), + m_total(10,10), + m_topleft(0,0), + m_cursor(0,0), + m_supports_cursor(false), + m_cursor_visible(false), + m_recompute(true), + m_update_level(0), + m_update_pending(true), + m_osd_update_pending(true), + m_viewdata(NULL), + m_viewdata_size(0), + m_machine(machine) { // allocate memory for the buffer m_viewdata_size = m_visible.y * m_visible.x; @@ -451,7 +451,7 @@ void debug_view::view_click(const int button, const debug_view_xy& pos) debug_view_manager::debug_view_manager(running_machine &machine) : m_machine(machine), - m_viewlist(NULL) + m_viewlist(NULL) { } @@ -573,10 +573,10 @@ debug_view *debug_view_manager::append(debug_view *view) debug_view_expression::debug_view_expression(running_machine &machine) : m_machine(machine), - m_dirty(true), - m_result(0), - m_parsed(debug_cpu_get_global_symtable(machine)), - m_string("0") + m_dirty(true), + m_result(0), + m_parsed(debug_cpu_get_global_symtable(machine)), + m_string("0") { } diff --git a/src/emu/debug/debugvw.h b/src/emu/debug/debugvw.h index aba8094aebe..e5f4df80966 100644 --- a/src/emu/debug/debugvw.h +++ b/src/emu/debug/debugvw.h @@ -72,35 +72,35 @@ enum debug_view_notification // attribute bits for debug_view_char.attrib -const UINT8 DCA_NORMAL = 0x00; // in Windows: black on white -const UINT8 DCA_CHANGED = 0x01; // in Windows: red foreground -const UINT8 DCA_SELECTED = 0x02; // in Windows: light red background -const UINT8 DCA_INVALID = 0x04; // in Windows: dark blue foreground -const UINT8 DCA_DISABLED = 0x08; // in Windows: darker foreground -const UINT8 DCA_ANCILLARY = 0x10; // in Windows: grey background -const UINT8 DCA_CURRENT = 0x20; // in Windows: yellow background -const UINT8 DCA_COMMENT = 0x40; // in Windows: green foreground +const UINT8 DCA_NORMAL = 0x00; // in Windows: black on white +const UINT8 DCA_CHANGED = 0x01; // in Windows: red foreground +const UINT8 DCA_SELECTED = 0x02; // in Windows: light red background +const UINT8 DCA_INVALID = 0x04; // in Windows: dark blue foreground +const UINT8 DCA_DISABLED = 0x08; // in Windows: darker foreground +const UINT8 DCA_ANCILLARY = 0x10; // in Windows: grey background +const UINT8 DCA_CURRENT = 0x20; // in Windows: yellow background +const UINT8 DCA_COMMENT = 0x40; // in Windows: green foreground // special characters that can be passed to process_char() -const int DCH_UP = 1; // up arrow -const int DCH_DOWN = 2; // down arrow -const int DCH_LEFT = 3; // left arrow -const int DCH_RIGHT = 4; // right arrow -const int DCH_PUP = 5; // page up -const int DCH_PDOWN = 6; // page down -const int DCH_HOME = 7; // home -const int DCH_CTRLHOME = 8; // ctrl+home -const int DCH_END = 9; // end -const int DCH_CTRLEND = 10; // ctrl+end -const int DCH_CTRLRIGHT = 11; // ctrl+right -const int DCH_CTRLLEFT = 12; // ctrl+left +const int DCH_UP = 1; // up arrow +const int DCH_DOWN = 2; // down arrow +const int DCH_LEFT = 3; // left arrow +const int DCH_RIGHT = 4; // right arrow +const int DCH_PUP = 5; // page up +const int DCH_PDOWN = 6; // page down +const int DCH_HOME = 7; // home +const int DCH_CTRLHOME = 8; // ctrl+home +const int DCH_END = 9; // end +const int DCH_CTRLEND = 10; // ctrl+end +const int DCH_CTRLRIGHT = 11; // ctrl+right +const int DCH_CTRLLEFT = 12; // ctrl+left // special characters that can be passed to process_click() -const int DCK_LEFT_CLICK = 1; // left instantaneous click -const int DCK_RIGHT_CLICK = 2; // right instantaneous click -const int DCK_MIDDLE_CLICK = 3; // middle instantaneous click +const int DCK_LEFT_CLICK = 1; // left instantaneous click +const int DCK_RIGHT_CLICK = 2; // right instantaneous click +const int DCK_MIDDLE_CLICK = 3; // middle instantaneous click //************************************************************************** @@ -118,8 +118,8 @@ typedef void (*debug_view_osd_update_func)(debug_view &view, void *osdprivate); // a single "character" in the debug view has an ASCII value and an attribute byte struct debug_view_char { - UINT8 byte; - UINT8 attrib; + UINT8 byte; + UINT8 attrib; }; @@ -129,8 +129,8 @@ class debug_view_xy public: debug_view_xy(int _x = 0, int _y = 0) : x(_x), y(_y) { } - INT32 x; - INT32 y; + INT32 x; + INT32 y; }; @@ -154,10 +154,10 @@ public: private: // internal state - debug_view_source * m_next; // link to next item - astring m_name; // name of the source item - device_t * m_device; // associated device (if applicable) - bool m_is_octal; // is view in octal or hex + debug_view_source * m_next; // link to next item + astring m_name; // name of the source item + device_t * m_device; // associated device (if applicable) + bool m_is_octal; // is view in octal or hex }; @@ -186,10 +186,10 @@ public: 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 + 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 }; @@ -248,33 +248,33 @@ protected: protected: // core view data - 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 + 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 // OSD data - debug_view_osd_update_func m_osdupdate; // callback for the update - void * m_osdprivate; // OSD-managed private data + debug_view_osd_update_func m_osdupdate; // callback for the update + void * m_osdprivate; // OSD-managed private data // visibility info - debug_view_xy m_visible; // visible size (in rows and columns) - debug_view_xy m_total; // total size (in rows and columns) - debug_view_xy m_topleft; // top-left visible position (in rows and columns) - debug_view_xy m_cursor; // cursor position - bool m_supports_cursor; // does this view support a cursor? - bool m_cursor_visible; // is the cursor visible? + debug_view_xy m_visible; // visible size (in rows and columns) + debug_view_xy m_total; // total size (in rows and columns) + debug_view_xy m_topleft; // top-left visible position (in rows and columns) + debug_view_xy m_cursor; // cursor position + bool m_supports_cursor; // does this view support a cursor? + bool m_cursor_visible; // is the cursor visible? // update info - bool m_recompute; // does this view require a recomputation? - UINT8 m_update_level; // update level; updates when this hits 0 - bool m_update_pending; // true if there is a pending update - bool m_osd_update_pending; // true if there is a pending update - debug_view_char * m_viewdata; // current array of view data - int m_viewdata_size; // number of elements of the viewdata array + bool m_recompute; // does this view require a recomputation? + UINT8 m_update_level; // update level; updates when this hits 0 + bool m_update_pending; // true if there is a pending update + bool m_osd_update_pending; // true if there is a pending update + debug_view_char * m_viewdata; // current array of view data + int m_viewdata_size; // number of elements of the viewdata array private: - running_machine & m_machine; // machine associated with this view + running_machine & m_machine; // machine associated with this view }; @@ -302,8 +302,8 @@ private: debug_view *append(debug_view *view); // internal state - running_machine & m_machine; // reference to our machine - debug_view * m_viewlist; // list of views + running_machine & m_machine; // reference to our machine + debug_view * m_viewlist; // list of views }; @@ -333,11 +333,11 @@ private: bool recompute(); // internal state - running_machine & m_machine; // reference to the machine - bool m_dirty; // true if the expression needs to be re-evaluated - UINT64 m_result; // last result from the expression - parsed_expression m_parsed; // parsed expression data - astring m_string; // copy of the expression string + running_machine & m_machine; // reference to the machine + bool m_dirty; // true if the expression needs to be re-evaluated + UINT64 m_result; // last result from the expression + parsed_expression m_parsed; // parsed expression data + astring m_string; // copy of the expression string }; diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c index 53ecf9c5dd0..ba3955030f3 100644 --- a/src/emu/debug/dvdisasm.c +++ b/src/emu/debug/dvdisasm.c @@ -54,9 +54,9 @@ debug_view_disasm_source::debug_view_disasm_source(const char *name, device_t &device) : debug_view_source(name, &device), - m_device(device), - m_disasmintf(dynamic_cast(&device)), - m_space(device.memory().space(AS_PROGRAM)) + m_device(device), + m_disasmintf(dynamic_cast(&device)), + m_space(device.memory().space(AS_PROGRAM)) { } @@ -72,20 +72,20 @@ debug_view_disasm_source::debug_view_disasm_source(const char *name, device_t &d debug_view_disasm::debug_view_disasm(running_machine &machine, debug_view_osd_update_func osdupdate, void *osdprivate) : debug_view(machine, DVT_DISASSEMBLY, osdupdate, osdprivate), - m_right_column(DASM_RIGHTCOL_RAW), - m_backwards_steps(3), - m_dasm_width(DEFAULT_DASM_WIDTH), - m_last_direct_raw(NULL), - m_last_direct_decrypted(NULL), - m_last_change_count(0), - m_last_pcbyte(0), - m_divider1(0), - m_divider2(0), - m_divider3(0), - m_expression(machine), - m_allocated(0,0), - m_byteaddress(NULL), - m_dasm(NULL) + m_right_column(DASM_RIGHTCOL_RAW), + m_backwards_steps(3), + m_dasm_width(DEFAULT_DASM_WIDTH), + m_last_direct_raw(NULL), + m_last_direct_decrypted(NULL), + m_last_change_count(0), + m_last_pcbyte(0), + m_divider1(0), + m_divider2(0), + m_divider3(0), + m_expression(machine), + m_allocated(0,0), + m_byteaddress(NULL), + m_dasm(NULL) { // fail if no available sources enumerate_sources(); @@ -199,7 +199,7 @@ void debug_view_disasm::view_char(int chval) m_cursor.y = temp; break; - case DCH_HOME: // set the active column to the PC + case DCH_HOME: // set the active column to the PC { const debug_view_disasm_source &source = downcast(*m_source); offs_t pc = source.m_space.address_to_byte(source.m_device.safe_pc()) & source.m_space.logbytemask(); @@ -393,7 +393,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines) m_total.x = m_divider2 + 1 + char_num * maxbytes_clamped + (maxbytes_clamped / minbytes - 1) + 1; } else if (m_right_column == DASM_RIGHTCOL_COMMENTS) - m_total.x = m_divider2 + 1 + 50; // DEBUG_COMMENT_MAX_LINE_LENGTH + m_total.x = m_divider2 + 1 + 50; // DEBUG_COMMENT_MAX_LINE_LENGTH else m_total.x = m_divider2 + 1; diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h index 64d25295d2d..1bfdbaf5ad7 100644 --- a/src/emu/debug/dvdisasm.h +++ b/src/emu/debug/dvdisasm.h @@ -77,9 +77,9 @@ public: private: // internal state - device_t & m_device; // underlying device - device_disasm_interface *m_disasmintf; // disassembly interface - address_space & m_space; // address space to display + device_t & m_device; // underlying device + device_disasm_interface *m_disasmintf; // disassembly interface + address_space & m_space; // address space to display }; @@ -123,19 +123,19 @@ private: bool recompute(offs_t pc, int startline, int lines); // internal state - disasm_right_column m_right_column; // right column contents - UINT32 m_backwards_steps; // number of backwards steps - UINT32 m_dasm_width; // width of the disassembly area - UINT8 * m_last_direct_raw; // last direct raw value - UINT8 * m_last_direct_decrypted;// last direct decrypted value - UINT32 m_last_change_count; // last comment change count - offs_t m_last_pcbyte; // last PC byte value - int m_divider1, m_divider2; // left and right divider columns - int m_divider3; // comment divider column - debug_view_expression m_expression; // expression-related information - debug_view_xy m_allocated; // allocated rows/columns - offs_t * m_byteaddress; // addresses of the instructions - char * m_dasm; // disassembled instructions + disasm_right_column m_right_column; // right column contents + UINT32 m_backwards_steps; // number of backwards steps + UINT32 m_dasm_width; // width of the disassembly area + UINT8 * m_last_direct_raw; // last direct raw value + UINT8 * m_last_direct_decrypted;// last direct decrypted value + UINT32 m_last_change_count; // last comment change count + offs_t m_last_pcbyte; // last PC byte value + int m_divider1, m_divider2; // left and right divider columns + int m_divider3; // comment divider column + debug_view_expression m_expression; // expression-related information + debug_view_xy m_allocated; // allocated rows/columns + offs_t * m_byteaddress; // addresses of the instructions + char * m_dasm; // disassembled instructions // constants static const int DEFAULT_DASM_LINES = 1000; diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c index c0a6b045bd4..7782bb6c073 100644 --- a/src/emu/debug/dvmemory.c +++ b/src/emu/debug/dvmemory.c @@ -74,37 +74,37 @@ const debug_view_memory::memory_view_pos debug_view_memory::s_memory_pos_table[9 debug_view_memory_source::debug_view_memory_source(const char *name, address_space &space) : debug_view_source(name, &space.device()), - m_space(&space), - m_memintf(dynamic_cast(&space.device())), - m_base(NULL), - m_length(0), - m_offsetxor(0), - m_endianness(space.endianness()), - m_prefsize(space.data_width() / 8) + m_space(&space), + m_memintf(dynamic_cast(&space.device())), + m_base(NULL), + m_length(0), + m_offsetxor(0), + m_endianness(space.endianness()), + m_prefsize(space.data_width() / 8) { } debug_view_memory_source::debug_view_memory_source(const char *name, memory_region ®ion) : debug_view_source(name), - m_space(NULL), - m_memintf(NULL), - m_base(region), - m_length(region.bytes()), - m_offsetxor(NATIVE_ENDIAN_VALUE_LE_BE(region.width() - 1, 0)), - m_endianness(region.endianness()), - m_prefsize(MIN(region.width(), 8)) + m_space(NULL), + m_memintf(NULL), + m_base(region), + m_length(region.bytes()), + m_offsetxor(NATIVE_ENDIAN_VALUE_LE_BE(region.width() - 1, 0)), + m_endianness(region.endianness()), + m_prefsize(MIN(region.width(), 8)) { } debug_view_memory_source::debug_view_memory_source(const char *name, void *base, int element_size, int num_elements) : debug_view_source(name), - m_space(NULL), - m_memintf(NULL), - m_base(base), - m_length(element_size * num_elements), - m_offsetxor(0), - m_endianness(ENDIANNESS_NATIVE), - m_prefsize(MIN(element_size, 8)) + m_space(NULL), + m_memintf(NULL), + m_base(base), + m_length(element_size * num_elements), + m_offsetxor(0), + m_endianness(ENDIANNESS_NATIVE), + m_prefsize(MIN(element_size, 8)) { } @@ -120,15 +120,15 @@ debug_view_memory_source::debug_view_memory_source(const char *name, void *base, debug_view_memory::debug_view_memory(running_machine &machine, debug_view_osd_update_func osdupdate, void *osdprivate) : debug_view(machine, DVT_MEMORY, osdupdate, osdprivate), - m_expression(machine), - m_chunks_per_row(16), - m_bytes_per_chunk(1), - m_reverse_view(false), - m_ascii_view(true), - m_no_translation(false), - m_maxaddr(0), - m_bytes_per_row(16), - m_byte_offset(0) + m_expression(machine), + m_chunks_per_row(16), + m_bytes_per_chunk(1), + m_reverse_view(false), + m_ascii_view(true), + m_no_translation(false), + m_maxaddr(0), + m_bytes_per_row(16), + m_byte_offset(0) { // fail if no available sources enumerate_sources(); @@ -181,10 +181,10 @@ void debug_view_memory::enumerate_sources() break; // add pretty much anything that's not a timer (we may wish to cull other items later) - // also, don't trim the front of the name, it's important to know which VIA6522 we're looking at, e.g. - if (strncmp(itemname, "timer/", 6)) + // also, don't trim the front of the name, it's important to know which VIA6522 we're looking at, e.g. + if (strncmp(itemname, "timer/", 6)) { - name.cpy(itemname); + name.cpy(itemname); m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, base, valsize, valcount))); } } @@ -653,10 +653,10 @@ bool debug_view_memory::read(UINT8 size, offs_t offs, UINT64 &data) { switch (size) { - case 1: data = debug_read_byte(*source.m_space, offs, !m_no_translation); break; - case 2: data = debug_read_word(*source.m_space, offs, !m_no_translation); break; - case 4: data = debug_read_dword(*source.m_space, offs, !m_no_translation); break; - case 8: data = debug_read_qword(*source.m_space, offs, !m_no_translation); break; + case 1: data = debug_read_byte(*source.m_space, offs, !m_no_translation); break; + case 2: data = debug_read_word(*source.m_space, offs, !m_no_translation); break; + case 4: data = debug_read_dword(*source.m_space, offs, !m_no_translation); break; + case 8: data = debug_read_qword(*source.m_space, offs, !m_no_translation); break; } } return ismapped; @@ -700,10 +700,10 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data) { switch (size) { - case 1: debug_write_byte(*source.m_space, offs, data, !m_no_translation); break; - case 2: debug_write_word(*source.m_space, offs, data, !m_no_translation); break; - case 4: debug_write_dword(*source.m_space, offs, data, !m_no_translation); break; - case 8: debug_write_qword(*source.m_space, offs, data, !m_no_translation); break; + case 1: debug_write_byte(*source.m_space, offs, data, !m_no_translation); break; + case 2: debug_write_word(*source.m_space, offs, data, !m_no_translation); break; + case 4: debug_write_dword(*source.m_space, offs, data, !m_no_translation); break; + case 8: debug_write_qword(*source.m_space, offs, data, !m_no_translation); break; } return; } diff --git a/src/emu/debug/dvmemory.h b/src/emu/debug/dvmemory.h index b370fdb51a9..06a9bcb9f16 100644 --- a/src/emu/debug/dvmemory.h +++ b/src/emu/debug/dvmemory.h @@ -60,13 +60,13 @@ public: address_space *space() const { return m_space; } private: - address_space *m_space; // address space we reference (if any) - device_memory_interface *m_memintf; // pointer to the memory interface of the device - void * m_base; // pointer to memory base - offs_t m_length; // length of memory - offs_t m_offsetxor; // XOR to apply to offsets - endianness_t m_endianness; // endianness of memory - UINT8 m_prefsize; // preferred bytes per chunk + address_space *m_space; // address space we reference (if any) + device_memory_interface *m_memintf; // pointer to the memory interface of the device + void * m_base; // pointer to memory base + offs_t m_length; // length of memory + offs_t m_offsetxor; // XOR to apply to offsets + endianness_t m_endianness; // endianness of memory + UINT8 m_prefsize; // preferred bytes per chunk }; @@ -127,31 +127,31 @@ private: void write(UINT8 size, offs_t offs, UINT64 data); // internal state - debug_view_expression m_expression; // expression describing the start address - UINT32 m_chunks_per_row; // number of chunks displayed per line - UINT8 m_bytes_per_chunk; // bytes per chunk - bool m_reverse_view; // reverse-endian view? - bool m_ascii_view; // display ASCII characters? - bool m_no_translation; // don't run addresses through the cpu translation hook - offs_t m_maxaddr; // (derived) maximum address to display - UINT32 m_bytes_per_row; // (derived) number of bytes displayed per line - UINT32 m_byte_offset; // (derived) offset of starting visible byte - astring m_addrformat; // (derived) format string to use to print addresses + debug_view_expression m_expression; // expression describing the start address + UINT32 m_chunks_per_row; // number of chunks displayed per line + UINT8 m_bytes_per_chunk; // bytes per chunk + bool m_reverse_view; // reverse-endian view? + bool m_ascii_view; // display ASCII characters? + bool m_no_translation; // don't run addresses through the cpu translation hook + offs_t m_maxaddr; // (derived) maximum address to display + UINT32 m_bytes_per_row; // (derived) number of bytes displayed per line + UINT32 m_byte_offset; // (derived) offset of starting visible byte + astring m_addrformat; // (derived) format string to use to print addresses struct section { bool contains(int x) const { return x >= m_pos && x < m_pos + m_width; } - INT32 m_pos; /* starting position */ - INT32 m_width; /* width of this section */ + INT32 m_pos; /* starting position */ + INT32 m_width; /* width of this section */ }; - section m_section[3]; // (derived) 3 sections to manage + section m_section[3]; // (derived) 3 sections to manage struct memory_view_pos { - UINT8 m_spacing; /* spacing between each entry */ - UINT8 m_shift[24]; /* shift for each character */ + UINT8 m_spacing; /* spacing between each entry */ + UINT8 m_shift[24]; /* shift for each character */ }; - static const memory_view_pos s_memory_pos_table[9]; // table for rendering at different chunk sizes + static const memory_view_pos s_memory_pos_table[9]; // table for rendering at different chunk sizes // constants static const int MEM_MAX_LINE_WIDTH = 1024; -- cgit v1.2.3-70-g09d2