a bank is just a piece of memory..
bla=CreateBank(1000)
now you have 1000 bytes of memory for you to abuse.. (to store variables/large maps etc.)
A bank is the way to make your own commands that look like normal blitz commands, instead of types that look like types.
See the help for CreateBank, PokeByte, PeekByte, PokeShort, PeekShort, PokeInt, PeekInt, PokeFloat, PeekFloat, BankSize, ResizeBank and FreeBank.
for maps, instead of storing 1 byte per maptile in a 2d array like this: dim map(100,100)
you could use a bank, like this: map=CreateBank(100*100)
in this case:
memlocation 0..99 equals x:0..99 / y:0
memlocation 100..199 equals x:0..99 / y:1
memlocation 200..299 equals x:0..99 / y:2
etc.
however, only when you use bytes.. if you use shorts (=2 bytes) then you need a bank twice this size and then:
memlocation 0..199 step 2 equals x:0..99 / y:0
memlocation 200..399 step 2 equals x:0..99 / y:1
etc.
bla=CreateBank(1000)
now you have 1000 bytes of memory for you to abuse.. (to store variables/large maps etc.)
A bank is the way to make your own commands that look like normal blitz commands, instead of types that look like types.
See the help for CreateBank, PokeByte, PeekByte, PokeShort, PeekShort, PokeInt, PeekInt, PokeFloat, PeekFloat, BankSize, ResizeBank and FreeBank.
for maps, instead of storing 1 byte per maptile in a 2d array like this: dim map(100,100)
you could use a bank, like this: map=CreateBank(100*100)
in this case:
memlocation 0..99 equals x:0..99 / y:0
memlocation 100..199 equals x:0..99 / y:1
memlocation 200..299 equals x:0..99 / y:2
etc.
however, only when you use bytes.. if you use shorts (=2 bytes) then you need a bank twice this size and then:
memlocation 0..199 step 2 equals x:0..99 / y:0
memlocation 200..399 step 2 equals x:0..99 / y:1
etc.