8bitworkshop Multiple Tilesets Example

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
Posts: 1
Joined: Tue Feb 04, 2020 8:42 pm

8bitworkshop Multiple Tilesets Example

Post by geo-gs » Tue Feb 04, 2020 9:05 pm

I had a pretty hard time figuring out how to do multiple tile-sets in 8bitworkshop and just wanted to make a post documenting how I solved this in case someone else is trying to figure it out too.

The best solution I've been able to figure out so far is to set up the project as MMC3 with four 16KB banks. The project then stores two tile-sets in two different PRG banks and will read these banks into CHR-RAM. Only one tileset is loaded into CHR-RAM at a time and the project changes which tileset is loaded depending on how many times the controller's `A` button is pressed.

Something else that is demonstrated is having just a single tile stored in one of the PRG banks. The third time that the controller's `A` button is pressed that single tile is loaded into CHR-RAM. This was to demonstrate how to load in just a couple of changed tiles into CHR-RAM depending on the level which I believe can help to reduce the size of some programs by de-duplicating graphics.

Another thing I wanted to demonstrate is how to annotate the assets stored in the PRG banks so that 8bitworkshop's asset editor could correctly view and edit them. It just makes mocking up simple graphics easier.

I like this CHR-RAM solution and think it can be even better if compression is applied to these tiles. However, I was forced into it because I have not been able to figure out how to set up multiple tile-sets (and swap between them) using CHR-ROM in 8bitworkshop. Does anyone know how to do this? Additionally, I have been unable to figure out how to expand MMC3 programs past four 16KB banks in 8bitworkshop. This seems like a hard-coded limit to the 8bitworkshop environment?

Here is a link to the github project: https://github.com/geo-gs/chr_ram_mmc3

Here is a link to the project setup in the 8bitworkshop development environment. https://8bitworkshop.com/v3.5.0/?repo=g ... _example.c

Post Reply