4Fermer6
Mega ShockedLe 22/10/2016 à 21:48
Hi HPMAN!

Sprites now jiving with Pals sun sun Many thanks for helping me out on this one.

In the end adding by 1 got the palette data I was looking for!

I was looking to reduce the number of lines of code and to eliminate the Image Catalog.s files (Created independent .s files for pictures, scrollers, and sprites)
I imagine the Image Catalogs must have an overhead associated with them?

This......
aSpriteInit(&BOX, (spriteInfo*)BOX1,1,16,0,0,0,0);palJobPut(16,1,((paletteInfo*)Box1_Palettes+1));

Reads nicer and has one less line of code than this....(My basic thinking)
volMEMWORD(0x2ffff0)=Sprites[Box].bank;
aSpriteInit(&BOX1,Sprites[Box].sprInfo,1,16,0,0,0,0);palJobPut(16,((paletteInfo*)Sprites[Box].palInfo)->palCount,&((paletteInfo*)Sprites[Box].palInfo)->data);

I quickly realized that call model 1 above relies on the defined values not changing!
#define BOX1 0x00001234#define BOX1_Palettes 0x00004567

As soon as I add a graphic to the middle of the chardata.xml list or modify the size of an existing graphic it is GAME OVER skull
because all of the defined values in bank0map.s will change making the defines I laid out useless tripaf

So now I am faced with the same question. Is Image Catalogs the best way to go when using the banked model?

On one hand I say yes because I can play with the chardata.xml file and catalog won't budge as long my gfx naming convention remains the same.
On the other hand there is the concern that an image catalog for this purpose helps bloat the program code (additional line of code seen above + code for the catalog + what ever resources the catalog needs to exist when the program is running)

Any insight on this one would be greatly appreciated sorry for the basic-ness here.

**Note I added an additional step above in the initial post just to demonstrate the proper struct needs to be added to the program code for the image catalog to work.
I followed what HPMAN did with pictures in the initial example and applied to sprites.