Beispiel #1
0
void c64pla_config_changed(int tape_sense, int caps_sense, BYTE pullup)
{
    pport.data_out = (pport.data_out & ~pport.dir) | (pport.data & pport.dir);

    pport.data_read = (pport.data | ~pport.dir) & (pport.data_out | pullup);

    if ((pullup & 0x40) && !caps_sense) {
        pport.data_read &= 0xbf;
    }

    if (!(pport.dir & 0x20)) {
        pport.data_read &= 0xdf;
    }

    if (tape_sense && !(pport.dir & 0x10)) {
        pport.data_read &= 0xef;
    }

    if (((pport.dir & pport.data) & 0x20) != old_port_data_out) {
        old_port_data_out = (pport.dir & pport.data) & 0x20;
        tapeport_set_motor(!old_port_data_out);
    }

    if (((~pport.dir | pport.data) & 0x8) != old_port_write_bit) {
        old_port_write_bit = (~pport.dir | pport.data) & 0x8;
        tapeport_toggle_write_bit((~pport.dir | pport.data) & 0x8);
    }

    pport.dir_read = pport.dir;
}
Beispiel #2
0
inline static void mem_proc_port_store(void)
{
    /*  Correct clock */
    ted_handle_pending_alarms(maincpu_rmw_flag + 1);

    pport.data_out = (pport.data_out & ~pport.dir)
                     | (pport.data & pport.dir);

    if (((~pport.dir | pport.data) & 0x02) != old_port_write_bit) {
        old_port_write_bit = (~pport.dir | pport.data) & 0x02;
        tapeport_toggle_write_bit((~pport.dir | ~pport.data) & 0x02);
    }

    (*iecbus_callback_write)((BYTE)~pport.data_out, last_write_cycle);

    if (((pport.dir & pport.data) & 0x08) != old_port_data_out) {
        old_port_data_out = (pport.dir & pport.data) & 0x08;
        tapeport_set_motor(!old_port_data_out);
    }
}