summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/mips/mips3dsm.h
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2017-07-05 11:44:49 +0200
committer Olivier Galibert <galibert@pobox.com>2017-11-26 17:41:27 +0100
commit6caef2579a1490f05d28bcede731cbdd45fc5c65 (patch)
tree8055384e183be3cb27e7d0894ac53dc96c09e6fa /src/devices/cpu/mips/mips3dsm.h
parent34b222062c89adbeed822f56be6130421777e11f (diff)
dvdisasm: Overhaul [O. Galibert]
Disassemblers are now independant classes. Not only the code is cleaner, but unidasm has access to all the cpu cores again. The interface to the disassembly method has changed from byte buffers to objects that give a result to read methods. This also adds support for lfsr and/or paged PCs.
Diffstat (limited to 'src/devices/cpu/mips/mips3dsm.h')
-rw-r--r--src/devices/cpu/mips/mips3dsm.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/devices/cpu/mips/mips3dsm.h b/src/devices/cpu/mips/mips3dsm.h
new file mode 100644
index 00000000000..a38771bbba0
--- /dev/null
+++ b/src/devices/cpu/mips/mips3dsm.h
@@ -0,0 +1,40 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ mips3dsm.c
+ Disassembler for the portable MIPS 3 emulator.
+ Written by Aaron Giles
+
+***************************************************************************/
+
+#ifndef MAME_CPU_MIPS_MIPS3DSM_H
+#define MAME_CPU_MIPS_MIPS3DSM_H
+
+#pragma once
+
+class mips3_disassembler : public util::disasm_interface
+{
+public:
+ mips3_disassembler() = default;
+ virtual ~mips3_disassembler() = default;
+
+ virtual u32 opcode_alignment() const override;
+ virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer &params) override;
+
+ offs_t dasm_one(std::ostream &stream, offs_t pc, u32 op);
+
+private:
+ static const char *const reg[32];
+ static const char *const cacheop[32];
+ static const char *const cpreg[4][32];
+ static const char *const ccreg[4][32];
+ inline std::string signed_16bit(int16_t val);
+ uint32_t dasm_cop0(uint32_t pc, uint32_t op, std::ostream &stream);
+ uint32_t dasm_cop1(uint32_t pc, uint32_t op, std::ostream &stream);
+ uint32_t dasm_cop1x(uint32_t pc, uint32_t op, std::ostream &stream);
+ uint32_t dasm_cop2(uint32_t pc, uint32_t op, std::ostream &stream);
+
+};
+
+#endif