diff --git a/src/emu/cpu/sm510/sm510.c b/src/emu/cpu/sm510/sm510.c index c428eb76e40..09029709849 100644 --- a/src/emu/cpu/sm510/sm510.c +++ b/src/emu/cpu/sm510/sm510.c @@ -8,7 +8,7 @@ - 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, SM531, .. + them needs to get emulated: SM500, SM530/31, SM4A, SM3903, .. References: - 1990 Sharp Microcomputers Data Book diff --git a/src/emu/cpu/sm510/sm510op.c b/src/emu/cpu/sm510/sm510op.c index 91dd26d1ccb..bb0f4975511 100644 --- a/src/emu/cpu/sm510/sm510op.c +++ b/src/emu/cpu/sm510/sm510op.c @@ -57,10 +57,22 @@ inline UINT8 sm510_base_device::bitmask(UINT16 param) void sm510_base_device::op_lb() { // LB x: load BM/BL with 4-bit immediate value (partial) + + // SM510 WIP.. + // bm and bl(low) are probably ok! m_bm = (m_bm & 4) | (m_op & 3); - m_bl = m_op >> 2 & 3; - if (m_bl == 3) - m_bl |= 0xc; + m_bl = (m_op >> 2 & 3); + + // bl(high) is still unclear, official doc is confusing + UINT8 hi = 0; + switch (m_bl) + { + case 0: hi = 3; break; + case 1: hi = 0; break; + case 2: hi = 0; break; + case 3: hi = 3; break; + } + m_bl |= (hi << 2 & 0xc); } void sm510_base_device::op_lbl()