I’m curious if debounce logic has ever been shared. I notice a difference between B/W, Stern, and JJP when compared to Spooky and Heighway. I brought this up recently with Fawzma (Rob Zombie programmer) on his facebook page, and he said:
Game is going and the tilt bob triggers.. tilt warning appears and a 3 second timer starts. If the title swings around and hits, you won't get a tilt while that timer is running. When that timer runs out and the tilt triggers again, you get a 2nd warning, and another 3/5 second grace period. 3rd hit is a tilt/drain.In AMH, the code (open source) is a bit different I think, depending on cycle timer::
int cabSwitch(unsigned char switchGet) { //Read a dedicated switch. If switch is on and debounce is off, returns a 1, else 0
if (cabStatus[switchGet] == cabRampDBTime[switchGet] and cabDebounce[switchGet] == 0) { //Has switch been on for its minimum time, and has debounce reset?
if (cabStatus[switchGet] == cabRampDBTime[switchGet] and cabDebounce[switchGet] == 0) { //Has switch been on for its minimum time, and has debounce reset?
cabDebounce[switchGet] = cabDBTime[switchGet]; //Set switch timer to its standard debounce from the table
return 1; //Return value of switch bit. The only way 1 will be returned is if Debounce has reset.
}
else {
return 0; //If timer not yet reset, return a 0.
}
unsigned short cabDBTime’ = {200, 200, 200, 200, 200, 200, 200, 200, //unused, Door, User0, RFlip, LFlip, Menu, Enter, Coin
18000, 2500, 7500, 200, 200, 5000, 7500, 200,}; //Tilt, ghostOpto, doorOpto, unused, Start, ghostOpto, doorOpto, unused
This explains pretty well what I’ve seen - is that the way the others do it? Other pins FEEL different so my guess is no, and that it might have something to do with the rate of the switch registering, but not sure.