2 Skelton for retropc emulator
4 Author : Takeda.Toshiya
12 void LS393::write_signal(int id, uint32_t data, uint32_t mask)
14 bool signal = ((data & mask) != 0);
15 if(prev_in && !signal) {
16 int prev_count = count++;
17 for(int i = 0; i < 8; i++) {
18 if(outputs[i].count) {
20 if((prev_count & bit) != (count & bit)) {
21 uint32_t val = (count & bit) ? 0xffffffff : 0;
22 write_signals(&outputs[i], val);
30 #define STATE_VERSION 1
32 void LS393::save_state(FILEIO* state_fio)
34 state_fio->FputUint32(STATE_VERSION);
35 state_fio->FputInt32(this_device_id);
37 state_fio->FputUint32(count);
38 state_fio->FputBool(prev_in);
41 bool LS393::load_state(FILEIO* state_fio)
43 if(state_fio->FgetUint32() != STATE_VERSION) {
46 if(state_fio->FgetInt32() != this_device_id) {
49 count = state_fio->FgetUint32();
50 prev_in = state_fio->FgetBool();