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; } }
static void io_add_direct_switches (IOPTR addr, U8 switchno) { io_add_ro (addr, io_mem_reader, sim_switch_matrix_get () + (switchno / 8)); }