summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/arm7/arm7.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/arm7/arm7.cpp')
-rw-r--r--src/devices/cpu/arm7/arm7.cpp83
1 files changed, 7 insertions, 76 deletions
diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp
index 89ae14f8f11..cf8a8560990 100644
--- a/src/devices/cpu/arm7/arm7.cpp
+++ b/src/devices/cpu/arm7/arm7.cpp
@@ -929,83 +929,14 @@ void arm7_cpu_device::execute_set_input(int irqline, int state)
}
-offs_t arm7_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+util::disasm_interface *arm7_cpu_device::create_disassembler()
{
- extern CPU_DISASSEMBLE( arm7arm );
- extern CPU_DISASSEMBLE( arm7thumb );
- extern CPU_DISASSEMBLE( arm7arm_be );
- extern CPU_DISASSEMBLE( arm7thumb_be );
-
- uint8_t fetched_op[4];
- uint32_t op = 0;
- int prefetch_index = get_insn_prefetch_index(pc);
- if (prefetch_index < 0)
- {
- memcpy(fetched_op, oprom, 4);
- if (T_IS_SET(m_r[eCPSR]))
- {
- if ( m_endian == ENDIANNESS_BIG )
- {
- return CPU_DISASSEMBLE_NAME(arm7thumb_be)(this, stream, pc, fetched_op, opram, options);
- }
- else
- {
- return CPU_DISASSEMBLE_NAME(arm7thumb)(this, stream, pc, fetched_op, opram, options);
- }
- }
- else
- {
- if ( m_endian == ENDIANNESS_BIG )
- {
- return CPU_DISASSEMBLE_NAME(arm7arm_be)(this, stream, pc, fetched_op, opram, options);
- }
- else
- {
- return CPU_DISASSEMBLE_NAME(arm7arm)(this, stream, pc, fetched_op, opram, options);
- }
- }
- }
- else
- {
- op = m_insn_prefetch_buffer[prefetch_index];
- if (T_IS_SET(m_r[eCPSR]))
- {
- if (m_endian == ENDIANNESS_BIG)
- {
- op >>= ((pc & 2) ? 0 : 16);
- fetched_op[1] = op & 0xff;
- fetched_op[0] = (op >> 8) & 0xff;
- return CPU_DISASSEMBLE_NAME(arm7thumb_be)(this, stream, pc, fetched_op, opram, options);
- }
- else
- {
- op >>= ((pc & 2) ? 16 : 0);
- fetched_op[0] = op & 0xff;
- fetched_op[1] = (op >> 8) & 0xff;
- return CPU_DISASSEMBLE_NAME(arm7thumb)(this, stream, pc, fetched_op, opram, options);
- }
- }
- else
- {
- if (m_endian == ENDIANNESS_BIG)
- {
- fetched_op[3] = op & 0xff;
- fetched_op[2] = (op >> 8) & 0xff;
- fetched_op[1] = (op >> 16) & 0xff;
- fetched_op[0] = (op >> 24) & 0xff;
- return CPU_DISASSEMBLE_NAME(arm7arm_be)(this, stream, pc, fetched_op, opram, options);
- }
- else
- {
- fetched_op[0] = op & 0xff;
- fetched_op[1] = (op >> 8) & 0xff;
- fetched_op[2] = (op >> 16) & 0xff;
- fetched_op[3] = (op >> 24) & 0xff;
- return CPU_DISASSEMBLE_NAME(arm7arm)(this, stream, pc, fetched_op, opram, options);
- }
- }
- }
- return 0;
+ return new arm7_disassembler(this);
+}
+
+bool arm7_cpu_device::get_t_flag() const
+{
+ return T_IS_SET(m_r[eCPSR]);
}