How to connect a joystick from a dandy to a pc. How to connect a game console to a computer monitor

In the article, I will not only show you how connect joystick from dandy to computer, but I will also offer you to download games for consoles Dendy, Nintendo, Sega. So if you are not going to connect a joystick, you can simply download games and play on a regular keyboard.

The construction is very simple. But before testing the interface you made, make sure that all wires are soldered correctly and that no bare wires are touching anything. I highly recommend using a housing for these interfaces to reduce the risk of short circuits.

Let's start with a joystick for Dendy (NES)... If you have a gamepad, and it has buttons A, B, Turbo A, Turbo B, Select and Begin (the last two may not exist, I strongly recommend not to take them) and communicates via 5 wires, then this is either NES or an analog The NES will work if you do it right.

However, it's time to get down to business. All you need is an LPT port connector (it's parallel, it's from a printer), a soldering iron, five absolutely any diodes, and, in fact, the joystick itself. Let's get started.

Here is the joystick connector itself (does it look like COM?)

Everything is soldered according to the scheme, if you want to connect two joysticks, then all the wires are also soldered except for the 8 and 7 contacts on the NES, they must be soldered to the 11 and 12 contacts on the LPT.

And if you have a joystick with a different connector, then see below:

To solder the wires according to the scheme, you need to open the connector, but I suggest making everything much easier. You can just make a kind of extension adapter adapter. In addition to LPT, we also need a COM connector (dad)

Another very important detail. The diodes are marked, they should be soldered with a strip up. You just solder the wiring according to the scheme to the LPT and that's it.

It turns out very much even. But design is not as important as work!

And now the program matters.

We have to:

1) Install the driver and configure it.

2) Start the console emulator and through it open the game that interests you.

Let's start by installing and configuring the driver.

According to the manual, it is suitable for OS: Win9x / Me / NT / XP / 2k. Unzip it to any convenient place and run Setup.exe ... A window appears on the screen on which you need to click:

The installation process consists in pressing the "Next" button and should not cause any difficulties, so I see no point in examining it in detail.

After installation, the "Parallel Port Joystick" folder will appear in the "Start" menu, with several shortcuts in it. We are interested in "Configure Joysticks" - and run it. The Joystick Configuration Utility window appears on the screen. In it we press the "Add" button.

We see a window for configuring a new joystick. We set the values ​​in it, as shown in the figure. Do not be embarrassed in choosing the type of interface, this is not connected with Linux OS in our case.

Having set all the values ​​correctly, click on the "Add" button. We get to the previous window. If we have only one joystick, you can safely press the "Done" button. If we need to configure the second joystick, then press "Add" again, a familiar dialogue appears, although our choice is already somewhat limited, but the values ​​will need to be set in the same way as in the picture above. The only exception is in the penultimate line, i.e. the controller number is now indicated not 1, but 2 or more, depending on which joystick we are connecting on the account.

Well, half the work is done, it remains to check the joystick's performance.

We go to the "Control Panel" and launch the shortcut "Game devices". Select the joystick we are interested in and click on the "Properties" button. The properties window appears. In the "Check" tab, we can check if our joystick is working. At the moment when no one touches the joystick and none of its buttons are clamped, the cross of the axes will be in the center of the white area, and the images of the buttons will all be equally dark red.

I think many of you remember those glorious times when we spent hours playing tanks, teenage mutant ninja turtles, battletods and doubledragon and a couple of dozen other super games on Dandy. It was a great time! Most of the games were damn hard, but even so, failure after failure, we still went to our goal and started the game over to go through it to the end today.

Having nostalgic to my heart's content, I decided that I really want to play Dendy and I want to play on a laptop, but not on a keyboard, but on a good old joystick.

Below I will describe what problems I encountered and how I solved them.

Let me explain a little why this is how I wanted to play. I still have the prefix and it works fine, but only a couple of cartridges remained (I gave the rest to my friends). And playing dandy games on the keyboard, well, it's somehow not ice at all.

There was a problem how to connect a joystick from Dandy to a laptop.

