Using high bank lines as address decoder?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
User avatar
olddb
Posts: 147
Joined: Thu Oct 26, 2017 12:29 pm
Contact:

Using high bank lines as address decoder?

Post by olddb » Tue Jan 12, 2021 12:02 pm

Let's say a 512k lorom rom game, could the high bank lines be used as an address decoder for cart RAM?

BA6 -> CS2 on 6264
/BA6 -> /CS on ROM

So cart RAM will reside at $40:8000 and mirrors.

I see this will have bus conflicts with internal wram, but how about at $c0:8000?

Does the address lines need a latch?

:?: :?: :?:

Sorry if this sounds stupid.
...

lidnariq
Posts: 10265
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Using high bank lines as address decoder?

Post by lidnariq » Tue Jan 12, 2021 2:12 pm

Unfortunately, on the SNES, there's no single address line that can be used as a way to map a device. You have to use /ROMSEL or else add external logic.

For your example of using BA6=A22, you can't only use the copy of RAM that you've mapped in the region where A23 is high: it'll still conflict with SNES-internal RAM because A23 isn't being used at all.

nocash
Posts: 1326
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: Using high bank lines as address decoder?

Post by nocash » Tue Jan 12, 2021 3:29 pm

Really not recommended, but I think this should work...

ROM./CS=/ROMSEL
SRAM./CS=A15 and SRAM.CS2=A23

The SRAM would be accessible at 80h-BFh:6000h-7FFFh, but that location isn't compatible with SRAM mapping in standard LoROM carts & standard LoROM emulation. And it would cause bus conflicts when accessing anything else in bank 80h-FFh. And you couldn't use SRAM./CS or SRAM.CS2 for battery logic with that wiring.
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty

User avatar
olddb
Posts: 147
Joined: Thu Oct 26, 2017 12:29 pm
Contact:

Re: Using high bank lines as address decoder?

Post by olddb » Thu Jan 14, 2021 9:56 pm

lidnariq wrote:
Tue Jan 12, 2021 2:12 pm
For your example of using BA6=A22, you can't only use the copy of RAM that you've mapped in the region where A23 is high: it'll still conflict with SNES-internal RAM because A23 isn't being used at all.
Sorry, can you be more specific. As I understand, internal RAM is at banks $7e and $7f, but not at banks
$fe and $ff. So how does this conflict?
...

nocash
Posts: 1326
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: Using high bank lines as address decoder?

Post by nocash » Thu Jan 14, 2021 11:02 pm

That was referring to your example. You were using A22=1 (BA6) to enable SRAM, which does confilct with WRAM in bank 7Eh-7Fh. The SRAM mapping may work in other banks, but the WRAM stops working with that example.

Oh, and latching: The whole address bus is supposed to stay constant throughout the whole memory access, so it would be pointless the latch (memorize) the address lines.
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty

lidnariq
Posts: 10265
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Using high bank lines as address decoder?

Post by lidnariq » Thu Jan 14, 2021 11:53 pm

What nocash said.

To wit, software can prevent a bus conflict if it there's another place it can access the same memory. But by using A22 (BA6), there's no way to access only SNES-internal RAM (any place where A23 downto A17 = 7'b0111111 ) without also accessing your hypothetical decoded RAM (any place where A22 = 1'b1 ).

User avatar
olddb
Posts: 147
Joined: Thu Oct 26, 2017 12:29 pm
Contact:

Re: Using high bank lines as address decoder?

Post by olddb » Sat Jan 16, 2021 12:12 pm

Thanks for the replies.
...

Post Reply