X-Arcade Tankstick – IL Mod

I recently received my X-Arcade Tankstick with tri-mode PCB pre-installed. The tri-mode PCB allows this stick to function as either a) a keyboard, b) a DirectInput device, or c) an XInput device.

The X-Arcade Tankstick is well built. It is sturdy and cleanly put together. I especially love the pinball buttons on the side, and the awesome trackball. The trackball has some real inertia and feels very well built. The trackball acts as a USB mouse, so the trackball is compatible with many PC games and emulators that expect mouse input, like Marble Madness, Golden Tee Golf, and many more.

Here is a pictures of the outside of the stick before modding:

Before modding

The inside is very tidy and nicely built. Everything is modular. There are quick-connects. Nothing is soldered directly, which is great. There are even two additional micro-switches inside the box and many additional unused quick connects on the wires.

Here is a picture of the inside before modding:

Before modding

Even though I love the controller as-is, I decided to mod it with IL parts, to make it even more responsive.

The IL mod was straightforward. It was a drop-in replacement. All holes and measurements on the case are 100% compatible with IL parts. The mod consisted of replacing all the fire buttons and sticks with IL parts, one by one. Here are the images after I put in two grey IL Eurosticks, 16 grey IL short stem push buttons for the fire buttons, and 4 white IL short stem push buttons for the pinball buttons on the side. All IL parts were equipped with Cherry D44X micro switches.

After modding
After modding

This was one of the easiest mods I have ever done. It just took some time to replace everything. I was happy to have my trusty IL plastic button wrench. Without the wrench, I wouldn’t have been able to replace all the buttons.

IL button wrench

One minor quirk involves the pinball side buttons. On the PC, the keyboard mode can be used for pinball games. In keyboard mode, the side buttons can be remapped easily. In DirectInput, XInput and Playstation mode (using the separately purchased Playstation adapter), the pinball side buttons act as left and right mouse button and player 1 and player 2 select, and cannot be remapped. This means I cannot play Pinball Arcade or Pinball FX on the PS4 with the side buttons, because the game expects L and R buttons on the player 1 controller. In a future project, I plan to re-wire the side buttons so that they act as left and right shoulder buttons for player 1. This should be a very easy thing. I just have to add a few wires and quick connects.

Pinball side buttons

Overall, this was my easiest mod so far. Everything was a drop-in replacement with IL parts. No soldering or Dremel work was needed.

The first thing I did after modding the controller was to play some Robotron on my MiSTer FPGA. It works perfectly! Robotron is so much fun with the two mounted arcade sticks:

Playing Robotron with two sticks is so much fun!

I love the X-Arcade Tankstick. Even before modding, it was a great and responsive controller with lots of room to rest my palms. With the IL mod, it became even better. The sticks and buttons are now easier to push, and the click sounds are not as loud. I also love the pinball side buttons and the trackball.

Until next time,

Mayflash F500 v2 Arcade Stick ‚Äď Seimitsu Mod

I recently modded my Mayflash F500 v2 arcade stick with genuine Seimitsu parts. The Mayflash F500 v2 arcade stick is very well built with two metal plates, an acrylic top that is held by powerful magnets making the artwork easily exchangeable, and pre-drilled additional holes for Seimitsu and Sanwa compatibility.

Here’s how the stick looks before modding:

Mayflash F500 v2 arcade stick with stock parts before modding

Interior of Mayflash F500 v2 arcade stick before modding.

Notice how tidy everything is inside and how nice it is built. I love the stability given by the metal plates. After taking out the stock joystick and buttons, I noticed additional, unused, holes in the metal plate. Those holes are there for modders: they perfectly fit my Seimitsu LS-32 stick (without its mounting plate). The pushbutton holes also fit Seimitsu and Sanwa buttons perfectly, making this the easiest arcade stick mod I have ever done.

Here you can see how I mounted the Seimitsu LS-32 stick using the holes that were already present. The stick sits flush below the top surface, as it should:

The top metal plate has additional holes for mounting a Seimitsu LS-32, as shown mounted here. The other holes are for the stock joystick or a Sanwa JLF joystick.

