summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/cpu/e132xs/32xsdasm.cpp8
-rw-r--r--src/devices/cpu/e132xs/32xsdasm.h14
-rw-r--r--src/devices/cpu/e132xs/e132xs.cpp13
-rw-r--r--src/devices/cpu/e132xs/e132xs.h5
-rw-r--r--src/tools/unidasm.cpp13
5 files changed, 45 insertions, 8 deletions
diff --git a/src/devices/cpu/e132xs/32xsdasm.cpp b/src/devices/cpu/e132xs/32xsdasm.cpp
index d6ecb866749..339c7b9c0b0 100644
--- a/src/devices/cpu/e132xs/32xsdasm.cpp
+++ b/src/devices/cpu/e132xs/32xsdasm.cpp
@@ -391,6 +391,10 @@ u32 hyperstone_disassembler::opcode_alignment() const
return 2;
}
+hyperstone_disassembler::hyperstone_disassembler(config *conf) : m_config(conf)
+{
+}
+
/*****************************/
/* Main disassembly function */
/*****************************/
@@ -408,8 +412,8 @@ offs_t hyperstone_disassembler::disassemble(std::ostream &stream, offs_t pc, con
uint8_t source_bit = SOURCEBIT(op);
uint8_t dest_bit = DESTBIT(op);
- global_fp = 0;
- int h_flag = 0;
+ global_fp = m_config->get_fp();
+ int h_flag = m_config->get_h();
uint8_t op_num = (op & 0xff00) >> 8;
diff --git a/src/devices/cpu/e132xs/32xsdasm.h b/src/devices/cpu/e132xs/32xsdasm.h
index 6c5b0fa4482..0ee99457c55 100644
--- a/src/devices/cpu/e132xs/32xsdasm.h
+++ b/src/devices/cpu/e132xs/32xsdasm.h
@@ -15,7 +15,14 @@
class hyperstone_disassembler : public util::disasm_interface
{
public:
- hyperstone_disassembler() = default;
+ struct config {
+ virtual ~config() = default;
+
+ virtual u8 get_fp() const = 0;
+ virtual bool get_h() const = 0;
+ };
+
+ hyperstone_disassembler(config *conf);
virtual ~hyperstone_disassembler() = default;
virtual u32 opcode_alignment() const override;
@@ -26,8 +33,11 @@ private:
static const char *const G_REG[];
static const char *const SETxx[];
- int size, global_fp;
+ config *m_config;
+ int size;
+ u8 global_fp;
+
void LL_format(char *source, char *dest, uint16_t op);
void LR_format(char *source, char *dest, uint16_t op);
void RR_format(char *source, char *dest, uint16_t op, unsigned h_flag);
diff --git a/src/devices/cpu/e132xs/e132xs.cpp b/src/devices/cpu/e132xs/e132xs.cpp
index c8051817cf6..d22d84aead2 100644
--- a/src/devices/cpu/e132xs/e132xs.cpp
+++ b/src/devices/cpu/e132xs/e132xs.cpp
@@ -149,7 +149,6 @@
#include "debugger.h"
#include "32xsdefs.h"
-#include "32xsdasm.h"
//#define VERBOSE 1
#include "logmacro.h"
@@ -1413,7 +1412,17 @@ void hyperstone_device::state_string_export(const device_state_entry &entry, std
util::disasm_interface *hyperstone_device::create_disassembler()
{
- return new hyperstone_disassembler;
+ return new hyperstone_disassembler(this);
+}
+
+u8 hyperstone_device::get_fp() const
+{
+ return GET_FP;
+}
+
+bool hyperstone_device::get_h() const
+{
+ return GET_H;
}
/* Opcodes */
diff --git a/src/devices/cpu/e132xs/e132xs.h b/src/devices/cpu/e132xs/e132xs.h
index de624a13688..acfeea49159 100644
--- a/src/devices/cpu/e132xs/e132xs.h
+++ b/src/devices/cpu/e132xs/e132xs.h
@@ -8,6 +8,7 @@
#include "cpu/drcfe.h"
#include "cpu/drcuml.h"
#include "cpu/drcumlsh.h"
+#include "32xsdasm.h"
/*
A note about clock multipliers and dividers:
@@ -60,7 +61,7 @@ class e132xs_frontend;
// ======================> hyperstone_device
// Used by core CPU interface
-class hyperstone_device : public cpu_device
+class hyperstone_device : public cpu_device, public hyperstone_disassembler::config
{
friend class e132xs_frontend;
@@ -215,6 +216,8 @@ protected:
// device_disasm_interface overrides
virtual util::disasm_interface *create_disassembler() override;
+ virtual u8 get_fp() const override;
+ virtual bool get_h() const override;
// device_state_interface overrides
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp
index 744d65282a3..3a9809c5b62 100644
--- a/src/tools/unidasm.cpp
+++ b/src/tools/unidasm.cpp
@@ -238,6 +238,17 @@ struct z8000_unidasm_t : z8000_disassembler::config
virtual bool get_segmented_mode() const override { return segmented_mode; }
} z8000_unidasm;
+// Configuration missing
+struct hyperstone_unidasm_t : hyperstone_disassembler::config
+{
+ bool h;
+ u8 fp;
+ hyperstone_unidasm_t() { h = false; fp = 0; }
+ virtual ~hyperstone_unidasm_t() = default;
+
+ virtual u8 get_fp() const { return fp; }
+ virtual bool get_h() const { return h; }
+} hyperstone_unidasm;
@@ -322,7 +333,7 @@ static const dasm_table_entry dasm_table[] =
{ "hmcs40", le, -1, []() -> util::disasm_interface * { return new hmcs40_disassembler; } },
{ "hp_hybrid", be, -1, []() -> util::disasm_interface * { return new hp_hybrid_disassembler; } },
{ "hp_5061_3001", be, -1, []() -> util::disasm_interface * { return new hp_5061_3001_disassembler; } },
- { "hyperstone", be, 0, []() -> util::disasm_interface * { return new hyperstone_disassembler; } },
+ { "hyperstone", be, 0, []() -> util::disasm_interface * { return new hyperstone_disassembler(&hyperstone_unidasm); } },
{ "i4004", le, 0, []() -> util::disasm_interface * { return new i4004_disassembler; } },
{ "i4040", le, 0, []() -> util::disasm_interface * { return new i4040_disassembler; } },
{ "i8008", le, 0, []() -> util::disasm_interface * { return new i8008_disassembler; } },