-
-
Notifications
You must be signed in to change notification settings - Fork 492
Advanced Drawing Techniques
Skeptim edited this page Apr 10, 2024
·
13 revisions
poke4(2*0x03FF0 + color_index, mapped_color_index)
+-------+-------------------+-------+
| ADDR | INFO | SIZE |
|-------+-------------------+-------|
| 00000 | SCREEN | 16320 | 240x136 = 32640 4bit pixels
| 03FC0 | PALETTE | 48 | 16 x 24bit RGB color values
| 03FF0 | PALETTE MAP | 8 | 16 x 4bit color indexes (for palette swapping of individual sprites)
+-------+-------------------+-------+
TIC-80 uses PALETTE MAP
to swap 4 bits colors indices to be drawn to any combination of 4 bits colors in the palette. The mapped 4 bits color is written on SCREEN
.
With sprite-drawing functions (spr
, map
, ttri
), this color swap is done when reading the color from sprite memory.
colorkey
parameters are applied on source colors, swapping out color indices before remapping.
Please see Blit Segment.
TIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
Platform
RAM & VRAM | Display | Palette | Bits per Pixel (BPP) |
.tic
Format | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
- BDR (0.90)
- BOOT (1.0)
- MENU
- OVR (deprecated)
- SCN (deprecated)
- TIC
- btn & btnp
- circ & circb
- clip
- cls
- elli & ellib (0.90)
- exit
- fget & fset (0.80)
- font
- key & keyp
- line
- map
- memcpy & memset
- mget & mset
- mouse
- music
- peek, peek4
- peek1, peek2 (1.0)
- pix
- pmem
- poke, poke4
- poke1, poke2 (1.0)
- rect & rectb
- reset
- sfx
- spr
- sync
- ttri (1.0)
- time
- trace
- tri & trib (0.90)
- tstamp (0.80)
- vbank (1.0)