#19998 - CyberSlag5k - Thu Apr 29, 2004 4:38 pm
This is just a thought I just had, but can you reload a palette? I know you can only have one 256 color palette for sprites, but couldn't you change it? Just reload the data for a different group of sprites, providing you weren't currently showing the old ones? The old ones would have their colors screwed up but as long as they're off screen it wouldn't matter. So is it doable?
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
#19999 - niltsair - Thu Apr 29, 2004 4:44 pm
Yes, you can reload it anytime you want. For example if your sprites are always separated by the middle of the screen, you could have 1 palette frop top sprites, and a second one for the botto part that you reload 2 times per screen refresh (middle/end).
_________________
-Inside every large program is a small program struggling to get out. (Hoare's Law of Large Programs)
-The man who can smile when things go wrong has thought of someone he can blame it on. (Nixon's Theorem)
#20003 - poslundc - Thu Apr 29, 2004 7:03 pm
niltsair wrote: |
Yes, you can reload it anytime you want. For example if your sprites are always separated by the middle of the screen, you could have 1 palette frop top sprites, and a second one for the botto part that you reload 2 times per screen refresh (middle/end). |
Note, however, that there isn't enough time in the HBlank interval to swap an entire 256 colour palette without getting some rainbowing. This has been discussed in another thread and it seems that some games do pull this off quite admirably, though, including Sonic Adventures (or some game of a similar name).
That is a fairly advanced technique, though. Most palette manipulation occurs during the VBlank period that occurs between frame redraws every 60th of a second. Using such manipulation you can do all sorts of things from fading to simulating some kinds of fluid animation. You can also do palette-swaps to create "families" of sprites eg. stronger enemies that look basically the same but are distinguished by a different skin-tone than their weaker counterparts. (This seems to be the kind of thing you're interested in.)
Dan.
#20006 - CyberSlag5k - Thu Apr 29, 2004 8:42 pm
Awsome. Thanks.
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...