Action 53 multicart engine
Moderator: Moderators
Action 53 multicart engine
To make up for there being no multicart for the 2011 NESdev compo, I'm working on rewriting the menu system so that we can include the NROM entries from both last year's and this year's, as soon as I can drag myself away from Cracked.
Last edited by tepples on Fri Jan 13, 2012 6:06 am, edited 1 time in total.
Way ahead of you, brother.Dwedit wrote:Need to drag yourself away from Cracked? Try TvTropes.
Q: It takes two to
- tango
- mango
- make an accident
- make a multicart
- make a thing go right
- make it out of sight
- all of the above
Imagine it being as easy to build a multicart of NROM games as it currently is to build a PocketNES image.
- NESHomebrew
- Formerly WhatULive4
- Posts: 418
- Joined: Fri Oct 30, 2009 4:43 am
- Contact:
I believe it could start in any bank. But another consideration, is that we can't know what bank it will be in the when the user hits reset - you'll always want some kind of reset vector available.
Because it uses the '161 which has a /clear input, I suppose it would have been possible to put an RC circuit (resistor-capacitor) on that, charged by Phi2 (M2). Kinda sucks I didn't consider that when I did the board layout, but oh well, it's only slightly annoying to add a bunch of 8-byte segments into LD65's configuration (8 bytes should be enough for mapper reset and JMP).
Because it uses the '161 which has a /clear input, I suppose it would have been possible to put an RC circuit (resistor-capacitor) on that, charged by Phi2 (M2). Kinda sucks I didn't consider that when I did the board layout, but oh well, it's only slightly annoying to add a bunch of 8-byte segments into LD65's configuration (8 bytes should be enough for mapper reset and JMP).
With some of these smaller games you certainly will want to fit more than one game per bank. The games true reset vector would be wherever it's convenient for the menu program (such as in a table that includes the NMI and RESET vectors of every game). In this case I normally set the ROM's NMI to point to $0170 or someplace odd that wouldn't be touched normally, the menu program can just put a JMP there. The "fake reset" triggered by the menu would be similar, but include a bankswitch write before the JMP.
The reset vector doesn't even have to be the same in all banks, as long as you are willing to make the reset code larger than 8 bytes (so that it can bankswitch from RAM). This is a good idea if by any chance it's impossible to find a ROM location that's free in all games. Something like this should work if the menu is in bank 0 (finding 19 free bytes is harder than finding 8, but finding 8 free bytes in the same location in all games might be harder than finding 19 bytes anywhere):Memblers wrote:With some of these smaller games you certainly will want to fit more than one game per bank. The games true reset vector would be wherever it's convenient for the menu program (such as in a table that includes the NMI and RESET vectors of every game). In this case I normally set the ROM's NMI to point to $0170 or someplace odd that wouldn't be touched normally, the menu program can just put a JMP there. The "fake reset" triggered by the menu would be similar, but include a bankswitch write before the JMP.
Code: Select all
Reset:
ldx #$06
- lda Bankswitch-1, x
sta $ff, x
dex
bne -
jmp $0000
Bankswitch:
stx Bankswitch-1
jmp InitializeMenu
Tokumaru guessed most of the design that I plan to use. NROM-128 automatically gets patched at $BFF0 if the reset vector is in $C000-$FFFF or at $FFF0 if the reset vector is in $8000-$BFFF. With NROM-256 or CNROM, the user must specify in a config file (the same one with the instruction blurbs) whether to patch 10 bytes at $FFF0 (more or less the Barbie stub) or 21 bytes anywhere (more or less the stub tokumaru listed). I also plan on storing the data that the patch replaces in the ROM's directory so that extraction of individual ROMs from the multicart is still lossless.Dwedit wrote:Does BNROM guarantee that the first page will be swapped in at reset, or does every page need reset code?
Memblers: Multiple titles can share a PRG ROM bank if the config file gives each game's entry point. These can even use CNROM if the game doesn't bankswitch after starting.
By loading the CHR bank assigned to the title before handing control over to the game. It's for things like Donkey Kong Classics, which combine two originally NROM-128 games into one CNROM. Games that switch banks after the game begins obviously wouldn't work. For example, the config records for four of the games might look like this:tokumaru wrote:How are you emulating CNROM with BNROM?
Code: Select all
# config file for action 53
title=LJ65
author=Damian Yerrick
year=2009
rom=LJ65_CRoom.nes
chrbank=0
reset=$C000
description:
Pack the blocks[etc]
.
title=Concentration Room
author=Damian Yerrick
year=2010
rom=LJ65_CRoom.nes
chrbank=1
reset=$8000
description:
Flip cards[etc]
.
title=Lawn Mower
author=Shiru
year=2011
rom=Mower_Thwaite.nes
chrbank=0
reset=$C000
description:
Cut grass[etc]
A: Go fast
.
title=Thwaite
author=Damian Yerrick
year=2011
rom=Mower_Thwaite.nes
chrbank=1
reset=$8000
description:
Shoot down ABMs[etc]
B: Fire from left silo
A: Fire from right silo
.
("LJ65", PRG=4, reset=$C000, CHR=6)
("Concentration Room", PRG=4, reset=$8000, CHR=7)
("Lawn Mower", PRG=5, reset=$C000, CHR=8)
("Thwaite", PRG=4, reset=$8000, CHR=9)