Do events have (unimplemented) timers?
Do events have (unimplemented) timers?
While browsing through my leapop code, I noticed that it combines bits 3-7 of the 2nd events byte for an events timer (arEventsTimer). The code never uses this timer though. The timer appears to be either 0 or 31 (ignoring 9x other values). And 31 is used only for unused events, starting in level 4 for events 41-56. Did we ever discuss this timer on the forum? I do not recall how I even know it's a "timer", it's not documented as such in poirot's specs either.
Re: Do events have (unimplemented) timers?
It may come from the SDLPoP source?
https://github.com/NagyD/SDLPoP/blob/80 ... #L713-L722
Or from Mechner's notes for the Apple II PoP source?
https://github.com/jmechner/Prince-of-P ... #L304-L306
Or here?
viewtopic.php?p=14795#p14795
The timer bits are used for deciding if a button with this modifier should be drawn pressed or not.
https://github.com/NagyD/SDLPoP/blob/80 ... #L252-L264
It timer > 1, then the button is drawn pressed.
The timer is decremented in every frame.
https://github.com/NagyD/SDLPoP/blob/80 ... #L783-L786
What I don't know is where is it set to 31 (0x1F) which means "jammed".
https://github.com/NagyD/SDLPoP/blob/80 ... #L752-L756
Re: Do events have (unimplemented) timers?
Thanks for the guesses, but I don't think I learned about it from any of these places.David wrote: ↑January 21st, 2023, 4:38 pmIt may come from the SDLPoP source?
https://github.com/NagyD/SDLPoP/blob/80 ... #L713-L722
Or from Mechner's notes for the Apple II PoP source?
https://github.com/jmechner/Prince-of-P ... #L304-L306
Or here?
viewtopic.php?p=14795#p14795
When a guard dies on a drop button? (I didn't look at the code. Just a guess.)
Re: Do events have (unimplemented) timers?
That would be logical, but I can't find any call to set_doorlink_timer() which could to that.
I added a debug printout in animate_button(), before set_doorlink_timer(), to see if perhaps the timer decreases from 0 to -1 and causes an integer overflow.
It doesn't.
Code: Select all
word timer = get_doorlink_timer(curr_modifier) - 1;
printf("animate_button: curr_modifier = %d, timer = %d\n", curr_modifier, timer);
set_doorlink_timer(curr_modifier, timer);
Code: Select all
sbyte link_timer = get_doorlink_timer(modifier);
printf("trigger_button: modifier = %d, link_timer = %d\n", modifier, link_timer);
// is the event jammed?
if (link_timer != 0x1F) {