Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(3 edits)

Thanks for your reply.

However I still cannot understand how poke and poke4 differ.

I downloaded and tested this example:

NIBBLES_IN_SPR=8*8
SPR_SHEET_ADDR=0x4000*2
sprIx=5 
sprDataHex="a000000aa0f00f0aaaaaaaaaaafaaa6aafffaaaaaafaa6aaaaaaaaaa33333333" 
cls()
for i=1,NIBBLES_IN_SPR do
 nibble=tonumber(sprDataHex:sub(i,i),16)
 poke4(SPR_SHEET_ADDR+(NIBBLES_IN_SPR*sprIx)+i-1,nibble)
end
print("See sprite sheet, index = "..sprIx)
function TIC() end

But still the same sprite (TIC-80) logo is displayed in index 5.

Maybe someone can provide examples to show how poke4 can be used for 2-bit sprites please?

Thanks in advance

`poke4` writes nibble (half of byte, 4 bites) = pixel

`poke` writes a byte = 2 pixel

"But still the same sprite (TIC-80) logo is displayed in index 5" - there is written the contents of the string sprDataHex.
Clear the area of the sprite sheet and run the cartridge - you will see this