Help With Reset Based Genesis Multi Cart

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
User avatar
Ziggy587
Posts: 174
Joined: Fri Oct 08, 2010 6:08 pm
Location: NY, USA

Help With Reset Based Genesis Multi Cart

Post by Ziggy587 »

Hey everyone. I'm having trouble with a Genesis / Mega Drive cart.

https://oshpark.com/shared_projects/W0QDhXOq

Image


I have the 74'161 wired up like this. I had used a 74'161 on a SNES cart wired the same way and it works fine, but it's not working on the Genesis. The first program loads, but after pressing reset I just get a blank screen.

I have jumper pads on the cart for the address lines, and they're large enough that you can easily solder wires to them. So using jumper wires, I manually connected the address lines to +5v and ground and verified that the memory was programmed correctly (I can get either program to load by manually wiring the address lines). I verified that the 74'161 was wired correctly too. I even checked the outputs of the 74'161 while powered on with my MM and confirmed that pressing reset makes them switch between 0v and 5v. And yet, it's not working.

One thing I've noticed, with any normal game, when you first power it on you get the TMSS "Produced by or under license from Sega" screen. But if you reset the game you don't get the TMSS screen again, it just resets the game. With my multi cart, I get the TMSS screen and then it loads the first first, but when I press reset I get just a blank screen. So I'm thinking it's not working because of the TMSS. And if so, then is a reset based multi cart even possible on a TMSS Genesis?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Help With Reset Based Genesis Multi Cart

Post by lidnariq »

I can't help - somehow just pressing the reset button doesn't fully reinitialize the Genesis - but this thread might be interesting related discussion
soniccd123
Posts: 46
Joined: Sat Jun 27, 2020 12:01 pm

Re: Help With Reset Based Genesis Multi Cart

Post by soniccd123 »

Ziggy587 wrote: Sat Apr 03, 2021 12:30 pm Hey everyone. I'm having trouble with a Genesis / Mega Drive cart.

https://oshpark.com/shared_projects/W0QDhXOq

Image


I have the 74'161 wired up like this. I had used a 74'161 on a SNES cart wired the same way and it works fine, but it's not working on the Genesis. The first program loads, but after pressing reset I just get a blank screen.

I have jumper pads on the cart for the address lines, and they're large enough that you can easily solder wires to them. So using jumper wires, I manually connected the address lines to +5v and ground and verified that the memory was programmed correctly (I can get either program to load by manually wiring the address lines). I verified that the 74'161 was wired correctly too. I even checked the outputs of the 74'161 while powered on with my MM and confirmed that pressing reset makes them switch between 0v and 5v. And yet, it's not working.

One thing I've noticed, with any normal game, when you first power it on you get the TMSS "Produced by or under license from Sega" screen. But if you reset the game you don't get the TMSS screen again, it just resets the game. With my multi cart, I get the TMSS screen and then it loads the first first, but when I press reset I get just a blank screen. So I'm thinking it's not working because of the TMSS. And if so, then is a reset based multi cart even possible on a TMSS Genesis?
Hey!

I think I can help you, I've done some tests with reset controlled Genesis multicarts with some success.

May I ask you, the counter outputs are connected to the respective Address bus pins in your schematic (A18 to the 1st, A17 to 2nd, etc), are these pins also connected to their respective pins in the cartridge connector? Also, what ROM sizes are you trying? If the Genesis do not retain control over some of these address lines, it will be able to just work with 64kB which is very little and not enough for the vast majority of the games

Another thing, If the 4 counter outputs are connected to the 4 MSB of the memory's address bus, there are 16 combinations possible for outputs, so you're effectivelly dividing your memory in 16 banks (MXF800C is 1MB, so rougly 64kB buffers), each click in the reset button will advance a bank, so if your program a 256kB ROM as the first one in the memory, you'll need to click the reset button 4 times to reach the first address of the next ROM.

If you want I can send you the schematic I used in a breadboard prototype that worked resonably well
poorstudenthobbyist
Posts: 252
Joined: Fri Jun 24, 2016 4:20 pm

Re: Help With Reset Based Genesis Multi Cart

Post by poorstudenthobbyist »

Ziggy587 wrote: Sat Apr 03, 2021 12:30 pm One thing I've noticed, with any normal game, when you first power it on you get the TMSS "Produced by or under license from Sega" screen. But if you reset the game you don't get the TMSS screen again, it just resets the game. With my multi cart, I get the TMSS screen and then it loads the first first, but when I press reset I get just a blank screen. So I'm thinking it's not working because of the TMSS. And if so, then is a reset based multi cart even possible on a TMSS Genesis?
I wrote about this in the thread I started that lidnariq posted, but one thing you can do is try different programs on the 322. I've found that certain games just won't load when doing this kind of thing, but others will. It's ultimately why I abandoned working on it, because I got too frustrated trying to completely reset the Genesis haha. I used the same kind of circuit on the SNES but never had any issues with games not loading properly.

