$4016 D3 and D4 ports on Famicom

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

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

Re: $4016 D3 and D4 ports on Famicom

Post by rainwarrior » Thu May 02, 2019 1:09 pm

Probably not news to the people in this thread, but I hadn't seen what the Four Score PCB looks like. There are some good photos here:
http://nintendoage.com/forum/messagevie ... adid=65237

So it was actually made by Hori? Both the ASIC and the PCB have their name on it.
tepples wrote:Would it be accurate to sum it up as a Four Score connected to D1 with $4017 and $4016 swapped at both the input and output?
Are we missing a turbo feature?

Bananmos
Posts: 468
Joined: Wed Mar 09, 2005 9:08 am
Contact:

Re: $4016 D3 and D4 ports on Famicom

Post by Bananmos » Thu May 02, 2019 5:36 pm

So I've just tried Micro Mages, and realised to my disappointment that both my Fourscores are PAL variants and won't play it at all on my NTSC NES. And judging by the thread at Nintendo age, no one has figured out a solution for how to mod the fourscore either.

I'd like to avoid any more delay in getting Micro Mages to run in 4-player mode, by just buying a US one on eBay. But this is proving more difficult than expected. The listings which show the back side of the fourscore are few and far between. So I guess my best bet is to look at the seller's location and hope it indicates the right model.

What's more, I'm not even sure exactly what part number I am looking for here, as despite loads of googling I cannot find any definite statement of what part number the US fourscore actually has. So far, I've found pages saying that the common European version is "NESE-034", and the one released in Scandinavia is "NES-034". And then yet another page saying the Scandinavian model is "NES-034A". And yet, I seem to be finding US sellers on ebay selling "NES-034A" versions. So something doesn't add up here...

Could anyone fortunate enough to own a US fourscore check the back / upload a photo?

tepples
Posts: 21750
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: $4016 D3 and D4 ports on Famicom

Post by tepples » Thu May 02, 2019 5:40 pm

From the back of the Four Score accessory (for NTSC NES) that I bought to write the "Eighty" tech demo:
Nintendo®
NES FOUR SCORE™
----------
Model No: NES-034
Rating: 10 mA
©1990 Nintendo
Pat. Pend. Made in Japan

lidnariq
Posts: 8780
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: $4016 D3 and D4 ports on Famicom

Post by lidnariq » Thu May 02, 2019 7:27 pm

Bananmos wrote:So I've just tried Micro Mages, and realised to my disappointment that both my Fourscores are PAL variants and won't play it at all on my NTSC NES. And judging by the thread at Nintendo age, no one has figured out a solution for how to mod the fourscore either.
I'd guess that the controller ports on the PAL Four Score have the same stupid pile of diodes that the PAL NES has...

Pokun
Posts: 1270
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: $4016 D3 and D4 ports on Famicom

Post by Pokun » Fri May 03, 2019 1:38 am

Yes, but only PAL-A (IIRC) and certain (German) PAL-B Four Scores. They should work on any NES but they require NES-004E controllers. The SCN PAL-B Four Scores shouldn't have those diodes or else they wouldn't be usable with the NES-004 controllers that NTSC and SCN NES systems comes with.

In other words NES-034A should be fine for NTSC and should work with any NES controllers.
rainwarrior wrote:
tepples wrote:Would it be accurate to sum it up as a Four Score connected to D1 with $4017 and $4016 swapped at both the input and output?
Are we missing a turbo feature?
Good point, I can't see a turbo switch anywhere.

lidnariq
Posts: 8780
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: $4016 D3 and D4 ports on Famicom

Post by lidnariq » Fri May 03, 2019 2:04 pm

Pokun wrote:Some people use one of the D3 or D4 pins for the microphone which breaks Zappers and accessories but then adds a switch so you have to choose either microphone or Zapper but not both at the same time.
... Could you get away with shorting 4016d2 and 4017d3? Such that whatever's plugged in (controller with microphone, or zapper) the same bit will appear in both places?

I suppose it could be a problem if there games that use the microphone and also the zapper?

Bananmos
Posts: 468
Joined: Wed Mar 09, 2005 9:08 am
Contact:

Re: $4016 D3 and D4 ports on Famicom