After a little googling, I realized that this is mainly solved by connecting via the LPT port and using ready-made drivers, but I have a laptop and this does not suit me. Then I remembered that I have an Arduino Uno board and I decided that I would go my own way and use it.

0. Definition of pinout on the joystick

The first problem turned out to be that the joysticks have internal connectors, and all the descriptions of the pinouts found on the Internet were for external connectors.

I could not find the specification for my noname dandy, so I began to examine the internal board to find power and ground there, and to understand which of the five pins on the joystick are connected to them. I dealt with this quickly. It turned out that these are two extreme contacts.

To Arduino, I connected everything directly, power supply - 5V supply, ground - ground, the other three contacts connected to digital pin 2, 3 and 4.

1. Description of the joystick protocol

It turned out to be not so easy to find this information. Just a few posts on a couple of forums. Personally, this post helped me: code.google.com/p/avrtoys/wiki/joystick, namely this code: avrtoys.googlecode.com/svn/trunk/joystick/main.c. And here is a link to the note mentioned in this entry in the Radio magazine: ftp.radio.ru/pub/arhiv/1996/06-96/46-6-1996.gif. From all this, I concluded that you need to send a signal to Latch, and then send a signal to Clock 8 times and each time read the value from Data, which, after each Clock, will contain information about the next joystick button.

2. Setting up the environment

If you already have everything configured or you are satisfied with the Arduino IDE, you can go to step 3.
I don't know about you, but personally, the official Arduino IDE depresses me terribly, so I'll briefly tell you how to use my favorite IDE.
First of all, I downloaded the Arduino IDE sources and found there the code responsible for compiling and uploading the firmware. After spending a little time, I selected all the commands that are used there:
#! / bin / bash avr-gcc -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -mmcu = atmega328p -DF_CPU = 16000000UL -I / usr / share / arduino / hardware / arduino / cores / arduino -I / usr / share / arduino / hardware / arduino / variants / standard $ filename.cpp -o $ filename.o avr-gcc -Os -Wl, - gc-sections -mmcu = atmega328p -o $ filename.elf $ filename.o libArduino.a -lm avr-objcopy -O ihex -R .eeprom $ filename.elf $ filename.elf.hex avrdude -V -p m328p -b 115200 -c arduino -P / dev / ttyACM0 -U flash : w: $ filename.elf.hex
In the above command, when linking, the libArduino.a library is used, it can be obtained by compiling all * .c and * .cpp files from the folder with headers and collecting all object objects into one archive. Or you can simply launch the Arduino IDE, compile any project and copy the /tmp/build*.tmp/core.a file. It will be absolutely equivalent.
All these commands are relevant for the Arduino Uno, for other arduino you need to change some parameters.

Now, using these commands, you can easily configure your IDE to automatically compile and load the firmware.

3. Writing the firmware code

Here it was only necessary to determine which of the 2, 3 and 4 pins are responsible for Latch, Clock and Data. I solved this by trial and error. We assume that 4 is Data, and we do Serial.println (digitalRead (4)), if there is any reaction when the buttons are pressed, then this is it. The remaining 2 contacts were determined when the firmware was already written, if everything works, then you guessed it, no - we swap it.

Again, the code was written based on avrtoys.googlecode.com/svn/trunk/joystick/main.c:

Firmware code

#include const int data = 2; const int latch = 3; const int clock = 4; const int TICK = 2; void init_joystick (int data, int latch, int clock) (pinMode (data, INPUT); pinMode (clock, OUTPUT); pinMode (latch, OUTPUT); digitalWrite (clock, HIGH);) int get_keys_state_joystick (int data, int latch , int clock) (digitalWrite (latch, HIGH); delayMicroseconds (TICK); digitalWrite (latch, LOW); int keys_state = 0; for (int i = 0; i< 8; ++i) { delayMicroseconds(TICK); digitalWrite(clock, LOW); keys_state <<= 1; keys_state += digitalRead(data); delayMicroseconds(TICK); digitalWrite(clock, HIGH); } return keys_state; } void setup() { init_joystick(data, latch, clock); Serial.begin(57600); } void loop() { Serial.write(get_keys_state_joystick(data, latch, clock)); }


