Bank= Command

Bank= lets you set the default preset bank used by the Preset() function within a task so you can send several messages to different areas all with the same preset.
This change is only for the task it is in and lasts until the next time you change the default preset value.

Syntax

Say you have a chase that chases through presets within a single area, by changing the bank you can completely change the chase while actually reusing the same code over and over again. Can be set more than once within the task, i.e. can be set for the first 6 messages and then set for the next 6 messages in a 12- message-task.
The default preset parameter if left blank is 1 until changed by this command. This will send a presets with a bank of 0x00.(Preset1-8)
Can be any value from 1-256.

The task editor in System Builder has a bug and will apply any default modification commands that are skipped over by a BRA command. Essentially only the last default modification will apply.

Examples

Example 1

This task will send out the following presets, [1,2,3,5,9,10,11,13].

{
Bank=1    //Set any unspecified preset to bank 1. (1-8)
Preset(P=1)
Delay()
Preset(P=2)
Delay(1)
Preset(P=3)
Delay()
Preset(P=5)

Bank=2    //Set any unspecified preset to bank 2. (9-16)
Preset(P=1)
Delay()
Preset(P=2)
Delay(1)
Preset(P=3)
Delay()
Preset(P=5)
}

Example 2

This task looks like it should send out presets [1,2,3,5,9,10,11,13] but the SB bug will make it only ever send presets from bank 2.

{
This example will run a chase that loops through 8 presets from two different banks.

Area=2   //Set the area of all messages to 2.
Delay=2  //Set any unspecified delay to 2sec.
Fade=2   //Set any unspecified fade to 2 sec.

LoadBank0:
LDA #1
STA ~1    //Mark that we are in bank 1.
Bank=1    //Set any unspecified preset to bank 1. (1-8)
BRA Chase //Branch down and run the chase.
Null

LoadBank1:
LDA #2
STA ~1    //Mark that we are in bank 2.
Bank=2    //Set any unspecified preset to bank 2. (9-16)
BRA Chase //Branch down and run the chase.
Null

Chase:
Preset(P=1)
Delay()
Preset(P=2)
Delay(1)
Preset(P=3)
Delay()
Preset(P=5)
Delay()
LDA ~1         //Compare which loop of the chase this is.
CMP #2         //Are we in bank 2?
BRZ LoadBank0  //Then reload bank 0 and rerun the chase.
BRA LoadBank1  //If not load bank 1 and rerun the chase.
Null
...
}