extern unsigned char bgm0, bgm0_end, p0, p0_end, t0, t0_end;
extern unsigned char bgm1, bgm1_end, p1, p1_end, t1, t1_end;
extern unsigned char bgm2, bgm2_end, p2, p2_end, t2, t2_end;
extern unsigned char bgm3, bgm3_end, p3, p3_end, t3, t3_end;
short sxbg1 = 0, sxbg2 = 0, sxbg3 = 0, flip = 0;
int main(void)
{
bgInitTileSet(0, &t0, &p0, 0, (&t0_end - &t0), 8, BG_4COLORS0, 0x2000);
bgInitTileSet(1, &t1, &p1, 0, (&t1_end - &t1), 8, BG_4COLORS0, 0x3000);
bgInitTileSet(2, &t2, &p2, 0, (&t2_end - &t2), 8, BG_4COLORS0, 0x4000);
bgInitTileSet(3, &t3, &p3, 0, (&t3_end - &t3), 16, BG_4COLORS0, 0x5000);
bgInitMapSet(0, &bgm0, (&bgm0_end-&bgm0), SC_32x32, 0x0000);
bgInitMapSet(1, &bgm1, (&bgm1_end-&bgm1), SC_32x32, 0x0400);
bgInitMapSet(2, &bgm2, (&bgm2_end-&bgm2), SC_32x32, 0x0800);
bgInitMapSet(3, &bgm3, (&bgm3_end-&bgm3), SC_32x32, 0x0C00);
while (1)
{
flip++;
if (flip == 3)
{
flip = 0;
sxbg3++;
sxbg2 += 2;
sxbg1 += 3;
}
}
return 0;
}
void bgSetScroll(u8 bgNumber, u16 x, u16 y)
Sets the scroll hardware to the specified location.
void bgInitMapSet(u8 bgNumber, u8 *mapSource, u16 mapSize, u8 sizeMode, u16 address)
Initializes a Map Set and loads it into SNES VRAM.
void bgInitTileSet(u8 bgNumber, u8 *tileSource, u8 *tilePalette, u8 paletteEntry, u16 tileSize, u16 paletteSize, u16 colorMode, u16 address)
Initializes a Tile Set and Loads the Tile GFX into VRAM.
void consoleInit(void)
Initialize console.
void WaitForVBlank(void)
Wait for vblank interrupt
the master include file for snes applications.
void setScreenOn(void)
Put screen On.
void setMode(u8 mode, u8 size)
Set the SNES hardware to operate in new display mode.