summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/e132xs
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/e132xs')
-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
4 files changed, 33 insertions, 7 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;