summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/diablo
diff options
context:
space:
mode:
author Joakim Larsson Edström <joakimlarsson42@gmail.com>2019-05-18 14:31:33 +0200
committer R. Belmont <rb6502@users.noreply.github.com>2019-05-18 08:31:33 -0400
commitab1e83ee3cb4e44bb59870ad04446992dc7d34c9 (patch)
treefe5ae0cd6d4857475a33f11166e4701e6ec3a456 /src/devices/cpu/diablo
parent52c6f4d1f3e054c9b974ad1e9837e4798742d2b1 (diff)
diablo1300: WIP Added new microcode, table rom and started looking at… (#5067)
* diablo1300: WIP Added new microcode, table rom and started looking at a callback interface * diablo1300.cpp: relative reference to table rom and added carry to debugger registers
Diffstat (limited to 'src/devices/cpu/diablo')
-rw-r--r--src/devices/cpu/diablo/diablo1300.cpp30
-rw-r--r--src/devices/cpu/diablo/diablo1300.h21
2 files changed, 43 insertions, 8 deletions
diff --git a/src/devices/cpu/diablo/diablo1300.cpp b/src/devices/cpu/diablo/diablo1300.cpp
index 5c809be344d..841dc544172 100644
--- a/src/devices/cpu/diablo/diablo1300.cpp
+++ b/src/devices/cpu/diablo/diablo1300.cpp
@@ -15,13 +15,15 @@
// CONFIGURABLE LOGGING
//**************************************************************************
#define LOG_OP (1U << 1)
+#define LOG_TABLE (1U << 2)
-#define VERBOSE (LOG_GENERAL | LOG_OP)
+#define VERBOSE (LOG_GENERAL | LOG_OP | LOG_TABLE)
//#define LOG_OUTPUT_FUNC printf
#include "logmacro.h"
-#define LOGOP(...) LOGMASKED(LOG_OP, __VA_ARGS__)
+#define LOGOP(...) LOGMASKED(LOG_OP, __VA_ARGS__)
+#define LOGTABLE(...) LOGMASKED(LOG_TABLE, __VA_ARGS__)
/*****************************************************************************/
@@ -62,6 +64,23 @@ inline void diablo1300_cpu_device::write_reg(uint16_t reg, uint8_t data)
data_write8(reg, data);
}
+inline void diablo1300_cpu_device::write_port(uint16_t port, uint16_t data)
+{
+ // TODO: interact with mechanics/layout engine
+}
+
+inline uint8_t diablo1300_cpu_device::read_table(uint16_t offset)
+{
+ LOGTABLE("Read %02x from table ROM offset %04x[%04x]\n", m_table->base()[offset & 0x1ff], offset & 0x1ff, offset);
+ return m_table->base()[offset & 0x1ff];
+}
+
+inline uint16_t diablo1300_cpu_device::read_ibus()
+{
+ // TODO: get signals from other boards
+ return 0;
+}
+
/*****************************************************************************/
DEFINE_DEVICE_TYPE(DIABLO1300, diablo1300_cpu_device, "diablo1300", "DIABLO 1300")
@@ -82,7 +101,7 @@ diablo1300_cpu_device::diablo1300_cpu_device(const machine_config &mconfig, cons
, m_program(nullptr)
, m_data(nullptr)
, m_cache(nullptr)
-
+ , m_table(nullptr)
{
// Allocate & setup
}
@@ -92,7 +111,8 @@ void diablo1300_cpu_device::device_start()
{
m_program = &space(AS_PROGRAM);
m_data = &space(AS_DATA);
- m_cache = m_program->cache<1, -1, ENDIANNESS_LITTLE>();
+ m_cache = m_program->cache<1, -1, ENDIANNESS_LITTLE>();
+ m_table = memregion("trom");
// register our state for the debugger
state_add(STATE_GENPC, "GENPC", m_pc).noshow();
@@ -101,11 +121,13 @@ void diablo1300_cpu_device::device_start()
state_add(DIABLO_PC, "PC", m_pc).mask(0x1ff);
state_add(DIABLO_A, "A", m_a).mask(0xff);
state_add(DIABLO_B, "B", m_b).mask(0xff);
+ state_add(DIABLO_CARRY, "CARRY", m_carry).formatstr("%1u");
/* setup regtable */
save_item(NAME(m_pc));
save_item(NAME(m_a));
save_item(NAME(m_b));
+ save_item(NAME(m_carry));
save_item(NAME(m_power_on));
// set our instruction counter
diff --git a/src/devices/cpu/diablo/diablo1300.h b/src/devices/cpu/diablo/diablo1300.h
index 4919448c081..00328a28007 100644
--- a/src/devices/cpu/diablo/diablo1300.h
+++ b/src/devices/cpu/diablo/diablo1300.h
@@ -56,10 +56,10 @@ protected:
inline uint8_t read_reg(uint16_t reg);
inline uint16_t read_port(uint16_t port){ return 0;}
- inline uint16_t read_table(uint16_t offset){ return 0;}
+ inline uint8_t read_table(uint16_t offset);// { return 0;}
inline void write_reg(uint16_t reg, uint8_t data);
- inline void write_port(uint16_t port, uint16_t data){}
- inline uint16_t read_ibus(){ return 0; }
+ inline void write_port(uint16_t port, uint16_t data);
+ inline uint16_t read_ibus(); // { return 0; }
// CPU registers
uint16_t m_pc;
@@ -75,6 +75,18 @@ protected:
address_space *m_program;
address_space *m_data;
memory_access_cache<1, -1, ENDIANNESS_LITTLE> *m_cache;
+
+ // rom regions
+ memory_region *m_table;
+
+#if 0
+ // Callbacks and set methods
+ write_line_delegate m_xxx_cb; // Called when xxx happens in CPU
+ void call_xxx_cb(int state){ if (!m_xxx.cb.isnull()) (m_xxx_cb)(state);
+public:
+ void set_xxx_callback( write_line_delegate callback ){ m_xxx_cb = callback; }
+ void set_line_yyy(int state){ m_yyy = state; }
+#endif
};
// device type definition
@@ -88,7 +100,8 @@ enum
{
DIABLO_PC = 1,
DIABLO_A,
- DIABLO_B
+ DIABLO_B,
+ DIABLO_CARRY
};
#endif // MAME_CPU_DIABLO_DIABLO1300_H