As a result, I received 1 byte containing information about all 8 joystick buttons, each in the corresponding bit. I got the following arrangement: A, B, Select, Start, Up, Down, Left, Right. This byte is then sent to the computer, where it is received and processed by my "driver".
As you can see, you can easily connect a second joystick.

4. Writing a "driver"

Here it was necessary to accept this very byte from the Arduino and emulate keystrokes on the keyboard. Yes, joystick presses will be handled like keyboard presses, good or bad.
I chose Python as my programming language. Simple and effective, I think it was perfect for the task.

The only problem that arose here is the bounce of the joystick contacts. I solved it by introducing a time interval after changing the state of the button, during which the state does not change. It took 0.05 s.

To emulate keystrokes on the keyboard, I used the xte utility included with Xautomation. It is very easy to use, here is an example: xte "keydown Left". See man xte for more information.

To exit the driver, I used the state when the entire D-pad is pressed. This state corresponds to the number 0xf0.

Driver code

#! / usr / bin / python import serial import os import time def bool_to_updown (val): if val: return "up" else: return "down" exit_keys = 0xf0 delta_time = 0.05 keys = [["Right", False, 0.0 ], ["Left", False, 0.0], ["Down", False, 0.0], ["Up", False, 0.0], ["s", False, 0.0], # START ["a", False , 0.0], # SELECT ["x", False, 0.0], # B ["z", False, 0.0]] # A ser = serial.Serial ("/ dev / ttyACM0", 57600) keys_state = 0 while keys_state ! = exit_keys: keys_state = ord (ser.read ()) for i in range (8): if not bool (keys_state & (1<< i)) != keys[i] and time.time() - keys[i] >delta_time: os.system ("xte" key (0) (1) "". format (bool_to_updown (keys [i]), keys [i])) keys [i] = not keys [i] keys [i] = time.time () for i in range (8): os.system ("xte" keyup (0) "". format (keys [i])) ser.close () print ("Goodbye!")

5. Hooray! Let's play!

Everything! It remains only to configure the dandy emulator, I chose FCEUX.
We indicate in the settings those keys that are indicated in the driver iii, and we remember our childhood!

Conclusion

In fact, there are other, possibly more effective ways to use the Arduino in this situation. For example, if you have an Arduino Leonardo, you can use the Keyboard object to send keyboard commands directly to your computer. You can also, as I understand it, reflash Arduino so that it is displayed as a joystick / keyboard / mouse and also send commands directly. Here's a tutorial: http://mitchtech.net/arduino-usb-hid-keyboard/. However, my method suits me completely and I am more than satisfied with the result.

Whatever one may say, but Arduino is a wonderful platform for such experiments.
Now it remains only to collect all this in the form of a separate device.

And finally a video:

All children of the 90s are familiar. Having burst into domestic markets, the console quickly gained popularity, and now in every home children of all ages gathered for an exciting game. Then, when computers became so affordable that everyone could buy them, the "Dandy" age gradually ended. In addition, more advanced analogs like Sega, Sony PlayStation and Nintendo 64 began to appear among consoles.

However, the craving to play toys of the 90s does not subside until now. Now you do not need to chase cartridges over all your friends and acquaintances. It is enough to carry out a few simple manipulations, and the opportunity to play "Dandy" will appear on a personal computer.

What is "Dandy"

"Dandy" is a console with one or two joysticks. The games were carried in special cartridges. This is a microcircuit, clad in a plastic case, which carried the recorded game. In the era of insufficient Internet in order to play something new, the exchange of cartridges with neighbors or friends was relevant.

The set-top box was connected via cables directly to the TV. And the game itself was played with one or two joysticks equipped with buttons.

A bit of history

The very first to transfer games from slot machines to home TV screens was the Japanese company Nintendo in 1984. The console blew up the world of video games and became a real sensation. Now everyone could play any games available on "Dandy" in a comfortable environment. Interestingly, the name of the console in Japan was Family Computer or Famicom. And she came to Europe and the USA a little later under the name NES.

