How does the Genesis handle resets, compared to Nintendo consoles?

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.
poorstudenthobbyist
Posts: 252
Joined: Fri Jun 24, 2016 4:20 pm

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by poorstudenthobbyist »

lidnariq wrote: Mon Dec 07, 2020 12:19 pm
poorstudenthobbyist wrote: Mon Dec 07, 2020 6:56 am It'd be nice if I could just connect it directly to the /VRES pin, I bet there's a good chance that if I connected the /VRES to the /MRES through a 1k resistor, the pin would be able to handle 5mA for the split second it needs to discharge the capacitor. I can't find a datasheet on it though.
If I remember correctly, VRES is low because MRES is low, so you unfortunately can't just put a stateless connection like that.

(VRES can be low for other reasons, such as WRES or MARK3 (B30))

Also, using MRES to reset the console will make the TMSS screen show up again. (Oh well)
Sorry, I misunderstood. I thought a "hard reset" would reset the internal RAM as well, to solve the issue I was running into.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by lidnariq »

There's a bunch of things going on on the Megadrive, and it's not particularly transparent.

I don't think it's system RAM that matters here - the TMSS ROM doesn't appear to do anything beyond what's necessary to test the cartridge and upload the relevant text - I think it's some other bit of VDP / arbiter state that's left in the wrong configuration when you only reset the 68k with /VRES.

There may be some specifics buried in Exodus's source code, but it's not immediately obvious.
poorstudenthobbyist
Posts: 252
Joined: Fri Jun 24, 2016 4:20 pm

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by poorstudenthobbyist »

For reference, when I turn on the game the TMSS screen comes up. After resetting to switch games, the TMSS screen doesn't appear again. I seem to have intermittent problems having Comix Zone as one of the games. The game I load in after that either has weird graphical problems, or just locks up.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by lidnariq »

Right. WRES (the button) does not re-trigger TMSS. VRES doesn't reinitialize some state, and that seems to cause bugs. MRES (power-on timer) reinitializes a bunch of things, including re-enabling TMSS.
poorstudenthobbyist
Posts: 252
Joined: Fri Jun 24, 2016 4:20 pm

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by poorstudenthobbyist »

I thought it was VRES that was tied to the button. B27 on the cart edge? That's what I'm using to trigger the clock on the counter.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by Pokun »

poorstudenthobbyist wrote: Mon Dec 07, 2020 9:26 am Ah, I was looking specifically at SNES here (haven't delved into NES multicarts yet) but the information is helpful and welcomed. And really interesting!
I don't think the SNES is really any different in this regard. A hard reset still keeps the system powered, so RAM and other devices shouldn't be affected by the reset.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by lidnariq »

poorstudenthobbyist wrote: Tue Dec 08, 2020 6:45 am I thought it was VRES that was tied to the button. B27 on the cart edge?
No.

VRES is driven by the bus arbiter in response to the button (WRES). VRES is also driven by the bus arbiter in response to MRES (B02) (via SRES). VRES is also driven by the bus arbiter in response to MARK3 (B30).
[VRES is] what I'm using to trigger the clock on the counter.
It's possible that WRES doesn't trigger a sufficiently total reset either...
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by lidnariq »

lidnariq wrote: Mon Dec 07, 2020 3:24 pm Looking at the disassembly here, it looks like you could carefully capture the microseconds that it reads the "SEGA" from the header, and assert /VRES at that moment to bypass TMSS.
Following up on this: I quickly tried something that would tap /VRES low for the requisite 10 cycles (per the 68k datasheet) as soon as it saw the first read from the cart (from the stub code that the TMSS copies into RAM).

It works! I have a functioning TMSS bypass in my VA7 Genesis1.

Interestingly, the PIC I used is just slow enough, and the "SEGA" signature is validated fast enough, that it's somewhat random as to whether the TMSS screen is shown or skipped. (The alternate "[space]SEGA" signature should reliably skip the TMSS screen)

It also doesn't seem to work around a bad signature (e.g. "AAAA") - I see 24 words fetched after but then it just stops forever. Without better test tools it's hard to know what's going wrong there.
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by TmEE »

Someone experimented with this method years ago with success also, I think a person named Jorge Nuno first proposed it.
Markfrizb
Posts: 607
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by Markfrizb »

lidnariq wrote: Sun Dec 27, 2020 1:25 am
lidnariq wrote: Mon Dec 07, 2020 3:24 pm Looking at the disassembly here, it looks like you could carefully capture the microseconds that it reads the "SEGA" from the header, and assert /VRES at that moment to bypass TMSS.
Following up on this: I quickly tried something that would tap /VRES low for the requisite 10 cycles (per the 68k datasheet) as soon as it saw the first read from the cart (from the stub code that the TMSS copies into RAM).

It works! I have a functioning TMSS bypass in my VA7 Genesis1.

Interestingly, the PIC I used is just slow enough, and the "SEGA" signature is validated fast enough, that it's somewhat random as to whether the TMSS screen is shown or skipped. (The alternate "[space]SEGA" signature should reliably skip the TMSS screen)

It also doesn't seem to work around a bad signature (e.g. "AAAA") - I see 24 words fetched after but then it just stops forever. Without better test tools it's hard to know what's going wrong there.
any idea if this would also work on clones and/or the Analogue clone?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: How does the Genesis handle resets, compared to Nintendo consoles?

Post by lidnariq »

Markfrizb wrote: Tue Dec 29, 2020 10:06 am any idea if this would also work on clones and/or the Analogue clone?
Why would clones have the TMSS screen?

But this appears to be a fundamental design flaw of how TMSS works - unlike the Game Boy, which maps the cart in a specific memory region and the IPL in the other, the Genesis seems to just have a toggle between "cart is mapped" and "IPL is mapped", and as long as we can hijack that...
Post Reply