Skip to content

Latest commit

 

History

History
193 lines (128 loc) · 20.1 KB

README.md

File metadata and controls

193 lines (128 loc) · 20.1 KB

OpenPSX2AmigaPadAdapter

OpenPSX2AmigaPadAdapter is an Open Hardware adapter that allows using a Sony PlayStation controller on Commodore computers, including the Commodore 64, Amiga and CD32.

Board

Summary

The Commodore Amiga CD32 came with cumbersome and fragile controllers, most of which did not survive the challenge of time. While many third-party replacements have surfaced in the meantime, most of them are not as solid and comfortable as the ubiquitous Sony PlayStation controllers. These have more than enough buttons, are cheap and most people are familiar with them, as the same basic design has been around for nearly 25 years. This means they would be a very good replacement, if they just didn't use a different connector and communication protocol.

OpenPSX2AmigaPadAdapter is a simple Arduino-based board that adapts the connector and translates the protocol, allowing the use of many PlayStation controllers on Commodore computers. It can either behave as a simple 1/2-button Atari-style joystick or as a full-fledged 7-button CD32 gamepad. It can also appear as an Amiga mouse.

Operating Modes

The adapter has two leds:

  • LD1 lights up steadily when a supported controller is plugged in. It blinks when no controller - or an unsupported one - is connected.
  • LD2 indicates the current operating mode, to be interpreted as follows.

Two-Button Joystick Mode

When the adapter is powered on, it defaults to Atari-style Two-Button Mode, which is indicated by LD2 being off.

This mode has been throughly tested on several Amiga models, but it should work wherever an Atari-style joystick is supported, including the Commodore VIC-20, Commodore 16 (through an adapter), Commodore 64, etc. See below for a compatibility table.

While in this mode, the adapter supports different button mappings, which have been carefully designed and tailored to different game genres. The mappings can be switched by pressing Select in combination with other buttons. LD2 will blink quickly a few times to indicate what mapping has been activated.

Standard Mapping: Select +

Standard Mapping is the simplest mapping possible: both the D-Pad and Left Analog work as direction buttons. is B1 and is B2. This is the default mapping as it should be usable just about in every game out there. It might not be the most natural these days, but it's the way the game was meant to be played by the developers, thus it should never fail you.

Note that very few games were originally made to take advantage of two buttons, as even fewer controllers had that many (!) those days. Here is a list of Amiga games that somehow support two buttons, if it can be any useful.

LD2 will blink once when this mapping is activated.

Racing Mapping 1: Select +

Racing Mapping 1 is useful for all those racing games that use to accelerate and to brake. These have been mapped to and , respectively, which should make them much more natural to play. When accelerating and braking at the same time, braking wins. Left Analog can be used to steer, but its vertical axis is ignored, to avoid accidental accelerating/braking. The D-Pad is fully functional and is handy when moving through menus. B1 and B2 can be found on and .

This mode is probably best suited to games that do not involve shifting gears, as downshifting is usually performed through + B1 which is pretty hard to achieve ( + ).

LD2 will blink twice when this mapping is activated.

Racing Mapping 2: Select +

Racing Mapping 2 is an alternative mapping for racing games that was inspired by GTA V. It lets you use R2 (or R1) to accelerate and L2 (or L1) to brake (which means they map to and , respectively). B1 is mapped to its natural position. Steering and the D-Pad work as in Racing Mode 1.

Accidentally, this control scheme was found out to be very comfortable with games that use B1 to accelerate and and to shift gears. Since is probably used for braking as well, it has also been mapped to , while B2 has been moved to .

LD2 will blink three times when this mapping is activated.

Platform Mapping: Select +

Platform Mapping is very similar to Standard Mapping, it just makes jumping way easier on a joypad and more natural to all the Mario players out there, by replicating on . Consequently, B2 has been moved to .

LD2 will blink four times when this mapping is activated.

Custom Mappings: Select + R1/R2/L1/L2

What if the built-in mappings are not enough? OpenPSX2AmigaPadAdapter allows you to make your own! And you can have up to four different ones, which are stored internally so that they can be recalled at any time. By default they behave similarly to the Standard Mapping, but they can be customized so that any button produces either the press of a single button or even of a button combo!

The programming procedure is as follows:

  1. Press and hold Select, then press and hold one of R1/R2/L1/L2 until LD2 starts blinking, finally release both buttons. You are now in Programming Mode.
  2. Press the button you want to configure. LD2 will flash quickly a few times.
  3. Press and hold the single button or button combo you want to be assigned to the button you pressed before. At this stage the D-Pad directions have their obvious meaning, while represents B1 and represents B2. LD2 will again flash quickly a few times.
  4. Release the button or combo you were holding.
  5. Repeat steps 2-4 for every button you want to customize.
  6. When you are done, press Select to store the mapping and leave Programming Mode. LD2 will stop blinking and you will be back to Two-Button Joystick Mode.

