02-04-2026, 02:39 AM
You need to install the tile set, and then reference it in your code - the simplest way is a bit like this:
u8 iLoopX;
u8 iLoopY;
InstallTileSetAt(yourbackground,sizeof(yourbackground)/sizeof(u16),128);
for(iLoopY=0;iLoopY<14;iLoopY++)
{
for(iLoopX=0;iLoopX<11;iLoopX++)
{
PutTile(SCR_2_PLANE,0,5+iLoopX,3+iLoopY,128+((u16)iLoopY*11)+(u16)iLoopX);
}
}
This would paint a background image (14x11 in this case) on to the background scroll plane starting at (5,3) using palette 0
u8 iLoopX;
u8 iLoopY;
InstallTileSetAt(yourbackground,sizeof(yourbackground)/sizeof(u16),128);
for(iLoopY=0;iLoopY<14;iLoopY++)
{
for(iLoopX=0;iLoopX<11;iLoopX++)
{
PutTile(SCR_2_PLANE,0,5+iLoopX,3+iLoopY,128+((u16)iLoopY*11)+(u16)iLoopX);
}
}
This would paint a background image (14x11 in this case) on to the background scroll plane starting at (5,3) using palette 0

