Connecting pedals to a Sega Dreamcast Race Controller

Friday, 30th September 2022

I recently built some Dreamcast Race Controller "De-Dead Zone" mods for people and before popping them in the post I tested them in my wheel. During this process I noticed an unpopulated region of the main PCB:

Photo of unpopulated region of the Dreamcast Race Controller PCB

I remember reading that some versions of the Race Controller had a socket on the back for the connection of a set of pedals, however those pedals were never released and games instead rely on a pair of analogue paddles mounted behind the wheel for braking and acceleration. I wondered if the pedal functionality was still available on my wheel, even though it lacks the relevant socket on the back. I traced the connections of the unpopulated components and made a guess of their values, based on their name (e.g. FB9 is presumably a fuse, C22 is presumably a capacitor) and comparing their function to other similar sections of the circuit. This is the circuit I arrived at:

Circuit diagram of the missing components on the Dreamcast Race Controller PCB

FB9 and FB10 connect +5V and GND to CN5's pins 1 and 5 respectively and are presumably the power connections for the pedals. R22 and R23 are 1MΩ pull-down resistors that were already present, and based on the thick traces from CN5's pins 2 and 3 and connection to two adjacent pins on the main microcontroller these are part of the analogue inputs from the two pedals. CN5's pin 4 is eventually connected to another pin on the microcontroller with a 10KΩ pull-up resistor, and my assumption is that the pedals should connect this pin to ground so the wheel can detect whether they are plugged in or not.

Other parts of the wheel use 100Ω resistors in series with their analogue inputs so I followed their lead. I'm not sure of the capacitor values; I picked 100nF for the C25 capacitor across the power supply lines and 10nF for the capacitors to ground on the other inputs (C22, C23 and C24) but these are complete guesses as I don't own a capacitor meter to test the similar components on other parts of the board.

As I also don't have the small surface-mount parts in stock I connected wire links across FB9, R17, R18, R19 and FB10 and then soldered five wires to CN5 so that I could build a small circuit on a breadboard with the resistors and capacitors on it. I then connected this to my racing wheel pedals:

CN5 Pin Function
1 +5V
2 Pedal 1 analogue voltage
3 Pedal 2 analogue voltage
4 Pedal detect (connect to GND)
5 GND

With the pedals connected like this the race controller does detect them and sends their status back to the Dreamcast console, however no game software I have tried has been able to work properly with the pedals. Games either ignore the pedals entirely or complain about an unsupported or disconnected controller. However, if you run the 240p Test Suite's controller tester you can see the pedals reported as two additional axes that operate independently of the existing analogue paddles.

Video thumbnail showing wheel and pedals being tested in the 240p Test Suite

The video above shows a demonstration of how the wheel and pedals perform in a handful of games and the 240p Test Suite, with that test suite being the only software I've found that can show the status of the pedals. It's a bit disappointing that no games seem to support the wheel and pedals together, but I thought it was interesting to see that the functionality is at least present in the wheel hardware.

Constructing a prototype of the updated Justifier adaptor for the Mega Drive

Wednesday, 6th July 2022

The latching behaviour of the light sensor output TH on the Justifier had caused one complication in the design of the adaptor, described in this earlier post in detail, and that is that there needed to be some way for the console to output the state of the TL back to the gun to reset TH each frame when TL goes high. The American Laser Games don't reset the gun in this fashion, but they don't need to as they use DATA2 for the light sensor output from the gun instead of the latching TH. The circuit had been adapted to tap into this unlatched signal on DATA2 when a Justifier as attached, but there was also some additional complications in the circuitry to ensure that when the adaptor was in "GameGun" mode it would still hold TL low to ensure that any connected Justifier was enabled as it couldn't rely on the game doing so.

