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 » Mon Nov 12, 2018 5:18 am

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 3004 times

User avatar
nesrocks
Posts: 446
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: About re-using tiles

Post by nesrocks » Mon Nov 12, 2018 5:44 am

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!

User avatar
tokumaru
Posts: 11561
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: About re-using tiles

Post by tokumaru » Mon Nov 12, 2018 6:25 am

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 » Mon Nov 12, 2018 9:30 am

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: 446
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: About re-using tiles

Post by nesrocks » Mon Nov 12, 2018 11:00 am

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!

User avatar
pubby
Posts: 549
Joined: Thu Mar 31, 2016 11:15 am

Re: About re-using tiles

Post by pubby » Mon Nov 12, 2018 11:04 am

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

Post Reply