void a2bus_pic_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) { switch (offset) { case 0: // set data out and send a strobe m_ctx_data_out->write(data); if (m_autostrobe) { start_strobe(); } break; case 2: // send a strobe start_strobe(); break; case 6: // enable interrupt on ACK m_irqenable = true; break; case 7: // disable and acknowledge IRQ, reset ACK flip-flop, disable autostrobe m_irqenable = false; m_autostrobe = false; lower_slot_irq(); break; } }
void a2bus_pic_device::device_reset() { m_started = true; m_ack = 0; m_irqenable = false; m_autostrobe = false; lower_slot_irq(); m_timer->adjust(attotime::never); // set initial state of the strobe line depending on the dipswitch clear_strobe(); }
uint8_t a2bus_pic_device::read_c0nx(uint8_t offset) { uint8_t rv = 0; switch (offset) { case 3: return m_ctx_data_in->read(); case 4: rv = m_ack; // clear flip-flop if (m_dsw1->read() & 0x10) // negative polarity { m_ack |= 0x80; } else { m_ack &= ~0x80; } return rv; case 6: // does reading this really work? m_irqenable = true; break; case 7: m_irqenable = false; m_autostrobe = false; lower_slot_irq(); break; } return 0; }
UINT8 a2bus_pic_device::read_c0nx(address_space &space, UINT8 offset) { switch (offset) { case 3: return m_ctx_data_in->read(); case 4: return m_ack; case 6: // does reading this really work? m_irqenable = true; break; case 7: m_irqenable = false; m_autostrobe = false; lower_slot_irq(); break; } return 0; }
void a2bus_themill_device::write_c0nx(uint8_t offset, uint8_t data) { switch (offset) { case 0: // 6502 IRQ if (data & 0x80) { m_status |= 0x01; lower_slot_irq(); } else { m_status &= ~0x01; raise_slot_irq(); } break; case 2: // 6809 reset if (data & 0x80) { m_6809->reset(); m_6809->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); m_6809->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); m_bEnabled = true; m_status &= ~0x04; } else { m_6809->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); m_bEnabled = false; m_status |= 0x04; } break; case 1: // 6809 halt if (data & 0x80) // release reset { m_status |= 0x02; } else { m_6809->reset(); m_status &= ~0x02; } break; case 3: // 6809 NMI if (data & 0x80) { m_6809->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); m_status |= 0x08; } else { m_6809->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); m_status &= ~0x08; } break; case 4: // 6809 FIRQ if (data & 0x80) { m_6809->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); m_status |= 0x10; } else { m_6809->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); m_status &= ~0x10; } break; case 5: // 6809 IRQ if (data & 0x80) { m_6809->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); m_status |= 0x20; } else { m_6809->set_input_line(M6809_IRQ_LINE, ASSERT_LINE); m_status &= ~0x20; } break; case 6: if (data & 0x80) // enable ROM socket { m_status |= 0x40; printf("The Mill: on-board ROM socket enabled; because none of these ROMs are dumped, the 6809 will not run!\n"); } else { m_status &= ~0x40; } break; case 7: // 6809 mapping if (data & 0x80) { m_status |= 0x80; m_flipAddrSpace = false; } else { m_status &= ~0x80; m_flipAddrSpace = true; } break; case 0xa: // addresses >= 0x8 are direct status writes? "Excel Flex 9" disc seems to indicate so. m_status = data; break; default: printf("The Mill: %02x to unhandled c0n%x\n", data, offset); break; } }