Retrode Forum

General Category => General Discussion => Topic started by: Wannado on 02/Dec/2014 01:32:45 AM

Title: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: Wannado on 02/Dec/2014 01:32:45 AM
You probably didn't expect this to happen anymore, but ...

With some help from JonY, Muzer, and of course Matthias, and using lots of information from the Nesdev website and similar sources, I designed and built a prototype of a NES plug-in for the Retrode. I also implemented experimental firmware support for this prototype. (Right now, it only exists as a branch and is not included in the standard firmware.)

I have attached a text file describing the pin assignments and an archive containing the PCB layout and schematics.
WARNING: My prototype uses a NES 72-pin connector (http://www.retro-video-game-repair.com/products/63-72-pin-connector/). The PCB must be exactly 1.2 mm thick to fit into that connector. (Warning added 2015-11-08)

Firmware Features

The experimental firmware has built-in support for NES cartridges with the following boards/mappers:
NROM, AxROM, CNROM, UxROM, SxROM/MMC1, TxROM/MMC3, HKROM/MMC6.
I have successfully tested it with all of my NES games.

Auto-detection of the above boards/mappers as well as the ROM/RAM sizes is working for all tested games.

Support of many other mappers is possible by implementing small "mapper drivers", which you can load at runtime by overwriting a particular file on the Retrode's file system (retained until the Retrode is disconnected/reset).

The ROM is presented in two ways:
- As an emulator-friendly ".nes" file (original iNES format, not NES 2.0). The information in the header is incomplete (and the battery flag isn't 100% reliable), but emulators should be able to deal with it. Some homebrew or pirate carts may be too large for this format.
- As separate files for PRG ROM and CHR ROM (which may also be RAM).

Detection of whether CHR is ROM or RAM is based on the frequency of the byte values (hex) F0, E0, C0, 03, 07, 0F. This is relevant for the ".nes" file, which only includes CHR ROM, not CHR RAM, for obvious reasons.

Savegame SRAM reading and writing is supported.


Status

2016-12-11: As stated previously, everything that is possible with the plug-in prototype is implemented in the experimental firmware and works quite well, and NES plug-in development retains its slow and irregular pace. However, my hopes that I could complete it in 2016 have proven illusory. It looks like it will still take months.
If I'll manage to do anything NES plug-in related in the few days this year has remaining, I will most probably be working on the improved PCB design.


To-do List

These are the major remaining items on my to-do list:
- Design an improved PCB, aiming to simplify assembly and use of the plug-in.
- Try to integrate NES plug-in support into the standard firmware.
- Maybe build another prototype with some modifications.
- Maybe improve detection of SRAM battery, if possible.


Update 2015-01-08: PCB and schematics added; formatting.
Update 2015-04-16: MMC6 (StarTropics) now supported, including SRAM reading.
Update 2015-11-08: Warning added; to-do list updated; spelling; new features: iNES file support, CNROM tested, SEROM now auto-detected like other SxROM.
Update 2016-03-20: Status, to-do list.
Update 2016-07-03: SRAM writing is now supported, size detection and CHR RAM detection improved; battery flag issue; status, to-do list.
Update 2016-12-11: Status.
Title: Re: NES plugin prototype created and working
Post by: Matthias_H on 02/Dec/2014 07:37:52 AM
That's great - congratulations!
Title: Re: NES plugin prototype created and working
Post by: nitro322 on 02/Dec/2014 02:14:49 PM
that's absolutely fantastic news.  Congrats, Wannado.  It sounds like you still have some work to do, but based on the previous discussion I've seen about this it sounds like just getting a working prototype is an incredible feat, and for my own purely selfish reasons I'm really hoping you can see this through to a final product.  :-)

For the "Implement emulator-friendly '.nes' file" part, for simplicity could you use something like the NES Cart Database XML file (http://bootgod.dyndns.org:7777/xml.php), which already contains details and checksums about most (if not all) known NES carts to identify the game via checksum and assemble the file as appropriate?  It seems like that'd be a fairly straightforward way to handle this part, though I'd guess it'd introduce some other challenges since embedding the whole XML file within the firmware would be rather wasteful.  Just an idea.
Title: Re: NES plugin prototype created and working
Post by: Nori on 03/Dec/2014 10:11:49 PM
That's absolutely awesome. I wish Matthias would do a reprint of the Retrode and a print of this plugin too. But I guess it's not going to happen. :(
Title: Re: NES plugin prototype created and working
Post by: Matthias_H on 06/Dec/2014 08:57:52 PM
There's more happening right now than you think :) Keep an eye on DragonBox...
Title: Re: NES plugin prototype created and working
Post by: hammer on 07/Dec/2014 07:12:03 AM
Will you email the mailing list if anything gets released?

BTW, since I was not able to buy an Atari 2600 adapter, I am trying to make one myself. I had 10 copies of the PCB made (and if this works, I will offer the extras to whoever might need them), and I'm in the process of getting a 2600 cartridge connector. Hopefully I can solder it without screwing it up.
Title: Re: NES plugin prototype created and working
Post by: Nori on 07/Dec/2014 11:24:10 PM
Awesome. Please be sure to let us know here when it's available. :p

When this gets sram support it will be epic.
Title: Re: NES plugin prototype created and working
Post by: Matthias_H on 08/Dec/2014 09:28:40 AM
Quote from: hammer on 07/Dec/2014 07:12:03 AM
Will you email the mailing list if anything gets released?

BTW, since I was not able to buy an Atari 2600 adapter, I am trying to make one myself. I had 10 copies of the PCB made (and if this works, I will offer the extras to whoever might need them), and I'm in the process of getting a 2600 cartridge connector. Hopefully I can solder it without screwing it up.

Careful: that adapter didn't work for all titles. I guess 30-year-old technology has higher switching currents than Retrode's controller can handle. I have done a new design for the 2600 plug-in (with additional resistors), but it's not tested yet.

Cheers,
Matthias
Title: Re: NES plugin prototype created and working
Post by: Khaz on 12/Dec/2014 03:42:53 AM
Quote from: Matthias_H on 06/Dec/2014 08:57:52 PM
There's more happening right now than you think :) Keep an eye on DragonBox...
I'm glad I checked back on the forum, I was under the impression everything had basically ground to a halt.

Is there actually a mailing list?  I would absolutely love some way to be notified of any new developments.  I don't want to risk missing another thing.

Oh yeah, and I should also say it's great to see this NES development!  Thank you very much for the work you've done Wannado!
Title: Re: NES plugin prototype created and working
Post by: hammer on 24/Dec/2014 03:38:02 AM
Quote from: Matthias_H on 08/Dec/2014 09:28:40 AM
Quote from: hammer on 07/Dec/2014 07:12:03 AM
Will you email the mailing list if anything gets released?

BTW, since I was not able to buy an Atari 2600 adapter, I am trying to make one myself. I had 10 copies of the PCB made (and if this works, I will offer the extras to whoever might need them), and I'm in the process of getting a 2600 cartridge connector. Hopefully I can solder it without screwing it up.

Careful: that adapter didn't work for all titles. I guess 30-year-old technology has higher switching currents than Retrode's controller can handle. I have done a new design for the 2600 plug-in (with additional resistors), but it's not tested yet.

Cheers,
Matthias

Didn't work like it just didn't work, or didn't work like it broke the Retrode somehow??? I already spent a bunch of effort on this mini-project... :)
Title: Re: NES plugin prototype created and working
Post by: hammer on 24/Dec/2014 03:39:13 AM
Quote from: Matthias_H on 08/Dec/2014 09:28:40 AM

Careful: that adapter didn't work for all titles. I guess 30-year-old technology has higher switching currents than Retrode's controller can handle. I have done a new design for the 2600 plug-in (with additional resistors), but it's not tested yet.

Cheers,
Matthias

And also, which titles didn't it work for?
Title: Re: (old Atari plug-in issues)
Post by: Wannado on 28/Dec/2014 04:48:12 PM
Quote from: hammer on 24/Dec/2014 03:38:02 AMDidn't work like it just didn't work, or didn't work like it broke the Retrode somehow??? I already spent a bunch of effort on this mini-project... :)
Quote from: hammer on 24/Dec/2014 03:39:13 AM
And also, which titles didn't it work for?

The way I understand it, the Retrode randomly froze when reading Atari 2600 cartridges. The theory is that the freezing is caused by high switching currents.

If the currents really exceed the Retrode's specifications, damage is possible, though no symptoms of damage have been observed yet.

I don't know which A2600 titles are affected. But even if a cartridge reads fine, the currents may still strain the hardware.
Title: Re: NES plugin prototype created and working
Post by: hammer on 28/Dec/2014 07:54:44 PM
That's annoying...after I went to all this trouble to make the PCB and source the connector....but thanks for the heads up. Is any work going to be done on this anytime in the not-so-distant future?
Title: Re: (Atari plugin)
Post by: Wannado on 31/Dec/2014 05:13:39 PM
Quote from: hammer on 28/Dec/2014 07:54:44 PM
That's annoying...after I went to all this trouble to make the PCB and source the connector...

You might still be able to improvise something using the PCBs you had produced. Maybe you could solder the Atari connector onto one of those cheap generic single-sided 100 mil raster PCBs. There, you could attach a resistor to each address and data pin. From the other end of each resistor, run a wire to the respective SMD solder pad on your SNES edge connector PCB.

You might also connect the long (stiff) wire legs of the resistors to the SMD pads directly, without additional (flexible) wires. That might simplify soldering. On the other hand, it will make it more difficult to avoid mechanical strain of the solder joints when inserting the edge connector into the Retrode.

Add wires for VCC and GND. Do not insert resistors into the VCC and GND lines.

Carefully consider the dimensions and location of each part. Keep in mind that you want to insert the SNES edge connector into the SNES slot of the Retrode and a cartridge into the Atari connector. There must be room for that. Mind the alignment (front/back) of the connectors and cartridge.

Oh, about the resistor value: In my NES plugin prototype, I have used 470 ohms resistors for this purpose, and it worked. Since the Atari is similarly ancient technology, I guess 470 ohms could work there, too. More is probably not necessary. IIRC, Matthias told me to use at least 100 ohms.
Title: Re: NES plugin prototype created and working
Post by: Matthias_H on 03/Jan/2015 10:48:33 AM
The simplest and cleanest solution is probably to sand off the solder stop (if any), use a cutter knife to interrupt the data lines, tin both ends, add a bit of flux, and bridge them with SMD resistors.

Cheers,
Matthias
Title: Re: NES plugin prototype created and working
Post by: slot9 on 28/Jan/2015 11:30:17 PM
I'm so excited by this news!
Title: Re: NES plugin prototype created and working
Post by: Ness and Sonic on 11/Feb/2015 09:43:55 AM
This would be nice to see on Stone Age Gamer.
Title: Re: NES plugin prototype created and working
Post by: Wannado on 25/Mar/2015 11:19:07 PM
Status update
Since I updated the OP in January, I had absolutely no time for the NES plugin or any other Retrode feature.

I'm still determined to improve the NES plugin design to make it easier for others to build one, or maybe even more.
But don't expect anything soon. I'll probably only have a few hours to spare for this every week.

Edit: See the OP for the most recent status.
Title: Re: NES plugin prototype created and working
Post by: Nori on 27/Mar/2015 09:53:54 PM
So at the moment SRM transfer is not yet possible?
Title: Re: NES plugin prototype created and working
Post by: Wannado on 06/Apr/2015 07:52:45 PM
Quote from: Nori on 27/Mar/2015 09:53:54 PM
So at the moment SRM transfer is not yet possible?
Reading SRAM from NES cartridges is working for the games I tested, writing SRAM is still on the to-do list (see original post).
Title: Re: NES plugin prototype created and working
Post by: EvilDragon on 17/Apr/2016 02:42:24 PM
Quote from: Wannado on 25/Mar/2015 11:19:07 PM
Status update
Since I updated the OP in January, I had absolutely no time for the NES plugin or any other Retrode feature.

I'm still determined to improve the NES plugin design to make it easier for others to build one, or maybe even more.
But don't expect anything soon. I'll probably only have a few hours to spare for this every week.

Great :) I'm still up for mass producing it, when it's finished :)
Title: Re: NES plugin prototype created and working
Post by: Wannado on 25/Apr/2016 08:42:50 PM
Quote from: EvilDragon on 17/Apr/2016 02:42:24 PM
Quote from: Wannado on 25/Mar/2015 11:19:07 PM
Status update
Since I updated the OP in January, ...

Great :) I'm still up for mass producing it, when it's finished :)

