Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Palattes #27

Open
wthorch42 opened this issue Jan 29, 2024 · 3 comments
Open

Palattes #27

wthorch42 opened this issue Jan 29, 2024 · 3 comments

Comments

@wthorch42
Copy link

Hi, Ian,

I have a question. How would I go about creating a new palette or adjusting an existing one? I think the VIC20 Lumacode palette needs just a touch of tweaking, but I don't know how to do it. I looked through the documentation, but didn't see anything. I also tried looking through the file system on the SD card and didn't see any obvious place where the palettes were defined. Is this something you have to do before compiling a new release or is it something an amateur like myself can do?

Thanks
Todd

@IanSB
Copy link
Owner

IanSB commented Feb 5, 2024

@wthorch42
The palettes are generated programmatically on first boot and then stored in /palettes on the SD card.
You can then edit those files or create additional custom palette files that you could manually select from the palette menu:

Each palette file contains 257 32 bit words with the first 256 being the palette colours and the last one being the number of entries that are used by the current palette.

Each palette colour word contains the following 4 bytes in order:
Red value 0-255
Green value 0-255
Blue value 0-255
Mono value 0-255 (used in mono mode)

Generally when less than 256 colours are defined the values should repeat to fill the 256 entries
(this is not actually necessary but ensures there is something valid in those entries.

So for a VIC20 custom palette file you would put the RGBM values in the first 16 words, repeat that 15 more times and put 0x10, 0x00, 0x00, 0x00 at the end.

Note the colour order is not the standard VIC20 order but you can use this table to work out the order:
{0, 6, 2, 4, 9, 11, 12, 3, 8, 14, 15, 7, 5, 10, 13, 1}
i.e.
palette entry 0 is VIC colour 0
palette entry 1 is VIC colour 6
palette entry 2 is VIC colour 4
...
palette entry 15 is VIC colour 1

If you get something that looks better, please post the values.

@wthorch42
Copy link
Author

wthorch42 commented Feb 8, 2024 via email

@IanSB
Copy link
Owner

IanSB commented Feb 8, 2024

@wthorch42

I haven’t had a chance to do a side-by-side comparison, but give this a try.

If you attached a file to your email reply it was not included in the github thread so you will have to view the thread and post it directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants