Soft and Hard reset on Famicom

Started by jpx72, December 21, 2011, 04:50:38 am

Previous topic - Next topic

jpx72

December 21, 2011, 04:50:38 am Last Edit: December 21, 2011, 04:55:42 am by jpx72
I noticed strange behavior at some multicart pirates when running on hardware and on emulator. Most emulators have the option to reset  "Soft" or "Hard", or even "Power off". I noticed on some multicarts that when running on real hardware, when a certain game is selected, the Reset button resets only the selected game, so it's the same as clicking "Soft" reset in an emulator. You must power off the whole console to get to the menu, the same in emulator - "Hard" reset or "Power off".
But on some multicarts are different (the 700in1). When pushing Reset button, the whole menu system appears. But when running on emulator, "Soft" reset only resets the selected game.
My conclusion: Reset button and "Soft" reset are not the same.
So what's exactly the "Soft" reset? Is there a way to add this switch to a real Famicom?
Is there a difference between "Hard" reset and "Power off" in an emulator?
(Used emulator: Nestopia)

PS: this post is NOT SPAM although it looks like it! :D

UglyJoe

December 21, 2011, 06:28:04 am #1 Last Edit: December 21, 2011, 07:49:14 am by UglyJoe
My guess would be that "soft" reset is supposed to function like the hardware reset, but is not emulated correctly.  I could be wrong, though.

edit: another possibility would be that the soft reset is emulated correctly, but the pirate mapper is not.  This is probably more likely since I think the hardware reset simply fires an interrupt request.

tonev

December 21, 2011, 08:48:02 am #2 Last Edit: December 22, 2011, 02:23:42 am by tonev
Jpx i know you have the 52 in 1 cart. There the reset function is implemented perfectly it even remembers the last game you played. For example if you played game number 6 and you reset the menu will be at 6.
I am back everyone :)

jpx72

I also think it's only a problem of emulation, but I wanted to hear other thoughts.
The 52in1 has indeed a very interesting way of remembering the choice. I wonder if it also works on a frontloading NES. I'll try that sometime.

Jamtex

I suppose the Soft and Hard resets are meant to emulate a warm and cold boot. The Reset button just pulls the /RES line low, and then jumps to the address held in the reset vector. The only way you could implement a cold boot switch is to put a debounced push switch between the power lines so it basically turns off as basically you need something to reset the hardware which the Reset button does not do.

famifan

hey there!

i've made a little research.

original famicom reset - only reset CPU (2a03)
nes reset - reset both CPU and PPU

but, there is no way to perform cartridge reset! It has no RESET signal connected to the cartridge slot.

So there are two types of multi-games carts:
1) which has built-in menu
if you reset this cart, you will reset only current played game, because there is no way to reset cartridge. Only power-off.
2) other, which triggers the CPU reset state and have a kind of cyclic counter that switchs to the next game on reset.

I checked nestopia source code and saw the differences beetween reset (aka 'soft reset') and 'hard reset'.
Hard reset performs the same as a soft reset, but also it makes some additional resetting steps (it reset RAM, and some other cpu/ppu flags, etc.).
And nestopia also perform reset for the cart too (but real console system doesn't!). Nestopia also detect cart board version. It knows about 500 board, and have additional instruction how to reset a specific board (like 700-in-1, that is mensioned above). Again it has hard reset capability, that provide some more additional steps to perform.

So hard reset is used to reset all components to the initial state.
Power off in nestopia works mostly like a 'hard reset' but it does another memory mapping then the hard reset provides.
Yes, the behavior is differ, but if you ain't a nes hacker or developer you can't see the distinction between the "hard reset" and "power-off".

jpx72

Cool stuff famifan! Thanks for the detailed explanation!
So nestopia has specific reset commands for specific boards?  I guess Nestopia by power-off resets all memory to clean it from any code left.
Quote from: famifan on January 18, 2012, 12:24:16 pmbut, there is no way to perform cartridge reset! It has no RESET signal connected to the cartridge slot.

..to understand correctly, both NES and FC don't have the cartridge-reset? How exactly you reset the cartridge slot?
Quote from: famifan on January 18, 2012, 12:24:16 pm
1) which has built-in menu
if you reset this cart, you will reset only current played game, because there is no way to reset cartridge. Only power-off.
2) other, which triggers the CPU reset state and have a kind of cyclic counter that switchs to the next game on reset.

...and 3) which has built-in menu but (as the 700in1) will show built-in menu on reset

famifan

Quote from: jpx72 on January 18, 2012, 10:30:55 pm
So nestopia has specific reset commands for specific boards?

yes, it has! about 500 types of different boards.
Quote from: jpx72 on January 18, 2012, 10:30:55 pm
  I guess Nestopia by power-off resets all memory to clean it from any code left.
Quote from: famifan on January 18, 2012, 12:24:16 pmbut, there is no way to perform cartridge reset! It has no RESET signal connected to the cartridge slot.

..to understand correctly, both NES and FC don't have the cartridge-reset? How exactly you reset the cartridge slot?

for example, sega mega drive has RESET signal connected to cartridge slot. So Sega send reset signal directly to ICs inside the cartridge.
Famicon reset button only send reset signal to CPU (2a03), because PPU reset pin is always hardwired to high logic level (and so you will see strange glitch garbage during the reset signal, because PPU doesn't reseive reset signal and continue to produce video output from VRAM).
I read that NES has reset signals for both PPU and CPU, so you will see blank screen during reset.

FC/NES can't send reset signal to cartridge, instead of that it resets only CPU. IMHO, resetting the CPU will start ROM program from it initial first address. Only this event you can catch instead of reset signal, and some carts do this.
Quote from: jpx72 on January 18, 2012, 10:30:55 pm
Quote from: famifan on January 18, 2012, 12:24:16 pm
1) which has built-in menu
if you reset this cart, you will reset only current played game, because there is no way to reset cartridge. Only power-off.
2) other, which triggers the CPU reset state and have a kind of cyclic counter that switchs to the next game on reset.

...and 3) which has built-in menu but (as the 700in1) will show built-in menu on reset

nestopia has a specific board reset command to this 700in1 cart, so it resets this cartridge too.

if you have 700in1 cart, could you tell me is it really show menu on reset?

i should agree that such board reset function is possible on real cart, but i don't have such carts, so i don't know anything about it. Shame on me.

jpx72

Quote from: famifan on January 19, 2012, 12:48:12 am
if you have 700in1 cart, could you tell me is it really show menu on reset?

Of course I have it, that's because I mentioned it. It's a pirate Famicom cartridge that works like this:
When you plug it to Famicom the built-in menu will show up. When you select a game from the menu and start it, it will run the selected game. But when you press reset from within the running game, the built-in menu will appear.

famifan

okay!

the ROM that you are playing on the emulator contains only the data from ROM ICs (CHR and PRG) and some info about the mapper id. That is all info about the mapper! Only ID, only 1 byte. So, every emulator has its own implementation of every well-known mapper and it behavior can distinct from the real one mapper IC.

And real pirated cart could have another mapper or somewhat improved mapper, which can return to the main menu after reset.