I have updated the OP again in the meantime, though not much has changed (except that I now at least did other Retrode stuff).

The prototype has two PCBs, of which one plugs into that NES spare part. For a mass-producible design, the plug-in should instead have only one PCB with the cartridge slot soldered onto it.

And that slot will probably be the biggest problem: 72 (2x36) pins with a stride of 2.50 mm seem to be rare. For a small series, Matthias suggested to saw apart shorter 2.50 mm slots, because we don't need the center pins. But that's nothing for real mass production. (Note: I have no idea how many or few people would be interested in buying this. Nevertheless, I'll try and make it as mass-producible as possible.)

Using 2.54 mm stride slots seems inacceptable to me, the risk of short circuits is too high: 0.04 mm * 18 = 0.72 mm = 28,8% of a pin, and if you don't center the cartridge perfectly, the offset will be even greater.

Edit: The 72 pins are 2x36, so the half width of the slot is 18 pins, not 36.
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: EvilDragon on 24/Jul/2016 08:40:25 AM
Thanks for the info!
I'll check with my production facility whether they can source these!
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Ice Man on 29/Jul/2016 07:57:31 PM
Just saw this plugin and indeed would love to see more.

Here's a small suggestion.

Why are you using the original NES mechanic connector instead of a solder NES connector like the kazzo or Retron consoles? It's much easier to deal with, doesn't bend pin easily and is is cheap to get as well.

That way you can do everything on once PCB and someone could print a neat 3D case for that, too. ;)
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Wannado on 29/Jul/2016 08:25:57 PM
Quote from: Ice Man on 29/Jul/2016 07:57:31 PM
Why are you using the original NES mechanic connector instead of a solder NES connector like the kazzo or Retron consoles? It's much easier to deal with, doesn't bend pin easily and is is cheap to get as well.

