summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/rsp/rsp_dasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/rsp/rsp_dasm.h')
-rw-r--r--src/devices/cpu/rsp/rsp_dasm.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/devices/cpu/rsp/rsp_dasm.h b/src/devices/cpu/rsp/rsp_dasm.h
new file mode 100644
index 00000000000..72dcdaae5e6
--- /dev/null
+++ b/src/devices/cpu/rsp/rsp_dasm.h
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:Ville Linde, Ryan Holtz
+/*
+ Nintendo/SGI RSP Disassembler
+
+ Written by Ville Linde
+*/
+
+#ifndef MAME_CPU_RSP_RSP_DASM_H
+#define MAME_CPU_RSP_RSP_DASM_H
+
+#pragma once
+
+class rsp_disassembler : public util::disasm_interface
+{
+public:
+ rsp_disassembler() = default;
+ virtual ~rsp_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 vreg[32];
+ static const char *const cop0_regs[32];
+ static const char *const element[16];
+ static const char *const element2[16];
+ inline std::string signed_imm16(uint32_t op);
+ void disasm_cop0(std::ostream &stream, uint32_t op);
+ void disasm_cop2(std::ostream &stream, uint32_t op);
+ void disasm_lwc2(std::ostream &stream, uint32_t op);
+ void disasm_swc2(std::ostream &stream, uint32_t op);
+};
+
+#endif