WOW! Now I understand the difference perfectly.
Thanks a million alrado for all your help and time in this!
It is exactly what I was looking for! Cannot thank you enough :)
So basically using 2-bit instead of 4-bit sprites does not make any difference in the number of sprites you have available. The number is always 512 (256 FG + 256 BG).
If you want more sprites, you can use the LZW compression and compress a sprite sheet as a string of text. Is that correct?
Thanks a lot. I understand better now.
However, in the beginning you have this:
You are using address 49152 (0xC000). Any reason behind this please?
Also, how does this example give me space for more sprites other than the 256 in the sprite editor? (excluding background tiles)
Thanks a real lot for your time in this alrado. I really appreciate and that is exactly what I was referring to.
However I do not think I am understanding the technique you used.
In the FG I see 5 sprites with pixels of all colours. What are those? When I removed them and ran the cartridge, nothing was displayed.
And you used the BG to draw your sprites. Why?
I guess if you use the sprite editor, you are still limited to 256 sprites and 256 tiles right? How does this give us 512 sprites instead of 256?
And why are there 2 sets of sprites on screen? It is as if the whole BG area is being output as well and then the sprite at 50,50.
Excuse my lack of experience in this but I am asking to learn.
If you can find some time to add a little more comments, that would be great.
Thanks once again for your time and well done for the cartridge.
Thanks for your reply alrado.
I understand that poke4 puts 1 pixel while poke puts 2 pixels
However how can you draw 2-bit (not 4-bit) sprites using poke4 please? Like the original NES sprites.
I was told by TIC support that if you use 2-bit sprites you gain an extra 512 sprites.
I would like to know how to use 0x4000 to store the 2-bit sprites and then store the 4-color palette maybe in map region 0x8000 as I was told.
I also saw your example of LZW-compressor. With 2 images it takes 16K of code. That is why I would like to use 2-bit if possible.
Imagine using 2-bit sprites with the LZW-compressor to have a lot more sprites.
An example code if possible would be great.
Thanks to all in advance for your time and help in this.
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