op_lb WIP

This commit is contained in:
hap 2015-07-17 19:34:46 +02:00
parent dfdaaf0a1c
commit 4b9d68194f
2 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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()