See reply #21 (http://forum.retrode.org/index.php/topic,282.msg2202.html#msg2202) above. The solder connectors I managed to find so far had the wrong stride.
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Ice Man on 29/Jul/2016 09:15:55 PM
Have you tried the one from Tototek?
http://www.tototek.com/store/index.php?main_page=product_info&cPath=22&products_id=179
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Wannado on 31/Jul/2016 10:44:56 AM
The page does not seem to list any specifications for the connector. I noticed that they also offer EverDrives, but I have no idea whether that's legitimate.
@EvilDragon, do you know anything about Tototek?

Before I built my prototype, I spent many hours trying to find a suitable connector, and I only found the NES spare part. I hope that EvilDragon will be more successful.

For a new prototype, if I get around to making one, I will use sawn-off pieces of shorter connectors.

Note that I am also aware of the threads on the Nesdev forums where people discussed the use of connectors with the wrong stride. I guess, if you can ensure that the cartridge is centered properly, and if the connector has narrow contacts, it may work. But I'm not a fan of such a solution.
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Ice Man on 01/Aug/2016 09:07:18 AM
I've bought this NES connector for my kazzo NES/FC dumper and it works great with all NES carts. Never had any issues yet. It's a solder type connector.
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Wannado on 06/Aug/2016 06:24:05 PM
Could you please try and measure the width of one row of 36 pins on that connector?

