Update(attract mode state)

From pinHeck Wiki
Jump to: navigation, search

Update(x) sets the state of attract mode and also updates the display driver as to the current player #, which ball you're on, total numnber of players, free play and/or # of credits.

Typically you'd call Update(0) at the start of a game, and every time a player is added. You'd also call it after the end of a ball, or when switching players.

The A/V driver needs to know the total # of players so it knows how many scores to display. It needs to know the current player #, so it knows which score should appear larger. Same applies to ball # and credits. It's important to realize the PIC32 and Propeller do not share variables - the PIC32 must tell the Propeller whatever it needs to know via the A/V commands.


The set value of Update(x) controls the attract mode, see below:

Example:

Update(0);

Disables attract mode when you start a game. Now if no videos are playing, the score(s) and ball # are shown.

Update(1);

Enables attract mode and starts it at stage 1 (will take effect once any currently playing videos end).

Update(4);

Enables attract mode and jumps to stage 4 of attract mode. A few reasons you might want to use this:

If stage 4 of the attract mode says "INSERT COINS" or "PRESS START", upon detecting a coin you'd call Update(4) so the display immediately jumps to PRESS START, and then cycles the attract mode from there.

If stage 8 of the attract mode shows the previous game's scores, after the match animation, you'd call Update(8) so attract mode is enabled and immediately jumps to the results of the game that just ended (this is what most pins do)


Keep in mind the pinHeck DMD driver is only ever doing 1 of 2 things:

1) Default action set by Update(x)

2) Running a video

"Default Action" means what the system should be doing if a video is not playing. This is also 1 of 2 things:

1) Showing the scores/ball # if a game is active.

2) Running attract mode if a game is not active.

Update(x) controls what the default action is - either showing the score (0) or attract mode (1 or higher)