David Haywood's Homepage
MAME work and other stuff

Slapping a Tiger would be a poor life choice

October 12, 2018 Haze Categories: General News. 11 Comments on Slapping a Tiger would be a poor life choice

I’ve been doing a bit of work on the XaviX emulation in MAME (technology used by a number of Plug and Play TV Games) and in that time I’ve made some decent progress with the emulation. While still far from perfect (some graphical problems, no sound, poor performance) I feel there has been enough progress to show some of it here. Some of the most noteworthy things using the hardware are the Taito / Namco Nostalgia collections which were released in Japan in 2006.

Taito Nostalgia 1 contains “Slap Fight” and “KiKi KaiKai” and remixed versions of them.
Below is the remix version of Slap Fight which mixes Slap Fight with another classic, Tiger Heli, giving you the Tiger Heli ship instead of the regular Slap Fight one. Due to the compressed screen size this version of the game is very difficult. The KiKi KaiKai allows you to play as the main character from Bonze Adventure instead.


Taito Nostalgia 2 Taito Nostalgia 2
Slap Fight Tiger Slap Fight Tiger
Slap Fight Tiger Slap Fight Tiger
Slap Fight Tiger Slap Fight Tiger

Namco Nostalgia 2 contains “Gaplus” and “Dragon Buster” again with remixed versions.
Below you can see the Gaplus remix “Gaplus Phalanx” where instead of shooting things you must capture the grey enemies while avoiding capturing the red ones (and not hitting anything in the process)

Namco Nostalgia 2 Namco Nostalgia 2
Gaplus Phalanx Gaplus Phalanx
Gaplus Phalanx Gaplus Phalanx
Gaplus Phalanx Gaplus Phalanx

Taito Nostalgia 1 contains “Legend of Kage” and “Gladiator” plus the usual remixes of them. Below is Amazones, the remix of Gladiator. Note, with current emulation missing the EEPROM support the key assignments are invalid by default and get lost every time you exit the game, but they can be assigned each time.

Taito Nostalgia 1 Taito Nostalgia 1
Amazones Amazones
Amazones Amazones
Amazones Amazones

Namco Nostalgia 1 still doesn’t run properly, so no shots from that one at the moment.

Outside of Japan the XaviX technology was used mostly by games with novelty controllers. Progress has been made on the emulation of some of those too.

Graphics were much improved in Radica’s Play TV Boxing, menus now look solid, priorities are correct, sprites fill the screen properly etc.


Radica Boxing Radica Boxing
Radica Boxing Radica Boxing

Radica’s Bass Fishing game no longer crashes when you enter gameplay, and no longer has corrupt text in the menus. Inputs aren’t fully mapped yet tho.


Radica Bass Fishing Radica Bass Fishing
Radica Bass Fishing Radica Bass Fishing

Radica’s Card Night no longer crashes upon reaching the main menu, and has more correct graphics. The glitch where it rendered a corrupt menu over the startup screens is gone too.


Radica Card Night Radica Card Night
Radica Card Night Radica Card Night

The Radica Madden & Football games now show their startup screens (EA license screen on Madden, Farsight developer screen on Football) and also prompt the player to throw the ball (not emulated) to start, rather than crashing at that point.


Radica Madden Radica Madden
Radica Football Radica Football

The e-kara things now have a scrolling screen and colours that aren’t garbage (although no inputs exist to get past this screen) and the Fisher Price ‘Rescue Heroes’ shows a startup screen now before crashing. Excite Fishing DX moans about the EEPROM.


e-kara Rescue Heroes
Excite Fishing DX

Wild Adventure Mini Golf shows some startup screens before getting to an animated display asking you to swing the club to start (not hooked up)


Wild Adventure Mini Golf Wild Adventure Mini Golf

Radica’s Baseball 2 shows it’s secret test menu, and also a startup screen, but crashes after showing the Radica Logo


Radica Baseball 2 Radica Baseball 2

Radica’s Ping Pong now boots, although you can’t serve.


Radica Ping Pong Radica Ping Pong
Radica Ping Pong

Radica’s Monster Truck has improved priorities (although controls still aren’t hooked up)


Radica Monster Truck Radica Monster Truck
Radica Monster Truck Radica Monster Truck

Snowboard has some minor improvements but still needs the raster interrupt hooking up for the ground


Radica Snowboarder Radica Snowboarder

While many of these still aren’t playable the progress over the last few days has taken most of them from doing almost nothing to looking much more like what they’re meant to be, and a much better picture of the overall hardware.