Post by Bananmos » Fri May 03, 2019 4:40 pm

So to my delight, it appears that NES-004E controllers *do* work on an NTSC NES when plugged into a NESE-034 fourscore. And they are the standard ones here in the UK, so easy to buy. I just didn't happen to have many of them, since my PAL NES's were from Sweden, and I then got NTSC ones - both of which use the NES-004 controller variant.

So looks like I'll soon have a 4-player Micro Mages setup after all... and the fourscore setup will be useful as a general coord extension too. :)

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

Re: $4016 D3 and D4 ports on Famicom

Post by rainwarrior » Fri May 03, 2019 7:15 pm

Do we have some documentation I could reference about the PAL controllers' diode protection?

From what I could find: the PAL controller port has 6 diodes on it, which can be bypassed to get NTSC controllers to work. To mod the controller side instead to work with PAL the recommendation is to put two 3.6K resistors connecting both LATCH and CLK to 5V. Presumably the latter is how the PAL controllers are normally wired?

Is there a schematic for the diodes in the controller port? Are there any negative consequences of doing either mod, or is it perfectly safe to use a PAL controller with an NTSC system? Is it unsafe to have an NTSC controller plugged into a PAL system?

lidnariq
Posts: 8780
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: $4016 D3 and D4 ports on Famicom

Post by lidnariq » Fri May 03, 2019 7:57 pm

rainwarrior wrote:Is there a schematic for the diodes in the controller port?
Using the pictures here and here, it appears to be
+5V --|>|-- jack
D3 --|>|-- jack
D4 --|>|-- jack
D0 --|>|-- jack
OUT --|<|-- jack
CLK --|<|-- jack
the marked capacitor isn't populated
the marked capacitor isn't populated
nes controllers PAL1-marked.png (61.26 KiB) Viewed 9025 times
Digitally, the diodes on D0, D3, D4 are a no-op - the NES already has a pull-up inside the console. However, on OUT and CLK it makes them open-collector, and the controller must add those pull-ups to work around it.

The diode on +5V makes this really sound like it was for some sort of regulatory compliance instead of "just" region locking them.
Are there any negative consequences of doing either mod, or is it perfectly safe to use a PAL controller with an NTSC system?
I can't think of any reason that the extra pull-ups on a NES system (3.6kΩ) would be bad. There's already a 10kΩ pull-up inside the console; two PAL controllers plugged into a deck would consume a tiny bit more static power – about 1.4mA per controller since OUT is idle low and CLK is idle high.
Is it unsafe to have an NTSC controller plugged into a PAL system?
No, it just won't work. It'll always see OUT and CLK as low, so no bits will ever come out.

Pedantically, diodes actually do conduct a tiny amount when reverse-biased, so it's conceivable that a sufficiently leisurely reading routine might be able to coax bits out.

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

Re: $4016 D3 and D4 ports on Famicom

Post by rainwarrior » Fri May 03, 2019 11:32 pm

Thanks for that explanation.

Pokun
Posts: 1270
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: $4016 D3 and D4 ports on Famicom

Post by Pokun » Sat May 04, 2019 8:58 am

Yes thanks! I'm glad to finally get a good explanation of how they are wired and why NES-004 controllers doesn't work on non-SCN PAL systems and Four Scores.

I see that the Hori multitap and the non-SCN PAL controller situation are both added to the wiki. Great!
Maybe the non-SCN PAL Four Score (NESE-034) should be mentioned too. It works on any NES (and HVC-101 I guess) but it requires controllers with pull-ups (NESE-004).
lidnariq wrote:
Pokun wrote:Some people use one of the D3 or D4 pins for the microphone which breaks Zappers and accessories but then adds a switch so you have to choose either microphone or Zapper but not both at the same time.
... Could you get away with shorting 4016d2 and 4017d3? Such that whatever's plugged in (controller with microphone, or zapper) the same bit will appear in both places?

I suppose it could be a problem if there games that use the microphone and also the zapper?
Yes and maybe a buzzy microphone would also mess with the Zapper. I think the microphone needs a separate wire.
lidnariq wrote:The diode on +5V makes this really sound like it was for some sort of regulatory compliance instead of "just" region locking them.
Then again Nintendo did the same thing with PAL SNES controllers, and that time they didn't discriminate Scandinavia either.
On the other hand, the 64 has region-free controllers but PAL versions got a ferrite bead lump on the cord. It's like a pattern of Nintendo to modify PAL controllers.