With 2.50 mm per pin, one row would be 9.0 cm (about 3.54 inches) wide. However, that includes 36 gaps, and there are only 35 gaps between 36 pins. With 2.54 mm (0.1 inch) per pin, the row would be 9.144 cm (3.6 inches) wide.
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Ice Man on 09/Aug/2016 09:23:22 PM
Will do, when I get my Kazzo back. I've borrowed it a friend.
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Ice Man on 30/Aug/2016 10:37:37 PM
Got my Kazzo back, measured and it's 9cm for 36 pins.
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Wannado on 03/Sep/2016 09:43:21 PM
That sounds great. Thank you, Ice Man! :)
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: Ice Man on 12/Sep/2016 05:12:06 PM
You're welcome. Hope it works out with this connector. Would love to hear any news. :D
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: EvilDragon on 05/Oct/2016 12:30:16 AM
That's great!
I haven't done much with Tototek yet, but I'm sure they'll sell it for cheaper prices as well, if I buy 1k of them.

I just ordered the PCB for more N64, SMS and GBx-Plugins, so whenever you're ready for a NES-Plugin, I'm happy to produce it as well :D
Title: Re: NES plug-in prototype created and working (last update: 2016-07-03)
Post by: EvilDragon on 05/Oct/2016 01:10:48 AM
BTW: Morethanall (which is where we get the SMS connectors) also have 2.5mm 72pin connectors:

