The PC-Henshin, a Turbografx-16 region converter, was designed in 2013 when I stumbled upon a Samtec connector (SIBF-20-F-S-AD) which I thought was “suitable” enough to jimmy into a Turbografx-16 edge connector.
UPDATE: I have found a source of brand new real HuCard connectors, production will resume on this product once the connector has been fully tested!
The SIBF-20-F-S-AD is a 20 position 0.050″ spacing spring-loaded connector. The pin spacing is the same as the a HuCard but the pin count is different since a HuCard has 38 positions. I inquired to Samtec about a 38 position variant but they declined saying that their manufacturing would cause the connector to bow after about 30 positions. Therefore, I decided to use two 20 positions SIBF’s side by side.
When placing two 20 position SIBF’s side by side, the problem arises that the pin spacing across the interface of the two connectors is not 0.050″ because the edges are wider (see picture below). I had to sand down the inner edges of two connectors in order to maintain a consistent 0.050″ spacing across the interface. Obviously, the two outer pins of my “custom” 40 pin connector assembly are useless for a 38 position HuCard but that doesn’t really do any harm.
The Conversion – PC Engine to Turbografx-16
Connector issues solved, the conversion to allow PC Engine games to run on Turbografx-16 is quite simple. All that need to be done is to reverse the pin order of the databus. Ignore the CPLD for now, the CPLD is not even soldered on for PC Engine to Turbografx-16 conversion.
The Conversion – Turbografx-16 to PC Engine
The conversion process to allow Turbografx-16 games to run on PC Engine is more complex because Turbografx-16 games (most of them) check which region hardware they are running on. Therefore, you can’t simply reverse the pin order of the databus – you actually have to trick the game into thinking it is running on Turbografx-16 hardware.
Region Check Code
My good friend, Ishiyakazuo, wrote a scanning tool which analyzed all Turbografx-16 roms in the goodset to identify similar biinary data – our hope was that similar data could indicate boiler plate region check code handed down by NEC to Turbografx-16 developers. One would assume that whatever code is performing the region check, even without being familiar with TG-16’s CPU, would look a little something like this:
test regionBit beq gameCode bra infiniteLoop
As luck would have it, we found the following code in ALL roms:
0x78 0x54 0xA9 0xFF 0x53 0x01 0xAD 0x00 0x10 0x29 0x80
I’ll leave it to the reader to figure it out as an exercise in HuC6280 assembly. But essentially, you can draw the following conclusions from disassembling this code and analyzing all ROMs:
- We only need to detect the first 7 bytes of the pattern since this pattern exists NOWHERE else in any game
- To fool the region check, we can simply replace the final 0x80 by a 0x00
Ishikazuo, with a bit of assistance from myself, wrote a VHDL state machine which looks for the 7 byte pattern discussed aboved. The console’s #OE signal is routed through a CPLD, when the 7 byte pattern is detected, the state machine counts the bytes until we reach where the 0x80 should be. At that point, we simply prevent #OE from reaching the HuCard and instead we drive 0x00 on the databus. Sounds pretty straightforward – and really, it’s basically a glorified Game Genie with only 1 function.
The only hurdle we encountered is that the HuC6280 does a bit of prefetching on certain opcodes. Therefore, this slightly modified the byte pattern we were looking for.
#TODO remember which damn signal is #OE
Instead of hard-coding which bytes would be repeated we simply changed the VHDL state machine to allow most of the byte pattern to have repeated bytes without losing track of the pattern. It’s just better programming that way!
PC Henshin is comprised of two boards, the main board has all of the components including the CPLD and the carrier board servers as a spacer to get the SIBF connectors at the right distance from the HuCard.