About re-using tiles

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
Yashiro
Posts: 7
Joined: Wed Sep 19, 2018 3:28 am

About re-using tiles

Post 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.
Attachments
Default.PNG
Default.PNG (1.17 KiB) Viewed 4070 times
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: About re-using tiles

Post 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.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: About re-using tiles

Post 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.
Yashiro
Posts: 7
Joined: Wed Sep 19, 2018 3:28 am

Re: About re-using tiles

Post 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.
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: About re-using tiles

Post 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.
Last edited by nesrocks on Mon Nov 12, 2018 3:28 pm, edited 1 time in total.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
User avatar
pubby
Posts: 583
Joined: Thu Mar 31, 2016 11:15 am

Re: About re-using tiles

Post by pubby »

You can bankswitch at the status bar split though, so status bar tiles don't necessarily count in the 4kb.
Post Reply