示例#1
0
int serial_iec_open(unsigned int unit, unsigned int secondary,
                    const char *name, unsigned int length)
{
    unsigned int i;

    serial_iec_bus_open(unit, (BYTE)secondary, serial_iec_set_st);

    for (i = 0; i < length; i++) {
        serial_iec_bus_write(unit, (BYTE)secondary, name[i], serial_iec_set_st);
    }

    serial_iec_bus_unlisten(unit, (BYTE)secondary, serial_iec_set_st);

    return 0;
}
示例#2
0
int serial_iec_write(unsigned int unit, unsigned int secondary, BYTE data)
{
    if (talk) {
        serial_iec_bus_untalk(unit, (BYTE)secondary, serial_iec_set_st);
        talk = 0;
    }

    if (!listen) {
        serial_iec_bus_listen(unit | 0x20, (BYTE)secondary, serial_iec_set_st);
        listen = 1;
    }

    serial_iec_bus_write(unit, (BYTE)secondary, data, serial_iec_set_st);

    return serial_iec_st;
}
示例#3
0
/* Send one byte on the serial bus.  */
int serial_trap_send(void)
{
    BYTE data;

    if (serial_truedrive && ((TrapDevice & 0x0f) != 4) && ((TrapDevice & 0x0f) != 5)) {
        return 0;
    }

    data = mem_read(BSOUR); /* BSOUR - character for serial bus */

    serial_iec_bus_write(TrapDevice, TrapSecondary, data, serial_set_st);

    MOS6510_REGS_SET_CARRY(&maincpu_regs, 0);
    MOS6510_REGS_SET_INTERRUPT(&maincpu_regs, 0);

    return 1;
}