Open mikelatiolais opened 5 years ago
Update: core.c /---------------------- / Set/reset a switch /-----------------------/ void core_setSw(int swNo, int value) { if (coreData->sw2m) swNo = coreData->sw2m(swNo); else swNo = (swNo/10)8+(swNo%10-1); //fprintf(stderr,"\nPinmame switch %d",swNo); coreGlobals.swMatrix[swNo/8] &= ~(1<<(swNo%8)); / clear the bit first */
if (coreGlobals.p_rocEn) {
coreGlobals.swMatrix[swNo/8] |= ((value ? 0xff : 0) ^ 0) & (1<<(swNo%8));
} else {
coreGlobals.swMatrix[swNo/8] |= ((value ? 0xff : 0) ^ coreGlobals.invSw[swNo/8]) & (1<<(swNo%8));
}
}
/------------------------- / update active low/high /-------------------------/ void core_updInvSw(int swNo, int inv) { int bit; if (coreData->sw2m) swNo = coreData->sw2m(swNo); else swNo = (swNo/10)*8+(swNo%10-1); bit = (1 << (swNo%8));
if (inv) inv = bit; if ((coreGlobals.invSw[swNo/8] ^ inv) & bit) { coreGlobals.invSw[swNo/8] ^= bit; coreGlobals.swMatrix[swNo/8] ^= bit; } }
wpc.c static SWITCH_UPDATE(wpc) {