I am working on an Intro that has close to 200 full screen (320x224) pictures.
The pictures are compiled using DATLib and are compiled sequentially in chardata.xml.
Instead of writing a long case statement I am hoping to iterate through all 200 pictures using pointer arithmetic.
So far this line works for the picture part:. pic = ((BYTE *)pic + 1144); //I can get to the next 320x224 screen with this one!
My current problem is how to iterate to the next palette....unlike the pictures that are all 280 tiles (320x224) the palettes all have different palette counts in each palette group which makes their addresses unique...
Is there a clean way to get to the next palette group address?
I have posted my code in hopes someone could point me in the right direction!
Thanks for your time
#ifndef __INTRO_H__
#define __INTRO_H__
#include <stdio.h>
#include <stdlib.h>
#include <input.h>
#include <DATlib.h>
#include "../../externs.h"
void IntroMovie()
{
BYTE count = 0;
picture Intro;
pictureInfo * pic = &IntroBlast1;
paletteInfo * pal = &IntroBlast1_Palettes;
initGfx();
backgroundColor(0x0000); //BG color
pictureInit(&Intro, pic,1, 1, 0, 0, 0);
palJobPut(1,pal->palCount,&pal->data);
SCClose();
while (1)
{
waitVBlank();
count++;
if (count == 5)
{
frameNum++;
pic = ((BYTE *)pic + 1144);//This line works next 320 x 224 tile group
pal = ((BYTE *)pal + (pal->palCount * 2)+2) ; //This Line does not output the correct palette entry-- Trying to move to the next palette entry
if ((DWORD)pal &1) pal = ((unsigned char *)pal)+1; //This Line does not output the correct palette entry -- Trying to move to the next palette entry
pictureInit(&Intro, pic,1, 1, 0, 0, 0);//Render next picture (works A-OK)
palJobPut(1,pal->palCount,pal->data);//Render next palette group (I am lost here)
count=0;
}
SCClose();
}
}
#endif