-
-
Notifications
You must be signed in to change notification settings - Fork 488
Bits Per Pixel
TimotheeGreg edited this page May 7, 2023
·
6 revisions
BPP is a setting in the TIC-80 Sprite Editor.
BPP Values:
- 1 Bit - (Palette of 2 colors, including transparency)
- 2 Bit - (Palette of 4 colors, including transparency)
- 4 Bit - (Palette of 16 colors, including transparency)
- Changing to lower BPP values will result in stretched out sprites.
- Changing to higher BPP values will result in Corrupted sprites.
- When pasting a sprite created with a different BPP value, the same corruptions will occur for higher and lower values respectively
Use this address VRAM: 0x3FFC
- Blit Segment
- Required using
poke()
andpoke4()
List:
0000 SYS GFX
0001 FONT
0010 4bpp BG Page 0
0011 4bpp FG Page 0
0100 2bpp BG Page 0
0101 2bpp BG Page 1
0110 2bpp FG Page 0
0111 2bpp FG Page 1
1000 1bpp BG Page 0
1001 1bpp BG Page 1
1010 1bpp BG Page 2
1011 1bpp BG Page 3
1100 1bpp FG Page 0
1101 1bpp FG Page 1
1110 1bpp FG Page 2
1111 1bpp FG Page 3
If you want to use 1 BPP setting for a sprite, first define functions to set BPP:
function set1bpp()
poke4(2 * 0x3ffc, 8) -- 0b1000
end
function set4bpp()
poke4(2 * 0x3ffc, 2) -- 0b0010
end
Call the 1 BPP function, draw your sprites, reset the drawing to 4 BPP when you are done with 1 BPP:
set1bpp()
spr(1217,x,y,0)
set4bpp()
This also works with font(); you can use 1bpp mode to draw your spritesheet, then simply call set1bpp() before calling font().
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)