Skip to content
TimotheeGreg edited this page May 7, 2023 · 6 revisions

BPP (Bits Per Pixel)

bpp us

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)

NOTE


  • 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

Address List


Use this address VRAM: 0x3FFC - Blit Segment

  • Required using poke() and poke4()

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

BPP Examples


4 Bit:

image

image

2 Bit:

image

image

1 Bit:

image

image

Usage Example


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()

alt

This also works with font(); you can use 1bpp mode to draw your spritesheet, then simply call set1bpp() before calling font().

Links


More information on Bits Per Pixel

Clone this wiki locally