FAQFAQ   GalleryGallery   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   Forum RSS Feed   Hacked Gadgets Main Site 

NES controller to parallel port
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Hacked Gadgets Forum Index -> Toy Hacks
View previous topic :: View next topic  
Author Message
Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Mon Jan 07, 2008 5:52 am    Post subject: NES controller to parallel port Reply with quote

I got bored so I connected a NES controller to my pc's parallel port and made a test program in FreeBASIC:


Code:
dim i as integer
dim x as integer
dim btna as integer
dim btnb as integer
dim btnse as integer
dim btnst as integer
dim btnup as integer
dim btndn as integer
dim btnl as integer
dim btnr as integer
screen 7
color 10, 0
out 890, 0
out 888, 0
do while inkey$ = ""
out 888, 2: out 888, 0
btna = 0: btnb = 0: btnse = 0: btnst = 0: btnup = 0: btndn = 0: btnl = 0: btnr = 0
if inp(889) = 127 then btna = 1
out 888, 1: out 888, 0
if inp(889) = 127 then btnb = 1
out 888, 1: out 888, 0
if inp(889) = 127 then btnse = 1
out 888, 1: out 888, 0
if inp(889) = 127 then btnst = 1
out 888, 1: out 888, 0
if inp(889) = 127 then btnup = 1
out 888, 1: out 888, 0
if inp(889) = 127 then btndn = 1
out 888, 1: out 888, 0
if inp(889) = 127 then btnl = 1
out 888, 1: out 888, 0
if inp(889) = 127 then btnr = 1
out 888, 1: out 888, 0
locate 1, 1
print "A button ="; btna
print "B button ="; btnb
print "Select button ="; btnse
print "Start button ="; btnst
print "Up button ="; btnup
print "Down button ="; btndn
print "left button ="; btnl
print "Right button ="; btnr
loop
end
Sorry for the badly written program Laughing


eric
Back to top
View user's profile Send private message Visit poster's website

Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Fri Jan 18, 2008 11:19 am    Post subject: Reply with quote

Here is a program that I made that lets me play a NES emulator (or anything else) and use a NES controller.


Code:
#Define KEYEVENTF_KEYDOWN 0
#Include "windows.bi"
Dim As Integer btna, btnb, btnc, btnd, btne, btnf, btng, btnh

Cls
Color 12, 0
Print "Nintendo Entertainment System Controller To Keyboard"
Print
Print
Color 15, 0
Print "White Wire From The Controller To Pin 1 On The Parallel Port (Power)"
Print "Red Wire From The Controller To Pin 2 On The Parallel Port (Clock)"
Print "Orange Wire From The Controller To Pin 3 On The Parallel Port (Latch)"
Print "Brown Wire From The Controller To Pins 18-25 On The Parallel Port (Ground)"
Print "Yellow Wire From The Controller To A 2.2K Resistor (Data)"
Print "The Other End Of The Resistor To The Base Of A NPN Transistor"
Print "The Emitter Of The Transistor To Pins 18-25 On The Parallel Port (Ground)"
Print "The Collector Of The Transistor To Pin 11 On The Parallel Port (Data)"
Print
Print
Print "Set Your Game's Keyboard Settings For The A Button To Be The Letter A"
Print "B Button To The Letter B"
Print "Start Button To The Enter Key"
Print "Select Button To The Space Bar"
Print "The Direction Pad To The Arrow Keys"
Print
Print
Print "Minimize This Window And Play Your Game"
Print
Print "To Close This Window Have It In focus And Hit The Esc Key"

Out 890, 0
Out 888, 0
Do Until Inkey$ = Chr(27)
Out 888, 2:Sleep 1: Out 888, 0:Sleep 1

btna = Inp(889)
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1

btnb = Inp(889)
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1

btnc = Inp(889)
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1

btnd = Inp(889)
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1

btne = Inp(889)
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1

btnf = Inp(889)
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1

btng = Inp(889)               
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1
                                                                   
btnh = Inp(889)
Out 888, 1:Sleep 1: Out 888, 0:Sleep 1   

If btna = 127 Then
Keybd_event &h41, &h1E, KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h41, &h1E, KEYEVENTF_KEYUP, 0
End If    'A

If btnb = 127 Then
Keybd_event &h42, &h30, KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h42, &h30, KEYEVENTF_KEYUP, 0
End If    'B                                                             

If btne = 127 Then                                                       
Keybd_event &h26, &h48, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h26, &h48, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
End If    'UP

If btnf = 127 Then
Keybd_event &h28, &h50, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h28, &h50, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
End If    'DOWN

If btng = 127 Then
Keybd_event &h25, &h4B, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h25, &h4B, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0                                 
End If    'LEFT

If btnh = 127 Then
Keybd_event &h27, &h4D, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h27, &h4D, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
End If    'RIGHT

If btnd = 127 Then
Keybd_event &h0D, &h1C, KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h0D, &h1C, KEYEVENTF_KEYUP, 0
End If    'START (ENTER)

If btnc = 127 Then
Keybd_event &h20, &h39, KEYEVENTF_KEYDOWN, 0
Else
Keybd_event &h20, &h39, KEYEVENTF_KEYUP, 0
End If    'SELECT (SPACE BAR)

Sleep 20
Loop
Cls
End


ps. the program seems to lock up if there is no controller attached.


eric


Last edited by Turd on Tue Oct 21, 2008 6:50 pm; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
Project_Nightmare
HG Master


Joined: 12 Oct 2007
Posts: 119
Location: Gig Harbor, WA

PostPosted: Fri Jan 18, 2008 10:48 pm    Post subject: Reply with quote

