summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/dvdisasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/debug/dvdisasm.h')
-rw-r--r--src/emu/debug/dvdisasm.h59
1 files changed, 26 insertions, 33 deletions
diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h
index 85ebd7cfef2..dcf756117b8 100644
--- a/src/emu/debug/dvdisasm.h
+++ b/src/emu/debug/dvdisasm.h
@@ -14,6 +14,7 @@
#pragma once
#include "debugvw.h"
+#include "debugbuf.h"
#include "vecstream.h"
@@ -51,7 +52,6 @@ public:
private:
// internal state
- device_disasm_interface *m_disasmintf; // disassembly interface
address_space & m_space; // address space to display
address_space & m_decrypted_space; // address space to display for decrypted opcodes
};
@@ -90,49 +90,42 @@ protected:
private:
// The information of one disassembly line. May become the actual
- // external interface at one point
+ // external interface at one point.
struct dasm_line {
- offs_t m_byteaddress; // address of the first byte of the instruction
- std::string m_adr; // instruction address as a string
+ offs_t m_address; // address of the instruction
+ offs_t m_size; // size of the instruction
+
+ std::string m_tadr; // instruction address as a string
std::string m_dasm; // disassembly
- std::string m_rawdata; // textual representation of the instruction values
- std::string m_encdata; // textual representation of encrypted instruction values
+ std::string m_topcodes; // textual representation of opcode/default values
+ std::string m_tparams; // textual representation of parameter values
std::string m_comment; // comment, when present
- bool operator == (const dasm_line &right) const {
- return
- m_byteaddress == right.m_byteaddress &&
- m_adr == right.m_adr &&
- m_dasm == right.m_dasm &&
- m_rawdata == right.m_rawdata &&
- m_encdata == right.m_encdata &&
- m_comment == right.m_comment;
- }
-
- bool operator != (const dasm_line &right) const {
- return !(*this == right);
- }
+ bool m_is_pc; // this line's address is PC
+ bool m_is_bp; // this line's address is a breakpoint
+ bool m_is_visited; // this line has been visited
+
+ dasm_line(offs_t address, offs_t size, std::string dasm) : m_address(address), m_size(size), m_dasm(dasm), m_is_pc(false), m_is_bp(false), m_is_visited(false) {}
};
// internal helpers
+ void generate_from_address(debug_disasm_buffer &buffer, offs_t address);
+ bool generate_with_pc(debug_disasm_buffer &buffer, offs_t pc);
+ int address_position(offs_t pc) const;
+ void generate_dasm(debug_disasm_buffer &buffer, offs_t pc);
+ void complete_information(const debug_view_disasm_source &source, debug_disasm_buffer &buffer, offs_t pc);
+
void enumerate_sources();
- offs_t find_pc_backwards(offs_t targetpc, int numinstrs);
- std::string generate_bytes(offs_t pcbyte, int numbytes, int granularity, bool encrypted);
- bool recompute(offs_t pc, int startline, int lines);
void print(int row, std::string text, int start, int end, u8 attrib);
+ void redraw();
// internal state
- disasm_right_column m_right_column; // right column contents
- u32 m_backwards_steps; // number of backwards steps
- u32 m_dasm_width; // width of the disassembly area
- u8 * m_last_direct_raw; // last direct raw value
- u8 * m_last_direct_decrypted;// last direct decrypted value
- u32 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
- std::vector<dasm_line> m_dasm; // disassembled instructions
+ disasm_right_column m_right_column; // right column contents
+ u32 m_backwards_steps; // number of backwards steps
+ u32 m_dasm_width; // width of the disassembly area
+ offs_t m_previous_pc; // previous pc, to detect whether it changed
+ debug_view_expression m_expression; // expression-related information
+ std::vector<dasm_line> m_dasm; // disassembled instructions
// constants
static constexpr int DEFAULT_DASM_LINES = 1000;