Here’s how it looks after I replaced all the stock parts with Seimitsu brand parts. I used a Seimitsu LS-32 stick, 8 Seimitsu PS-14-G red pushbuttons and 1 Seimitsu PS-14-D yellow pushbutton:

Mayflash F500 v2 interior after modding with Seimitsu parts.

Mayflash F500 v2 exterior after modding with Seimitsu parts.

I now personally like Seimitsu better than Sanwa. Seimitsu sticks and buttons feel sturdier and heavier to me, and they definitely make nicer sounds with more “oomph” when actuated, compared to Sanwa parts which feel more flimsy to me. But I think this is all a matter of taste. And the Mayflash F500 allows easy modding with Sanwa or Seimitsu, whatever you prefer.

One note: The circuitry in this stick actually uses a common ground, so there’s no compatibility issues with Sanwa or Seimitsu parts. Some sticks use uncommon ground which makes modding harder. I first saw all the separate ground wires and thought it might not be common-ground, but it is ūüôā

The Mayflash F500 v2 has a lot of circuitry inside and claims to be compatible with PC Directinput, PC XInput, Switch, PS3, and many more. I have not tested all of that, but I did briefly play using XInput in PC, and it seems to work just fine. I am not sure if all that circuitry adds much ¬†input lag. If any lag is revealed in the future, I don’t see a big problem either. The case is so tidy and there’s so much room inside that it would be absolutely no problem to bypass all that complicated Mayflash USB circuitry and instead directly hook up a PS1 digital PCB connected to a Retroadapter flashed with my RetroadapterMOD firmware (https://github.com/rsn8887/retroadaptermod), a Retropad32, a Daemonbyte USB adapter or any other lag-free controller readout solution.

I love the Mayflash F500 v2 and how easy it is to mod it with actual Seimitsu (or Sanwa) arcade parts. This is a stick build from the beginning with modders in mind.

I also ordered a KOWAL octagonal restrictor plate for the Seimitsu stick. That light and dark blue two-layered plastic thing that came preinstalled on my Seimitsu stick (shown in the photos above) is not what I want from an octagonal restrictor, regardless what Seimitsu tries to say about it.

EDIT: I installed the KOWAL octagonal restrictor plate a few days after the original post, and it works great!

Seimitsu LS-32 stick after installation of KOWAL octagonal restrictor plate.

Until next time,

A shader for sharp pixels


A while ago, based on TheMaister’s work, I made a collection of shaders to display old-school 2D graphics with sharp pixels, no distortion, and minimal blurring.

In particular, the sharp-bilinear-simple shader was included. I recommend this shader with all games that display low-resolution 2D pixel graphics to achieve optimum image quality.


Sharp-bilinear-simple does an automatic integer pre-scale (2x, 3x, 4x, etc.), depending on the game and screen resolution. The pre-scale is done using point filtering with no blurring. Only the final scaling, if any is necessary after the pre-scale has already been applied, is then done using linear filtering. This produces sharp pixels with zero pixel wobble and minimal blurring in all 2D games regardless of output resolution.


Compared to a simple linear filtering that smoothes the pixels (“video smoothing=ON”), pixels are much less blurry with this shader. Compared to point filtering without smoothing (“video smoothing=OFF”), the pixels do not change shape or wobble as they move across the screen.

Example Images

Here is an example image with the sharp-bilinear-simple shader switched on:

Image with sharp-bilinear-simple shader on.

Here is an example with shaders off and smoothing on (too much blur):

Without the shader and with smoothing on there is too much blur.

Here is an example with shaders off and smoothing off (it looks sharp at first):

Without the shader and with smoothing off, it appears fine, but…

On first glance, the above seems to look sharp and good. You might think a shader is not necessary. But looking at the picture in detail, we can see the pixel wobble that happens when no shader is used. The pixels on the black diagonal (circled) should all be the same square shape. Instead, some of them appear rectangular and quite distorted:

Without shader, the pixels have different shapes. This causes ugly “pixelwobble” when things are moving.

Compare the above detail to the result with the shader on:

With the sharp-bilinear-simple shader, pixels are sharp and there is no more pixelwobble.

Now all pixels have the same shape, at the cost of a slight reduction in sharpness.


The calculations done by sharp-bilinear-simple are trivial. Using it with RetroPie on a Raspberry Pi 3 in 1080p full HD resolution, Street Fighter 3 Third Strike (libretro-fba) runs at a steady 60 fps. Since this is a pretty taxing game to emulate, I don’t think enabling the shader can cause slow-down in any games, at least not on Raspberry Pi 3.

Improvements to TheMaister’s Original “retro/sharp-bilinear”

  • There’s a small improvement that makes sharp-bilinear-simple work better with vertical games (shmups etc.). The autoscale is calculated separately for both the horizontal and vertical dimension, e.g. the integer prescale could be 4 for the horizontal, and 2 for the vertical. The original sharp-bilinear only used the vertical dimension to calculate the auto-prescale, and then used the same integer for both x and y.
  • The autoscaling factors are pre-calculated in the vertex shader, instead of re-calculating for every pixel.
  • The sharp-bilinear-2x-prescale shader configuration, only included in the package for RetroPie and Retroarch, is even less computationally intensive than the sharp-bilinear-simple shader. It is just a shader config that applies two passes of the stock.glsl “Null shader,” with different filtering settings. It contains almost no calculations and should be extremely fast.


The shader is available on Github. It was recently included in Retroarch and Retropie where it can be enabled in the configuration menus. It was also added to FrangarCJ’s vita-shader-collection for the PS Vita, and can be enabled in several emulators such as¬†UAE4all2 for Vita, ScummVM for Vita, and Cpasjuste’s excellent arcade emulator PFBA for Vita. The shader is also automatically enabled in the Vita games¬†SDLPoP-Vita, SDLPal, and Bermuda.

Sharp-bilinear-simple relies on hardware filtering. In ScummVM for Vita “video smoothing” has to be on and in PFBA for Vita “filter: linear” has to be set for the shader to work correctly. In addition, the shader has to be selected. It is sometimes called “sharp,” or “sharp-simple” in the shader selection menu.

Until next time,

Converting Analog Joystick to Digital Joystick Signals

The following picture shows how a good analog-joystick-to-digital-joystick conversion should be done, with a circular deadzone in the center, and eight symmetric angular zones for the eight possible directions:


Sadly, most software uses a far inferior solution, where each axis is checked separately and compared to the deadzone by itself. This results in the following, terrible, result:


If the deadzone, which is now square, is small, as in the picture above, then the diagonal zones are much too big. The user will constantly hit the diagonals by accident.

In contrast, if the deadzone is large, then the diagonal zones become way too small. The user will have a hard time hitting the diagonals at all:


Using the angular zones from the first picture avoids all these problems. It also leads to slightly more complicated code. Both axes have to be analyzed together to find the result. Here is some example code snippet:

float slope = 0.414214f; // tangent of 22.5 degrees
// circular deadzone check
if (joyX * joyX + joyY * joyY >= deadZoneSquared) {
   if (joyX > 0 && joyY > 0) {
      // upper right quadrant
      if (joyY > slope * joyX)
         up = true;
      if (joyX > slope * joyY)
         right = true;
   } else if (...) // code for other three quadrants

Here, joyX and joyY are the analog readouts as floats, deadZoneSquared holds the squared value of the radius of the circular deadZone in the center, and up, down, left, and right are booleans that are set to true to indicate the resulting digital directions.

XPadder for PC does this correctly. Joy2key does not.

Personally, I prefer to use the DPAD for digital controls anyways. But many people like to use the analog stick. If the conversion is not done correctly, the experience can be quite frustrating for them.

Finally, to perform a truly analog control readout such as for a flight simulator, there are also many pitfalls. Basically, to do it right one has to use a radial, scaled deadzone, as detailed in the following great article from third-helix:


Until next time,

Pelican Real Arcade Universal Stick – spinner mod

Recently, I went back into the guts of my Pelican Real Arcade Universal controller (previously modded with IL and HAPP arcade parts). I added a TurboTwist 2 Spinner controller for use with games such as Arkanoid or Tempest. Here is a picture of the finished mod. The new spinner can be seen to the left of the two white buttons towards the rear of the case:


I played a few hours of Arkanoid 1 and 2 with it on the Xbox using CoinOPS. It was really fun, but quite hard to play because I am so used to playing these games with a mouse.

The mod was very easy. I had an unused button in the case anyways. I just took it out and put in the spinner instead. The spinner functions as a usb mouse (only the horizontal axis is actuated of course). I guided a usb extension cord out of the back of the controller case together with the original Playstation 1 controller cable from my previous mod. In order to hook it up to the Xbox, I used a USB-to-Xbox adapter cable.

The analog sensitivity in MAME has to be adjusted on a per game basis, and depends on the counts per revolution of the original game, as well as the counts per revolution ratio of your spinner controller. The TurboTwist 2 has 1200 counts per turn – enough resolution to simulate any spinner-based arcade game. A list of counts per revolution values for some arcade games can be found here. For example, Arkanoid 2 has 972 counts per revolution. So the analog sensitivity in MAME should be set to 972/1200=81%. I am assuming any kind of mouse acceleration is turned off.

Until next time,

Pelican Real Arcade Universal Stick – IL Parts Mod

A few years ago, I finished my first arcade controller mod, replacing the knockoff stick and buttons in a Pelican Real Arcade Universal Stick with arcade-authentic parts from HAPP and IL. The Pelican has a nice large and sturdy case made from thick particle board. Here are pictures of my modded controller. Note the additional DB9 connector for the connection of an old Amiga/Atari style joystick:

4 PelicanHapp_Front

3 PelicanHapp_Bottom_Detail

2 PelicanHapp_Bottom

1 PelicanHapp_Top

I replaced all the Buttons with concave buttons from HAPP, and the stick with an IL eurostick.

The pictures show my initial mod where I used a HAPP stick. I later went back and replaced that with an IL stick. The IL sticks are used in European arcades and are of much better quality than the current generation of similar looking HAPP sticks. HAPP used to simply re-brand the high-quality IL sticks from Europe. But, a few years ago, HAPP apparently decided to  manufacture their own sticks in China instead. These Chinese-made HAPP sticks feel wobbly and imprecise when playing games. The good IL sticks can be distinguished from the new HAPP knockoffs by looking at the square actuator at the bottom of the joystick shaft. For sticks from IL the actuator is white, while the knockoff HAPP sticks have a black actuator.

I used the concave style buttons because I remember those from the arcades when I was young. Most professional gamers seem to prefer the convex shape, since it allows your fingers to move more quickly between buttons.

In addition to replacing the stick and buttons, I also replaced the Pelican PCB with the PCB from a Playstation 1 controller (non-dualshock).

Finally, I added a 9-pin male serial port for connection of an Amiga or Atari style joystick for emulation purposes.

I had to solder a few wires: 10 Buttons, ground on every microswitch, and then the four joystick directions. I realize now that I should have just bought Quickconnect crimp connectors for all the wires. That would have made it much easier than soldering directly to all the microswitches. 

When soldering the wires to the test points on the Playstation 1 controller, two of the testpoints completely detached. I think this was due to the heavy wires I used. The wires pulled on the testpoints with quite a bit of force. I managed to scrape the resin off some of the copper traces on the PCB and solder the detached wires to those. This turned out to be quite unstable, too, and the traces looked like they might lift off the PCB far too easily. So I decided to secure all the solder joints and attached wire segments to the PCB with blobs of 5 min. epoxy. Now it is all rock solid, nothing moves anymore and the wires are kept from pulling directly on the solder joints. I can only recommend epoxy to secure such fragile spots. The electrical contacts have to be good to begin with though. Once the epoxy is on there, it becomes really hard to go back and change anything.

On the Playstation controller PCB, I then de-soldered the white 7-pin molex style connector that joins the controller cable to the PCB. I did this hoping that I would be able to fit the cable with the white connector through the hole in the back panel of the Pelican case. It didn’t quite fit. So I detached the white connector from the cable, guided it through the hole, and then soldered the 7 tiny wires directly onto the Playstation controller PCB. That was quite wobbly and fragile (while soldering, two of the wires ripped off immediately). In the end, I finally got the seven solder joints to be somewhat stable without one of them ripping off. I then encased the joints and wire segments in epoxy to secure them.

Now everything was very nice: the Playstation controller cable fit into the strain relief of the Pelican, the Playstation controller PCB could be fastened to the Pelican case in the same place where the original PCB used to be. By the way, the original PCB was not very good. For example, it was not even recognized as a Playstation controller by the Total Control 2 Plus PS1-to-Dreamcast adapters.

The IL stick and buttons fit into the existing holes in the case. The screw holes to hold the joystick in place also fit the new stick. Maybe the Pelican was originally designed to house HAPP/IL parts, and then, at some later point, it was decided to put in knockoff parts instead to save some money?

Other notes:

– Since I didn’t have the crimp style Quickconnects, I directly soldered to the microswitches. Next time, I will use the correct 0.187″ Quickconnects. That way, it will be much easier to replace a broken microswitch in the future.

– The wiring in the box is quite cluttered. I secured it all with zip ties, so it shouldn’t be a problem in daily use, but it still looks messy.

РI used 22 American Wire Gauge wiring. The original wires in the Pelican controller were much smaller. I realized that soldering a thin wire is much easier than a thick wire. Next time, I will probably use thinner wiring. On the other hand, with this thick wire,  the chances of breaking a wire when servicing the controller are much slimmer. And I anticipate some of these microswitches to eventually go bad.

– I daisy-chained all grounding wires. In the original Pelican design, each switch had its own dedicated ground wire, e.g. grounding was done in a star pattern. The star pattern is the correct way to ground things in general. However, with such a simple application as this joystick, we do not very about Voltages at the microvolt level and ground loops should not be an issue here.

Until next time,

Mayflash Arcade Stick – Sanwa Mod

Some time ago, I modded my Mayflash arcade stick with authentic Sanwa parts that are used in the arcades, as well as a PCB taken from an old Playstation 1 (non-dualshock) controller. The Mayflash has a slightly small but otherwise quite sturdy plastic case.

Here are the pictures of my modded stick:



As parts, I again used all Sanwa components:

LB-35 balltop in black,
GTY octagonal restrictor plate,
and OBSF-30 buttons in many different colors.

At first, I tried to use a green balltop, but that looked horrible. I think the black balltop looks much nicer on this case.

The Mayflash controller must be the cheapest arcade stick money can buy. I paid $25 for a brand new one! The case is the only good thing about this stick though. The PCB, the stick, and the buttons are of pretty bad quality and feel wobbly. It is worth buying just for the case, though.

Although the PCB works with PC/PS2 and PS3, it is no good in everyday use. Contrary to other arcade sticks, the directions are mapped onto the left analog stick with 100% actuation and not to the digital gamepad directions. This mapping makes the stick out-of-the-box useless for example for Soul Calibur and Tekken. In those games, you will run constantly, dashing with double-tap doesn’t work either, and there are probably a myriad of other complications.

In addition, the PCB does not utilize a common ground for joystick directions. This is extremely annoying. At first, I tried to make use of this PCB. I had to make my Sanwa stick compatible by cutting its common ground connections and directly solder onto its microswitches. In the end, this was unneccessary, since I decided to replace the PCB with one from a Playstation 1 controller, which uses common ground. I kept the Mayflash PCB in the case, but only use it  because it provides me easy access to the contacts of the start and select buttons (see picture).

The buttons in the Mayflash controller are cheap parts that press directly onto charcoal contacts on a large secondary PCB. That is quite bad, because everytime you hit the button, you are pressing directly on a PCB, just like in a gigantic directional pad. Who thought of this? *shiver*

I drilled four holes into the top wall of the case, and attached the new Sanwa joystick via its large metal mounting plate to those holes with four screws and nuts. Before doing that, I used a dremel tool on the inside of the case to file away any plastic pieces that happened to be in the way of the Sanwa stick. There are quite a few plastic extrusions and mounting pieces on the inside of the case that are in the way. But they can be filed off very easily.

Luckily, the hole for the stick in the Mayflash case is big enough for the Sanwa stick with its black joystick cover. The stick does not touch the hole, even when actuating diagonals.

The holes for the buttons also required quite a bit of dremel work. The diameter of the holes is just 1.5 mm too small to allow for the Sanwa buttons. Luckily, the plastic can easily be filed away with the dremel to enlargen the button holes to the correct diameter. From my own experience, it doesn’t seem to matter whether the holes are not perfectly circular, as long as they are not too small. If the holes are too small, they will squeeze the buttons too much, making them feel stiff. This is easily noticed when pressing the buttons.

I mounted the Playstation 1 controller PCB  on one of the remaining tapped holes inside the case using one small screw and a cable tie.

I am pretty happy with the result. This was the cheapest arcade stick I have modded so far.

Until next time,

Hori Tekken Tenth Anniversary Stick – Sanwa Mod

A while ago, I modded my Tekken Tenth Anniversary stick with Sanwa parts. The original stick contains knockoff parts. I wanted the original parts as found in the arcades. The Tekken stick has a pretty awesome case made out of thick plastic with metal plates on the top and bottom.

Here are the pictures of the modded stick:



As parts I used:

Рoriginal Sanwa JLF-TP-8YT-SK Stick
РSanwa octagonal restrictor Plate GTY
Рred ball Sanwa LB-35
Рred Sanwa 30 mm snap-in buttons OBSF-30
РStart and select: yellow Sanwa 24 mm snap-in buttons OBSF-24

Plus several screws, crimp-style quickconnects and other small parts.

The buttons in the Hori are directly soldered to the PCB, without any wires! This design strikes me as extremely bad, but it is probably the cheapest solution. On the other hand, the case of the controller struck me as very nice and sturdy.

I desoldered the PCB from the buttons using solder wick, and re-attached it at a different place using an angle-bracket screwed directly into the plastic case. This way, I gained enough room to guide wires from the new buttons to the PCB. I tried to find a way to attach the PCB directly to the bottom of the case, but there was no room for screws there. It turns out that there is no space between the plastic bottom inside the case and the outer aluminum piece.

The solder joints on the PCB are easy to access and rather big. This made it easy to solder the new wires to them. The PCB functions perfectly as a Playstation 1 controller and works with adapters of all kinds to connect this controller to other devices.

The way the original stick is mounted to the case was quite nicely done by Hori. The stick is attached to the metal cover by four screws that screw into tapped holes on four metal angle brackets that are welded directly to the underside of the metal top cover.

In order to mount the new Sanwa stick, I first detached its rectangular metal mounting plate and looked for other holes to use. After detaching the microswitches, I found four holes in the Sanwa main body that almost aligned with the mounting holes in the Hori case.

Sadly, the holes in the Sanwa body do not perfectly align with the tapped holes on the metal brackets on the case. To fit the new stick, I first enlarged the holes in the Hori case using a power tool. This destroyed the tap, and I decided to use nuts and washers instead. I then used a dremel to file the four holes in the Sanwa body to make room for screw heads between the body and the microswitches. To mount the Sanwa stick, I then simply used four small screws with nuts and washers.

The button holes in the Hori case already have the correct diameter needed for the new Sanwa buttons. However, there are small metal tongues sticking out. The tongues are used to keep the Hori buttons from rotating, but are in the way of the new Sanwa buttons. I used the dremel to file all of them off.

At the end, I have a discovery to share: the hole for the joystick in the Hori case is too small to house a Sanwa stick with stick cover. The stick cover is a black, slightly conical, plastic piece that goes around the bare metal stick shaft. If that cover is on, the stick collides with the hole when using a diagonal direction. This is undesirable, because the stick throw should only be limited by the restrictorplate, and not the hole in the case. Otherwise the stick throw will feel like a mixture of circular and octagonal. The solution is to simply leave the joystick cover off. The Sanwa dustplate will not fit anymore, but that is not a problem since the old Hori one will fit the new coverless stick perfectly.

Until next time,