Use of parallel ports in NES/PC interfaces

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

Moderators: B00daW, Moderators

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Re: Use of parallel ports in NES/PC interfaces

Post by kyuusaku » Mon Mar 25, 2013 5:02 pm

It's not hard to get a PCI-E parallel port for a modern computer, it is however difficult to rewrite legacy software to use it.

Cybertronic
Posts: 9
Joined: Sun Mar 24, 2013 11:16 am

Re: Use of parallel ports in NES/PC interfaces

Post by Cybertronic » Mon Mar 25, 2013 10:20 pm

tepples wrote:
Cybertronic wrote:You CAN find USB adapters that support all the right protocols but, you just have to look around.
Any help with the right query? Would usb ecp epp spp return mostly relevant results? I tried that and got If you need to connect a legacy parallel-port device like [...] EPROM programmer [...] please use our cardbus version which doesn't help for a laptop that has only USB, not CardBus.
If you want an IEEE1284 Card that is worth your money get a "2S1P Combo-Value" by SIIG It is fully compliant with IEEE 1284-1994 parallel port standard and supports ECP, EPP, PS2 and SPP modes.
On siig.com I see PCIe and PCI, one of which should work provided your PC is a desktop.
I feel Cardbus Technology died off too quickly. There were so many great options.

Worst case scenario you could build a USB2LPT...
http://www-user.tu-chemnitz.de/~heha/ba ... -16.en.htm

or buy it....
http://www.aliexpress.com/store/product ... 29698.html

The drivers virtualize the port so the legacy hardware doesn't know the difference. I got one a while back and works like a champ.


Additionally there is the Targus ACP45US1, but I have never used it personally but it is listed that it supports EPP/ECP and even comes with DB9 serial. Decent brand, but never tried this particular product before.

http://www.newegg.com/Product/Product.a ... 6834994907
kyuusaku wrote:It's not hard to get a PCI-E parallel port for a modern computer, it is however difficult to rewrite legacy software to use it.

With well written drivers you don't need to rewrite legacy software to use it. A proper legacy adapter should be fully transparent, and function as the original would using hardware virtualization if it isn't a junk product.

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

Re: Use of parallel ports in NES/PC interfaces

Post by lidnariq » Mon Mar 25, 2013 11:42 pm

USB, almost by definition, is incompatible with the way most legacy bit-banging parallel ports is used; it's not ECP or EPP that's necessary, but rather MMIO.

Now, this is something that—modulo timing constraints—could be supported by dosbox, dosemu, or the windows NTVDM; for 32-bit code running not in ring 0, a fault handler. All of these all involve more involvement from lower-level kernel bits than most people are comfortable with.

Cybertronic
Posts: 9
Joined: Sun Mar 24, 2013 11:16 am

Re: Use of parallel ports in NES/PC interfaces

Post by Cybertronic » Wed Mar 27, 2013 10:10 pm

lidnariq wrote:USB, almost by definition, is incompatible with the way most legacy bit-banging parallel ports are used; it's not ECP or EPP that's necessary, but rather MMIO.

Now, this is something that—modulo timing constraints—could be supported by dosbox, dosemu, or the windows NTVDM; for 32-bit code running not in ring 0, a fault handler. All of these all involve more involvement from lower-level kernel bits than most people are comfortable with.
That is a very good point, I really do take for granted all the virtual machines I run on my rig. Being in network administration, virtualization kinda becomes an every day thing for me, and I forget not everyone can or knows how to run virtual machines. But still as it stands, the information provided in the write ups that use these parallel ports are free and generally intended to be a low cost solution so people really shouldn't complain that the writeup calls for a parallel port rather than a specialized piece of hardware such as a programmable IC.

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

Re: Use of parallel ports in NES/PC interfaces

Post by tepples » Thu Mar 28, 2013 5:06 am

Cybertronic wrote:Being in network administration, virtualization kinda becomes an every day thing for me, and I forget not everyone can or knows how to run virtual machines.
I thought anybody who used NES programs developed since 1997 was aware of emulators, which are a kind of virtual machine.

Cybertronic
Posts: 9
Joined: Sun Mar 24, 2013 11:16 am

Re: Use of parallel ports in NES/PC interfaces

Post by Cybertronic » Thu Mar 28, 2013 3:51 pm

tepples wrote:
Cybertronic wrote:Being in network administration, virtualization kinda becomes an every day thing for me, and I forget not everyone can or knows how to run virtual machines.
I thought anybody who used NES programs developed since 1997 was aware of emulators, which are a kind of virtual machine.
yeah that is true, but it does not fit the context of this thread for what the parallel port is intended to be used for. OP wanted to write/dump some Famicom Disk system games, and the only option was via parallel port.. An Emulator for the NES would be of no use to him in this particular case. He can't just emulate .FDS images onto or off of a stack of Famicom disks to be used on a real Famicom/NES.

If he wanted to just play Famicom disk system games on an emulator I am sure he wouldn't have posted a rant on how he hates parellel ports can't get a hold of a computer with one.

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Re: Use of parallel ports in NES/PC interfaces

Post by kyuusaku » Thu Mar 28, 2013 4:24 pm

Will USB adapter drivers hook to port-writing DOS apps in NTVDM?
Virtual machines? Which virtual machines are able to forward port access (today)?
I know Dosbox can, but obviously there's timing jitter which still renders it unacceptable for many applications.