The console came to Russia in 1992 and was called "Dandy". It was copied and reproduced in various formats. True, in the early stages the existing "Atari" and the like competed with it. But "Dandy" quickly bypassed all known formats and won the hearts of game lovers of that time. However, with the arrival of the new Genesis or Sega Mega Drive 2, and then the Sony PlayStation, it had to make room for this market.

In the modern world, you can also find versions of the original Dandy console in specialty stores and play for the so-called "fan".

"Dandy": the modern era

You can plunge into the magical world of games on "Dandy" in the modern world. There are many possibilities for this. One of the simplest and most affordable is to connect the Dandy's joystick to the computer. Thanks to the electronics market, you can buy different versions of the device on the Internet or on radio markets. A modern joystick for "Dandy", as a rule, has a USB port, through which you can connect it to a PC. This approach contains a minimum of manipulation. If there is a desire to tinker with the soldering iron and the original joystick was accidentally discovered, then you can connect it too by creating a special adapter with your own hands.

Connect the joystick from "Dandy" to the computer via USB

The first thing to do for such a connection is to purchase a joystick for the "Dandy". You can find it both on specialized electronics sites and in various markets. The joystick does not have to be similar to its original representative. Outwardly, it can look like any other console.

After finding a joystick for "Dandy", you need to attend to the software. To do this, you need to download a special application - a set-top box emulator. Since officially "Dandy" has the abbreviation NES, then you need to search for the appropriate program precisely for such a request. There are a lot of emulators on the network. But the principle of operation of this application is the same - launching games on "Dandy" in the program window.

Emulator

After the emulator is found and downloaded, you need to find the game directly. You can also do this by searching on specialized sites.

You can demonstrate how to connect a Dandy joystick to a computer using one of the popular emulators - FCEUX. Its window looks like the photo below.

Downloading and installing will not take much time, since the program weighs no more than 2 megabytes and is easy to learn.

Now it's time to connect and configure the joystick from "Dandy". To do this, you need to insert it into the USB port of your computer. Then select the Config item in the emulator menu and go to the Input section.

In the configuration window that opens, to configure the joystick, click the Configure item. A new interface will open, which will visually resemble the location of the buttons on the joystick. Thus, by clicking on the designated button and setting the corresponding key on the PC keyboard, the behavior in the emulator is configured. After installing all the joystick buttons, you need to save everything and exit to the main program window.

Next, you need to find the required game. There are also many of them freely available on the Internet. Games are launched through the File menu of the emulator, in which you need to select the Open ROM item. ROM is an image of the game, packed in a format that the emulator can understand. In addition to the basic features, the program allows you to save the state of the game at any time and also start it from the same place. This was not enough for many children in the era of complex games.

How to connect a joystick from "Dandy" to a computer via the LPT port

Quite a lot of varieties and clones of the "Dandy" prefix were released. Accordingly, joysticks could have a different shape and number of contacts. In most cases, a 9 or 15 was used. The 9-pin connector is very similar to that of a computer. It is this factor that can be used to create an adapter from "Dandy" to PC.

First you need two connectors - LPT and COM. They will have to be disassembled in order to be able to properly solder the wires. Soldering is carried out according to the simple scheme shown in the picture below.

As you can see, connector 1 on the joystick connects to connectors 5-9 through a series of diodes. The rest are directly soldered. By connecting the wires and soldering them in the correct sequence, you can put everything back together. The adapter is ready for the first test.

Joystick Drivers

But before that you need to attend to the software component of the equipment. Since the operating system does not know how to control this kind of joystick, you need to install a driver with the necessary information into it. Naturally, no one developed it specifically for the PC. Therefore, you will have to use universal means to implement the connection of such devices with a computer.

There are many such software products on the Internet, but it is better to use the PPJoy application. It is optimized for connecting unknown devices like joysticks to a computer by selecting the appropriate driver.

The download and installation process itself is simple. After successful installation, an icon of this program will appear on the desktop. After launching it, you can see a window offering to add a new device to the configuration. You need to click the Add button. Next, the program will display a window in which you need to set how the connection will be made. In the settings, you need to specify the following:

    parallel port - LPT1, respectively, if it is one;

    controller type - SNES or NES;

    interface type - Linux;

    controller number - Controler 1;

    controller subtype - NES.