None of this would have been possible without Sean Riddle dumping the majority of these titles and Peter Wilhelmsen purchasing many of them for that purpose.

Go to article.. »

Little Changes (part 2)

October 2, 2018 Haze Categories: General News. 19 Comments on Little Changes (part 2)

The Steel Force changes mentioned in the previous update didn’t make 0.202, but should be in for 0.203, but I wanted to take this opporunitiy to highlight some more small changes that will be also be in 0.203.

I said before it’s not always ‘low profile’ titles that get fixes, and the last week or two has seen some bug fixes to better known titles that are just as important.

First I’ll start with CPS3, and a long-standing bug with the combo meters in JoJo’s Venture / JoJo’s Bizarre Adventure. This is one that back in the day I didn’t really put any research into due to unwanted attention and misuse of MAME for commercial bootlegs, but given that its been 10 years, the hype has died down and people still wanted to see it fixed, I decided to give it a look.

Actually a fairly simple problem. The game is only capable of displaying one Combo counter at a time, draws them off screen and uses ‘rowscroll’ to ‘bounce’ them into the display, so not only was the 2nd combo meter missing (because it never got scrolled on) but the ‘bounce’ on the Player 1 side was missing too, which was a dead giveaway for what the problem was. I was actually looking at CPS3 already with a view to fixing some of the palette manipulation effects in the later (P2 side) stages of Red Earth so fixing this was just sidetracking a bit. I might do an update about the palette stuff in Red Earth if I figure that out too.


JoJo's Venture
JoJo's Venture JoJo's Venture
JoJo's Bizarre Adventure
JoJo's Bizarre Adventure JoJo's Venture

The next piece of work isn’t mine, but that of Mooglyguy (Ryan Holtz) and happppp. This concerns the ‘Mirror Mode’ in Rave Racer (as well as the rear view mirror and a number of elements in other System 22 games)

To active mirror mode you should enter a code during the 3-2-1 countdown at the start of a race. Once this countdown appears, quickly turn the steering wheel RIGHT then RIGHT again, then press the BRAKE and GAS pedals together. If done correctly the display will instantly flip. To do it in MAME without analog controls you’ll want to set the digial speeds, sensitivity and auto-center speed on all the controls up high (100 did the trick for me)

Previously the mirror view did not properly flip the screen, but instead acted like the screen was flipped without showing the effect, meaning it basically just played with reversed controls and the speedometer needle in the incorrect position. Mooglyguy researched the issue, and happppp worked out how to implement it in the driver. Some optimizations were made at the same time meaning the driver also performs a bit better than it did before.


Rave Racer
Rave Racer Rave Racer
Rave Racer Rave Racer

So there you go, two fixes to the emulation of some better known platforms that will be in MAME 0.203 and higher.

Not covered here in pictures, but equally important are some changes smf has made to the Playstation GPU emulation, fixing bugs in Silent Hill (non-arcade) as well as Psyvariar, the latter which was rendering the game near unplayable on later levels due to intense flickering of the background graphics (that fix is in 0.202) Again this is a ‘higher profile’ change due to the popularity of the home system and because many popular arcade titles made use of Playstation based hardware. The Psyvariar fix is timely too because of the massive improvements in the sound emulation the driver received recently (far surpass anything that could be classed as ‘Little Changes’)

Go to article.. »

Little Changes

September 10, 2018 Haze Categories: General News. 22 Comments on Little Changes

It always annoys me when I read people making claims that there are only a ‘handful’ of fixes in the newer MAME versions compared to those that people are running on awfully underpowered devices like the Raspberry Pi; versions so old you’ll be stretched to find any active developer who even considers them to be the same project as MAME anymore.

Most of those versions are based on versions somewhere between 15 and 20 years old, and it would be more accurate to say there have been a handful of fixes every single week since then, many graphical, many directly affecting how the games play. The recent work done on the emulation of various protection chips is a good example of where the older versions are going to have fundamental gameplay flaws, with Operation Wolf in 0.201 being the latest in a long line of example.

The Super Shanghai Dragons Eye fixes mentioned in a previous post are also an example of an improvement that might otherwise slipped under the radar, and the post before that about Chrono Soldier shows how documentation of what’s what in those older versions is wrong too, with them presenting what turned out to be a prototype as the final game.

