Log In  


I have looked around but been unable to find anything that clearly describes how best to utilise the colour table features of Picotron. I may just have missed it so if you know of a good resource please feel free to redirect me!

So I was looking into the colour tables and from what I know so far, its a lookup table that describes which colour to use when colouring a pixel. By default I know that drawing over a colour with another (drawing red over blue for example) will just result in the new colour being placed, replacing the previous colour (so the pixel is now red in my example).

I know that other colour blending techniques could take advantage of this, however I cant seem to figure out how to modify the values in the table. In a game I'm working on for example I would like to be able to draw a 'shadow' that is essentially just an oval using a predefined 'shadow colour', and it would darken each pixel it draws over by 1 'unit'.

I suspect I would need to alter the values for the shadow colours 'row ' or 'column' in the colour table so it returns a different value but figuring out how is a mystery!

I appreciate any tips or tutorials anyone comes up with!



1

A 64x64 sprite is actually the perfect way to represent and modify a color table. Doing get_spr(n) gets you a 64x64 u8 userdata. The best way to actually use that color table is to memmap it to one of the color table addresses. It's basically free, because it doesn't modify the underlying memory, and once you unmap it it goes back to Picotron's default behavior without having to store the original color table.

If you do end up making a sprite, keep in mind that the gfx editor doesn't give you any control over the two high bits, so you may need to deliberately set them in code if you're doing masking effects.


So with this example I could visually draw the 64x64 table showing the colours you would get from drawing over the top of another colour?

am I right in thinking the x axis is the colour of the pixel you are drawing to, and the y axis is the colour you are printing with? pretty sure I read it worked like that somewhere but cant seem to find where now haha


1

@SquishyChs https://www.lexaloffle.com/dl/docs/picotron_gfx_pipeline.html has this snippet:
out_col = peek(0x8000+coltab*0x1000 + draw_col*64 + target_col), where draw_col is the colour you're drawing, and target_col is the colour at the target position. This tells us that x is the target colour and y is the draw colour.


1

I did a little guide with Washburnello`s help, hope it helps! Color Tables in Picotron


1

Ooh thank you all! taxicomics this guide looks like it will be incredibly useful! I'm out at the moment but will be going through this when I get a chance!



[Please log in to post a comment]