Now it remains to click on the Add button. This will add the device to the system. In the next window, you must click Done.

After setting all the settings for the joystick, you need to check and calibrate it. To do this, in Windows operating systems there is an item in the Control Panel called "Gaming Devices". In it, in the "Properties" tab, it is possible to check how the joystick reacts to pressing certain keys. If there is any activity, the joystick works and you can open the emulator. If not, then you need to re-solder everything, because something went wrong.

A quick overview of popular emulators

A small list of the most popular and convenient working emulators:

    FCEUX. This emulator was already mentioned in the article. It is open source and can run on a wide variety of systems. Has a wide range of settings and functions.

    iNES. A simple and lightweight emulator for the Windows operating system. It has a minimal package of settings and configurations.

    Nestopia. Also has Can work under Windows, Linux, Mac OS operating systems. Lots of settings and features.

    VirtuaNes. This emulator is capable of supporting a light gun, slowing down and speeding up the game, as well as many settings related to video processing.

    RetroCopy. This is one of the multi-console emulators that can reproduce images of not only Dandy games, but also Sega, Nintendo and many other slot machines and consoles.

conclusions

Of course, for radio amateurs the second version of the "Dandy" joystick for PC will be more interesting. For simple gamers who have decided to plunge into the nostalgia of old games, method number 1 is perfect. First, the cost of joysticks with USB is not so great. In addition, now you can buy them at almost any corner. Secondly, this is a significant time saving when connecting and calibrating a new device.

The network contains a large number of Dandy games. Play with a joystick or a keyboard is a personal choice. But it is precisely the complete immersion in the atmosphere of that era that will still give only a comprehensive restoration of the gameplay.

Joystick games have been ported by Dandy enthusiasts so that they can be used on a large number of different emulators. Another significant advantage is the fact that the simplest joystick can also be used to emulate other consoles, such as Sony PlayStation or Sega. You just need to install the appropriate program and find the image of the desired game.

I am sure many have seen joysticks for computers in stores, for example from Sony PlayStation.

Unfortunately, they are very expensive, but why not make one yourself? There is a very real possibility to play with such a gamepad / joystick on a PC - a compatible computer, not even the most powerful one. Most games and programs will not be able to distinguish your device from a branded joystick for a few $ 100. (for some reason, it is considered that once some gadget is connected to the computer, then it should definitely cost fabulous money) The trick is that this joystick can be used in any game, just assign them to the joystick buttons when assigning keys.

In general, the GamePad is a device very similar to an analog joystick. The difference between a typical joystick and a GamePad is in the axis characteristics. Joysticks usually have two axes - X and Y. Continuous movement of the lever along these axes using two potentiometers is converted into analog electrical signals, which are then converted into digital signals using an ADC, on the basis of which the X and Y variables are calculated. GamePad has non-proportional the deviation from the center of the X and Y values ​​for nine positions (including the center), it is much simpler in design, and therefore more reliable.

The construction is very simple. Just double-check before checking the interface you made to make sure all wires are soldered properly and that no bare wires are touching anything. I highly recommend using a case for these interfaces to reduce the risk of short circuits.

Let's start with a joystick for Dendy or NES.

If you have a gamepad, and it has buttons A, B, Turbo A, Turbo B, Select and Begin (the last two may not exist, I strongly recommend not to take them) and communicates via 5 wires, then this is either NES or an analog The NES will work if you do it right.

However, it's time to get down to business. All you need is an LPT port connector (it's parallel, it's from a printer), a soldering iron, 5 1N914 or 1N4148 diodes, and, in fact, the joystick itself. Let's get started.

Here is the joystick connector itself (though it looks like COM)


Everything is soldered according to the scheme, if you want to connect two joysticks, then all the wires are also soldered except for the 8 and 7 contacts on the NES, they must be soldered to the 11 and 12 contacts on the LPT.


To solder the wires according to the scheme, you need to open the connector, but I suggest making everything much easier. You can just make a kind of extension adapter adapter.

In addition to LPT, we also need a COM connector (dad).

Another very important detail. The diodes are marked, they should be soldered with a strip up. You just solder the wiring according to the scheme to the LPT and that's it.


