summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2016-04-05 11:32:35 +0200
committer hap <happppp@users.noreply.github.com>2016-04-05 11:33:05 +0200
commit10cadefbe2259c6d97be7ad644e169d5d8ac2afb (patch)
tree36770e808d10630e057df7559029c0494aba80a6 /src/devices/cpu
parent2becb82ad14bbe84bb237c4831fb70ad980e73da (diff)
sm500 file placeholders
Diffstat (limited to 'src/devices/cpu')
-rw-r--r--src/devices/cpu/sm510/kb1013vk1-2core.cpp11
-rw-r--r--src/devices/cpu/sm510/sm500.cpp8
-rw-r--r--src/devices/cpu/sm510/sm500.h60
-rw-r--r--src/devices/cpu/sm510/sm500core.cpp38
-rw-r--r--src/devices/cpu/sm510/sm500op.cpp6
-rw-r--r--src/devices/cpu/sm510/sm510.cpp46
6 files changed, 135 insertions, 34 deletions
diff --git a/src/devices/cpu/sm510/kb1013vk1-2core.cpp b/src/devices/cpu/sm510/kb1013vk1-2core.cpp
new file mode 100644
index 00000000000..db85ae27023
--- /dev/null
+++ b/src/devices/cpu/sm510/kb1013vk1-2core.cpp
@@ -0,0 +1,11 @@
+// license:BSD-3-Clause
+// copyright-holders:hap, Igor
+/*
+
+ KB1013VK1-2 MCU core implementation
+
+*/
+
+#include "sm500.h"
+#include "debugger.h"
+
diff --git a/src/devices/cpu/sm510/sm500.cpp b/src/devices/cpu/sm510/sm500.cpp
new file mode 100644
index 00000000000..b24953709fc
--- /dev/null
+++ b/src/devices/cpu/sm510/sm500.cpp
@@ -0,0 +1,8 @@
+// license:BSD-3-Clause
+// copyright-holders:hap, Igor
+/*
+
+*/
+
+#include "sm500.h"
+#include "debugger.h"
diff --git a/src/devices/cpu/sm510/sm500.h b/src/devices/cpu/sm510/sm500.h
new file mode 100644
index 00000000000..7abe96e0d2a
--- /dev/null
+++ b/src/devices/cpu/sm510/sm500.h
@@ -0,0 +1,60 @@
+// license:BSD-3-Clause
+// copyright-holders:hap, Igor
+/*
+
+ Sharp SM500 MCU family cores
+
+*/
+
+#ifndef _SM500_H_
+#define _SM500_H_
+
+#include "sm510.h"
+
+
+// I/O ports setup
+
+// ..
+
+
+// pinout reference
+
+/*
+
+ O33 O43 O12 O22 O32 GND O42 O11 O21 O31 O41 OS1
+ 36 35 34 33 32 31 30 29 28 27 26 25
+ ________________________________________________
+ | |
+O23 37 | | 24 OS2
+O13 38 | | 23 OS3
+O44 39 | | 22 OS4
+O34 40 | | 21 H1
+O24 41 | | 20 H2
+O14 42 | SM500 | 19 VM
+O45 43 | | 18 OSCin
+O35 44 | | 17 OSCout
+O25 45 | | 16 VDD
+O15 46 | | 15 K4
+O46 47 | | 14 K3
+O36 48 | * | 13 K2
+ |________________________________________________/
+
+ 1 2 3 4 5 6 7 8 9 10 11 12
+ O26 O16 R4 R3 R2 R1 GND _T bt al ACL K1 note: bt = beta symbol, al = alpha symbol
+*/
+
+class sm500_device : public sm510_base_device
+{
+public:
+ sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override;
+};
+
+
+
+extern const device_type SM500;
+
+
+#endif /* _SM500_H_ */
diff --git a/src/devices/cpu/sm510/sm500core.cpp b/src/devices/cpu/sm510/sm500core.cpp
new file mode 100644
index 00000000000..4ea9af383fd
--- /dev/null
+++ b/src/devices/cpu/sm510/sm500core.cpp
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:hap, Igor
+/*
+
+ Sharp SM500 MCU core implementation
+
+*/
+
+#include "sm500.h"
+#include "debugger.h"
+
+
+// MCU types
+const device_type SM500 = &device_creator<sm500_device>;
+
+
+// internal memory maps
+static ADDRESS_MAP_START(program_2_7k, AS_PROGRAM, 8, sm510_base_device)
+ AM_RANGE(0x0000, 0x00ff) AM_ROM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(data_96_32x4, AS_DATA, 8, sm510_base_device)
+ AM_RANGE(0x00, 0x1f) AM_RAM
+ADDRESS_MAP_END
+
+
+// device definitions
+sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sm510_base_device(mconfig, SM500, "SM500", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_2_7k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm500", __FILE__)
+{ }
+
+
+// disasm
+offs_t sm500_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+{
+ extern CPU_DISASSEMBLE(sm510);
+ return CPU_DISASSEMBLE_NAME(sm510)(this, buffer, pc, oprom, opram, options);
+}
diff --git a/src/devices/cpu/sm510/sm500op.cpp b/src/devices/cpu/sm510/sm500op.cpp
new file mode 100644
index 00000000000..038e0b09c37
--- /dev/null
+++ b/src/devices/cpu/sm510/sm500op.cpp
@@ -0,0 +1,6 @@
+// license:BSD-3-Clause
+// copyright-holders:hap, Igor
+
+// SM500 opcode handlers
+
+#include "sm500.h"
diff --git a/src/devices/cpu/sm510/sm510.cpp b/src/devices/cpu/sm510/sm510.cpp
index 9c6b197f06f..ab8e0fb176c 100644
--- a/src/devices/cpu/sm510/sm510.cpp
+++ b/src/devices/cpu/sm510/sm510.cpp
@@ -2,17 +2,24 @@
// copyright-holders:hap
/*
- Sharp SM510 MCU family - known chips:
+ Known chips: (* means not emulated yet)
+
+ Sharp SM510 MCU family:
- SM510: 2.7Kx8 ROM, 128x4 RAM(32x4 for LCD)
- SM511: 4Kx8 ROM, 128x4 RAM(32x4 for LCD), melody controller
- SM512: 4Kx8 ROM, 128x4 RAM(48x4 for LCD), melody controller
-
- Other chips that may be in the same family, investigate more when one of
- them needs to get emulated: SM500, SM530/31, SM4A, SM3903, ..
-
+ - *KB1013VK4-2: Soviet-era clone of SM510, minor differences
+
+ Sharp SM500 MCU family:
+ - *SM500: x
+ - *SM530: x
+ - *SM531: x
+ - *KB1013VK1-2: Soviet-era clone of SM500, minor differences
+
References:
- 1990 Sharp Microcomputers Data Book
- 1996 Sharp Microcomputer Databook
+ - KB1013VK1-2/KB1013VK4-2 manual
TODO:
- proper support for LFSR program counter in debugger
@@ -59,35 +66,6 @@ void sm510_base_device::device_start()
m_write_segbs.resolve_safe();
m_write_segc.resolve_safe();
- // zerofill
- memset(m_stack, 0, sizeof(m_stack));
- m_pc = 0;
- m_prev_pc = 0;
- m_op = 0;
- m_prev_op = 0;
- m_param = 0;
- m_acc = 0;
- m_bl = 0;
- m_bm = 0;
- m_c = 0;
- m_skip = false;
- m_w = 0;
- m_r = 0;
- m_div = 0;
- m_1s = false;
- m_k_active = false;
- m_l = 0;
- m_x = 0;
- m_y = 0;
- m_bp = false;
- m_bc = false;
- m_halt = false;
- m_melody_rd = 0;
- m_melody_step_count = 0;
- m_melody_duty_count = 0;
- m_melody_duty_index = 0;
- m_melody_address = 0;
-
// register for savestates
save_item(NAME(m_stack));
save_item(NAME(m_pc));