http://www.morethanall.com/upload/products_pdf/1831725386541640ff59ee8.pdf
http://www.morethanall.com/upload/products_pdf/63739209054d1b129d8f60.pdf

They don't have 90° angled ones. though.
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: Matthias_H on 03/Jan/2017 08:36:04 AM
Last time I inquired they said that those weren't available (though they might change their mind when an order of 10kpcs comes in)
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: ShoothimNow on 03/Jan/2017 05:38:09 PM
This is going to sound stupid (and I already apologize a ton before even asking it)... but....

Upon reading the updates, I spotted : battery flag issue

Would there be a way to... indicate how much life is left on a battery?  I am the furthest thing from an electrical engineer, but I had to make an account and ask.

I already feel like a fool asking  :-X
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: Wannado on 04/Jan/2017 04:33:50 PM
The game cartridge provides no suitable connection that would allow the Retrode to directly sense the presence of the battery, measure its voltage, etc.

The battery is supposed to power only the save RAM, not the other ICs of the cartridge. Also, it must not be "charged" by the regular supply voltage from the NES/... (there is at least one diode in the cartridge to prevent this). I therefore believe that the battery is "isolated" so that its voltage cannot be measured through the cartridge connector, not even at the cartridge's power supply pins.

The Retrode can only look at the data in the game's RAM and make a guess if that's meaningful game data (battery backed) or just what that particular RAM chip likes to initialize with.
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: ShoothimNow on 17/Jan/2017 03:32:05 PM
Like I said, it was a terribly stupid question =) Thanks Wannado =)
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: Phoenix on 07/Jan/2019 04:52:49 PM
Hi, I was wondering what has occurred with the NES adapter project since Dec 2016 :)
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: newbie2 on 25/Jan/2019 11:23:50 PM
The most recent Kazzo (now called inlretro) is also an option: http://www.infiniteneslives.com/inlretro.php
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: Phoenix on 28/Jan/2019 12:03:22 AM
Quote from: newbie2 on 25/Jan/2019 11:23:50 PM
The most recent Kazzo (now called inlretro) is also an option: http://www.infiniteneslives.com/inlretro.php
I was thinking more about an adapter/firmware than a new system
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: ssokolow on 30/Jan/2019 08:48:54 AM
Quote from: newbie2 on 25/Jan/2019 11:23:50 PM
The most recent Kazzo (now called inlretro) is also an option: http://www.infiniteneslives.com/inlretro.php

Ooh, nice! They've released a new version with with Linux officially a supported platform for the host app. Looks like I'll have to start adding some NES games to my collection when I have some slack in my entertainment budget.

(Last I checked, the INL Retro was the old three-slot version which relied on the same host software as original Kazzo boards... and the Linux port of that is so hard to track down in the maze of NESdev posts that it's semi-mythical.)
Title: Re: NES plug-in prototype created and working (last update: 2016-12-11)
Post by: newbie2 on 03/Feb/2019 09:54:41 AM
Quote from: Phoenix on 28/Jan/2019 12:03:22 AM
Quote from: newbie2 on 25/Jan/2019 11:23:50 PM
The most recent Kazzo (now called inlretro) is also an option: http://www.infiniteneslives.com/inlretro.php
I was thinking more about an adapter/firmware than a new system

Unfortunately it seems to be the only game in town for NES at this point. If you just opt for the NES connector it is $35 plus shipping which is not that much more than what the retrode plugins cost.