Exemplo n.º 1
0
/* read_* functions must return 0xff if nothing to read!!! */
static BYTE read_ciapb(cia_context_t *cia_context)
{
    BYTE byte = 0xff;

    /* FIXME: in the upcoming userport system this call needs to be conditional */
    byte = userport_joystick_read_pbx(byte);

    byte &= ((0xff & ~(cia_context->c_cia[CIA_DDRB]))
             | (cia_context->c_cia[CIA_PRB] & cia_context->c_cia[CIA_DDRB]));
    return byte;
}
Exemplo n.º 2
0
inline static BYTE read_pra(via_context_t *via_context, WORD addr)
{
    BYTE byte = 0xff;

    /* FIXME: in the upcoming userport system this call needs to be conditional */
    userport_joystick_read_pbx(byte);

    /* joystick always pulls low, even if high output, so no
       masking with DDRA */
    /*return ((j & ~(via_context->via[VIA_DDRA]))
        | (via_context->via[VIA_PRA] & via_context->via[VIA_DDRA]));*/
    return byte;
}
Exemplo n.º 3
0
/* read_* functions must return 0xff if nothing to read!!! */
static BYTE read_ciapb(cia_context_t *cia_context)
{
    BYTE byte;
#ifdef HAVE_RS232
    if (rsuser_enabled) {
        byte = rsuser_read_ctrl();
    } else
#endif
    byte = parallel_cable_cpu_read(DRIVE_PC_STANDARD);

    /* FIXME: in the upcoming userport system this call needs to be conditional */
    byte = userport_joystick_read_pbx(byte);
    byte = userport_rtc_read(byte);

    byte = (byte & ~(cia_context->c_cia[CIA_DDRB])) | (cia_context->c_cia[CIA_PRB] & cia_context->c_cia[CIA_DDRB]);
    return byte;
}
Exemplo n.º 4
0
/* read_* functions must return 0xff if nothing to read!!! */
static BYTE read_ciapb(cia_context_t *cia_context)
{
    BYTE byte = 0xff;

    if (machine_class == VICE_MACHINE_CBM5x0) {
        byte = ((0xff & ~(cia_context->c_cia[CIA_DDRB]))
                | (cia_context->c_cia[CIA_PRB] & cia_context->c_cia[CIA_DDRB]))
               & ~((joystick_value[1] & 0x0f)
                   | ((joystick_value[2] & 0x0f) << 4));
    } else {
        /* FIXME: in the upcoming userport system this call needs to be conditional */
        byte = userport_joystick_read_pbx(byte);

        byte &= ((0xff & ~(cia_context->c_cia[CIA_DDRB]))
                 | (cia_context->c_cia[CIA_PRB] & cia_context->c_cia[CIA_DDRB]));
    }
    return byte;
}
Exemplo n.º 5
0
BYTE cia2_read(WORD addr)
{
    BYTE retval = 0xff;

    if ((addr & 0x1f) == 1) {
        /* FIXME: in the upcoming userport system this call needs to be conditional */
        retval = userport_joystick_read_pbx(retval);

        if (ps2mouse_enabled) {
            retval &= (ps2mouse_read() | 0x3f);
        }
        if (c64dtv_hummer_adc_enabled) {
            retval &= (hummeradc_read() | 0xf8);
        }
        return retval;
    }

    /* disable TOD & serial */
    if (((addr & 0xf) >= 8) && ((addr & 0xf) <= 0xc)) {
        return 0xff;
    }

    return ciacore_read(machine_context.cia2, addr);
}