It doesn’t stop there tho, Steel Force is a game I emulated for MAME 0.58, which was released on 05 Feb 2002. I was watching one of LordBBH’s MAME Roulette streams where he ended up playing the game and noticed that on one of the levels there was a priority bug. I hadn’t noticed this issue before, so I’d never considered fixing it. Having noticed it, I decided to take a look at making a few improvement to the driver, and ended up fixing the priority bug while also improving some scene transitions I noticed were faulty too.

It’s subtle, and a lot more obvious when in motion because they move at a different speed, but the screenshot on the left has some ugly ‘oil’ bubbles over the ground, which should be part of the background and hidden under the ground layer.


Steel Force Steel Force

There are still potentially some alignment issues with the game, as a few scenes do still look a little rough at the edges of the screen, but such bugs are commonly found in games due to safe areas, overscan and the like. The ending text for example doesn’t quite fit with the current visible area / alignment. This may, or may not be a bug in the original game, it doesn’t look like a great deal of effort was put into this screen, the developers even managed to misspell the title of the game as ‘STEELF FORCE’ The problem is there are very few high quality original resources for these games to use as reference.

Steel Force

So, anyway should you want to experience this game without ugly scene transitions and without the priority bugs, 0.202 or higher is going to be required.

Other little changes have been made over the last week or so too. I emulated a game called Pitapat Puzzle (which I need to write about at some point) and that allowed me to fix some video banking issues in later levels of the ‘Die Break’ game in ‘Bestri’ which is actually one of the most genuinely enjoyable Korean breakout clones. The bonus stages take the form of a Space Invaders style round, and if the ‘Girls’ dipswitch is enabled, are meant to show some non-erotic artwork rather than the usual grassy fields etc. Not only was the banking incorrect, but the later graphic ROMs weren’t even being loaded correctly. This one has been incorrect since MAME 0.113u3 (22 March 2007) which is when it was first added, and I had no solution to the tile banking at the time.

Left is MAME 0.201 and below, right is what will be in MAME 0.202 and higher.


Die Break (Bestri)
Die Break (Bestri) Die Break (Bestri)
Die Break (Bestri) Die Break (Bestri)

Anyway, there’s a common theme with these things. On the surface the games appeared to be just fine, you could fire them up, and play them, with no obvious issues in the first 10 minutes of play, but once you started to get a bit further into the games you’d encounter an increasing number of problems.

For Super Shanghai you’d have to complete a handful of stages to get to the glitched cutscenes and priorities, for Steel Force you’d have to complete a bunch of levels to get to the broken priorities, for Die Break (Bestri) you’d have to complete 9 stages to see the issue. For Chrono Soldier you’d have to know about the game, and complete at least 3 stages for it to become apparent that the old version is massively incomplete. For Operation Wolf you’d have to play the game, possibly even reach right before the final boss to see it glitch out (although if you were using anything more than a year old the problems were significantly worse)

These are all little changes from an end user point of view, but when you consider that (aside from Operation Wolf) they’re things that a single developer has fixed in the space of roughly a week then multiple that by the number of developers, then further multiple by the number of weeks old each MAME version is and you can see how quickly the number of bug fixes adds up, and how it’s far more than a just a handful. The older versions aren’t “good enough” they’re downright awful for any serious use.

I get the novelty value of running the ancient versions on old devices, I get that it’s ‘cheaper’ etc. (although I find that debatable, as a Pi3 is 6 times slower in benchmarks than a throwaway 9 year old 3Ghz Core 2 Duo) but I still find it frustrating that people are recommending such versions and hardware for serious MAME builds. Once anybody starts playing on one, even running just the classics, you start to hit a mountain of bugs even if on the surface they look ‘good enough’

Sure there are regressions in new versions too, and some of those do frustrate me, but the overall trend is towards many more things working better, and regressions do get fixed.

A lot of the progress in MAME doesn’t get detailed writeups (because really, we’d rather be fixing things and improving the emulator) but it’s still there, happening all the time, just like the stuff I have covered here.

Go to article.. »

A Pile of Tiles, Correctly Ordered

September 5, 2018 Haze Categories: General News. 6 Comments on A Pile of Tiles, Correctly Ordered

Around 5 years ago MAME 0.150 was released (17 September 2013) and in this release was a rewrite of the Data East protection chip handling, which allowed many previously problematic games that ran on Data East hardware to run without hitting protection related issues. To me it was one of the biggest advances in emulation at the time because quite a number of games made very devious use of the protection.

At that time there were two sets of Super Shanghai Dragon’s Eye dumped. The first was an English language bootleg that partially worked, but appeared to have buggy code where the bootleggers had missed protection checks and not reworked certain elements for the bootleg hardware properly. The emulation was imperfect, and trying to figure it out wasn’t helped by being unsure which bugs were emulation bugs and which were errors that would happen in the actual bootleg.

