Valkyrie No Densetsu hack update (with a vengeance)

Not so long ago Hokuto left a comment on the Namco System 2 Keycus Hacks page regarding a problem with the hack for Valkyrie No Densetsu : the keycus protection chip was also used as a random number generator in the game, leading to strange behaviour alteration …

One of the baddies (Arijigoku aka Antlion) is supposed to throw round projectiles around him, in a random pattern, as you can see in the following Mame capture :

Correct random pattern in Mame with keycus emulation

My hack consisted in removing all keycus memory area calls and replacing them with the “no operation” instruction. It works well when the chip is just used as a protection (check Namco System 2 keycus hacks for more info), but it completely defeats its role as a random number generator. With my hack, the projectiles are thrown in straight lines, as you can see below :

Keycus protection removed without random number generation

In order to restore correct throw behaviour, I created a pseudo random number generation routine in 68000 assembly that I added to the program rom, and replaced previous keycus calls used to get the numbers by a call to this routine.

I had to tweak the code a few times to achieve a good enough result (ie fast and with no visible repeat pattern) as it’s not possible to have a real random number generator. It involved intensive testing in Mame as there’s no savestate available for this game, meaning that I had to speed run the first part of the game to get to the point where the problem appears at every code update …

As you can see below, it works quite well 🙂 (sorry for the animated gif size)

Random throw behaviour

You can grab the updated files in the Namco System 2 Keycus Hacks page.

Namco System 2 keycus hacks

Last year Guru asked me if I could alter the program code of a Final Lap 2 so it would bypass access to the protection chip which had failed. The protection chip, known as ‘keycus’, is used on various Namco arcade systems.

Final Lap 2 runs on the System 2 hardware, 68000 based. As I have some experience about 68000 programming, I gave it a go.

The keycus is accessed between address 0xd00000 and 0xd0000f, and generally returns random numbers which are expected by the system.

Keycus ID for Final Lap 2 is C318. When you try to run the board without it, you get this message on boot up :

RAM ERROR
C00400

I did search the program rom for access to the keycus area, and bypassed them. The modified program rom was then tested successfully on real hardware.

Next on line was Final Lap 3. This one uses 2 keycus chips for protection : the C318 (same as Final Lap 2) and C341. When either of the chips fails or is removed, the message


SYSTEM DOWN!

appears at boot up.

I used the same method as for Final Lap 2, and the modified version was also confirmed working on real hardware.

I ended up patching all System 2 games using a keycus for protection, for a total of 22 games (39 different sets), listed below :

  • Bubble Trouble – Golly Ghost 2
  • Burning Force
  • Cosmo Gang the Video
  • Dirt Fox
  • Dragon Saber
  • Final Lap 2
  • Final Lap 3
  • Finest Hour
  • Golly! Ghost!
  • Kyuukai Douchuuki
  • Marvel Land
  • Mirai Ninja
  • Ordyne
  • Phelios
  • Rolling Thunder 2
  • Steel Gunner 2
  • Suzuka 8 Hours 2
  • Super World Stadium
  • Super World Stadium ’92
  • Super World Stadium ’93
  • Valkyrie No Densetsu

Files are available here or in the Download section.

All the sets have been successfully tested on Mame, but only 4 of them were tested on real hardware so far. So if you are testing one of those that have not been tested yet, don’t hesitate to send a feedback, I’ll gladly add it to the list 🙂

All the hardware information used in this post was provided by Guru.