Saturday, 18 January 2020

Reviving suicided Gaelco PCBs : The Right Way

Most of arcade enthusiasts/collectors know what 'suicide battery' means.It's the term used to describe a small battery found on some arcade PCBs.The battery powers a RAM that hold a decryption table which is needed to decode program code so when the battery runs out, the contents of RAM is lost and hence game can no longer run.Many arcade manufacturers used suicide batteries in their games  like Sega, Capcom and others too.In this small guide I will explain how to properly revive suicided boards manufactured by Gaelco, a small spanish company.This is the list of boards that currently can be revived:
  • World Rally
  • Alligator Hunt
  • World Rally 2
  • Touch & Go
  • Maniac Square
  • TH Strikes Back
  • Glass
  • Target Hits
Hardware uses a Dallas  DS5002 MCU (in QFP package) as protection, which has up to 128k of battery-backed RAM containing a program for the DS5002 to execute :
 

This program actually patches main CPU's code. If the battery dies, the DS5002 no longer makes the correct patches and the game won't run. Typical symptoms of a dead battery are a "COPROCESSOR NOT READY" message :


Until some time ago it was possible to revive only World Rally since Gaelco itself released the code of this game to be re-injected onto the DS5002 MCU.Then two smart guys, Peter Wilhelmsen and  Morten Shearman Kirkegaard, devised a way to back-up DS5002 firmware of all boards via FPGA, this is the original document explaining their work:

Backing Up Firmware from Dallas Semiconductor DS5002FP

Some time ago I tried to desuicide a TH Strikes Back but I falied using the standard procedure hence Peter Wilhelmsen himself kindly explained me how to correctly perform it.Taking as example TH Strikes Back if you look at the MAME source:


 https://github.com/mamedev/mame/blob/4e089ae32e8335034b2412a2d478e278fd29832d/src/mame/drivers/thoop2.cpp#L332


You will see: DS5002FP_SET_MON( 0x79 ) which means the special register MCON is set to 0x79 (lowest bit signifies if protected/locked or not), MCON is responsible for partitioning of code/data boundaries.
I will not cover here the preliminary setup on how to connect the PCB to a PC via RS232 or USB to UART adapter, there are many tutorials on the net.
Working on the terminal program on your PC these are the steps to repair most boards that does not use the entire memory as code (like World Rally 1)  :

  1. 'U' command (without quotation marks) to unlock the MCU.The game should answer ''UNLOCKED'
  2. 'L' then upload/paste the intel hex file. 
  3. 'W MCON <value>' (for TH Strikes Back 'W MCON 79') to write the special register
  4. 'R' to read the status of NV SFRs, you should see MCON now set to 78 (lowest bit not set because its not yet locked) 
  5. 'Z' to lock the MCU

A big thanks again to Peter Wilhelmsen for his work and precious help.Thanks to him now we are able to revive our boards.

And a posthumous thanks to his friend/collegue Morten Shearman Kirkegaard who sadly passed away some months ago :


Farewell Morten Kirkegaard


This little guide is dedicated to his memory.

2 comments:

  1. Great work, thank you very much for your contribution to the preservation of the arcade's heritage.

    ReplyDelete
  2. Hi. I am having problems with this motherboard. A few months ago it was working perfectly, but a few weeks ago I had "Coprocessor bad".

    Here in my twitter account I have taken the pictures: https://twitter.com/Tailsnic_Retro/status/1272218777845936128

    Whenever I turn on again the game, the error is still happening. The MCON value is always F8, and I have set the new battery and all the contacts are in good continuity.

    ReplyDelete