Skip to content
Marcuss2 edited this page Dec 24, 2017 · 18 revisions

sync

sync [toCart=true]

0.60 changes:

sync [mask = 0 bank = 0 tocart = false]
you can use sync to switch memory bank in Runtime (one time per frame)

Parameters:

  • toCart : true - to move sprites/map/sound from runtime to cart, false - to restore data from cart (can be useful to reset all the data)

sprite/map data restores on every startup. Call sync() api to save sprite/map data modified during runtime.

In older versions of TIC-80, calling this function was not required to save runtime map and sprite data. Sync should be called any time changes to the sprites and map are made during runtime if you'd like the changed to be applied.

Parameters (0.60):

  • mask : mask of sections you want to switch:
tiles   = 1<<0 -- 1
sprites = 1<<1 -- 2
map     = 1<<2 -- 4
sfx     = 1<<3 -- 8
music   = 1<<4 -- 16
palette = 1<<5 -- 32

0 - will switch all the sections
1 | 2 | 4 - will switch tiles, sprites and map sections for example

  • bank : memory bank, can be 0...7, code from all memory banks is put together automatically.
  • toCart : true - to move sprites/map/sound from runtime to cart, false - to restore data from cart (can be useful to reset all the data)
Clone this wiki locally