The second set was a Japanese set of the original game, which prior to the Data East protection work previously mentioned, had not worked properly either as various protection checks were failing.

Once the new protection code was in the Japanese set became playable, but had a number of graphical problems, and it wasn’t 100% clear how things hooked up because the existing hookups in the driver were based around the bootleg, which wasn’t quite the same as the original hardware, and some bad assumptions had been made.

While the game worked well enough to be marked as ‘Working’ in MAME the palette and priority issues were annoying, however, due to interests wavering, the driver got put on the back-burner and remained there ever since.

A recent dump of the original, non-bootleg English language set however prompted me to go back and look at the driver, and looking at it with fresh eyes I was able to spot some really quite obvious errors and reimplement the priority and mixing in a way that actually works for all situations.


Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye

Left old emulation, Right new emulation

MAME 0.201 and below MAME 0.202 and above
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye
Super Shanghai Dragon's Eye Super Shanghai Dragon's Eye

The emulation of the bootleg was also improved, and benefits from the priority fixes, however there are still a number of other glitches, such as it not clearing the text in certain situations, and hanging at the end of the intro text until you press a button in quest mode. These appear to be cares where the bootleggers failed to deal with the protection properly as previously mentioned, so very likely happen on the bootleg hardware too.

Interesting note unrelated to the emulation: using the infinite ‘helper’ cheat isn’t actually very useful as the game always ends up recommending the first pair it finds, not the best, which inevitably leads to you failing levels.

and yeah, I know it’s a Shanghai tile matching game, and everybody seems to hate those these days, but all drivers need attention :-)

Go to article.. »

20 Years a Prototype

September 5, 2018 Haze Categories: General News. 2 Comments on 20 Years a Prototype

“Toki no Senshi – Chrono Soldier” has been supported in MAME for the longest time. It’s a Sega System 2 game, and records would indicate that it was added in MAME 0.34b3 which was released on September 17, 1998, so give or take a couple of weeks, 20 years ago.

What nobody seemed to have noticed in those 20 years is that the dumped version of the game was actually a prototype, and that the original hadn’t actually been dumped. There was a note in the source added more recently saying that the existing set was possibly a bootleg, because an original board had been observed with an encrypted 317-0040 module and the code we had was decrypted, but nobody had noticed that the build we had was a very different version of the game.

The PCB with the encrypted CPU module was dumped recently, so I bruteforced the key (thanks to Sega’s weak random number generation algorithms that were used to generate the keys) and got the new set running in MAME.

There were already a couple of unexpected difference with the new dump; firstly not only did the CPU code ROMs differ, but the tile ROMs were also different, as was one of the sprite ROMs and the colour PROM. This is highly unusual.

Comparing the initial gameplay demo there were clearly some visual differences, so I decided to delve a bit deeper into it.

The more I looked, the more I started to become sure that the old build wasn’t a hack or a bootleg, but actually a prototype, with the new build being much more complete. First of all, let’s look at the level layouts in the old build that’s been supported for 20 years.

Older / Prototype build, Levels 1,4,5,8

I’ve grouped these levels out of order to make it clear that after level 3 the prototype starts recycling levels, in fact the first level gets used 4 times with different themeing and by the time you get to level 8 the theme / tileset doesn’t seem to be complete either.

Proto lv1 Proto lv4 Proto lv5 Proto lv8
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)


Prototype build, Levels 2,3,6,7

As mentioned, the prototype starts recycling at stage 4, so there are 2 more unique stages, stage 2, which gets recycled at stage 6, and stage 3 which gets recycled at stage 7. Again the themes change each time to make the levels still look fresh even when they’re not. Note also the complete lack of background details here, it’s just a single tile repeated meaning that really only a single stage was 100% complete at this point in time.

Proto lv2 Proto lv6 Proto lv3 Proto lv7
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)
Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?) Toki no Senshi - Chrono Soldier (prototype?)

So we can conclude that in the earlier build which I’m dubbing a prototype, there is very little variety in the levels (3 complete foreground / object placement layouts, 1 complete background layout) and the final theme doesn’t even seem to be complete.

Final build Levels 1,2,3,4

