summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/sm510/sm510op.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/sm510/sm510op.cpp')
-rw-r--r--src/devices/cpu/sm510/sm510op.cpp33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/devices/cpu/sm510/sm510op.cpp b/src/devices/cpu/sm510/sm510op.cpp
index 8570f6139b5..4d98c91ab36 100644
--- a/src/devices/cpu/sm510/sm510op.cpp
+++ b/src/devices/cpu/sm510/sm510op.cpp
@@ -4,24 +4,20 @@
// SM510 shared opcode handlers
#include "emu.h"
-#include "sm510.h"
+#include "sm510base.h"
// internal helpers
u8 sm510_base_device::ram_r()
{
- int blh = (m_sbl) ? 8 : 0; // from SBL (optional)
- int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM
- u8 address = (bmh | blh | m_bm << 4 | m_bl) & m_datamask;
+ u8 address = (m_bmask | m_bm << 4 | m_bl) & m_datamask;
return m_data->read_byte(address) & 0xf;
}
void sm510_base_device::ram_w(u8 data)
{
- int blh = (m_sbl) ? 8 : 0; // from SBL (optional)
- int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM
- u8 address = (bmh | blh | m_bm << 4 | m_bl) & m_datamask;
+ u8 address = (m_bmask | m_bm << 4 | m_bl) & m_datamask;
m_data->write_byte(address, data & 0xf);
}
@@ -52,7 +48,6 @@ u8 sm510_base_device::bitmask(u16 param)
}
-
// instruction set
// RAM address instructions
@@ -71,11 +66,6 @@ void sm510_base_device::op_lbl()
m_bm = (m_param & m_datamask) >> 4;
}
-void sm510_base_device::op_sbl()
-{
- // SBL: set BL high bit for next opcode - handled in execute_one()
-}
-
void sm510_base_device::op_sbm()
{
// SBM: set BM high bit for next opcode - handled in execute_one()
@@ -128,7 +118,7 @@ void sm510_base_device::op_rtn1()
void sm510_base_device::op_t()
{
// T xy: jump(transfer) within current page
- m_pc = (m_pc & ~0x3f) | (m_op & 0x3f);
+ m_pc = (m_pc & ~m_pagemask) | (m_op & m_pagemask);
}
void sm510_base_device::op_tl()
@@ -154,7 +144,6 @@ void sm510_base_device::op_tm()
}
-
// Data transfer instructions
void sm510_base_device::op_exc()
@@ -231,8 +220,8 @@ void sm510_base_device::op_kta()
void sm510_base_device::op_atbp()
{
- // ATBP: output ACC to BP(internal LCD backplate signal)
- m_bp = m_acc & 1;
+ // ATBP: output ACC to BP LCD flag(s)
+ m_bp = m_acc;
}
void sm510_base_device::op_atx()
@@ -354,8 +343,8 @@ void sm510_base_device::op_tabl()
void sm510_base_device::op_tis()
{
// TIS: skip next if 1S(gamma flag) is clear, reset it after
- m_skip = !m_1s;
- m_1s = false;
+ m_skip = !m_gamma;
+ m_gamma = 0;
}
void sm510_base_device::op_tal()
@@ -440,12 +429,6 @@ void sm510_base_device::op_idiv()
m_div = 0;
}
-void sm510_base_device::op_dr()
-{
- // DR: reset divider low 8 bits
- m_div &= 0x7f;
-}
-
void sm510_base_device::op_dta()
{
// DTA: transfer divider low 4 bits to ACC