I'm trying to make a Mario-All-Stars-esque cart with a few SuperFX games on it. I'm trying to achieve this using a 74x363 with it's latch input connected to the SNES A23 line and it's outputs feeding a AVR ATmega8. The AVR is controls the address and CS lines needed to select the various eprom chip/bank (I'm using two 27c160s), the SRAM bank select (to provide protection for Starfox 2's save) and lastly its connected to the cart /reset line.
On power on the first thing the AVR does is pull /reset low and selects the eprom bank for the menu. After doing this and waiting ~50ms it releases /reset by changing the relevant I/O pin to input with the pull-up disables (hi-z essentially). This part works and the menu comes up no problem.
When a game is selected the menu code fades out the screen writes a 3 byte unlock code to the AVR followed by the selected game. The AVR then pulls /reset low, waits ~250ms, sets the eprom banking, waits another ~250ms, releases /reset and then switched the I/O pin back to input (no pull-up) and begins monitoring /reset.
This part doesn't work. On game selection the screen fades out and the music stops (I guess the /reset pull down is working) but then the SNES just sits there with a blank screen. Hitting the reset button does nothing. It should as the AVR should be monitoring the /reset line so it can bank the menu back in. At the moment the only way to get the menu to come back is to power-cycle the SNES.
When my menu fades out the screen on game selection it doesn't do anything other than send the bankswitching command and then sit in a endless loop. I assume thats enough because when the AVR does the reset at it's end the game would be banked in and the SNES would start executing it's code.
Any hints? Do I need to put some code in WRAM to perform the bankswitching comms (with interrupts off perhaps?). That could make returning to the menu by the reset button pretty much impossible would it?
EDIT:
I think that this is a problem on the AVR side of things. Bumping the clockspeed to 2MHz for some reason has got the reset-start game part to work but for some reason that I can't fathom at all every menu option selects just one game and resetting just restarts that game...
EDIT EDIT:
Success! The cause of that last problem was down to the very bad address decoding I use for the 74x363. Because all I use is A23 it can also respond to reads. All I had to do is alter the AVR's code to wait a moment after receiving the unlock byte sequence and then sample the 74x363's outputs once the SNES has reached that endless loop I mentioned earlier.
3 out of the 4 games on the cart work (game 4 starts game 3 for some reason. EDIT EDIT EDIT: because of a typo...) and even my 'reset lock' feature, where one can choose to lock the chosen game until a power-cycle.
On power on the first thing the AVR does is pull /reset low and selects the eprom bank for the menu. After doing this and waiting ~50ms it releases /reset by changing the relevant I/O pin to input with the pull-up disables (hi-z essentially). This part works and the menu comes up no problem.
When a game is selected the menu code fades out the screen writes a 3 byte unlock code to the AVR followed by the selected game. The AVR then pulls /reset low, waits ~250ms, sets the eprom banking, waits another ~250ms, releases /reset and then switched the I/O pin back to input (no pull-up) and begins monitoring /reset.
This part doesn't work. On game selection the screen fades out and the music stops (I guess the /reset pull down is working) but then the SNES just sits there with a blank screen. Hitting the reset button does nothing. It should as the AVR should be monitoring the /reset line so it can bank the menu back in. At the moment the only way to get the menu to come back is to power-cycle the SNES.
When my menu fades out the screen on game selection it doesn't do anything other than send the bankswitching command and then sit in a endless loop. I assume thats enough because when the AVR does the reset at it's end the game would be banked in and the SNES would start executing it's code.
Any hints? Do I need to put some code in WRAM to perform the bankswitching comms (with interrupts off perhaps?). That could make returning to the menu by the reset button pretty much impossible would it?
EDIT:
I think that this is a problem on the AVR side of things. Bumping the clockspeed to 2MHz for some reason has got the reset-start game part to work but for some reason that I can't fathom at all every menu option selects just one game and resetting just restarts that game...
EDIT EDIT:
Success! The cause of that last problem was down to the very bad address decoding I use for the 74x363. Because all I use is A23 it can also respond to reads. All I had to do is alter the AVR's code to wait a moment after receiving the unlock byte sequence and then sample the 74x363's outputs once the SNES has reached that endless loop I mentioned earlier.
3 out of the 4 games on the cart work (game 4 starts game 3 for some reason. EDIT EDIT EDIT: because of a typo...) and even my 'reset lock' feature, where one can choose to lock the chosen game until a power-cycle.