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.

FirstPreviousNextLast RSSSearchBrowse by dateIndexTags