Now if we look at the new dump “Toki no Senshi – Chrono Soldier (MC-8123, 317-0040)” the new set, which came from a board with proper Sega EPR numbers and an encrypted 317-0040 module you can see that the level design has evolved quite a bit. I’ve kept the levels in order this time because no level layouts are recycled (so I don’t have to group to make the point). As you can see, Levels 1,2 and 3 are basically the ones from the prototype but with improved background details etc. It was after that point the prototype started recycling levels, however, level 4 here is a brand new layout, not present in the prototype at all.

Final lv1 Final lv2 Final lv3 Final lv4
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)

Final build Levels 5,6,7,8

Again, we have completely new level layouts here, the bosses do still cycle, just like in the older build, which is slightly disappointing, but the level designs for these later stages are significantly more challenging (or frustrating depending on your point of view) There is reuse of one of the visual themes (stage 5 and 7) but overall you can see that there’s a lot more content here than in the prototype build. The final 2 levels are still a little lazy, with level 7 having a background with no detail and the level 8 theme being a palette swap, but it’s likely there was no time left to develop them further and the actual level designs being unique was probably considered ‘good enough’

Final lv5 Final lv6 Final lv7 Final lv8
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)
Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set) Toki no Senshi - Chrono Soldier (newer, encrypted set)

There are other differences too, the new set actually has a staff screen when you complete it, and the high score table correctly shows that you reached round 08, not round 01 in that case too.


Toki no Senshi - Chrono Soldier Toki no Senshi - Chrono Soldier

compare that to the old set, no ending, incorrect level shown.


Toki no Senshi - Chrono Soldier (prototype)

The new set also has a test mode, while the old one will just give you a black screen if the test dipswitch is set. note, the video ram check fails tho, this appears to be a bug in the game code that was probably introduced at the last minute and not fixed before release.


Toki no Senshi - Chrono Soldier Toki no Senshi - Chrono Soldier Toki no Senshi - Chrono Soldier Toki no Senshi - Chrono Soldier

Title screen is recoloured slightly (like most things between the sets) but mostly the same, left is final, right is prototype.


Toki no Senshi - Chrono Soldier Toki no Senshi - Chrono Soldier (prototype)

Overall you can see there are a lot of differences between these sets. I think 20 years must be a record for having something supported in MAME without realising it was a prototype and the final version was still missing.

Thanks to ShouTime for dumping this piece of history, it’s been interesting to look at and might have gone unnoticed for even longer without his efforts to get this stuff preserved. Prototypes are fascinating, but knowing the final versions of games have been documented and preserved is vital when looking back at our history.

btw I’m happy for The Cutting Room Floor to use any of this research / resources contained in the write up as they see fit.

Go to article.. »

Robin Banks gets you nowhere

August 6, 2018 Haze Categories: General News. 7 Comments on Robin Banks gets you nowhere

If you’ve ever tried running the Sega ST-V game ‘Decathlete’ in MAME, you’ll have probably noticed it doesn’t look pretty.


Decathlete (0.200)

Infact, aside from a few advertising banners in the 400 Meter race every single graphical element appears to be corrupt, meaning you can only really make out the shapes of the models and nothing more. Performance, you may have noticed is also really bad, significantly worse than almost all the other Sega ST-V titles, and surprising considering it’s “only” Saturn based hardware.

Decathlete (0.200) Decathlete (0.200)

So why does Decathlete look so bad compared to all the other ST-V titles in every single MAME version up to and including 0.200? Simple, it had additional protection of a type that had not yet been figured out.

The ST-V cartridge for Decathlete contains a chip marked 315-5838, this chip provides encryption and compression related functions for the game, and figuring it out has been on my ToDo list for a long time, but the lack of decompressed and unencrypted data to study was a problem. To compound the problem the game data did not fully align with that found in the home port to the Sega Saturn either, so that wasn’t especially helpful as a source of unencrypted data to study.


Decathlete Cartridge, protection chip highlighted

Since Peter Wilhelmsen and Morten Shearman Kirkegaard have been working with me and producing hardware solutions to get data out of systems this seemed like a decent target for them to help with as a solution to easily transfer the decompressed and decrypted data from the game to a PC would provide significantly more data to study. I helped by providing information about the way the device works in terms of the SH2 program using it, where the encrypted data was, and my own observations on the tables uploaded (one of them clearly being a dictionary etc.) while Peter and Morten went to work producing a piece of hardware that slots in where the main program ROM would go on an ST-V cartridge, allowing us to sniff bus accesses to the ROM space as a way of transferring any data the SH2s can see back to the PC; the same technique that was used to transfer data back from the PGM2 unit and one we hope to use with some other systems like Casio Loopy in the future. This is much easier and more efficient than trying to display the data onscreen or anything like that.

