Constants and limits¶
Constants at a glance¶
pad.* |
twelve buttons, see the table in pad |
gfx.FLIP_H gfx.FLIP_V |
1, 2, flags of gfx.sprite |
gfx.TILE_FLIP_H gfx.TILE_FLIP_V |
0x400, 0x800, tile map entries |
gfx.TILE_FONT16 gfx.TILE_FONT8 gfx.TILE_BLOCK |
704, 960, 963, the system tiles |
gfx.TRANSPARENT … gfx.BEHIND |
0..5, modes of gfx.effect |
phy.PX |
65536, the unit of Q16.16 fixed point |
phy.MASK phy.GRAVITY |
actor flags |
phy.LEFT phy.RIGHT phy.UP phy.DOWN |
contacts of phy.touch |
sys.TOUR |
1024, one full turn for sys.sin |
The gfx constants are described in gfx, the phy ones in phy, sys.TOUR in sys.
The limits the console imposes¶
| display list | 256 entries per frame |
| art pool | 320 KiB, pages of 64 bytes; 16 loads and 96 KiB per frame |
| library (the bundle's art) | 2 MiB in the simulator; the NOR flash of RP2 holds 16 |
| bitmaps | 1,024, system fonts included; 12 palettes, 16 backgrounds |
| compositing budget | 16,000 cycles per scanline; beyond, the line is displayed stale |
| tile map | 256 × 128 tiles; window 128 × 64; 624 bytes of writes per frame |
| actors | 256 |
| animations | 64, of 32 images each |
| contacts per frame | 256 |
| collision mask | 64 KiB |
| Lua heap | 384 KiB |
| instructions per call | 200,000, _update() and _draw() separately |
These bounds are not whims: they are those of the hardware, measured on the board, or of RP1's SRAM budget. Exceeding one is reported with a number rather than discovered on screen. The display list, the pool, the library and the tile map are described in gfx; actors, animations, contacts and the collision mask in phy.