Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit) (+1)

The spritesheet isn't a 128x128 image in the memory, it's 256 consecutive 8x8 4 bit sprites

So, to set/get pixels to the spritesheet try to use these functions

function sset(x,y,c)
    local addr=0x4000+(x//8+y//8*16)*16 -- get sprite address
    poke4(addr*2+x%8+y%8*8,c) -- set sprite pixel
end
function sget(x,y)
    local addr=0x4000+(x//8+y//8*16)*16 -- get sprite address
    return peek4(addr*2+x%8+y%8*8) -- get sprite pixel
end

edit:

added the functions to snippets https://github.com/nesbox/tic.computer/wiki/Code-examples-and-snippets#setget-spritesheet-pixel

Thank you! Btw awesome work on this project!