Is it possible to brick a NES cartridge by input alone?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Is it possible to brick a NES cartridge by input alone?

Post by rainwarrior »

koitsu wrote:The general theory about the behaviour differing in emulators and PowerPak is that whatever's triggering the problem may relate to RAM or ZP variables having different contents vs. an actual cart. This is par for the course/understandable, not too exciting.

The original claim was the following (and it's completely invalid -- there is no "sub-frame timing" or anything else we can't figure out going on):
[14:18] <Buddybenj> Well like I said this either relies on sub-fram timing or very low level hardware quirks, so it would be nice if someone could test on a real cartridge at least three times
I would guess that the inconsistency on the same system is probably mostly due to human timing differences, e.g. some frame counter or other state in RAM that changes depending on when you actually press buttons and ends up taking part in the execution of the bug?

On different systems (emulator / powerpak / cartridge / various NES machines) you have different RAM initialization (including the battery backed RAM), different open bus behaviours, etc. Even if we didn't have to deal with the first issue of it being inconsistent even on the same setup, any of these things could change the behaviour yet again.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Is it possible to brick a NES cartridge by input alone?

Post by Sour »

Is it actually "safe" to bankswitch the bank the CPU is currently reading from? i.e is the bankswitching behavior guaranteed to finish in time for the next cpu read? This is what happens when the cpu writes to $8000 before executing the $02 opcode. If the switching is not over before the next read, maybe the CPU ends up reading potentially random data? (This is just a guess from someone who knows nothing about the actual hardware, so take it for what it's worth: not much.)

Mesen treats $02 as a crash (halt) and stops the emulation there, but even if I let it keep going, I only get a black screen with a repeating loop of instructions containing a fair bit of unofficial opcodes.

The end result could be affected by the bankswitch behavior + maybe how the unofficial opcodes are treated? (opcodes doesn't explain NES vs Powerpak though)
Random memory vs all 0s at boot doesn't seem to affect the execution (but I only tried either option once)
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Is it possible to brick a NES cartridge by input alone?

Post by lidnariq »

Sour wrote:Is it actually "safe" to bankswitch the bank the CPU is currently reading from?
With only one exception, NES bankswitching happens during the write cycle, so there's no "currently reading from".
i.e is the bankswitching behavior guaranteed to finish in time for the next cpu read?
Yes. For most (if not all) of the discrete logic mappers, the latching event happens on a rising edge of /ROMSEL (i.e. at the end), the data bus won't be driven until the next /ROMSEL (unless it's driven immediately because of the RMW double-write), and the output is valid within 32ns, substantially less than the 210ns between rising edge of /ROMSEL to next falling edge of same.

While it's possible that ASIC mappers could be slower enough to be a problem, 210ns is an eternity even in 1980s logic.
User avatar
Marscaleb
Posts: 240
Joined: Fri Sep 11, 2015 10:39 am
Contact:

Re: Is it possible to brick a NES cartridge by input alone?

Post by Marscaleb »

rainwarrior wrote: Metroid has lots of known crash/glitch passwords, but none of them are going to set fire to your TV.
No way man, that's totally a real thing. Back when the Super Nintendo just came out, there was this kid at my school who told me he got one, and then he tried turning it on and his NES on at the exact same time, and he swears to me that they both blew up!

Then in High School when he was 14 he said he had a corvette, but he just didn't drive it to school.

Image


(Okay honestly those were two different people)
Last edited by Marscaleb on Fri Dec 02, 2016 4:59 pm, edited 1 time in total.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Is it possible to brick a NES cartridge by input alone?

Post by rainwarrior »

koitsu wrote:Note: the "O" in MOTHER is actually a zero, not a capital-oh. Though I'd mention that.
It is not. It is a capital letter O. Using a zero will result in an "ERROR TRY AGAIN" message.

I tried this on my Wii U virtual console version just for fun, though nothing particularly interesting happened (the screen turned red and the game hung). I'm curious if they've fixed whatever bug they had in the 3DS emulator 5 years ago that caused it to hang the system.

Also, we're apparently having a related discussion in another thread about "why do these rumours keep coming up?"
viewtopic.php?f=2&t=15187
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Is it possible to brick a NES cartridge by input alone?

Post by Dwedit »

Marscaleb wrote:No way man, that's totally a real thing. Back when the Super Nintendo just came out, there was this kid at my school who told me he got one, and then he tried turning it on and his NES on at the exact same time, and he swears to me that they both blew up!

Then in High School when he was 14 he said he had a corvette, but he just didn't drive it to school.
Does his uncle work for Nintendo?
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: Is it possible to brick a NES cartridge by input alone?

Post by zeroone »

Can the processor recover from one of the KIL (JAM) [HLT] illegal opcodes by issuing a reset/break/interrupt? Or, do you have to power cycle it after a KIL?
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Is it possible to brick a NES cartridge by input alone?

Post by rainwarrior »

I believe a reset works, but not an IRQ/NMI. Some info here: http://www.pagetable.com/?p=39
Post Reply