My LPT solution has been to use a USB MCU to issue buffered I/O with deterministic timing. It works well for almost every LPT application (as long as they don't use a write-back protocol), but reimplementing protocols sucks, and there's the unavoidable latency.

Cybertronic
Posts: 9
Joined: Sun Mar 24, 2013 11:16 am

Re: Use of parallel ports in NES/PC interfaces

Post by Cybertronic » Thu Mar 28, 2013 4:55 pm

VirtualBox is by far the best free virtual machine, it can forward port access as well as direct access to any hardware you'd like (with a bit of editing a few xml files). I've had virtual box setup before where it accessed a partition or another hard drive in a dual boot setup with full 3D hardware acceleration. I did this because I did not want to constantly reboot to switch between an OS, and I had brute force CPU power (i7 3930K) and plenty of ram on my side (32gb)

https://www.virtualbox.org/

As far as I know though it does not support parallel ports, but it does have, serial passthrough and emulation. There are some "hacks" to get it kinda working, and there is a release candidate version that has it added which you can try at your own risk.

https://forums.virtualbox.org/viewtopic ... rt#p233253


VMWare on the other hand, has full parallel virtualization or passthrough, but it isn't free.

http://www.vmware.com/

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Re: Use of parallel ports in NES/PC interfaces

Post by kyuusaku » Thu Mar 28, 2013 5:38 pm

If it can forward port access, why doesn't it support parallel ports? By serial support it sounds like its just hooking the Windows API, not actually trapping the ports which apparently requires IOMMU--a recent hardware extension.

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

Re: Use of parallel ports in NES/PC interfaces

Post by rainwarrior » Thu Mar 28, 2013 8:06 pm

kyuusaku wrote:It's not hard to get a PCI-E parallel port for a modern computer, it is however difficult to rewrite legacy software to use it.
Speaking of which, has anybody written a version of FDSLOADR that runs on a modern platform? (e.g. Windows 7 desktop with a PCIe parallel port installed)

If no, I'm planning to attempt it myself, but it would make me pretty happy to find out it's already done.

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Re: Use of parallel ports in NES/PC interfaces

Post by kyuusaku » Thu Mar 28, 2013 9:19 pm

FDSloadr needs a reliable timebase, which you can't get in a non-RTOS like Windows. If you rewrite it, you're better off targetting a FTDI chip in bit-bang mode (I'm saving this for a rainy week), or offloading the whole program to a microcontroller.

Cybertronic
Posts: 9
Joined: Sun Mar 24, 2013 11:16 am

Re: Use of parallel ports in NES/PC interfaces

Post by Cybertronic » Sat Mar 30, 2013 12:32 pm

kyuusaku wrote:FDSloadr needs a reliable timebase, which you can't get in a non-RTOS like Windows. If you rewrite it, you're better off targetting a FTDI chip in bit-bang mode (I'm saving this for a rainy week), or offloading the whole program to a microcontroller.
Then wouldn't the simple solution be to Emulate an RTOS environment?

http://www.freertos.org/FreeRTOS-Window ... MingW.html

I figure if you are going to write a modern implementation for Legacy hardware you should make modern systems behave more like legacy systems. That is part of the reason DOSBox exists because it is easier to make a modern OS behave like DOS rather than having a DOS application behave like a modern one. WOW32 is a wonderful example as well. Windows 7 64-bit runs 32 bit applications because it recreates a 32 bit environment natively by simulating 32 bit memory addresses and a few other things that aren't present or changed in a 64 bit OS. I can run Windows 3.1 in a virtual machine on a 64-bit processor so it would stand to reason that creating an RTOS wrapper for an application like FDSloader is possible to do. I am not saying it would be easy, just saying just because a Modern OS does things differently or doesn't do something an older OS did doesn't mean it can't be adapted to do so. XBOX 1 kernel and software operates at Ring 0, something Windows normally wouldn't do, and people had said it wasn't possible, yet people managed make Xbox Emulators that execute these very applications at Ring 0. (albeit they worked slowly and with faults but the point is the applications ran)

So we know the appropriate hardware can be found via PCI or USB, and the Above link shows that RTOS process threads can be created, now we just need the software to run with the RTOS threads and address the hardware.

here is a commercial RTOS virtualization..

http://www.tenasys.com/index.php/tenasy ... or-windows
Last edited by Cybertronic on Sat Mar 30, 2013 12:50 pm, edited 2 times in total.

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

Re: Use of parallel ports in NES/PC interfaces

Post by rainwarrior » Sat Mar 30, 2013 12:44 pm

Yes, there are ways of circumventing windows' scheduler when necessary.

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

Re: Use of parallel ports in NES/PC interfaces

Post by tepples » Sat Mar 30, 2013 1:01 pm

Can you run a 64-bit OS in a virtual machine inside a 32-bit OS and keep the benefits of a 64-bit OS?

Can you run a real-time OS in a virtual machine inside a non-real-time OS and keep the benefits of a real-time OS?

User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Re: Use of parallel ports in NES/PC interfaces

Post by blargg » Sat Mar 30, 2013 1:10 pm

For things that don't run constantly, there's always the 100% CPU approach to getting better scheduling on a non-real-time OS (though not the full guarantee of a real-time one).

Post Reply