It turns out very much even.

I will tell you how to set it up at the end of the article.

To get the most out of it, I downloaded the Dendy emulator. Briefly what an emulator is.

Such a program that completely emulates any game console, games for it are also loaded separately, any game can be downloaded to the Internet.

Here's Suprer Mario for you.

And here is the black cloak.

Only a true gaming gourmet will appreciate this.

Now joystick for Sony Playalert alert-infoion (PSX)


You can also use joysticks with two mini joysticks at the bottom, it is called with six axes. You can also connect joysticks with feedback, that is, those that vibrate. Here's a diagram.

The diodes are the same as for Dendy. Joysticks with six axes and feedback require a 9 volt power supply. For simple joysticks like mine, you don't need to do power. But if you really want to, then I recommend buying a Chinese small 9v power supply for plugging into an outlet, they cost no more than a dollar.

I want to note that the diagram shows the reverse side of the PS port.

Just cut off the Sonya connector and solder the LPT.

In order to connect the second joystick, all its wires must be soldered as well, but pin 9 from PSX should be soldered to pin 13 on LPT, and 1 pin from PSX to pin 15 on LPT. That's all.

Now specifically about the setup procedure, although the matter is even simpler here.

First you need to download DirectPad Pro firewood ( where to download, google, original sources no longer exist)

In the Windows control panel, select game devices (joystick icon) and press the "Add" button. In the window that appears, press the "Add" button again, and then "Install from disk".

Next, find the directory into which you unpacked the driver archive and select the line that appears DirectPad Pro.Inf. After that, click OK a couple of times and add the DirectPad Pro Standard And Force FeedBack device.

Then you can select DirectPad Pro Controller and DirectPad Pro Force FeedBack Controller from the list of game devices. We select the appropriate driver and our controller appears in the "Game devices" window.


Now we press the "Properties" button and get into the driver configuration window. Select then select the ID of the joystick (written in the middle at the top) and put the number in the list next to the Conroller Type (it may not be 1, if other joysticks were installed in your system before).

After that, select the correct address of your LPT port (you can see it in the System: Devices - COM and LPT ports are usually 378).

That's all! Ultimately, you have a DirectInput compatible joystick, i.e. can be played in any windows game that supports the joystick via DirectX drivers. You only need to select DirectPad Controller in the game settings.

The following were tested for performance: NFS Undergraund, Max Payne2, Worms 3D, GTA 3, GTA Vice city, etc. The schemes are 100% functional. Enjoy.

Dendy (Dandy) - the legendary console, which, in fact, was a hardware clone of the Famicom console from Nintendo, assembled in Taiwan from Chinese components. Naturally, 20 years ago no one was interested in these details: the very fact of owning a console with several cartridges was considered the greatest happiness. Dandy has become a household name, the dream of children and adults.

Today, other consoles are popular, but sometimes there is a desire to return to the years when Super Mario was the main character of games, and Mortal Kombat was not yet so colorful and realistic, but it was already drawing young gamers into the web of deadly battles. To return these feelings, you just need to figure out how to connect Dandy to the TV.

Connection

As standard, the set-top box comes with an RF cable that connects to the antenna connector on the TV.

Remember that you can connect and disconnect the antenna only when the device is turned off!

The connection itself is made as follows:

After that, the game should appear on the screen, the cartridge with which you installed in the console.

AV cable

If you want the best picture quality, use an AV (low frequency) cable instead of a standard RF cord. With its help, the set-top box is connected to the TV not using the antenna connector, but through the video input.
In this case, additional equipment setup is not required: you just need to connect the two devices using a cable, and then switch to AV mode on the TV.

If the TV does not have an AV-out, but there is a SCART connector, use a special adapter.

Everything has its time

Remember that Dandy is over 20 years old, so your favorite game can look very unattractive on a high-resolution screen. Therefore, it is better to buy and connect a PS3 to a TV, and run Dendy games on a computer by downloading an emulator.
Of course, you won't be able to achieve a complete feeling of immersion in the past, but if, for example, you connect a gamepad to a computer, you can spend an unforgettable evening in the company of your favorite childhood games.