void wpc_write (void *unused, unsigned int addr, U8 val) { switch (addr) { #if (MACHINE_WPC95 == 1) case WPC95_FLIPPER_COIL_OUTPUT: sim_sol_write (32, &sim_sols[4], val); #elif (MACHINE_FLIPTRONIC == 1) case WPC_FLIPTRONIC_PORT_A: sim_sol_write (32, &sim_sols[4], ~val); #endif break; case WPC_GI_TRIAC: /* The input side of the triac has a latch; store only the G.I. related bits there */ linux_triac_latch = val & PINIO_GI_STRINGS; /* The outputs are comprised of whatever GI strings are already on, plus whatever outputs (GIs and relays) were just written. */ val |= linux_triac_outputs; sim_triac_update (val); break; #if (MACHINE_ALPHANUMERIC == 1) case WPC_ALPHA_POS: sim_seg_set_column (val); break; case WPC_ALPHA_ROW1: sim_seg_write (0, 0, val); break; case WPC_ALPHA_ROW1+1: sim_seg_write (0, 1, val); break; case WPC_ALPHA_ROW2: sim_seg_write (1, 0, val); break; case WPC_ALPHA_ROW2+1: sim_seg_write (1, 1, val); break; #endif #if (MACHINE_PIC == 1) case WPCS_PIC_WRITE: simulation_pic_access (1, val); #else case WPC_SW_COL_STROBE: if (val != 0) sim_switch_data_ptr = sim_switch_matrix_get () + 1 + scanbit (val); #endif break; } }
U8 wpc_read (void *unused, unsigned int addr) { switch (addr) { #if (MACHINE_PIC == 1) case WPCS_PIC_READ: return simulation_pic_access (0, 0); #else case WPC_SW_ROW_INPUT: return *sim_switch_data_ptr; #endif #if (MACHINE_WPC95 == 1) case WPC95_FLIPPER_SWITCH_INPUT: return ~sim_switch_matrix_get ()[9]; #elif (MACHINE_FLIPTRONIC == 1) case WPC_FLIPTRONIC_PORT_A: return ~sim_switch_matrix_get ()[9]; #endif default: return 0; } }