summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2016-03-22 12:26:40 +0100
committer hap <happppp@users.noreply.github.com>2016-03-22 12:26:57 +0100
commite28ac68d81538b0b382c1acb6f334eb2f97c2016 (patch)
tree254c120e5e9e7f92537c11e6e283ebb1d84b19ad /src/devices/cpu
parentf29fc8c3db877f9d9db495a8625b9c1fe079fc1a (diff)
SM511: added undocumented opcodes
Diffstat (limited to 'src/devices/cpu')
-rw-r--r--src/devices/cpu/sm510/sm510.cpp5
-rw-r--r--src/devices/cpu/sm510/sm510.h1
-rw-r--r--src/devices/cpu/sm510/sm510op.cpp6
-rw-r--r--src/devices/cpu/sm510/sm511core.cpp10
4 files changed, 16 insertions, 6 deletions
diff --git a/src/devices/cpu/sm510/sm510.cpp b/src/devices/cpu/sm510/sm510.cpp
index 9f6b7beee30..f7cde2a1322 100644
--- a/src/devices/cpu/sm510/sm510.cpp
+++ b/src/devices/cpu/sm510/sm510.cpp
@@ -19,7 +19,10 @@
- callback for lcd screen as MAME bitmap (when needed)
- LCD bs pin blink mode via Y register (0.5s off, 0.5s on)
- LB/SBM is correct?
- - SM511 unknown opcodes
+ - SM511 undocumented/guessed opcodes:
+ * $01 is guessed as DIV to ACC transfer, unknown which bits
+ * $5d is certainly CEND
+ * $65 is certainly IDIV, but not sure if it behaves same as on SM510
*/
diff --git a/src/devices/cpu/sm510/sm510.h b/src/devices/cpu/sm510/sm510.h
index 58094fc11a4..113b406d544 100644
--- a/src/devices/cpu/sm510/sm510.h
+++ b/src/devices/cpu/sm510/sm510.h
@@ -260,6 +260,7 @@ protected:
void op_skip();
void op_cend();
void op_idiv();
+ void op_dta();
void op_illegal();
};
diff --git a/src/devices/cpu/sm510/sm510op.cpp b/src/devices/cpu/sm510/sm510op.cpp
index cf99cbc5ae4..c2d0658ba6f 100644
--- a/src/devices/cpu/sm510/sm510op.cpp
+++ b/src/devices/cpu/sm510/sm510op.cpp
@@ -450,6 +450,12 @@ void sm510_base_device::op_idiv()
m_div = 0;
}
+void sm510_base_device::op_dta()
+{
+ // DTA: transfer divider low bits to ACC
+ m_acc = BITSWAP16(m_div,0,0,0,0, 0,0,0,0, 0,0,0,0, 7,8,9,10) & 0xf;
+}
+
void sm510_base_device::op_illegal()
{
logerror("%s unknown opcode $%02X at $%04X\n", tag(), m_op, m_prev_pc);
diff --git a/src/devices/cpu/sm510/sm511core.cpp b/src/devices/cpu/sm510/sm511core.cpp
index 2347721ff90..611050bc730 100644
--- a/src/devices/cpu/sm510/sm511core.cpp
+++ b/src/devices/cpu/sm510/sm511core.cpp
@@ -63,8 +63,8 @@ sm512_device::sm512_device(const machine_config &mconfig, const char *tag, devic
void sm511_device::get_opcode_param()
{
- // XXX?, LBL, PRE, TL, TML and prefix opcodes are 2 bytes
- if (m_op == 0x01 || (m_op >= 0x5f && m_op <= 0x61) || (m_op & 0xf0) == 0x70 || (m_op & 0xfc) == 0x68)
+ // LBL, PRE, TL, TML and prefix opcodes are 2 bytes
+ if ((m_op >= 0x5f && m_op <= 0x61) || (m_op & 0xf0) == 0x70 || (m_op & 0xfc) == 0x68)
{
m_icount--;
m_param = m_program->read_byte(m_pc);
@@ -102,7 +102,7 @@ void sm511_device::execute_one()
switch (m_op)
{
case 0x00: op_rot(); break;
-// case 0x01: op_xxx(); break; // ?
+ case 0x01: op_dta(); break; // guessed
case 0x02: op_sbm(); break;
case 0x03: op_atpl(); break;
case 0x08: op_add(); break;
@@ -119,7 +119,7 @@ void sm511_device::execute_one()
case 0x5a: op_ta0(); break;
case 0x5b: op_tabl(); break;
case 0x5c: op_atx(); break;
-// case 0x5d: op_cend(); break;
+ case 0x5d: op_cend(); break;
case 0x5e: op_tal(); break;
case 0x5f: op_lbl(); break;
@@ -127,7 +127,7 @@ void sm511_device::execute_one()
case 0x62: op_wr(); break;
case 0x63: op_ws(); break;
case 0x64: op_incb(); break;
-// case 0x65: op_idiv(); break;
+ case 0x65: op_idiv(); break;
case 0x66: op_rc(); break;
case 0x67: op_sc(); break;
case 0x6c: op_decb(); break;