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.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/devices/cpu/sm510/sm510op.cpp b/src/devices/cpu/sm510/sm510op.cpp
index 654ce20a5d2..acaf607f9df 100644
--- a/src/devices/cpu/sm510/sm510op.cpp
+++ b/src/devices/cpu/sm510/sm510op.cpp
@@ -11,15 +11,17 @@
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 | m_bm << 4 | m_bl) & m_datamask;
+ u8 address = (bmh | blh | 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 | m_bm << 4 | m_bl) & m_datamask;
+ u8 address = (bmh | blh | m_bm << 4 | m_bl) & m_datamask;
m_data->write_byte(address, data & 0xf);
}
@@ -40,7 +42,7 @@ void sm510_base_device::push_stack()
void sm510_base_device::do_branch(u8 pu, u8 pm, u8 pl)
{
// set new PC(Pu/Pm/Pl)
- m_pc = ((pu << 10 & 0xc00) | (pm << 6 & 0x3c0) | (pl & 0x03f)) & m_prgmask;
+ m_pc = ((pu << 10) | (pm << 6 & 0x3c0) | (pl & 0x03f)) & m_prgmask;
}
u8 sm510_base_device::bitmask(u16 param)
@@ -69,6 +71,11 @@ 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()
@@ -139,7 +146,7 @@ void sm510_base_device::op_tml()
void sm510_base_device::op_tm()
{
- // TM x: indirect subroutine call, pointers(IDX) are in page 0
+ // TM x: indirect subroutine call, pointers(IDX) are on page 0
m_icount--;
push_stack();
u8 idx = m_program->read_byte(m_op & 0x3f);
@@ -225,7 +232,7 @@ 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) != 0);
+ m_bp = m_acc & 1;
}
void sm510_base_device::op_atx()