BREPEAT (Command)

V1
Indications are,  in SmileBasic V1 is identical to that in V2.

V2
is a command used in conjunction with the function. It has two forms: one numerical parameter,, or three numerical parameters,. All numerical parameters are rounded down to the nearest integer.

When SmileBasic is first started,  behaves exactly as   does: when a button gets pressed, one bit of   is set for one frame, but the bit is cleared for the next frame even if the button stays down. It will remain clear for all the rest of the duration the button is down, and remain clear when it is released, and is only set again after the button is released and pressed once more. is used to alter the behaviour of.

With a positive value for, the command   will have the following effect. Say the button corresponding to  (see the table below) is pressed during frame t, and remains down for some time to follow. For the duration of frame number t+1, the corresponding bit in  is set. For every frame from t+2 to t+ inclusive, the bit is clear (if   is zero or one, there are no such frames). For frame number t+ +1, the bit is set. For frame t+ +2, the bit is clear, and remains clear until t+ + +2. Then, it is set for one frame, then clear for another  frames, then set for one frame, etc.. Once the button is released, the bit will not be set again until it is pressed again and the pattern starts over.

To express the same information in another way: for =0, those frames that have the bit set (as an offset from the first time the bit is set), are:

0, +1, 2* +2, 3* +3, etc. (until the button is released).

For &gt;0, the frames that have the bit set are:

0,,  + +1,  +2* +2,  +3* +3, etc. (until the button is released).

From this, it can be seen that the effect of = +1 is identical to the effect of  =0.

With a value of 0 for, or when   and   are omitted, then   once more functions the same as   for that button.

If,  , or   is negative, the command generates an error. The relationship between  values and buttons is as follows:

button 0 D-pad up  1 D-pad down 2 D-pad left 3 D-pad right 4 A  5 B   6 X   7 Y   8 L   9 R   10 START

It can be seen that the mask used in the  function for button   is 2undefined.

values above 12 generate an  error. The purpose of allowing the values 11 and 12 is unknown.

V3
No information on SmileBasic V3.