Page 1 of 1

About re-using tiles

Posted: Mon Nov 12, 2018 5:18 am
by Yashiro
When a game has tiles that might be reused anywhere, do you have to copy them for each tileset or can you have dedicated banks for this?

I've posted a pic with such graphics that currently takes up 64 tiles.

Re: About re-using tiles

Posted: Mon Nov 12, 2018 5:44 am
by nesrocks
You can use a mapper that lets you switch banks with a finer range, like 2k or 1k. So you can keep that 1k of CHR and change the other 3/4 of the 4k. MMC3 is a good candidate for this.

Re: About re-using tiles

Posted: Mon Nov 12, 2018 6:25 am
by tokumaru
It really depends on the mapper you're using, and whether you're using CHR-ROM or CHR-RAM.

CHR-RAM gives you the ability to arrange the tiles however you want, because you manually have to put the tile patterns in place, byte by byte. You only need a single copy of these common tiles in PRG-ROM, that you can copy to VRAM whenever needed. The main drawback of CHR-RAM is that you can't switch tiles rapidly, since you have to do it byte by byte.

If you use CHR-ROM, it'll depend on how fine the CHR switching is. Some mappers will switch big chunks (8KB or 4KB) at a time, and in that case you will indeed have to duplicate the common tiles across different banks. But more advanced mappers, like the MMC3, can switch CHR in finer chunks (1KB and 2KB) so you may consider dedicating one slot to these common tiles permanently.

Re: About re-using tiles

Posted: Mon Nov 12, 2018 9:30 am
by Yashiro
I was thinking of dividing into 2 KB for the common tiles, 2 KB for the status bar and 4 KB for the rest of the tiles. With an MMC3 mapper this should be possible.

Re: About re-using tiles

Posted: Mon Nov 12, 2018 11:00 am
by nesrocks
Sounds good. Just mind you that each chr bank is 4k big. Bg + spr = 8k. So 1 KB for the common tiles, 1 KB for the status bar and 2 KB for the rest of the tiles.

Re: About re-using tiles

Posted: Mon Nov 12, 2018 11:04 am
by pubby
You can bankswitch at the status bar split though, so status bar tiles don't necessarily count in the 4kb.