It is currently Wed May 23, 2018 11:33 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Bankswitched CHR-RAM?
PostPosted: Sun Feb 07, 2016 3:23 am 
Offline
User avatar

Joined: Fri Jan 24, 2014 9:05 am
Posts: 145
Location: Hungary
I've got this idea recently to somehow combine the benefits of using CHR-ROM and CHR-RAM. For the sake of a simple explanation, let's assume we have 32k of RAM. Of course the PPU would only ever be able to use $0000-$1FFF of the RAM chip by default. However, with discrete logic the game can control A13 and A14 of the RAM chip to switch the 8k of CHR-RAM window of the PPU. So you fill the 32k of RAM with different animation frames, keeping copies of whatever you don't want to animate (Sprite tiles could just be the same set copied 4 times, to $0000-$0FFF,$2000-$2FFF,$4000-$4FFF,$6000-$6FFF of the RAM chip)
Then, during gameplay, all you have to do is keep cycling through these CHR-RAM banks to have everything animated.

Pros:
+ You get to compress your tiles, like with regular CHR-RAM
+ You can easily animate a large number of tiles like with CHR-ROM bankswitching, without having to waste space or resort to updating only a few tiles in NMI.
+ Possible to implement using discrete logic only (While still using other bits of the CPU data bus to select PRG-ROM banks)

Cons:
- Takes a lot of time to fill the whole RAM (do it in forced blank)
- Makes loading new sprite tiles more difficult (unless you could select CHR-RAM banks for sprites and background separately)


Top
 Profile  
 
PostPosted: Sun Feb 07, 2016 4:27 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3521
Location: Indianapolis
I've made a few boards that use bankswitched CHR-RAM: Squeedo (2004 version), 8TROM, and GTROM. Only Squeedo and GTROM were ever produced in quantity, and the latter is available now. Both of those only switch 8kB pages, have 32kB of CHR-RAM, and use part of that memory for 4 nametables. In GTROM's case you only get 2 8kB pages of tiles though, the other half of the memory is used for nametable paging. I've never been able to resist hooking the nametables up to the CHR-RAM.

There's only so much animation you can get out of flipping between 2 pages, but if it's combined with sprite tile and nametable updates, then at least it does increase the number of tiles available for display. I've noticed 128kB SRAMs have finally been approaching the nice $1 mark where 32kB ones used to be, so I'd expect to see those used more. You're right that filling a large amount of CHR-RAM does take a noticeable amount of time though, especially if the decompression is non-trivial. One good thing that can still do during forced blanking is play music, so it doesn't have to completely disrupt the flow.

Another advantage of CHR-RAM paging, and still applies to having 2 pages, is that you can do double-buffering. So if you have an animation that takes longer than one vblank to render, you can do partial updates while displaying the previous frame. The result is that you can update a large part of the screen at once, with no visual 'waving' or 'tearing' side-effects.


Top
 Profile  
 
PostPosted: Sun Feb 07, 2016 6:36 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4045
What about single screen mirroring and using the internal CHR RAM as the first 64 tiles?

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sun Feb 07, 2016 12:21 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7432
Location: Chexbres, VD, Switzerland
Dwedit wrote:
What about single screen mirroring and using the internal CHR RAM as the first 64 tiles?

That's what Napoleon Senki does, and it is indeed a very elegant use of the NES hardware. Such a magnificent mapper for such a shitty game, what a waste.


Top
 Profile  
 
PostPosted: Sun Feb 07, 2016 12:42 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20064
Location: NE Indiana, USA (NTSC)
I thought the Napoleon Senki mapper (#77 VOTE FOR PEDRO) used CHR ROM (one 2K switchable window) and 8K of CHR RAM to make four-screen:
  • $0000-$07FF: One 2K bank of CHR ROM
  • $0800-$17FF: CHR RAM, used for 6K of pattern tables
  • $2000-$27FF (first two nametables) in four-screen
  • $2800-$2FFF (last two nametables): Internal video memory

What Dwedit refers to (internal video memory as pattern table) is what the Magic Floor mapper (#218) does.


Top
 Profile  
 
PostPosted: Tue Feb 09, 2016 5:05 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 958
There are other mappers on the wiki that do bankswitched CHR-RAM. And a proposal. Hmm...probably not enough for a subcategory to be useful?


Top
 Profile  
 
PostPosted: Tue Feb 09, 2016 5:21 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20064
Location: NE Indiana, USA (NTSC)
Essentially all mapper hardware capable of bankswitching CHR ROM is also capable of bankswitching CHR RAM. Even in MMC1/3 boards with a 6264 (8Kx8 SRAM) or equivalent 8 KiB CHR RAM, the upper address bits of the CHR RAM were run through the mapper as opposed to being directly connected to the PPU address bits. This includes SGROM, SNROM, SOROM, SUROM, SXROM (Japan only), TGROM, TKSROM (Japan only), and TNROM (Japan only).

The limit in some people's minds is whether Nintendo ever produced such a board with more than 8 KiB. This wasn't common in the pre-1997 era for cost reasons, as a 62256 (32Kx8 SRAM) was more expensive than a 6264. But memory is cheaper nowadays. And any emulator that understands the NES 2.0 header should support GNROM (#66), Color Dreams (#11), MMC1 (#1), or MMC3 (#4) with a 32 KiB CHR RAM.


Top
 Profile  
 
PostPosted: Tue Feb 09, 2016 5:34 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 958
I recall there being a debate over whether it was meaningful to say which boards could be modded to accept CHR-RAM, since that depends on how much you mod them, but not where nor when.

UNROM-512, at least, is a mapper/board that RetroUSB makes(made?) and is therefore available(?) as non-donor carts for homebrew to use that does "vanilla" >8kiB bankswitched CHR-RAM.

Also, discussing the games that did use it seems fruitful for this topic, but I don't know much about them and their innards.


Top
 Profile  
 
PostPosted: Tue Feb 09, 2016 8:48 pm 
Offline

Joined: Wed Feb 03, 2016 10:39 pm
Posts: 32
I'm using CHR-RAM bankswitching, and I'd be willing to bet that a lot of other devs are too. I'm pretty sure (though might be wrong) that the original Battle Kid bankswitches CHR-RAM because the modern UNROM512 supports it, and there are good reasons to have it.

As Tepples said, anything that can bankswitch CHR-ROM should (in theory) be able to bankswitch CHR-RAM.


Top
 Profile  
 
PostPosted: Tue Feb 09, 2016 9:28 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6291
Location: Canada
thenewguy wrote:
I'm pretty sure (though might be wrong) that the original Battle Kid bankswitches CHR-RAM because the modern UNROM512 supports it.

Nope. The original Battle Kid was designed for plain UNROM (256k), and Battle Kid 2 only relied on the extension to 512k, and not any of the other extended features. The extra features were made prospectively by RetroUSB; they might be used in one of the 8-bit christmas carts?


Top
 Profile  
 
PostPosted: Tue Feb 09, 2016 9:37 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20064
Location: NE Indiana, USA (NTSC)
Study Hall uses at least some of the extended features.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group