Discussion

IDEA load palette

0

moechofe 2019-01-31 09:00

This would be usefull to have multiple palette in the FILE 1 and a function that help reload the colors.

Actually putting more data in the FILE 1 will result in black screen at program launch.


Timo 2019-01-31 17:32

To load colors you can just use the COPY command. It's a bit low-level, but I don't want to add too many commands for "advanced" features.
Anyway, don't know why the screen is black with more data, I'll check it.


was8bit 2019-02-01 02:08

I verified it.. I copied color data and pasted again so the data was doubled... when I then ran the program, everything was black ... then I noticed that my color 0 (palette 0) was black... editing and saving the colors restores the data lines to two lines again (it deletes the extra data)

I did a test, and tried making the background different colors, copy paste to double the data, then ran again., I discovered that different colors for color 0 causes different issues... some kills one or the other background... some kill all sprites, some seem to mix chacters around (ones I made but haven't used where then showing up), etc..

I didn't log which color 0 caused what issue.... I can get it logged if you need help with it :)


was8bit 2019-02-01 02:18 (Edited)

@moechofe...

Colors here are easy... color=16*RED+4*GREEN+BLUE where any color is 0-3 you could store your color palette sets into a database and load them anytime with
PALETTE n,[c0],[c1],[c2],[c3]

So...

DIM PAL(2,7,3) would hold 3 sets of palettes (except color 0 as there is only one color 0 for the entire set, i would set that seperately as PALETTE 0,#,,,

FOR ISET=0 TO 2
FOR IPAL=0 TO 7
FOR ICOL=1 TO 3
READ PAL(ISET,IPAL,ICOL)
NEXT ICOL
NEXT IPAL
NEXT ISET

DATA 1,1,1, 2,2,2, 3,3,3, 4,4,4, 5,5,5, 6,6,6, 7,7,7, 8,8,8
DATA 11,11,11, 12,12,12, 13,13,13, 14,14,14, 15,15,15, 16,16,16, 17,17,17, 18,18,18
DATA 21,21,21, 22,22,22, 23,23,23, 24,24,24, 25,25,25, 26,26,26, 27,27,27, 27,27,27

Would set up your 3 sets of palettes....


was8bit 2019-02-01 02:22

ISET=1
FOR IPAL=0 TO 7
PALETTE IPAL,,PAL(ISET,IPAL,1),PAL(ISET,IPAL,2),PAL(ISET,IPAL,3)
NEXT IPAL

Would load a palette set for your game to use :)


was8bit 2019-02-01 02:25

Of course, my data base is generic, yours would hold different numbers, not repeat the same colors...


was8bit 2019-02-01 02:27

I often change a single color on the fly during a game as a way to "animate" something ... it's super easy :)


was8bit 2019-02-01 02:41

... you may already know this, but this shows how easy to create "animation" via quick color changes... :)

https://lowresnx.inutilis.com/topic.php?id=275


was8bit 2019-02-01 03:06

You may find it easier to POKE the color change directly into memory.. like this demonstrates ...

https://lowresnx.inutilis.com/topic.php?id=277


moechofe 2019-02-01 11:32

The COPY solution cost less token, but thank you for idea anyway :)


was8bit 2019-02-01 15:33

I've always been one who likes to consider as many possibilities :)


Timo 2019-02-01 17:25

Ok, got it. The startup sequence copies the whole ROM entry into the color registers, ignoring its size. So if it's bigger than 32 bytes, it just overwrites the following registers, too. I fixed it for the next release.


was8bit 2019-02-01 18:03

Coolio :)


Log in to reply.