Herramientas de usuario

Herramientas del sitio


joy2ps2_en

Description

Joy2PS2 is a versatile interface designed to connect one or two gamepads from various retro platforms. This solution converts and redirects gamepad events into keyboard strokes to a PS/2 port. You'll find this type of port on old PCs and some modern ones, as well as on recent devices like the Next or the ZXUno, the latter being the platform for which it was initially designed. This interface is highly compatible and adaptable, including several keyboard maps in its firmware to facilitate interaction with different systems.

Note: As of release 2, Joy2PS2 is compatible with real PCs that use a PS/2 connection.

The original design of the logo and casing for Joy2PS2 version 2.3 was created by Jorge Mejias Cazorla.

Photos of the casing and PCB of Joy2PS2 version 2.3

Integrated version in an SNES controller designed by Antonio Villena

Demo of Joy2PS2 version 1.0, using the old Arduino firmware

Controls

The gamepads compatible with the interface include: Atari, NeoGeo OldStyle, MSX, Amstrad CPC, VIC 20, Sega Master System, Sega Megadrive (3 or 6 buttons), Amiga, ZX Spectrum, and NES Famicom DB9. All of these can be directly connected to DB15 or DB9 sockets. However, some like the MSX, will require a special adapter to use the third button.

You can enter a special state called SHIFT at any time using any of the following combinations:

  • Pressing Start + Button 1
  • Pressing Select + Start
  • Pressing and releasing the Keymapper key (necessary only for gamepads without a Start button)

In SHIFT mode, it might seem like none of the buttons are working, but this is not the case. In this mode, actions are triggered by pressing button 1 on the gamepad as the final event. To exit SHIFT mode, you can press a SHIFT combination again or press button 2 on the gamepad.

Note: The combinations described are performed by pressing and releasing the buttons, not holding them down. Any change in direction resets the count of other actions:

  • Button 1 only: Switches cursor controls to OPQA and back on Joystick 1 (the main one).

Keyboard Maps

  • Button 2 only: Cancels SHIFT mode. You can also cancel it by pressing the SHIFT combination again.

ZXUno Reboot

Below are the sequences for rebooting the ZXUno through the SHIFT mode:

  • Down once, then button 1: Reset. Automatically switches to cursor mode
  • Down twice, then button 1: MasterReset. Automatically switches to cursor mode.
  • Down three times, then button 1: MasterReset and access to ROMs. Automatically switches to cursor mode.
  • Down four times, then button 1: MasterReset and access to cores. Automatically switches to cursor mode.
  • Down five times, then button 1: MasterReset and access to BIOS. Automatically switches to cursor mode.
  • Down six or more times, then button 1: Continues with the option of five times.

Game Menu

The following sequences enable navigating the game menu using SHIFT mode:

  • Up once, then button 1: Triggers the 'R' key.
  • Up twice, then button 1: Triggers the '0' key.
  • Repeat up followed by button 1: Continues sequentially from '1' to '9', where it holds.

Game Loader

Use the following sequences in SHIFT mode to load games:

  • Right once, then button 1: Activates the NMI.
  • Right twice, then button 1: Executes the 'LOAD “”' keys (128k mode).
  • Right three times, then button 1: Executes the 'J “”' keys (load“” in 48k mode).
  • Right four times and subsequent: Continues with the option from three times.

Extra Functions

The following functions can be activated in SHIFT mode using the sequences described:

  • Left once, then button 1: Activates Keyboard Mode (details below).
  • Left twice, then button 1: Executes the Escape function (useful for single-button joysticks, used in conjunction with the Keymapper button as shift).
  • Left three times, then button 1 for player 1 or 2: Changes the keyboard map for the corresponding player (see details of available maps below).
  • Left four times, then button 1: Changes video mode (Scroll / Lock).
  • Left five times and subsequent: Continues with the video mode option.

Switching between DB15/DB9 and DB9x2

To toggle between DB15/DB9 and DB9x2 configurations, follow these steps while in SHIFT mode:

  • Press and hold button 1, then press button 2.

The selected configuration will persist even after a warm reboot of the ZXUno.

Scancode Timing

From release 3, the half-clock and clock times for sending Scancodes on the ZXUno, after a cold or warm reboot, comply with the standards of a real keyboard, being 16 and 32 microseconds respectively.

  • In SHIFT mode, holding Start and pressing UP: Decreases the times in multiples of four, to a minimum of 4 and 8 microseconds.
  • In SHIFT mode, holding Start and pressing DOWN: Increases the times in multiples of four, to a maximum of 16 and 32 microseconds.

Host Command Listening Enable / Disable

From release 5, the host command listening function on the ZXUno is disabled by default and after any reboot, whether cold or warm.

  • To enable listening: In SHIFT mode, press and hold button 1, then press the right key.
  • To disable listening: In SHIFT mode, press and hold button 1, then press the left key.
  • To keep listening enabled temporarily: Stay in SHIFT mode. Listening will automatically disable after the keyboard initialization.“

Keyboard Mode (KEYSTROKES)

