adding a super quick ball save

14 views
Skip to first unread message

james cardona

unread,
Dec 25, 2012, 2:52:37 PM12/25/12
to fre...@googlegroups.com
Hi all,
one more question.  I have two targets close to the flippers that are notorious for bouncing the ball back to the drain when taken.  In the original version of the code there was a ball save that started if those switches registered.  I added that using ballsave_add_time (1); but even with that, sometimes the shot is so fast that the drain occurs before the ball save is implemented ( I think this is like a code race or something).  I was thinking of putting some switch logic check in the end_ball code that was specific to my machine but thought I would post here to see if there was a better solution first.

Brian Dominy

unread,
Dec 25, 2012, 3:14:49 PM12/25/12
to fre...@googlegroups.com
One option is to write a handler for the "ball_drain" event, which should return false if you don't want it to be considered a drain, and true otherwise.  You can do a brief sleep in that handler, then check if the targets were recently hit.

You shouldn't have to change any core OS logic, hooking into ball_drain should do the trick (that's what standard ball save does).

Great work by the way - this is really impressive what you've done.

Brian

On Tue, Dec 25, 2012 at 2:52 PM, james cardona <JAMES....@pseg.com> wrote:
Hi all,
one more question.  I have two targets close to the flippers that are notorious for bouncing the ball back to the drain when taken.  In the original version of the code there was a ball save that started if those switches registered.  I added that using ballsave_add_time (1); but even with that, sometimes the shot is so fast that the drain occurs before the ball save is implemented ( I think this is like a code race or something).  I was thinking of putting some switch logic check in the end_ball code that was specific to my machine but thought I would post here to see if there was a better solution first.



--
- Brian

james cardona

unread,
Dec 26, 2012, 8:59:06 AM12/26/12
to fre...@googlegroups.com, br...@oddchange.com
good idea!
Reply all
Reply to author
Forward
0 new messages