Images palette question

Prince of Persia related subjects that do not have their own boards.
Post Reply
Nico
Efendi
Efendi
Posts: 15
Joined: January 26th, 2009, 3:11 am

Images palette question

Post by Nico »

Hi, There is something I don't understand about the color palettes of the images. How is it possible that some images have a certain palette and other have a completly different palette and yet both images are shown on the same screen perfectly.

How can you achieve this?
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Re: Images palette question

Post by poirot »

vga game supports 320x200 in 256 colors. Due to format restrictions and to save memory (remember the game was created by the end of the 80's), each image is able to use only a 16-color palette. The game has different active palettes at the same time:

- the built-in palette, used for background, texts, potion palette. Editable with cuspop
- the main environment palette (changes with the environment). Editable with PR.
- the second environment palette use only in the plain wall tile (also changes with the environment). Editable with PR.
- the guard palette (that's one of the reasons there can only be one guard per screen). Editable in a binary resource extractable with PR and specified in FormatSpecifications.
- The kid palette (used for our guy, his shadow, the skeleton, the lives and the mouse)
- The pv palette, used for the torches, princess and Jaffar (not sure about that it's been a long time).

so, as you can see each palette has 16 colors, we can add up to 16 different palettes at one time. A very big disadvantage is that colors may be repeated, for example orange in the torch and a guard may be repeated, but there is no solution for that. In fact that's the reason why mouse, skeleton and kid shares palettes: to save some palette space for the common white.

Edit: mickey correction
Nico
Efendi
Efendi
Posts: 15
Joined: January 26th, 2009, 3:11 am

Re: Images palette question

Post by Nico »

Hi poirot,
So, there are multiple palettes active at the same time, right? how can you do this? I've been trying to find an example of this but I couldn't find any. Can you show me an example?

Thanks!
User avatar
mickey96
Beylerbey
Beylerbey
Posts: 70
Joined: November 29th, 2008, 2:19 pm
Location: Nairobi, Kenya
Contact:

Re: Images palette question

Post by mickey96 »

poirot wrote:vga game supports 32'x240 in 256 colors.
Correction: VGA game supports 320x200 in 256 colors.
Refueled my car! Now I can keep going!
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Re: Images palette question

Post by poirot »

Nico wrote:Hi poirot,
So, there are multiple palettes active at the same time, right? how can you do this? I've been trying to find an example of this but I couldn't find any. Can you show me an example?

Thanks!
define "example". You need a C code to see how to handle VGA graphics or an example of this in POP1?
Post Reply