search and valid playfield

12 views
Skip to first unread message

james cardona

unread,
Jan 4, 2013, 2:54:48 PM1/4/13
to fre...@googlegroups.com
ball search is currently first started at start_ball in game.c right after ball is sent to shooter lane.  It would seem to me that this should be triggered by valid_playfield instead.  Is there any good reason not to move it there? 

I am thinking that currently the ball search timer is counting down if the player leaves the ball on the shooter lane as I have seen that ball_search_run begins like 1 or 2 seconds after the ball is fired in those cases.

Brian Dominy

unread,
Jan 4, 2013, 3:04:29 PM1/4/13
to fre...@googlegroups.com
As it is now, if a ball becomes trapped after it is ejected from the trough, but before it hits the shooter switch, the game will ball search.  This is primarily for older games where the ball could get caught on the lip of the trough release point.  The vibration from the ball search could fix it.

You are right that the timer begins to count immediately.  But it will pause as soon as the shooter is seen though.  See the test "!switch_poll_logical(MACHINE_SHOOTER_SWITCH)" in common/search.c.  Make sure you have marked your shooter switch as "shooter" in the md file otherwise this won't happen.  This matches the behavior of real WPC software, which will ball search if the shooter switch is not working.

Brian

james cardona

unread,
Jan 4, 2013, 3:53:13 PM1/4/13
to fre...@googlegroups.com, br...@oddchange.com
That makes sense.  Perhaps resetting the timer as soon as valid_playfield is set?

Brian Dominy

unread,
Jan 4, 2013, 3:56:32 PM1/4/13
to fre...@googlegroups.com
That's already happening.  See kernel/switches.c.  After set_valid_playfield() is called, we always call ball_search_timer_reset().

Brian

Reply all
Reply to author
Forward
0 new messages