lidnariq
Posts: 8780
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: $4016 D3 and D4 ports on Famicom

Post by lidnariq » Sat May 04, 2019 2:57 pm

Pokun wrote:Yes and maybe a buzzy microphone would also mess with the Zapper. I think the microphone needs a separate wire.
But only if there are games that care about both at the same time, right? The point is that on the AV Famicom there's no microphone unless the user added it... Whereas on the original Famicom someone theoretically could have held the P2 controller as a mic and the zapper at the same time.

So it's true that if a game expects the microphone, and the zapper is plugged in instead, it'll get a nonsense signal, and vice versa ... but if the right peripheral is plugged in, and no game cares about both at the same time, I can't figure out why it wouldn't be ok?



Also, I sat down and traced the picture of the PCB of the US Four Score, and found something interesting... they didn't swap the various pins on the ASIC around to achieve the changed signature... I think the signature might be controlled by pin 12... either that, or pins 13-16 are wired differently and pin 12 routes the different signals differently.

Code: Select all

           ---v---
P2 Clk <- |o 1 22 | -- 5V
P2 Dat -> |  2 21 | <- 2//4
P3 Clk <- |  3 20 | -> P1 Clk
P3 Dat -> |  4 19 | <- P1 Dat
P4 Clk <- |  5 18 | -> relayed OUT
P4 Dat -> |  6 17 | <- *out?
TurboB -> |  7 16 | -> *4016d?
TurboA -> |  8 15 | <- *clk1?
  C/RA -> |  9 14 | -> *4017d?
    RB <- | 10 13 | <- *clk2?
   Gnd -- | 11 12 | <- gnd***
           -------
* can't verify, assumed same as preceding pinout.
*** note change

(edit:) Have to admit I'm tempted to get my hands on a Four Score just so that I can see what changes if I change what pin 12 is tied to.

Pull-ups R2, R3, & R4 on the board pull "out", "clk1", and "clk2" high. Current-limiting resistors R9, R10 prevent bus conflicts (with what??) on "4016d" and "4017d". Every pin between the ASIC and one of the controller jacks has undervoltage protection diodes (nine in total: one for OUT, four for DATA and four for CLOCK). Every data pin from a controller has a pull-up resistor.

Also, in hindsight, there's no reason the Four Score needs its own 25µs RC to detect when to restart the serial stream, so I'm not entirely certain what it is for. It's too fast to just be the turbo button control, although they obviously could have a digital divider inside.

krzysiobal
Posts: 589
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland

Re: $4016 D3 and D4 ports on Famicom

Post by krzysiobal » Thu Jun 13, 2019 1:04 am

I did few experiments with four-score (PAL version 1.1, chip: FPA-PAL-S01).
Image Image Image Image


First, the exact shape and parameters of input clocks (pin 9, 10):
13.2395 kHz
Image

Then, I wrote a simple program that returns in loop state of button A as fast as possible,

Code: Select all

lda #1
	ldx #0
	clc
forever1:	
	sta $4016
	stx $4016
	bcc forever1
enabled "turbo A" on four score and hold the A button. The button read-back state was alternating every 34.617ms and the transition always appeared during rising edge of four-score clock, every 512 of them.
Image

Next I looked at the time dependency between OUT0 (from console) and its buffered version (fed into joypads), as well as the joypad clocks.
Image

And last thing is the mysterious pin 12 - it alters he signature returned by 16-24 reads.
When disconnected, it seems to be internally pulled up to +5V.

Code: Select all

pin 12 | $4016 reads 16-24  | $4017 reads 16-24
 GND           $10                   $20
 +5V           $20                   $10
BTW. I did few months ago similar adapter, which can work in 3 modes (selected by switch):
Mode 1 - 4 players in NES format
Mode 2 - 4 players in Famicom format
Mode 3 - Joypad 1 and 3 controls $4016.D0 and Joypad 2 and 4 controls $4017.D0 (So you can play regular 1 player games using 2 joypas or 2 player games using 4 joypads)

Image

Post Reply