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; datasette_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; datasette_toggle_write_bit((~pport.dir | pport.data) & 0x8); } pport.dir_read = pport.dir; }
static void store_pb(tpi_context_t *tpi_context, BYTE byte) { if ((byte ^ tpi_context->oldpb) & 0x40) datasette_set_motor(!(byte & 0x40)); if ((byte ^ tpi_context->oldpb) & 0x20) datasette_toggle_write_bit(byte & 0x20); }
static void store_prb(via_context_t *via_context, BYTE byte, BYTE myoldpb, WORD addr) { if ((addr == VIA_DDRB) && (via_context->via[addr] & 0x20)) { log_warning(via_context->log, "PET: Killer POKE! might kill a real PET!\n"); } parallel_cpu_set_nrfd((BYTE)(!(byte & 0x02))); parallel_cpu_set_atn((BYTE)(!(byte & 0x04))); if ((byte ^ myoldpb) & 0x8) { datasette_toggle_write_bit((~(via_context->via[VIA_DDRB]) | byte) & 0x8); } }
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; datasette_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; datasette_set_motor(!old_port_data_out); } }