This mode allows direct interaction with the keyboard through the following commands:

  • Up: Changes to the next key and prints the character on the screen.
  • Down: Changes to the previous key and prints the character on the screen.
  • Left: Deletes the previous character.
  • Right: Accepts the current character or inserts a space.
  • Button 1: Switches to the key corresponding to the right shift key (for typing uppercase letters or special characters).
  • Button 2: Functions as the Enter key.
  • To exit the mode: Enter SHIFT mode and choose another option, or exit SHIFT mode if already inside.

Hello World' Example in Keyboard Mode

Official Firmware

To upgrade to the latest Official Firmware, you can use the AVR binary update software, XLoader.

For updates from the command line in OpenBSD or Linux, use avrdude with the appropriate parameters.

  • OpenBSD:
avrdude -p atmega168 -c arduino -P /dev/cuaU0 -v -b 19200 -U flash:w:joy2ps2.hex

The parameter /dev/cuaU0 may change to /dev/cuaU1, /dev/cuaU2, etc., depending on the connected serial devices.

  • Linux:

The setup is similar, but the device might be /dev/ttyUSB0, /dev/ttyACM0, etc., depending on how it is identified in the system.

Keyboard Maps

Map 0

(By default, upon connecting or cold rebooting the ZXUno)

(Starting from Release 4)

Map 1

(Starting from Release 4)

Map 2

(Default M.A.M.E keys)

List of Tested Cores

Link to Spectrum

Link to others

  • Spectrum
  • Amstrad CPC
  • BBC Micro
  • Atari 800 XL
  • Kyp Spectrum
  • Jupiter ACE
  • SAM Coupe
  • ZX81
  • Acorn Electron
  • Acorn Atom
  • TBBlue (Next)
  • PC/XT (From release 2)
  • Apple II (resynthesizing core with CLK and DATA as PULLUP, Download here)
  • VIC-20 (resynthesizing core with CLK and DATA as PULLUP, Download here)
  • Oric Atmos (resynthesizing core with CLK and DATA as PULLUP, Download here)
  • C64 beta 7 (resynthesizing core with CLK and DATA as PULLUP, Download here)
  • MSX1
  • Sega Master System (From release 4, currently only for the first player)
  • Arcade: Phoenix, Pacman, Galaxian, Frogger, Invaders, Scramble, Galaga (From release 4)

Current version

Acknowledgments

Lastly, we would like to thank everyone who, in one way or another, has contributed to making this project a reality::

ZXUno

ZXUno Team

ZXUno Community

Jorge Mejias Cazorla (Mejias3D)

Antonio Villena

mcleod_ideafix

Samuel (Quest)

Bruno Silva

Juanjo Luna (Yombo)

Retro Adapter (broken link)

Dani's PS2Emu

Frequently Asked Questions (FAQ)

Does my 6-button Megadrive gamepad fully work or only some buttons as with the ZXUno's DB9 connector?

All buttons are recognized and will be mapped according to the configured key map. The Start and Mode buttons will also work for those Megadrive gamepads that include them.

Is it possible to play with 2 players? What happens if keys from the first player are pressed?

Yes, it is possible. Upon connection, the interface is configured to be used from the main DB9 port or DB15 (Neogeo). If the auxiliary DB9 port (second player) is used, keys associated with the last buttons of DB15 will be activated due to shared pins. To use two players, switch to DB9x2 mode using the corresponding sequence in SHIFT mode.

I selected a core with a different video mode than the one set by default in the BIOS from the core menu. How can I change it without a connected physical keyboard?

There is a sequence to change the video mode while in SHIFT mode. Refer to the SHIFT mode combination section in this wiki for details.

I found a game that I can't start because a mapping for a required key in the options menu is missing, what can I do?

The firmware includes the most common keys used in computer game menus, from '0' to '4' and 'R' to redefine. If other keys are needed, they can be requested to be included in a firmware update.

The key mappings do not meet the needs of a specific core or game, is there a solution?

The firmware can be almost completely adjusted to meet needs. Ideally, cores should follow a uniform standard regarding key use. The most common keys are selected by default, although it can be reviewed and adjusted if justified.

I disagree with the layout of SHIFT mode sequences, are there alternatives?

It's normal to have different preferences regarding the official firmware sequences. Users can debate and decide on the ideal combinations to develop an alternative firmware. Also, if you have programming skills, you can modify the firmware to your liking as the source codes are available to everyone.

When I connect an external keyboard, key presses repeat when using the gamepad.

This can happen because the external keyboard has active command listening, which can interfere with communication by sharing the CLK/DATA pins of the PS/2 connector. One solution is to place a diode on the DATA line with the cathode towards the external keyboard. For more information, visit this link:

http://www.zxuno.com/forum/viewtopic.php?f=63&t=1804

Although Joy2PS2 was designed to operate without the need for an external keyboard, especially in setups like bartop arcade machines, using a keyboard can enhance the user experience.

joy2ps2_en.txt · Última modificación: 2024/06/19 18:55 por spark2k06