Is NES/Famicom detection possible?
Moderator: Moderators
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Is NES/Famicom detection possible?
Is it possible to programmatically tell the difference between a NES and a Famicom?
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: Is NES/Famicom detection possible?
I have no idea what any of that means.
Re: Is NES/Famicom detection possible?
Yes. Ask player 2 to press all buttons on the controller, if start and select are missing, it's a Famicom.
Seriously though, there are a few characteristics that can only be found in Famicoms, such as the inability to read from OAM, but that's just because the Famicom is older and the earlier units used older revisions of the PPU and CPU, but after the NES was introduced, they probably shared the exact same chips.
Another difference between the NES and the Famicom is that the Famicom doesn't reset the PPU when the console resets... Not sure how that could be used, but asking players to reset the console isn't much better than asking player 2 to press all the buttons...
Seriously though, there are a few characteristics that can only be found in Famicoms, such as the inability to read from OAM, but that's just because the Famicom is older and the earlier units used older revisions of the PPU and CPU, but after the NES was introduced, they probably shared the exact same chips.
Another difference between the NES and the Famicom is that the Famicom doesn't reset the PPU when the console resets... Not sure how that could be used, but asking players to reset the console isn't much better than asking player 2 to press all the buttons...
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: Is NES/Famicom detection possible?
What about what lidnariq said?
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Is NES/Famicom detection possible?
That link described polling the controller devices and other things to detect the connected buttons/hardware etc. in a similar way, just without user input.
There is a caveat to this in that there are a lot of clone devices out there. If your software is trying to do something differently based on "NES" or "Famicom" you can probably with some effort identify those two machines specifically, but it gets a whole lot harder to cover all the bases. (Also... didn't Everdrive or PowerPak end up messing with the results of these tests in some way too?)
There is a caveat to this in that there are a lot of clone devices out there. If your software is trying to do something differently based on "NES" or "Famicom" you can probably with some effort identify those two machines specifically, but it gets a whole lot harder to cover all the bases. (Also... didn't Everdrive or PowerPak end up messing with the results of these tests in some way too?)
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: Is NES/Famicom detection possible?
Well, considering
A) We can't include every clone
and
B) Most people wouldn't have clones
I think this is fine to use for default language settings and controller pictures.
A) We can't include every clone
and
B) Most people wouldn't have clones
I think this is fine to use for default language settings and controller pictures.
- orlaisadog
- Posts: 166
- Joined: Thu May 31, 2018 11:12 am
- Location: Bristol, England
Re: Is NES/Famicom detection possible?
Also, can someone explain that post simply please?
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Is NES/Famicom detection possible?
This isn't like translating a sentence from one language to another. It's a complex technical topic, and there's a whole lot of required knowledge. I made an attempt to simplify it for you in my last post, but apparently you were unsatisfied because I removed too much in that simplification. Sorry that's not good enough, but explaining it in the way you need is probably far too much work for you to reasonably request all at once.orlaisadog wrote:Also, can someone explain that post simply please?
Like, the simple answer to your question is more or less "yes", though a better answer might be "it's probably a good idea to have the user choose directly, instead". If you want to learn the prerequisites for the "how" part, maybe start by learning something small first. Small questions are easier to answer.
I think there's far more clones than original systems out there at this point. This forum, though, does tend to be slightly biased toward the official Nintendo hardware, though there is a notable Dendy faction here too.orlaisadog wrote:Most people wouldn't have clones
Re: Is NES/Famicom detection possible?
I'll make it simple: the answer is yes, it can be done with accuracy for detecting a true NES vs. a true Famicom, with user involvement (asking the player to press buttons on controllers).
However: this may not work correctly (read: the detection may not be accurate) on some clone consoles (i.e. not true Nintendo-made NES or Famicoms).
Simple enough?
However: this may not work correctly (read: the detection may not be accurate) on some clone consoles (i.e. not true Nintendo-made NES or Famicoms).
Simple enough?
Re: Is NES/Famicom detection possible?
It isn't a very useful thing to do because Famicom and NES cartridges don't fit into each other's slots...
Re: Is NES/Famicom detection possible?
Even though clones didn't use to be particularly prevalent in most developed countries, they were in several parts of the world. Brazil, Russia and many other countries had Famiclones almost exclusively. But nowadays, even in the US, the old hardware is constantly failing, and since the patents for the console already expired, several companies are coming up with their own take on the system and cashing in on nostalgia.orlaisadog wrote:Most people wouldn't have clones
Unless designs like this become more common. Double-ended carts were normally used to put two games on the same cartridge, but it'd be really cool if someone decided to make dual NES-Famicom carts.pubby wrote:It isn't a very useful thing to do because Famicom and NES cartridges don't fit into each other's slots...
Re: Is NES/Famicom detection possible?
The pressing Start on controller 2 method won't distinguish an NES from an AV Famicom. The technique used by allpads will.
If it's just setting the default value for language selection so that the user doesn't have to go to Options as often, the stakes aren't quite that high.rainwarrior wrote:There is a caveat to this in that there are a lot of clone devices out there. If your software is trying to do something differently based on "NES" or "Famicom" you can probably with some effort identify those two machines specifically, but it gets a whole lot harder to cover all the bases.
PowerPak has pullups on data lines, while the NES grounds the lines in question. This can be detected and worked around. EverDrive behaves more like an authentic cartridge with respect to open bus behavior.rainwarrior wrote:(Also... didn't Everdrive or PowerPak end up messing with the results of these tests in some way too?)
Re: Is NES/Famicom detection possible?
Do you mean something similar to the "almighthy" Hydron? It's a little bizarre and kind of messy...tokumaru wrote:it'd be really cool if someone decided to make dual NES-Famicom carts.
But works fine!
Re: Is NES/Famicom detection possible?
Untested code, condensing the results of Riding the open bus:
Code: Select all
; The PPU is mapped at $2000-$3FFF. (Addresses $2000-$2007 are
; unique; $2008-$3FFF are mirrors.) The PPU contains a dynamic
; latch called "io_db" in Visual 2C02 and "PPUGenLatch" in FCEUX,
; which holds the last value written to any PPU port. Reading a
; write-only PPU port, such as the VRAM address ($2006), returns
; the value of io_db.
lda #$FF
sta $3F16 ; Fill $3F16 (i.e. $2006) and io_db
sta $3F16 ; write twice because that's conventional for $2006
cmp $3F16 ; read io_db
bne io_db_not_supported ; NOAC clones may implement io_db wrong
; The next read is tricky. When doing an indexed read that crosses
; a 256-byte boundary, 6502 adds the index to the low byte mod 256
; and then fixes it up next cycle if there was a carry.
; Thus $3FF6 + $20 reads $3F16 then $4016. The $3F16 read
; precharges the data bus with io_db. Then the $4016 read changes
; only those controller port bits that are connected to something.
; CAUTION: Open bus works differently on some flash cartridges.
; The PowerPak has pull-up resistors that continuously precharge
; the data bus with $FF. But because this is the same value we
; stored in io_db, it will not change the test result.
ldx #$20
lda $3FF6,x ; reads $3F16 then $4016
; Bits 3-4 are open bus on a Famicom but driven on an NES based
; on two wires of controller port 1, and usually driven low.
; They probably won't both be true on an NES unless a Zapper is
; plugged into port 1 and the trigger is half-pulled.
and #$18
cmp #$18
beq is_famicom
is_nes: