David Haywood's Homepage
MAME work and other stuff

MAME 0.170 released

January 27, 2016 Haze Categories: General News. 15 Comments on MAME 0.170 released

MAME 0.170 has been released over at mamedev.org.

The Snow Board Championship progress shown below is included in the release, although currently still relies on the decryption table (luckily it compresses down really well, to about 60meg) That’s the only really noteworthy thing I was involved in for this release, been a bit busy.

The S14001A improvements should not be overlooked, they were contributed by one of the guys who worked on making the original hardware and provide a noticeable improvement in the sound quality for Berzerk etc.

If you haven’t already checked out the ‘Wing Force’ prototype you really should do, such a shame the game never made it to market because it’s a really good take on the general ‘Raiden’ formula. Only real downside is that it’s a bit too easy, and the game hadn’t got to the stage of the dipswitches being hooked up so there’s no way to adjust the difficulty, still, it’s a good fun game, especially for the more casual players who might have found shmups to be already be getting a little difficult by the time.

One final important note, the 0.170 release could do with a good bit of testing, some core changes went in that mean some bad code that was ‘safe’ before is no longer safe, and will cause MAME to crash, there were quite a lot of drivers programmed using this bad assumption, and while Tafoid, Mooglyguy and myself have tried to eliminate all the obvious ones with some extensive regression testing the tests we’ve been able to do only cover driver startup, which means that we’re not getting 100% code coverage. If you encounter anything unusual, eg. missing sound, graphics, or just outright crashes that didn’t happen in 0.169 then please let us know, on a project this size it’s practically impossible to test every case ourselves so we are relying on end users.

To close this rather short article I’d like to make one final callout to a few people who haven’t yet got in touch with us about relicensing their code. Any code that we do not get permission to relicense will need to be dropped from the project and rewritten, something we would prefer to avoid if possible.

The most significant of these is ‘insideoutboy’ who worked on a few drivers with me back in the early 2000s, working on drivers such as ‘Popper’, ‘Car Jamboree’, ‘Flower’ ‘Super Cross II’ and ‘Marine Date’ The only contact information we had for his is an old (no longer active) hotmail account, as well as some also no longer used / active accounts on forums (the old ztnet ones etc.) It seems that nobody has really heard from him outside of the period he was active. There are users on gamefaqs with the same username, but they’ve already been contacted and deny being the same person. To the best of our knowledge he was located somewhere in Australia, so if you have friends there who contributed back in the day who might have gone by that name, please do let them know we’d like to get in touch.

Two other fairly significant ones are ‘Edgardo E. Contini Salvan’ who wrote the driver for Namco’s Toy Pop / Libble Rabble, ‘Enrique Sanchez’ who wrote the Yie Ar Kung Fu driver, and ‘Ed Mueller’ with the Birdie King driver.

There are a couple of others too, for non arcade drivers, and one or two where where we have contact details we still haven’t tried yet, but if anybody does know for sure who the above people are, and can point them back our way that would be preferable, ideally we’d like to relicense drivers as BSD-3 clause, but GPL / LGPL is also an option. Dropping drivers and rewriting them is a last resort, but if no contact is made we will have no choice but to do that.

Go to article.. »

Extreme Sensation Exploit!

January 3, 2016 Haze Categories: General News. 26 Comments on Extreme Sensation Exploit!

I was staring to think we weren’t going to get any Snow this year, only rain, lots and lots of rain….

However, even if there’s no snow outside, I can present you with some snow for MAME, in this case the news that Gaelco’s SnowBoard Championship is a step closer to being emulated.

Unlike most Gaelco games which used an evil Dallas protection device complete with suicide battery, SnowBoard Championship instead used a less complex device programmed to do some decryption tasks, and used as protection. The game was passing various things to the device, like text strings, sample numbers, and some directional direction used by the game, it expected correct data back in order for the game to run properly.

Previously in MAME the game would display corrupt text, hang during attract mode, play incorrect samples and have completely broken controls.

The operation of the device turned out to be simple, actually even less complex than I was first expecting. I’d already briefed Charles MacDonald (who purchased a PCB for running our tests) that the game writes 32-bits of data to an address, and reads 16-bits back from another address, and that it uses different pairs of addresses throughout execution, so naturally I was expecting the different addresses to use different encryption schemes, one of his first discoveries was that the address was completely irrelevant, done only to throw off anybody trying to understand it.

With this knowledge he made a few mods to the hardware and software running on the board to collect the 16-bit results for all possible 32-bit writes the game could make, resulting in an 8GB table.

I hooked this 8GB table up in MAME to verify the results and the game immediately started working.

We still need to reduce the 8GB table to actual equations, Olivier plans on looking at this, but rest assured the game is now very close to being playable in a public build of MAME. (RAR compression manages to reduce the table to a 180MB file, there are clear patterns all over the place, so I doubt even that is especially complex)

Here’s a video recorded from MAME, it’s recorded using the 2.1 parent set.



Both the 2.1 and 2.0 sets use the same encryption, so here are some screenshots from the 2.0 set for anybody not wanting to watch the video.


SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship
SnowBoard Championship SnowBoard Championship

and for those wondering, yeah, I’ve still got more to add to the 0.169 article below, just this came up today, I’ve also got to at some point turn the yearly summary article into something publishable ;-)

Go to article.. »

MAME 0.169 released – some highlights

December 30, 2015 Haze Categories: General News. 11 Comments on MAME 0.169 released – some highlights

MAME 0.169 was released over at mamedev.org earlier this morning as the final release of the year.

There have been a lot of ‘under the hood’ modernizations which will hopefully have minimal impact, although do require updated compile tools, so if you build your own make sure to update your environment.

There are no major surprises with this one, although work done on some older drivers is definitely noteworthy. Vas Crabb’s work means that the Zaccaria’s Laser Battle / Lazarian driver (which also runs Cat and Mouse) got a fair bit of attention, making MAME easily the best emulator for those games now. Previously, despite being marked as working they weren’t really properly playable.

I recorded this video of Lazarian a couple of weeks ago, although I should really re-record it as things have been tweaked and further improved since then, as you can see all waves are now playable tho.



Cat and Mouse also gained much improved colours, as well as working music / sound effects which really is the highlight of the game; it’s not surprising Zaccaria heavily promoted the audio side of this game in their flyers etc. because every level has it’s own melody, not the most common feature back in 1982. Unfortunately we’re 99.9% sure that the sprite rom on this game is underdumped, probably incorrectly marked on the PCB and therefore ended up being dumped as the wrong size (much like the last program rom – which is why set 2 doesn’t work still) Flyers for the game show graphics that simply aren’t present in the set we have. I’ve uploaded a video of the current emulation state of that too anyway, and again we’re easily the best emulator for that game now. If anybody has a PCB for Cat and Mouse we’d really like some videos, a redump of the gfx ROM as a larger chip type, and closeups of a few parts of the PCB.



You’ll notice that Run and Gun is relisted in the new working section despite being ‘working’ for a long time. The reason for this is that the game never really worked properly, we ran it in single screen mode, but even then it was confused, the default option upon starting a game was ‘play against the other screen’, and option which shouldn’t have appeared at all in single screen mode and worse still selecting it would cause the game to hang. The game now correctly runs in single screen mode, and also has some clones added with the dual screen setup (they use the same ROMs because it’s actually the same PCB with a different dipswitch setting and a video demux board added, but in MAME it’s easier to support as a clone)

A video of it running in dual screen mode can be seen below, there are still some minor video issues in this mode, but you can actually play a full 4 player versus match now.



One thing that shouldn’t be overlooked is finally getting a bios dump from the GameKing handheld. This isn’t working yet, but does boot to the internal 3-in-1 menu. The system has a resolution of only 48×32 pixels despite being released in 2003(!) I’m sure there were general household appliances with higher resolutions at that point. As I said, not yet working, but I do always enjoy seeing progress on these obscure handhelds, and dumping the bios / roms when they’re not in standard packages (they’re inside small epoxy blobs) is always a challenge, one that in this case is now out of the way.


GameKing GameKing GameKing

GameKing GameKing GameKing

The new ‘Knock Out’ set is quite interesting too, it had been sitting there overlooked and not added for many years because it had simply been described as ‘copyright string removed’ and ‘no other changes’ Turns out this isn’t actually true. Below is how the existing Knockout set in MAME looked (and the original Triple Punch game on which it’s based)


Knock Out Knock Out Knock Out

Now.. the new set looks like this


Knock Out Knock Out Knock Out Knock Out

The copyright is indeed gone, and the set has definitely been hacked a bit for the Italian market (all the life dipswitch settings give you 2 less lives than mentioned in test mode) however there’s also this extra ‘Treasure’ listed on the title screen, and a bonus round to go with it. Also the ‘bean’ type character is black, making it more stealthy, although I’m not 100% sure if this is intentional or if this set should use different colour proms, the character colour in the bonus round is a bit ugly too. Either way, a surprising discovery.

… more to come

Go to article.. »

No longer utter Pollux

December 14, 2015 Haze Categories: General News. 9 Comments on No longer utter Pollux

The Dooyong developed shooters are some of the more original Korean efforts of the 1990s, while other companies were simply bootlegging hardware ideas and code and hacking them into new looking games, Dooyong actually created their own games and used their own hardware designs.

The quality in general was fairly average, but they’re not terrible to play.

The emulation of them still had some bugs too, each game uses a slightly different mapping (same basic ideas, but all the ports moved around, slight changes etc.) which means sometimes bad assumptions get made, or things get missed. One game in the driver that had always had issues was Pollux with visible problems even on the title screen, and a number of MameTesters bugs relating to it.

We knew from earlier work on Flying Tiger that the hardware had some palette banking, it just hadn’t been hooked up on Pollux.

I spent a bit of time hooking it up, but was initially a little confused, we knew that Pollux was missing a palette cycle effect on the title, but none of the colours in any of the palette banks were cycling. That actually turned out to be a simple case of a missing vblank flag. The 2nd palette bank uploaded by the game is for the most part a darker copy of the first, although it was quickly obvious that the title screen was meant to be using that darker copy and not the one that it was using before, the darker copy is where the palette colours were cycling, and also where the correct colours were for several other title screen elements rather than entirely just darker versions like the rest of the time the game is running.

Now, when the palette ‘banking’ was hooked up to Flying Tiger we didn’t actually treat it as banking, we treated it as some ‘ram write protecetion’ meaning the bank bit was being used more like a RAM write protect flag than actual palette banking. This struck me as wrong, and a little more studying of a reference video for Pollux gave further weight to my theory that the hardware really did want to do real palette banking instead.

What I’d noticed is that in Pollux, when a bomb was released, the screen was meant to show periodic brighter pulses for the duration of the bomb. What I found out is that we’d actually been rendering the whole of Pollux with the wrong palette, the brighter version, since it was first emulated. That brighter palette was actually only meant to be used when you used a bomb, that was the entire point in there being two palette banks, a simple and quick way to turn the whole screen brighter / darker without having to write a new palette during gameplay. This simple bankswitch on the palette actually fits well with Dooyong’s general design of this hardware – leaving the CPU as free as possible to just run the game logic, not be updating palette data and tilemap data)

I implemented this, it turned out the selected palette bank for writing is also always the visible one. As a result the game looks much darker now, which greatly improves the contrast between backgrounds and sprites.

There was a MameTesters bug concerning the character portraits in the ending, after fixing the above issues I checked and that was fixed too, not too surprising.


Title screen – Left = Bad palettes, Right = Good palettes
Pollux - Bad Pollux - Good

Here’s a video from MAME with the fixes, it’s got cheats enabled, but allows you to see all scenes in the game for reference.



The Flying Tiger code was also updated with this new knowledge, although I don’t know if anything has changed in it as a result. It’s possible some of the other games in the driver should have this hooked up too, I plan on checking that soon.

Go to article.. »

The Value of Videos

December 13, 2015 Haze Categories: General News. 6 Comments on The Value of Videos

One of the most important things we can do as a society is make videos of things, take photos of things, and share them for the world to see, you never quite know when what you’ve done might come in handy, or prove to be the only remaining reference that something once existed, it continues to amaze me how even things that were at one point popular are now difficult to find any visible trace of now.

This is true of arcade games as much as anything else, and I Know when looking at the fruit machine and other non-video games the situation is even worse, sometimes not a single photo of a machine anywhere.

While looking at Mega System 1 it was noted in the source that the game P47 sets some other bits during the Jaleco logo, effect unknown. Luckily, in this instance there was a video on YouTube of P47 booting up. It’s a terrible quality video, but it still gave us an idea of what was missing.



some kind of trail effect…

I poked around with the code a bit, and have attempted to implement this in MAME.



I don’t know if this is actually correct, at the point where they want the trails to vanish they adjust a parameter, the original video isn’t really clear enough to show how the trails are removed, so I’ve had to guess. If anybody has a P47 PCB and can record a better quality video it would be appreciated, the one on YouTube was more useful than the original poster probably ever thought it would be, but not really good enough to say my emulation is correct :-)

Go to article.. »

Mirror Mirror

December 12, 2015 Haze Categories: General News. 4 Comments on Mirror Mirror

Another long-standing problem with the Mega System 1 driver is the lack of character movement in the attract modes of 64th Street and Chimera Beast. A similar problem was fixed in Cybattler a long time ago by handling a mirror address for main RAM, easily noticed due to unmapped reads/writes, but the other two games weren’t making any unmapped reads or writes.

Today I decided to try a little experiment. I knew from the ‘nmk16.cpp’ hardware that sometimes the 68k is hooked up to RAM in a way that means the byte write behavior is a little unusual. The standard way of handling byte writes is to make sure only the byte of the word that is being written to changes, leaving the other half of the word alone. Due to the way the 68k works it’s also possible for that hookup to be slightly different, so that a byte write alters the content of both bytes in the destination word, mirroring the written byte in the other half.

Most games break if you implement things the latter way, they assume they can write bytes without them corrupting the adjacent byte. I quickly changed Megasystem 1 to use that method to see what happened, the result, a working attract mode. I do wonder if this is part of a bigger picture, NMK and Jaleco often worked together, there are Jaleco games in ‘nmk16.cpp’ and NMK developed several of the titles for Jaleco’s Megasystem hardware too, it’s possible some hardware ideas / designs were also being shared.

While only Chimera Beast and 64th Street show obvious improvements from this, and both of those are ‘Megasystem 1 Type C’ hardware, I’ve hooked it up to all hardware types (except D, but that’s very different and did cause the game to crash) I’ve not noticed any real differences this way, most games don’t make many byte writes, some avoid them entirely. St. Dragon makes an unusually high number so it might be worth checking / verifying that nothing has broken there with these changes, it is afterall possible that only one of the board types has this design.

Here are some revised attract mode videos from the games. The 64th Street one also shows the environment damage that was previously missing (Kale fixed it last week) and the Chimera Beast one, to my surprise, shows the Mosaic effect, it’s used ingame when you get grow.





Go to article.. »