Unfortunately, with all these complications I found that Lethal Enforcers no longer worked reliably, for example pulling the trigger would advance two items in the menu instead of one. I think all of the additional routes for the signal to work its way through the circuit – as well as the crude diode logic used to avoid having to add even more logic chips – was causing timing issues. Now that I know it's possible to tap directly into DATA2 to get the unlatched light gun signal from the Justifier it removes the need to reset the gun every frame, which allows for somewhat simpler diagram:

Adaptor from a Light Phaser or Justifier to Justifier or GameGun
Light Phaser/Justifier to Justifier/GameGun adaptor

Compared to the previous circuit you'll notice the TL signal coming back from the console to the gun inputs has been removed along with the supporting diode logic near the mode switch. Diodes are used between DATA3 and TL on the gun inputs to ensure that if DATA3 is low (which is used to identify a Justifier) it'll also pull down TL to keep the adaptor enabled. (TL is used for the trigger input when a Light Phaser is connected so can't be held low permanently). The 470Ω resistor is used to limit the current in case a different type of controller that is driving TL high and DATA3 is connected – protection against that sort of thing is also why TR has a 1KΩ resistor on it and the TH output sports a 470Ω resistor.

After making these changes, I redrew the circuit in KiCad in preparation of a new PCB design. The above diagram is clearer on how the logic elements are laid out, but at least with the KiCad diagram I can check the correctness of the PCB before spending any money on manufacturing. This of course assumes that the translation from breadboard→logic diagram→wiring diagram is correct too! To assist in this, I printed off the KiCad diagrams and then rebuilt the circuit on some prototyping board, connecting pin to pin using the numbers assigned in the wiring diagram:

The circuit constructed on a prototype board

It's not pretty, but it works! Unfortunately the particular prototyping board I used was of very low quality, with the solder preferring to make bridges than solder to the pads (which themselves don't take much heat to loosen and fall off the board – don't even think about reworking any mistakes!) and the insulation on the wire I'm using seems to have a pretty low melting point, making it shrink back from solder joints and form short circuits very easily. In other words, the less said about the bottom of the board, the better:

The underside of the circuit constructed on a prototype board showing the wiring detail

However, the important thing is that it works, and now that I've been able to test it out in all of the released Mega-CD games I feel much more confident about redesigning the PCB.

Adding a GameGun mode switch to the Mega Drive Justifier adaptor

Thursday, 30th June 2022

The light gun adaptor for the Mega Drive and Mega-CD that I'm working on now has a mode switch that allows you to choose between "Justifier" and "GameGun" modes. The circuit is starting to look a little messy:

Adaptor from a Light Phaser or Justifier to Justifier or GameGun
Light Phaser/Justifier to Justifier/GameGun

I have not fully tested the diagram or circuit in practice, but my initial tests are encouraging. The main change is an extra multiplexer that changes the source of four output pins on the adaptor:

Output Justifier GameGun
TH Latched light gun 1 or 2 sensor Raw light gun 1 sensor
DATA0 Light gun 1 or 2 trigger Light gun 1 trigger
DATA2 Raw light gun 1 or 2 sensor Logic high
DATA3 Logic low Light gun 1 start

The DATA1 pin continues to be connected to the Justifier start button output in this arrangement which is not correct but there aren't enough multiplexers available to also switch that, and in my testing it doesn't seem to affect the detection or handling of the adaptor as a GameGun.

At this point I think I need to build the circuit again on some prototyping board using the diagram as a reference (and not the breadboard prototype) to ensure that the diagram is correct. If that still works I can redesign the PCB and get some new boards manufactured to fully test the circuit's performance in all the Mega Drive and Mega-CD games once more.

The circuit constructed on a breadboard

Hopefully these PCBs will work a little better than the first batch now that I've made all of these improvements to the circuit!

The mysteries of the American Laser Games GameGun

Tuesday, 28th June 2022

When experimenting with the American Laser Games titles to try to get my Light Phaser-to-Justifier adaptor working properly I was surprised to see the circuit was initially detected as a GameGun. This was not a light gun I was familiar with so went to read about it on Sega Retro which turned up a photo of the gun:

The American Laser Games GameGun
The American Laser Games GameGun – photo from Sega Retro by user Black Squirrel

This gun is from American Laser Games themselves and is labelled "Sega CD Compatible" as it was apparently based on their similar gun for the 3DO. Sega Retro does also mention the following:

The GameGun [...] is also compatible with games designed for both the Sega Menacer and Konami Justifier. The GameGun is the only widely produced light gun to substitute the Menacer, and is therefore the only smaller alternative to an accessory often criticised for its cumbersome size.

This does sound like an intriguing device! It must pack some fairly sophisticated technology to be compatible with all three light gun protocols, considering how different they all are from each other. I'm not entirely sure how that would practically work, either, as there doesn't seem to be a mode switch or the additional buttons found on the Menacer. Maybe they're on the other side of the gun in the photo…

Fortunately, nesdev.org forum user nintendo2600 owns an ALG GameGun and posted some photos of the internals, which forum user TmEE used to derive a circuit diagram:

The American Laser Games GameGun
The American Laser Games GameGun circuit diagram reverse engineered by TmEE on nesdev.org

This circuit is very simple, only passing on the amplified light sensor signal to the TH output, the state of the trigger button to DATA0 (pin 1) and the state of the start button to DATA3 (pin 4). The GameGun appears to lack any sort of circuitry to generate a controller device ID, which on the Mega Drive is handled by setting the DATA0 to DATA3 pins to various "invalid" combinations depending on the state of TH as an input (the DATA pins are mapped to the d-pad in a standard controller, and an "invalid" combination would be for example reporting that up and down were held simultaneously – this is covered in somewhat more detail in this earlier journal post.

The Menacer and Justifier both contain the appropriate logic to generate a valid controller device ID, and so games supporting those guns check to see whether such a gun returns a valid device ID before allowing you to use the respective gun. Without that logic in place, the GameGun will not be detected as a Justifier or Menacer and so is unsupported in these games. I'm not sure where the source of the information that the GameGun is compatible with games that require a Menacer or Justifier originates, but the circuit doesn't back that up and it would also explain why people who own this gun have not been able to get it working in games that do not explicitly support the GameGun.

The inability to detect a GameGun is also why the American Laser Games default to assuming you have one plugged in, even if you don't have anything plugged into the controller port at all! Its simple design also makes a passive adaptor from the Master System Light Phaser to the GameGun possible:

Adaptor from a Light Phaser to GameGun
Light Phaser to GameGun adaptor

A passive Justifier-to-GameGun adaptor should also be possible, as well as a universal adaptor that could handle both guns. Interestingly the two games I was having compatibility difficulties with before – Mad Dog II and Crime Patrol – work with such a simple adaptor and a Light Phaser, even though the repeated triggering from the Light Phaser causes problems when it's converted to a Justifier using the circuit described in my previous post. Maybe a better solution to the compatibility issues would be to provide a Justifier/GameGun switch on the adaptor…

Even if I can get the Justifier adaptor working completely in Justifier mode in Mad Dog II and Crime Patrol a GameGun mode may still be handy as Corpse Killer on the Mega-CD supports the GameGun but not support the Justifier.

The above video shows the simple passive adaptor working in Mad Dog II: The Lost Gold. A big thank you to TmEE for reverse engineering the GameGun and to nintendo2600 for posting the photos of the insides of their controller!

Improving the Konami Justifier adaptor's compatibility by properly implementing the DATA2 output

Saturday, 25th June 2022

In the previous entry I mentioned how the Justifier light gun adaptor for the Mega Drive and Mega-CD had some compatibility issues, not working at all on one of my older Mega Drive consoles and not working in any of the games developed by American Laser Games. Fortunately, the former issue ended up being very easy to fix. After moving the circuit around a bit and checking various points with a logic probe I found that it did work sometimes, but not reliably. This made me think it was a floating input and adding a 10K pull-up resistor to TL on the Mega Drive side fixed the issue entirely. I have also added 10K pull-ups to TH and TR on the Mega Drive side, just to be sure. Unfortunately, this didn't help with the American Laser Games titles – they still weren't working.

A DE-9 breakout adaptor attached to the second controller port of a Mega Drive

To be able to diagnose the issue it would be very useful to actually see what's happening on the controller port's data lines. I can probe my own circuit, but not the Konami Justifier, so to help me out I built a crude DE-9 breakout adaptor that can sit between the console and the controller and provide pin headers to connect my logic analyser to.

One of the games that has issues, Mad Dog McCree, claims the adaptor is a "GameGun" and not a Justifier. This seems to indicate a problem with the device detection during startup, so I logged the activity to see what was going on:

Logic analyser trace showing activity on DATA2 line

This trace surprised me, as I had assumed all this time that DATA2 and DATA3 should be low at all times and were tied to ground on the adaptor. Indeed, inside the Justifier itself DATA3 seems to be soldered directly to ground; DATA2 is connected to a pin on the controller chip but I wasn't sure what it was supposed to be doing and tying it low didn't seem to cause any issues.

Zooming into the trace I could see that DATA2 was always the opposite logic level to TL, so I added a hex inverter chip to invert TL and connected its output to DATA2. Restarting the console made Mad Dog McCree detect the adaptor as a Justifier; pressing the Start button advanced through menus and pulling the trigger caused the screen to flash. Progress, of sorts, but the game would still not register any shots as being on-screen.

One detail about the Justifier's TH output, which goes low when the gun sees light on the screen, is that it is latched – once it goes low, it remains low, until the TL line goes high to reset the gun. This is not a feature I'd previously implemented as the Konami-developed games don't seem to rely on this behaviour. However, in the American Laser Games titles, once TH goes low, it remains low until the game resets back to the demo loop. How can the game tell where the gun is aimed if TH is pretty much permanently stuck low? This doesn't seem to bother the American Laser Games titles, so they must be using some other method for detecting when the gun can "see" light from the TV screen.

Logic analyser trace showing activity on DATA2 line at TV frame and line frequencies

Looking at a logic trace from real Justifier of the running game turned up some further information about the DATA2 signal; at points the signal would pulse low at around 60Hz, and sometimes those low pulses would themselves contain pulses at around 15.625kHz. These numbers are suspiciously close to the TV vertical (frame) and horizontal (line) refresh rates – are the games expecting the light sensor input from the gun to be on DATA2 instead of TH?

I replaced the simple DATA2=NOT(TL) circuit with DATA2=NOR(NOT(TH),TL) as this would pass TH to DATA2 when TL was low but output low when TH was high. Success, of sorts: Mad Dog McCree and Who Shot Johnny Rock? now work.

Unfortunately Mad Dog II and Crime Patrol still don't register shots. I compared a real Justifier to the adaptor and it mostly looks the same, with one possible exception: retriggering from the light sensor. Below is a capture of a successful shot from the Justifier; the top trace is the trigger pull, the lower trace is the signal on DATA2, showing a single burst of activity on the few lines where the gun can "see" the bright flash of the TV screen:

Trace of successful Justifier shot, showing a single burst of activity on DATA2
Single burst of activity after a shot from the Justifier

The Light Phaser doesn't produce a single set of pulses via the adaptor for the bright flash it sees, it produces four:

Trace of failed Light Phaser shot, showing four bursts of activity on DATA2 spaced 16ms apart
Four bursts of activity after a shot from the Light Phaser

The four bursts of activity repeat at around 60Hz; it's as if the Light Phaser continues to see the screen as being bright for a few more frames after the initial flash, but the Justifier only allows a single frame's worth of pulses to get through. The other control lines do not change to indicate this.

My best guess is that the two games that do not work with the adaptor detect the additional sets of pulses generated by the Light Phaser and rejects the shot if "too much light" (for lack of a clearer description at this point) is detected. One thing I have noticed is that the Justifier appears to have some sort of automatic gain control and adjusts its sensitivity based on recent light levels. If you point the gun at a reasonably bright spot on a TV screen it outputs a series of pulses every time the beam passes under where it's aimed. If you then pull the trigger to cause a bright screen flash the gun will output pulses during the flash but when the flash is over and the gun is left pointing at a less bright area of the screen it stops outputting pulses for a short while. The pulses then gradually return over the period of a few frames. Conversely, the Light Phaser outputs pulses consistently with no temporary loss of sensitivity after the screen's bright flash.

Trace of missing pulses from the light sensor in the Justifier after a trigger pull and flash

The captured traces above show this somewhat – after the trigger pull (when top trigger line goes low) the screen flashes brightly. The Justifier sends pulses initially but then there is a gap of around 200ms in the output from its light sensor after the bright screen flash. The Light Phaser, however, sends pulses continuously after the bright flash.
Some further testing also found the further related side effects that seem to confirm this:

  • When using a real Justifier gun directly connected to the console, if you turn the TV brightness and contrast up and shoot at a bright spot on the screen the game will sometimes reject your shots. This doesn't happen when shooting at dark areas.
  • When using a Justifier plugged into the adaptor, the adaptor works fine and shots are registered. In this mode the adaptor is not just a simple pass-through, it is replicating all the rest of the functionality of the Justifier gun and only relying on the connected gun for its light sensor.
  • When using the Light Phaser plugged into the adaptor, if the TV brightness is turned down and shoot at a dark spot on the screen the game will sometimes register your shots. This doesn't happen when shooting at light areas.

Unfortunately, as the issue appears to originate in the light sensor of the gun with no external way to control it, I'm not sure if I'll be able to find a good solution to this problem. Running the video signal through the adaptor to detect bright flashes and gate the light sensor output may work but is not a particularly clean solution!

Updated circuit for the Light Phaser to Justifier adaptor with improved Mega-CD support
Light Phaser/Justifier to Justifier adaptor

The above circuit diagram shows the new version of the adaptor. I believe it's correct but I have made mistakes drawing circuits before (the current prototype PCBs with pins 8 and 9 swapped on the controller port inputs spring to mind) so to summarise the changes:

  • TL, TR and TH inputs on the Mega Drive side of the adaptor are now pulled high with 10K resistors.
  • The DATA2 output is now driven with DATA2=NOR(NOT(TH),TL), allowing the adaptor to be properly identified as a Justifier in American Laser Games titles and have its light sensor signal sent to the console.
  • As the NOR gate chip required for DATA2 had two gates going spare on it the latching behaviour of TH has been implemented with an SR latch.
  • As the plain unlatched light sensor signal is available on a Justifier's DATA2 output a spare multiplexer on each input has been used to choose the light sensor signal between DATA2 (Justifier) and TH (Light Phaser).

The changes to improve compatibility only require one extra logic chip (and a handful of resistors). I tested all of my games again and found the following compatibility results:

  • Working
    • Lethal Enforcers (Cartridge and CD)
    • Lethal Enforcers II: Gun Fighters (Cartridge and CD)
    • Snatcher
    • Mad Dog McCree
    • Who Shot Johnny Rock?

  • Incompatible
    • Mad Dog II: The Lost Gold
    • Crime Patrol

Note that as the compatibility issue seems to be with the light sensor part of the individual guns, it is possible to play Mad Dog II: The Lost Gold and Crime Patrol via the adaptor if you plug in a Justifier instead of a Light Phaser. There is little point in doing so, however; for simultaneous two-player games this would allow you to play a game with two (slightly cheaper) blue Justifiers instead of sourcing the extremely expensive pink Justifier, but the American Laser Games titles with two-player support rely on taking it in turns with a single gun so you may as well just plug your Justifier in directly. Still, it feels like I'm getting somewhere.

Page 1 of 50 1 2 3 4 550

Older posts RSSSearchBrowse by dateIndexTags