diff options
Diffstat (limited to 'src/emu/cpu/amis2000/amis2000op.inc')
-rw-r--r-- | src/emu/cpu/amis2000/amis2000op.inc | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/emu/cpu/amis2000/amis2000op.inc b/src/emu/cpu/amis2000/amis2000op.inc index 504fc174379..ed6f6158d89 100644 --- a/src/emu/cpu/amis2000/amis2000op.inc +++ b/src/emu/cpu/amis2000/amis2000op.inc @@ -33,9 +33,10 @@ void amis2000_device::push_callstack() m_callstack[0] = m_pc & m_callstack_mask; } -void amis2000_device::op_illegal() +void amis2000_device::d_latch_out(bool active) { - logerror("%s unknown opcode $%02X at $%04X\n", tag(), m_op, m_pc); + m_write_d(0, active ? (m_d ^ m_d_polarity) : 0, 0xff); + m_d_active = active; } @@ -195,21 +196,22 @@ void amis2000_device::op_rsm() void amis2000_device::op_inp() { // INP: input D-pins to ACC and RAM - op_illegal(); + UINT8 in = m_d_active ? m_d : m_read_d(0, 0xff); + m_acc = in & 0xf; + ram_w(in >> 4 & 0xf); } void amis2000_device::op_out() { // OUT: pulse output ACC and RAM to D-pins - op_illegal(); + logerror("%s unknown opcode $%02X at $%04X\n", tag(), m_op, m_pc); } void amis2000_device::op_disb() { // DISB: set D-latch to ACC and RAM directly m_d = m_acc | ram_r() << 4; - m_write_d(0, m_d, 0xff); - // TODO: exit from floating mode on D-pins + d_latch_out(true); } void amis2000_device::op_disn() @@ -221,15 +223,14 @@ void amis2000_device::op_disn() 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 + d_latch_out(true); } void amis2000_device::op_mvs() { // MVS: output master strobe latch to A-pins + d_latch_out(false); m_write_a(0, m_a, 0xffff); - // TODO: enter floating mode on D-pins } void amis2000_device::op_psh() @@ -244,7 +245,7 @@ void amis2000_device::op_psh() case 0xe: // exit from floating mode on D-pins - // ? + d_latch_out(true); break; case 0xf: @@ -271,7 +272,7 @@ void amis2000_device::op_psl() case 0xe: // enter floating mode on D-pins - // ? + d_latch_out(false); break; case 0xf: @@ -288,8 +289,9 @@ void amis2000_device::op_psl() void amis2000_device::op_eur() { - // EUR: set timer frequency(European) and D-latch polarity - op_illegal(); + // EUR: set timer frequency(European) and D-latch polarity, via ACC + m_d_polarity = (m_acc & 1) ? 0x00 : 0xff; + d_latch_out(m_d_active); // refresh } @@ -350,6 +352,12 @@ void amis2000_device::op_nop() // NOP: no operation } +void amis2000_device::op_halt() +{ + // HALT: debugger breakpoint for devkit-use + logerror("%s unknown opcode $%02X at $%04X\n", tag(), m_op, m_pc); +} + // Skip Instructions @@ -393,7 +401,7 @@ void amis2000_device::op_sam() void amis2000_device::op_sos() { // SOS: skip next on SF(timer output), clear SF - op_illegal(); + logerror("%s unknown opcode $%02X at $%04X\n", tag(), m_op, m_pc); } void amis2000_device::op_tf1() |