Note that a mapping you have just programmed is not activated automatically, so you will have to press Select and one of R1/R2/L1/L2 (and release them quickly) to switch to it.

The Custom Mappings cannot be configured so that overrides or so that the vertical axis of Left Analog is ignored, still they might be useful here and there. For instance, having B1 + on and B1 + on makes the Amiga version of Golden Axe much more playable.

Commodore 64 Mode

Button 2 on Commodore 64 usually behaves in the opposite way at the electrical level, with respect to the other buttons. So a tweak can be enabled to invert the behaviour of button 2, use it if you find that your game of choice always sees it pressed or if it triggers on release rather than on press.

Just hold Select and press Start briefly. LD2 will flash once when this tweak is enabled and twice when it is disabled.

Mouse Mode

Whenever the right analog stick is moved, the adapter switches to Amiga Mouse Mode. In this mode, the right stick emulates the movements of a mouse. Movement speed is somewhat proportional to how far the stick is moved.

This mode can be useful as an emergency mouse, and it will be particularly handy if you have the adapter connected to port 1 of an Amiga computer and you need to use a mouse for short while (maybe to do some settings in a cracktro). Instead of unplugging the adapter, plugging in a mouse, and then the adapter again, you can take advantage of this feature.

Mouse mode is indicated by LD2 blinking. Press any direction on the D-Pad to go back to Joystick or CD32 Mode.

CD32 Controller Mode

When the adapter is connected to a CD32 console, it will automatically switch into this mode, which will emulate all 7 buttons of the original CD32 controller. LD2 will light up steadily.

By default, buttons are mapped as follows:

  • : Red
  • : Blue
  • : Yellow
  • : Green
  • L1/L2/L3: L
  • R1/R2/R3: R
  • Start: Start/Pause

If you press Select, the 4 main buttons get "rotated":

  • : Red
  • : Blue
  • : Yellow
  • : Green

Both the D-Pad and Left Analog always work as direction buttons.

Components and Assembly

The board is basically a customized Arduino Uno, this means it was designed to work with an ATmega328P microcontroller, but you can also use ATmega88/A/P/PA or ATmega168/P microcontrollers, as they are pin-compatible and slightly cheaper. The A/P/PA suffixes usually identify somewhat minor chip revisions, the board should work with all of them. If you can, use P or PA versions, which consume less power. Note that at the moment the firmware uses 99% of the flash space available on an ATmega88 and any possible future improvements and/or new features are likely to overflow that, so you'd better use an ATmega168 at least.

A noteworthy exception to this rule is the ATmega328PB, which is NOT 100% pin-compatible with the 328P. Nevertheless, it MIGHT just work as well. It might also destroy whatever you connect the adapter to, so do it at your own risk.

You are recommended to solder the microcontroller first. The TQFP-32 package is easier to solder than it looks, watch some videos on YouTube and develop your own technique. Just make sure to orient it correctly.

Solder the oscillator then. You can either use a through-hole crystal with its caps (these will depend on the crystal, but usually 18-22pF are a good bet) or a 3-pin resonator. Whichever you choose, it shall have a frequency of 16 MHz. If you choose the crystal, you might want to put some insulation tape under it to avoid it touching the pads for the resonator.

Solder all the remaining parts in the order you prefer, just keep the controller connectors last.

Note that the PlayStation controller is powered at 3.3V and the interface signals use the same voltage. Due to the particular circuit used for level shifting (the microcontroller works at 5V), the MOSFETs should really be BSS138.

The PlayStation controller connector can be found from many Chinese sellers as a spare part. Get one with 90° pins, otherwise the adapter will be pretty awkward to use. The pins will be pretty short, but you should manage to solder it in place. Make sure it sits level on the board, otherwise it might not fit in the 3D-printable case, which you are recommended to use in order to make the adapter more mechanically solid. In alternative, some hot glue behind the connector (where the pins are) seems to do the same job, but it won't look as pretty.

Hint: If you don't have the PCB, you can build a full adapter with an Arduino Uno/Nano/Whatever board. This is not supported though, so you are on your own, but all the information you need is in the schematics or in the firmware code :).

Firmware

Before you can use the adapter, you will need to load some firmware (i.e.: an Arduino sketch) on it. This can be found under the firmware directory, along with instructions.

Compatibility

Computers and Consoles

