It is currently Wed Oct 17, 2018 8:20 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 104 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next
Author Message
PostPosted: Thu Jul 19, 2018 11:40 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Is it possible to programmatically tell the difference between a NES and a Famicom?


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 11:43 am 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7657
Location: Seattle
Yes. viewtopic.php?p=189960#p189960


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 11:46 am 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
I have no idea what any of that means.


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 11:51 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10897
Location: Rio de Janeiro - Brazil
Yes. Ask player 2 to press all buttons on the controller, if start and select are missing, it's a Famicom. :lol:

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...


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 12:11 pm 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
What about what lidnariq said?


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 12:26 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6887
Location: Canada
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?)


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 12:50 pm 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
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.


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 12:51 pm 
Offline
User avatar

Joined: Thu May 31, 2018 11:12 am
Posts: 153
Location: Bristol, England
Also, can someone explain that post simply please?


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 1:09 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6887
Location: Canada
orlaisadog wrote:
Also, can someone explain that post simply please?

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.

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.

orlaisadog wrote:
Most people wouldn't have clones

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.


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 1:15 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3634
Location: Mountain View, CA
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?


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 2:06 pm 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 381
It isn't a very useful thing to do because Famicom and NES cartridges don't fit into each other's slots...


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 3:02 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10897
Location: Rio de Janeiro - Brazil
orlaisadog wrote:
Most people wouldn't have clones

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.

pubby wrote:
It isn't a very useful thing to do because Famicom and NES cartridges don't fit into each other's slots...

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.


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 3:23 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20662
Location: NE Indiana, USA (NTSC)
The pressing Start on controller 2 method won't distinguish an NES from an AV Famicom. The technique used by allpads will.

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.

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:
(Also... didn't Everdrive or PowerPak end up messing with the results of these tests in some way too?)

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.


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 3:30 pm 
Offline
User avatar

Joined: Sat Jul 04, 2015 9:58 am
Posts: 817
Location: -29.794229 -55.795374
tokumaru wrote:
it'd be really cool if someone decided to make dual NES-Famicom carts.

Do you mean something similar to the "almighthy" Hydron?
Attachment:
File comment: Hydron
2.jpg
2.jpg [ 50.82 KiB | Viewed 1307 times ]

It's a little bizarre and kind of messy...
But works fine! :mrgreen:
Attachment:
cartucho-duplo-slot-72-e-60-pinos-roger-rabbit-original-nes-D_NQ_NP_667582-MLB26596058497_012018-F.jpg
cartucho-duplo-slot-72-e-60-pinos-roger-rabbit-original-nes-D_NQ_NP_667582-MLB26596058497_012018-F.jpg [ 243.9 KiB | Viewed 1307 times ]


Top
 Profile  
 
PostPosted: Thu Jul 19, 2018 3:48 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20662
Location: NE Indiana, USA (NTSC)
Untested code, condensing the results of Riding the open bus:
Code:
  ; 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:



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 104 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group