Some Genesis games would actually load fine, but have palletes of the game that was loaded before I cycled to the new game. Really weird stuff. I think it might've had something to do with the Genesis not completely reinitializing when the reset button was pressed.
User avatar
Ziggy587
Posts: 174
Joined: Fri Oct 08, 2010 6:08 pm
Location: NY, USA

Re: Help With Reset Based Genesis Multi Cart

Post by Ziggy587 »

soniccd123 wrote: Sat Apr 03, 2021 7:21 pmMay I ask you, the counter outputs are connected to the respective Address bus pins in your schematic (A18 to the 1st, A17 to 2nd, etc), are these pins also connected to their respective pins in the cartridge connector? Also, what ROM sizes are you trying? If the Genesis do not retain control over some of these address lines, it will be able to just work with 64kB which is very little and not enough for the vast majority of the games
OK, so I have the 161 outputs wired to jumper pads. They're not actually attached to anything until you jump them. A18 goes to the first output, and A17 to the second. I have them labeled on the board. You can jump either address line so it's connected to the cart edge connector or the 161, but not both. The jumper pads are labeled 1, 2 and 3. 1 goes to the cart edge connector, 2 goes to the ROM, and 3 goes to the 161. The third and fourth outputs from the 161 go to pads, but aren't actually connected to anything.

The ROM sizes I'm using are actually very small (they're homebrew utilities) but I have them each mirrored enough times to be the appropriate ROM sizes. The first program is only 16KB, and the second is 256KB, but they're both mirrored enough times to be a 2Mbit ROM each. I'm using a 29F800 because that's what I had on hand. So the first 2Mb of the ROM is filled with the first program, and the second 2Mb of the ROM Is filled with the second program, and the last 4 Mb is empty. I used the A18 pads to jump that address line so that it's effectively a 4Mb 29F400 chip (A17 being the highest address). Then I have A17 jumped to the second output of the 161. I realize this means that each reset wont change the A17 line, but it should still work (you would just have to reset multiple times to change). However, when I press reset, I get just a black screen. And I've tried pushing reset again and again, but the screen just remains black.

When it wasn't working, I pulled the ROM off and reprogrammed it. This time I doubled my 4Mb ROM so now it's a full 8Mb. I tried letting the 161 control both A17 and A18 but that didn't work. Then I tried manually connected A18 from ROM to ground or 5v but it still wasn't working. I also tested everything with some jumper wires. I jumped A17 pad 2 to A18 pad 3, which connects the A17 line from ROM to the first input of the 161. Same results, it boots the first program fine but resetting results in a black screen.