Attack Hardware

With these tools and a list of source data provided they were able to extract all the decrypted and decompressed data from the game. I verified the extracted data by hacking up the protection device emulation to allowing MAME to read data directly from the files provided by Peter and Morten, and could confirm that for the files I hooked up the graphics appeared correctly in the game.

This was not the end of things however as supporting the data in decrypted form would not be true emulation, the real algorithm was needed and because this chip provided compression functions as well as the encryption there was an extra hurdle in the way (pun intended)

Anyway, Morten actually ended up making quite short work of this, using the tables uploaded by the game at runtime to figure out the nature of the compression, and writing a program that could recompress the extracted (fully decompressed / decrypted) data giving compressed (but not encrypted) blocks of data that were the same size as the compressed (but encrypted) blocks of data in the original game rom.

Since we now had the compressed, but unencrypted form of the compressed, encrypted data found in the ROM the encryption scheme could be studied too. We were hoping that it would be a simple 16-bit XOR that changed per-game, but instead, while still operating on 16-bits, it turned out to be more complex. Morten & Peter did figure out something that worked, and could correctly decrypt the data, but it wasn’t the cleanest of algorithms. Samuel Neves stepped in at this point and helped try to simplify the algorithm as much as possible, but even after that it was still a lot more complex than a simple XOR. This is actually quite frustrating, because while none are as high-profile as Decathlete there are a number of other games using the same chip that clearly have different encryption keys and we’ll likely need study those too rather than being able to work it out from the data.

Anyway, I was provided with sample code by Peter and Morten which worked outside of MAME, and so I took on the task of adapting said code for use in MAME, ensuring it worked in a ‘stream in, stream out’ ‘bytes on request’ mode as required for it to work in the way the SH2s talking to it expect it to work. By hooking it up in MAME the graphics are now correctly decrypted when running the game.


Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)
Decathlete (preview 0.201) Decathlete (preview 0.201)

As you can see the emulation isn’t perfect yet, but none of those problems are protection related anymore, merely video emulation glitches. A lot of things are transparent that shouldn’t be transparent, and for reasons not investigated performance of this is actually worse than some of the Naomi titles, despite being on Saturn hardware, it runs at about 30% ingame without frameskip. It’s probably a worst-case scenario for a fair bit of the MAME Saturn emulation code, which will need revisiting at some point. Due to these issues I’ve actually left it as ‘NOT WORKING’ for now, despite being playable, but I don’t want people to get a bad first impression of the improvements. This might change if other people feel it should be marked as working.

I mentioned other games using the chip, and those are

Name Club v1 and v2 (chip has a 317-0229 sticker):
These use it for compressing and encrypting the higher resolution image data that gets sent to the printer (so you can’t actually see any onscreen problems as a result of the missing emulation, but if we were to hook up printer emulation it would print out garbage)

Print Club Winnie The Pooh Vol 2 / 3 (chip has a 317-0230 sticker):
Uses it to decrypt a block of startup code, so the machine doesn’t boot right now. Use beyond that unconfirmed, might just be that one block of data.

Print Club Love Love Vol 1 / 2 (chip has a 317-0231 sticker):
Same use as other PC Winnie The Pooh

Dead or Alive (on Model 2A)
Game uses it to decrypt a single string, which it then does a byte-for-byte comparison against the expected result. This has been hacked around for long before people even knew it had this complex decryption / compression chip, an absolute waste of silicon.

The other cases are potentially going to be annoying as they’ll require work to give us enough data to figure out the encryption part. Dead of Alive for example, we have the exact output string, and the compressed / encrypted data, and can even recompress the string, but there’s not enough data there to actually draw any conclusions about the encryption part.

Could there be more, maybe, there are a lot of random redemption games and a ton of undiscovered Print Club cartridges still out there.

Here’s a video of Decathlete running, note this was recorded with -aviwrite, so appears to be full speed even when the emulation was running much slower.


Content not available.
Please allow cookies by clicking Accept on the banner

Other slightly interesting notes about Decathlete, depending on the BIOS region it uses different compressed data for some elements. The US region is obvious, the Winners Don’t Use Drugs logo isn’t needed for other regions, so doesn’t get decompressed. What is less obvious is why it uses slightly different font data, I haven’t studied it much, but the difference in size isn’t enough to cover Japanese characters or the like. This actually confused me at first because Peter and Morten were working with an STV unit that had a European bios, and all my notes were based off running it in Japanese.

Go to article.. »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close