/* read_* functions must return 0xff if nothing to read!!! */ static BYTE read_ciapb(cia_context_t *cia_context) { BYTE byte = 0xff; byte = read_userport_pbx(0x1f, byte); /* The functions below will gradually be removed as the functionality is added to the new userport system. */ #if defined(HAVE_RS232DEV) || defined(HAVE_RS232NET) if (rsuser_enabled) { byte = rsuser_read_ctrl(byte); } else #endif byte = parallel_cable_cpu_read(DRIVE_PC_STANDARD, byte); byte = (byte & ~(cia_context->c_cia[CIA_DDRB])) | (cia_context->c_cia[CIA_PRB] & cia_context->c_cia[CIA_DDRB]); return byte; }
BYTE pio1_read(WORD addr) { BYTE pio1_value = 0xff; /* Correct clock */ ted_handle_pending_alarms(0); /* The functions below will gradually be removed as the functionality is added to the new userport system. */ if (drive_context[0]->drive->parallel_cable || drive_context[1]->drive->parallel_cable) { pio1_value = parallel_cable_cpu_read(DRIVE_PC_STANDARD, pio1_value); } else { pio1_value = pio1_data; } pio1_value = read_userport_pbx(0xff, pio1_value); if (tape_sense) { pio1_value &= ~4; } return pio1_value; }
BYTE cia2_read(WORD addr) { BYTE retval = 0xff; if ((addr & 0x1f) == 1) { retval = read_userport_pbx(0x1f, retval); /* The functions below will gradually be removed as the functionality is added to the new userport system. */ 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); }