So then I tried manually connecting A17 to ground and 5v. If I jump A17 to ground, it loads the first program from power on. If I jump A17 to 5v it loads the second program from a power on. And in both cases, resetting worked (it wouldn't change games because it was no longer hooked up to the 161, but it reset the same game instead of a black screen). So this tells me I've mirrored and programmed my ROMs successfully, the problem is definitely on the Genesis side.

soniccd123 wrote: Sat Apr 03, 2021 7:21 pm If you want I can send you the schematic I used in a breadboard prototype that worked resonably well
Yes, thanks. I'd be curious to see how you wired it if it's different from how I am trying it.
poorstudenthobbyist wrote: Sat Apr 03, 2021 7:53 pm I wrote about this in the thread I started that lidnariq posted, but one thing you can do is try different programs on the 322. I've found that certain games just won't load when doing this kind of thing, but others will. It's ultimately why I abandoned working on it, because I got too frustrated trying to completely reset the Genesis haha. I used the same kind of circuit on the SNES but never had any issues with games not loading properly.

Some Genesis games would actually load fine, but have palletes of the game that was loaded before I cycled to the new game. Really weird stuff. I think it might've had something to do with the Genesis not completely reinitializing when the reset button was pressed.
I also have the 161 wired the same way on a SNES cart and it works perfectly fine. So is there no way to have the cart get the Genesis to do a hard reset? I actually designed this cart specifically for these two homebrew utilities. I could always use a mechanical switch, which you would have to toggle between power cycles to change the program. It's just that using the 161 with the reset to trigger it is so much sleeker.
poorstudenthobbyist
Posts: 252
Joined: Fri Jun 24, 2016 4:20 pm

Re: Help With Reset Based Genesis Multi Cart

Post by poorstudenthobbyist »

Ziggy587 wrote: Sun Apr 04, 2021 6:26 am I also have the 161 wired the same way on a SNES cart and it works perfectly fine. So is there no way to have the cart get the Genesis to do a hard reset? I actually designed this cart specifically for these two homebrew utilities. I could always use a mechanical switch, which you would have to toggle between power cycles to change the program. It's just that using the 161 with the reset to trigger it is so much sleeker.
You might be able to include some code at the beginning of each ROM that resets all the registers to some default value. I'm not very familiar with programming on Genesis or SNES, but I know from other non-gaming related programming experience that sometimes leftover data can screw you up.

Here's the schematic for my multicart, that I think worked pretty well with the correct games. It's been a while since I looked at it haha.

The SJ_xROMy pads are for selecting between just one 27C322 and two 27C322 (x determining the number of '322s). If you used just one you didn't need to include the '139 decoder.
The SJ_1R8M_x pads were for selecting 8 Mbit chunks, SJ_1R16M_x pads were for 16 Mbit chunks, and SJ_1R32M_x pads were 32 Mbit chunks.
Attachments
genesismulti.PNG
soniccd123
Posts: 46
Joined: Sat Jun 27, 2020 12:01 pm

Re: Help With Reset Based Genesis Multi Cart

Post by soniccd123 »

About the Hard Reset, if you look at plutiedev, it explains how both soft and hard reset can be controlled by the cart: https://plutiedev.com/cartridge-slot#reset-signals
Reset signals

/MRES and /VRES are the console's reset signals. The former is asserted once when the console first powers on, while the latter is asserted alongside it and whenever the Reset button is pressed. Their main purpose is to let you reset whatever hardware you have on the cartridge (if needed).

Both are open drain and connected directly to the bus, meaning that while the console may assert it, the cartridge can also do it by pulling them low. Never pull them high when not asserting them.. The /MRES signal will reset the entire console while the /VRES signal will only reset the CPUs and YM2612 (but not the VDP and PSG). You usually want the latter.

Note that /VRES is completely useless in Master System mode since it's constantly held low by the console (presumably to keep the 68000 out of the way?). You'll have to rely on /MRES in that case.
The 5V part is very important, to control the signal, To control any of these signals, you should use a circuit that has a GND and a High-Z state.

It it very likely that some leftover data is making this not work. If both ROMs fit completely on each bank, there should not be a situation where the Genesis tries to control a pin which is not connected.

Anyways, if you want, my schematic is here:
Image

I did this as a way to the Genesis to retain control over the address lines not used by the counter. the 74125 is a quad tristate buffer which, when a buffer is activated, it connects the respective address line from the cart edge to the memory. When it is not activated the line is pulled high by the pull-up resistor. As the 74125 buffer activation pins are active low, when the counter is in 0000 state, all pins are connected to the cart edge, permiting that ROMs bigger than the bank size to be used.

The real problem I had is that the /VRES line goes low every time the Genesis boot up, so the starting address is actually always at least 0001 (not counting the other problem, that the count input actually is disconnected for some moments before Genesis full boot, which can lead to random counts as the first one).

What I'm really considering in future projects is using a very small AVR MCU to handle this, I have not done any tests yet, but would make life a lot easier, also would make asserting both /MRES and /VRES simpler
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Help With Reset Based Genesis Multi Cart

Post by lidnariq »

plutiedev wrote: Both are open drain and connected directly to the bus, meaning that while the console may assert it, the cartridge can also do it by pulling them low. Never pull them high when not asserting them.. The /MRES signal will reset the entire console while the /VRES signal will only reset the CPUs and YM2612 (but not the VDP and PSG). You usually want the latter.
The important parts are:

/MRES resets everything (including TMSS, which is a little annoying)
/VRES is low because /MRES is low (or because /MARK3 is low)
/MRES is usually only used for the power-on-good signal, and although the cartridge can discharge it, nothing else does

Some games don't handle having the VDP in the incorrect state. As Poorstudenthobbyist said, the mildest symptom is "wrong colors" and sometimes full crashes. The only solution for these seem to be driving /MRES from the card edge at the right time. You must use something vaguely sophisticated for this, because as long as you drive /MRES low, /VRES will also stay low.

I have written PIC code to handle this /VRES-therefore-/MRES-briefly dance.
User avatar
Ziggy587
Posts: 174
Joined: Fri Oct 08, 2010 6:08 pm
Location: NY, USA

Re: Help With Reset Based Genesis Multi Cart

Post by Ziggy587 »

Thanks for the info, everyone. I'm going to have to circle back to this when I have more time to futz around with it.
Post Reply