The day MAME saved a project…

Fun & Games
The day MAME saved a project…

Pt 10654

Cool story about MAME being used to reclaim assets for a publisher….

The publisher insisted that the map be a perfect replica of the original, with all the right tiles in all the right places. Given enough time I could have reversed engineered the ROM and reconstructed it that way, but with only a day or two left I had to come up with something fast. The idea I came up with was so utterly absurd that even I was surprised it worked so well. The first thing I did was write an application that searched for the MAME window and then sat in the background taking a constant stream of screenshots which it saved to disk. I then had the best game player in the office play SpyHunter for about 10 minutes, using MAME’s built-in cheats so that he never died. A second utility then post-processed these files and stitched them together using a simple pixel-match algorithm to create a continuous image. A third utility then scanned over this image and again applied a simple pixel-match against the tiles in the sprite page that we had exported eariler. What I was left with was a partially reconstructed version of the original SpyHunter map array. I say partially because many of the tiles were missing: if a car or explosion effect etc was present on screen then the pixel-match algorithm would fail and the tiles in that part of the map would be left blank. Most of the action happened on the road where it was easy to fill in missing tiles, for the rest I had our guy play the MAME version a few more times, merging the data sets for each pass. When all was said and done there were only about 20 or so tiles missing from the entire game, at which point it was trivial to go through and add them manually using the MAME screen-shots as reference. The end-result was a 18×1538 array of tile indices representing a perfect reconstruction of the original map data.

Img413 482

More:

Discuss this article with the rest of the community on our Discord server!
Tagged

current: @adafruit - previous: MAKE, popular science, hackaday, engadget, fallon, braincraft ... howtoons, 2600...

View more articles by Phillip Torrone

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK