here is the resource code, i have removed debug functions to simplify, but none return any errors besides currentMap returning 0 when i try to load the big map.
my metatiles are 32x32px, is there anyway i can load tileset and tilemap separated? maybe that way i could save some RAM (224x7 metatiles in this map - then i could map each metatile to individual 8x8 hardware tiles).
code:
Code: Select all
IMAGE level1a "gfx/Dark Wood Demo Foreground.png" NONE
Code: Select all
#include <genesis.h>
#include "gfx.h"
u16 allPaletteValues[64];
Map *currentMap;
void SetPalette(u16 paletteIndex, const u16* palette)
{
int loop = 0;
for (loop = 0; loop < 16; loop++)
{
allPaletteValues[loop + (paletteIndex << 4)] = palette[loop];
}
}
void FadeIn(u16 time)
{
VDP_fadeInAll(allPaletteValues, time, 1);
}
int main()
{
currentMap = unpackMap(level1a.map, NULL);
u16 index = TILE_USERINDEX;
SYS_disableInts();
VDP_loadTileSet(level1a.tileset, index, TRUE);
VDP_setMapEx(PLAN_A, currentMap, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, index), 0, 0, 0, 0, planWidth, planHeight);
SetPalette(PAL0, level1a.palette->data);
SYS_enableInts();
index += level1a.tileset->numTile;
FadeIn(10);
while (TRUE)
{
VDP_waitVSync();
}
return 0;
}