summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-01-30 22:11:55 +0100
committer hap <happppp@users.noreply.github.com>2015-01-30 22:11:55 +0100
commitb1ac74aa020b482eecd6cff9be01ef66c6fa4a93 (patch)
tree45d71366e11f62119f6a8a17073f2f9c848f76c0
parentfcb2d59e4e660df8b74ae00c2b4de63c8ae6f90f (diff)
added some i/o opcodes
-rw-r--r--src/emu/cpu/amis2000/amis2000.c14
-rw-r--r--src/emu/cpu/amis2000/amis2000.h2
-rw-r--r--src/emu/cpu/amis2000/amis2000op.inc64
3 files changed, 73 insertions, 7 deletions
diff --git a/src/emu/cpu/amis2000/amis2000.c b/src/emu/cpu/amis2000/amis2000.c
index 81dcea88d5e..5afe974f681 100644
--- a/src/emu/cpu/amis2000/amis2000.c
+++ b/src/emu/cpu/amis2000/amis2000.c
@@ -5,7 +5,9 @@
American Microsystems, Inc.(AMI) S2000-family 4-bit MCU cores, introduced late 1970s
TODO:
- - x
+ - unemulated opcodes (need more testing material)
+ - support external program map
+ - add 50/60hz timer
- add S2200/S2400
*/
@@ -147,6 +149,8 @@ void amis2000_device::device_start()
m_e = 0;
m_i = 0;
m_k = 0;
+ m_d = 0;
+ m_a = 0;
// register for savestates
save_item(NAME(m_callstack));
@@ -164,6 +168,8 @@ void amis2000_device::device_start()
save_item(NAME(m_e));
save_item(NAME(m_i));
save_item(NAME(m_k));
+ save_item(NAME(m_d));
+ save_item(NAME(m_a));
// register state for debugger
state_add(S2000_PC, "PC", m_pc ).formatstr("%04X");
@@ -190,6 +196,12 @@ void amis2000_device::device_reset()
m_pc = 0;
m_skip = false;
m_op = 0;
+
+ // clear i/o
+ m_i = 0;
+ m_k = 0;
+ m_d = 0; m_write_d(0, 0, 0xff);
+ m_a = 0; m_write_a(0, 0, 0xffff);
}
diff --git a/src/emu/cpu/amis2000/amis2000.h b/src/emu/cpu/amis2000/amis2000.h
index 5f583343fde..966a85cd524 100644
--- a/src/emu/cpu/amis2000/amis2000.h
+++ b/src/emu/cpu/amis2000/amis2000.h
@@ -91,6 +91,8 @@ protected:
UINT8 m_e; // 4-bit generic register
UINT8 m_i; // 4-bit i-pins latch
UINT8 m_k; // 4-bit k-pins latch
+ UINT8 m_d; // 8-bit d-pins latch
+ UINT16 m_a; // 13-bit a-pins latch (master strobe latch)
devcb_read8 m_read_k;
devcb_read8 m_read_i;
diff --git a/src/emu/cpu/amis2000/amis2000op.inc b/src/emu/cpu/amis2000/amis2000op.inc
index 708f416f578..97fa6b6db82 100644
--- a/src/emu/cpu/amis2000/amis2000op.inc
+++ b/src/emu/cpu/amis2000/amis2000op.inc
@@ -187,31 +187,83 @@ void amis2000_device::op_out()
void amis2000_device::op_disb()
{
// DISB: set D-latch to ACC and RAM directly
- op_illegal();
+ m_d = m_acc | ram_r() << 4;
+ m_write_d(0, m_d, 0xff);
+ // TODO: exit from floating mode on D-pins
}
void amis2000_device::op_disn()
{
- // DISN: set D-latch to ACC+carry via segment decoder
- op_illegal();
+ // DISN: set D-latch to ACC+carry via on-die segment decoder
+ static const UINT8 lut_segment_decoder[0x10] =
+ {
+ // 0-F digits in bit order [DP]abcdefg
+ 0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, 0x77, 0x1f, 0x4e, 0x3d, 0x4f, 0x47
+ };
+ m_d = lut_segment_decoder[m_acc] | (m_carry ? 0x80 : 0x00);
+ m_write_d(0, m_d, 0xff);
+ // TODO: exit from floating mode on D-pins
}
void amis2000_device::op_mvs()
{
// MVS: output master strobe latch to A-pins
- op_illegal();
+ m_write_a(0, m_a, 0xffff);
+ // TODO: enter floating mode on D-pins
}
void amis2000_device::op_psh()
{
// PSH: preset high(BL) master strobe latch
- op_illegal();
+ switch (m_bl)
+ {
+ case 0xd:
+ // set multiplex operation
+ // ?
+ break;
+
+ case 0xe:
+ // exit from floating mode on D-pins
+ // ?
+ break;
+
+ case 0xf:
+ // set all latch bits high
+ m_a = 0x1fff;
+ break;
+
+ default:
+ // set selected latch bit high
+ m_a |= (1 << m_bl);
+ break;
+ }
}
void amis2000_device::op_psl()
{
// PSL: preset low(BL) master strobe latch
- op_illegal();
+ switch (m_bl)
+ {
+ case 0xd:
+ // set static operation
+ // ?
+ break;
+
+ case 0xe:
+ // enter floating mode on D-pins
+ // ?
+ break;
+
+ case 0xf:
+ // set all latch bits low
+ m_a = 0;
+ break;
+
+ default:
+ // set selected latch bit low
+ m_a &= ~(1 << m_bl);
+ break;
+ }
}
void amis2000_device::op_eur()