System Compatible Notes
Commodore Amiga (All models) Yes Tested on A500+ and A1200 (1.D3), it is expected to be compatible with all models in both 2- and 7-button Joystick modes and in Mouse mode.
Commodore Amiga CD32 Yes Both 2- and 7-button Joystick modes and Mouse mode. Games not using lowlevel.library might be a bit of hit-and-miss, please report any misbehaviours.
Commodore CDTV Maybe Not tested yet, but expected to work in 2-button Joystick mode and Mouse mode through a connector adapter.
Commodore 64 Yes Tested in 2-button Joystick mode, but second button untested. Mouse mode might damage CIA chips though, be careful not to turn it on!
Commodore 16 Maybe Not tested yet, but expected to work in 2-button Joystick mode through OpenC16JoyAdapter. C16 only supports Button 1 though.
Commodore VIC-20 Maybe Not tested yet, but expected to work in 2-button Joystick mode. Be careful with Mouse mode.
Sega Master System No Would probably work in 2-button Joystick mode if power was routed from pin 5 on the SMS controller port to pin 7 of the adapter.
Sega Mega Drive/Genesis No Would probably work as an SMS controller with the same mod as above. Some more pin rerouting AND a custom firmware could make it appear as a Mega Drive 6-button controller.
MSX No Would probably work in 2-button Joystick mode by swapping a few pins on the controller port.

Controllers

The latest versions of the OpenPSX2AmigaPadAdapter firmware use PsxNewLib to read the PlayStation controller. This makes it compatible with (almost) all controllers.

Please refer to the PsxNewLib Compatibility List for details.

Current Consumption

Following are the results of some rough measurements:

  • An ATmega88PA-based OpenPSX2AmigaPadAdapter with an original Sony Dual Shock/Dual Shock 2 controller connected draws about 20 mA.
  • Consumption rises to 25 mA with the dongle of my EastVita wireless controller, when the controller is connected. It peaks to 35 mA while it is searching for the controller.
  • Using an ATmega328P bumps all consumptions by 5 mA.

This means that the current absorbed by the adapter is "reasonable" and that it should be safe to use in all cases. It is well below the 100 mA maximum available from any Amiga controller ports, for instance.

Enclosure

Three different 3D-printable enclosures are currently available for this board:

  • The first one was kindly contributed by Petros Kokotis and needs screws for assembly.
  • A second one was designed by Lemaru and uses a snap-in design. It also has holes for the LEDs.
  • Another one was made by Gary Ogden and is better suited for use with the CD32, as it has some kind of bottom support.

My gratitude goes to all the three guys for their great work and support!

Releases

If you want to get this board produced, you are recommended to get the latest release rather than the current git version, as the latter might be under development and is not guaranteed to be working.

Every release is accompanied by its Bill Of Materials (BOM) file and any relevant notes about it, which you are recommended to read carefully.

License

The OpenPSX2AmigaPadAdapter documentation, including the design itself, is copyright © SukkoPera 2019-2020.

OpenPSX2AmigaPadAdapter is Open Hardware licensed under the CERN OHL v. 1.2.

You may redistribute and modify this documentation under the terms of the CERN OHL v.1.2. This documentation is distributed as is and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES whatsoever with respect to its functionality, operability or use, including, without limitation, any implied warranties OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE or infringement. We expressly disclaim any liability whatsoever for any direct, indirect, consequential, incidental or special damages, including, without limitation, lost revenues, lost profits, losses resulting from business interruption or loss of data, regardless of the form of action or legal theory under which the liability may be asserted, even if advised of the possibility or likelihood of such damages.

A copy of the full license is included in file LICENSE.pdf, please refer to it for applicable conditions. In order to properly deal with its terms, please see file LICENSE_HOWTO.pdf.

The contact points for information about manufactured Products (see section 4.2) are listed in file PRODUCT.md.

Any modifications made by Licensees (see section 3.4.b) shall be recorded in file CHANGES.md.

The Documentation Location of the original project is https://github.com/SukkoPera/OpenPSX2AmigaPadAdapter/.

Support the Project

Since the project is open you are free to get the PCBs made by your preferred manufacturer, however in case you want to support the development, you can order them from PCBWay through this link:

PCB from PCBWay

You get my gratitude and cheap, professionally-made and good quality PCBs, I get some credit that will help with this and other projects. You won't even have to worry about the various PCB options, it's all pre-configured for you!

Also, if you still have to register to that site, you can use this link to get some bonus initial credit (and yield me some more).

Again, if you want to use another manufacturer, feel free to, don't feel obligated :). But then you can buy me a coffee if you want:

Buy Me a Coffee at ko-fi.com

Get Help

If you need help or have questions, you can join the official Telegram group.

Thanks