Just curious.... MMC5 x CHR

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

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

Re: Just curious.... MMC5 x CHR

Post by tokumaru »

I don't know of any specific commercial games that do what I said, I was just listing possible uses of 8KB CHR-RAM bankswitching.

In my old Sonic engine I needed to have monitors and rings show up as both sprites and background, and they're animated, but 8x16 sprites fetching from the background side would've broken the scanline counter, so this was a good solution.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Just curious.... MMC5 x CHR

Post by rainwarrior »

Bregalad wrote:
rainwarrior wrote:Seems like a case of a feature they already had in the mapper (which was designed for 256k CHR-ROM) that they just decided to use because it was slightly convenient.
In which part of the game does sprites use tiles from the background or vice-versa ?
I thought it did this on the title screen and intro, but looking again the sprites used aren't common with any of the background tiles used at the same time.

However, the banking is constantly being used, and very often has banks in common between the two pages. I think that's why I had made that assumption.

Anyhow, I found a much better use for it while looking at it: when walking around and talking to people, it changes banking at a scanline split, so the field can use different background CHR than the text overlay.

With Mesen's debugger you can put the PPU space $0000-1FFF and CHR space $0000-1FFF in two different windows side by side, which is a good way to see at a glance how the banks are used.

I dunno what the logic is behind the specific banking patterns (a flat 8k mapping is never used, it's always some weird combination), but probably it was managed automatically be a tool anyway. I think there's probably a bunch of little things you could do this way. It's not like they had much incentive to stick to flat CHR-RAM banking.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Just curious.... MMC5 x CHR

Post by tepples »

The following layout for MMC3 TG/TNROM should make good use of 8 KiB CHR RAM and allow sharing tiles between background and sprites without interfering with its PA12-rise-triggered interval timer.

Set the C bit, which swaps $0000-$0FFF with $1000-$1FFF, and set the CHR windows to 0, 2, 4, 5, 6, 3.

Window 0 ($1000-$17FF): Banks 0 and 1 (sprite-only things)
Window 1 ($1800-$1FFF): Banks 2 (sprite-only things) and 3 (shared things)
Windows 2-4 ($0000-$0BFF): Banks 4-6 (background-only things)
Window 5 ($0C00-$0FFF): Bank 3 (shared things)
For text overlay, use a raster split to switch window 5 to a font or VWF canvas in bank 7.

Because $1C00-$1FFF and $0C00-$0FFF point to the same memory, spinning rings are practical.
Post Reply