Lol, I know a lot of places that show conversions of controllers to computer ports. I myself got some for my emulators. PM me if you want them, though I need to retrace my steps to find them since I lost interest in them.
Back to top
View user's profile Send private message Send e-mail
Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Sat Jan 19, 2008 2:42 pm    Post subject: Reply with quote

Sure I'd like to see those, if it's no problem Very Happy


eric
Back to top
View user's profile Send private message Visit poster's website
Project_Nightmare
HG Master


Joined: 12 Oct 2007
Posts: 119
Location: Gig Harbor, WA

PostPosted: Sat Jan 19, 2008 3:28 pm    Post subject: Reply with quote

I have used the Xbox controllel hack from redcl0ud and it worked great for me, especially when I connected the live headset to it and used it as my mic/heaset.

To mod an (original) XBox controller to usb (and you can download the drivers to have all the devices that can be connected it also work):
http://www.redcl0ud.com/

N64 to parallel:
http://arcadecontrols.com/Mirrors/emulatronia/n64pad/

PSX to parallel:
http://www.emulatronia.com/reportajes/directpad/psxeng/print.htm

SNES to parallel:
http://www.tolaris.com/snes-to-parallel/

If you want to buy some controller adaptors you can buy it from here:
http://www.ztnetstore.com/

It's a pitty that znet resold the (n64) adaptoid for a limited time a few years after it was discontinued (I luckly got one and it works great). I also got the "N64/PSX USB Adapter" too for my n64 controller but it is crap (it goes wacky when i connect the controller to it and it doesn't work well with the PSX controller also).


Last edited by Project_Nightmare on Thu Apr 10, 2008 6:34 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Sat Jan 19, 2008 6:30 pm    Post subject: Reply with quote

Great links, thanks Very Happy


eric
Back to top
View user's profile Send private message Visit poster's website
Project_Nightmare
HG Master


Joined: 12 Oct 2007
Posts: 119
Location: Gig Harbor, WA

PostPosted: Sat Jan 19, 2008 8:44 pm    Post subject: Reply with quote

NP Cool I was glad I could find them again and none were dead links Razz
Back to top
View user's profile Send private message Send e-mail
Project_Nightmare
HG Master


Joined: 12 Oct 2007
Posts: 119
Location: Gig Harbor, WA

PostPosted: Thu Jan 24, 2008 9:49 am    Post subject: Reply with quote

Oh, and I'd like to add that you can find a long list of emulators here:
http://en.wikipedia.org/wiki/List_of_video_game_console_emulators

And a long list of games here (though it is hard to find out how to download them at first):
http://romhustler.net/
Back to top
View user's profile Send private message Send e-mail
Logic Kills
HG Writer


Joined: 17 Nov 2007
Posts: 17

PostPosted: Wed Apr 09, 2008 4:27 pm    Post subject: Reply with quote

Nice, can't believe I didn't see this earlier.
Back to top
View user's profile Send private message
Project_Nightmare
HG Master


Joined: 12 Oct 2007
Posts: 119
Location: Gig Harbor, WA

PostPosted: Thu Apr 10, 2008 6:32 pm    Post subject: Reply with quote

I recently found that romhustler stopped hosting some of their roms, use this site if you cant get the ones that you want: http://www.emuparadise.org/roms/#




If you have some consoles that you want to play online for free, you should also see my console tunneling post: http://forum.hackedgadgets.com/viewtopic.php?t=1629
Back to top
View user's profile Send private message Send e-mail
crusch
Newbie


Joined: 19 May 2008
Posts: 3

PostPosted: Mon May 19, 2008 7:16 pm    Post subject: Reply with quote

great post and links, I've been wondering looking for this. thanks a lot!
_________________
Packet Bytes Cruschgear Jimerston Life Views Webarracks
Back to top
View user's profile Send private message
Project_Nightmare
HG Master


Joined: 12 Oct 2007
Posts: 119
Location: Gig Harbor, WA

PostPosted: Fri May 23, 2008 11:58 pm    Post subject: Reply with quote

crusch wrote:
great post and links, I've been wondering looking for this. thanks a lot!


Glad I could be of assistance Very Happy
Back to top
View user's profile Send private message Send e-mail
lmczitz
Newbie


Joined: 27 Jul 2008
Posts: 1

PostPosted: Sun Jul 27, 2008 11:47 am    Post subject: I will thank you guys very much if you could help. Reply with quote

I created a SNES to Parallel Port adapter. My problem is that unfortunately the thing simply won't work with WINDOWS XP PRO SP2 with drivers I am utilizing. These drivers are the fallowing:
PPjoy http://www.simtel.net/pub/pd/75176.htmland
Direct Pad Pro http://arcadecontrols.com/Mirrors/www.ziplabel.com/dpadpro/
I will thank you guys greatly if you can find information on how to make this thing work properly with XP SP2.

NOTE: I heard that there are some issues with the drivers for this mod and directX9c....

Thanks again in advance guy. God bless you all.
Back to top
View user's profile Send private message AIM Address
Turd
HG Ruler


Joined: 18 Aug 2007
Posts: 274
Location: Saskatchewan, Canada

PostPosted: Sun Jul 27, 2008 2:25 pm    Post subject: Reply with quote

The source code is listed on the site but I don't know anything about C, C++ or whatever it is. Sorry I wish I could help you. Maybe someone else knows how to get it working.


On another note, my program won't compile anymore Sad


eric
Back to top
View user's profile Send private message Visit poster's website
meetu
Newbie


Joined: 01 Oct 2008
Posts: 4

PostPosted: Wed Oct 01, 2008 6:58 am    Post subject: Hi Reply with quote

This seems amazing to me as i have never seen this before

___________________________________________________
loans.co.uk/help/no-credit-check-loans.php]no credit check loans[/url] anuncios vilafranca del penedes download cell phone ringtones
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Hacked Gadgets Forum Index -> Toy Hacks All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group