Kool Stuff [2]: Bad Science - Hacking Mortal Kombat for Sega Genesis
This post is part of Kool Stuff, a companion book to Long Live Mortal Kombat: Round 1 (now on Kickstarter!) that contains interviews I was unable to do before hitting Long Live MK’s deadline. Subscribe to Episodic Content to keep up with news on Long Live MK, and to follow along with Kool Stuff as new chapters are published.
Growing up, I was happily entrenched in the Nintendo camp during the 16-bit console war between Sega and Nintendo. The NES was my first console, so when the Super NES came around, I stuck with Mario as he went head-to-head with Sonic.
The influence on first-party titles on console sales back then (and still today) is well known. What you don't hear about as much are the third-party games that turned the tide in one company's favor. Street Fighter II: The World Warriors hit arcades in 1991 and came to Super NES one year later. Landing the exclusive home port of the world's most popular arcade game was a big deal for Nintendo. The Super NES was barely a year old, and sales skyrocketed.
Then Sega and Acclaim fired back with Mortal Kombat. If you're reading this, you likely already know the story of Mortal Monday: On September 13, 1993, MK1 came to Super NES, Sega Genesis, Game Boy, and Game Gear. I wrote about the development of those ports in Arcade Perfect, a book published in 2019, but the key takeaway is that although the Genesis hardware was deficient in some ways compared to Nintendo's 16-bit platform, Sega's version of Mortal Kombat outsold Nintendo's five to one. The reason, of course, was the blood code.
The Super Nintendo port had unresponsive controls, but the larger problem was Nintendo's censorship: sweat replaced blood, and neutered fatalities replaced tearing out hearts and knocking off heads. The Genesis port had watered-down fatalities, too, but who remembers them? Nobody. Why? Because if you played on Sega, you used the blood code.
Paul Carruthers was the sole programmer tapped to convert Mortal Kombat to the Mega Drive, aka Genesis. Blood dealt a heavy blow to Nintendo and sent sales of Sega consoles roaring back. However, Carruthers rarely receives credit for his port's tight controls. The game was tight and responsive, just as responsive as the coin-op version's; that's because Carruthers did a one-to-one code conversion. He did a great job, but he had little time and fewer resources to work with. As a result, the Genesis port had muddy graphics, dull and muted sound effects, and loads of missing animation frames, sound samples like character names, and fighting stances.
Carruthers is not to blame for those shortcomings. Read Arcade Perfect and you'll find that ports, even potentially lucrative ones like Mortal Kombat, were rarely given the time, attention, and resources they deserved. Ferreira saw room for improvement. So did many others; so did Carruthers himself. Paulo H. G. Ferreira was the one to do something about it.
Ferreira is known around the ROM hacking community as Master Linkuei. He's the lead hacker behind Mortal Kombat Arcade Edition, an effort to patch up Carruthers' 16-bit port and make it arcade perfect, or as close to it as possible. Many ROM hacks are one-person efforts, but Master Linkuei enlisted the help of a few others: Bill "BillyTime!Games" Wicker, Chev Chelios, and Danilo Dias. I talked to all four developers to learn how the project started, what their contributions entailed, what tools they used, and what gave them the most trouble along the way.
Craddock: What's your earliest memory of seeing a Mortal Kombat game?
Paulo H. G. Ferreira: When I was four or five years old. I went to my uncle's house. He was playing Mortal Kombat II for the SNES. I was really amazed by the "realistic" graphics and sound effects. Later that week, I rented Mortal Kombat II for my Master System, an 8-bit console that was still popular in Brazil.
Danilo Dias: I played Mortal Kombat for the first time in an arcade-bar in my hometown. I saw the machine and I was amazed: It looked like a movie to me.
Chev Chelios: My younger brother has always been a fighting game companion. We waited a long time to rent Mortal Kombat. As soon as we got it, we stayed two days in a row just playing. We only stopped to eat. A striking part for me is Matt Furniss's soundtrack on the Mega Drive port. I love Dan Forden's arcade track, but Matt's is my favorite in MK1. It's always been very immersive for me; getting to Goro's Lair on Mega Drive is like stepping into an '80s horror movie.
Bill Wicker: My earliest memory was when my dad rented the first game from Blockbuster. He'd just gotten a Super Nintendo, had the pack-in Super Mario World, and one of his routines for a while was going to Blockbuster and renting different games. Most of them were action games, sports titles, the occasional one-off. One day, he brought home Mortal Kombat. I'd started gaming at an early age, probably four or five years old, so the first memory I have is seeing the start-up screen of Mortal Kombat when Goro smacks the Acclaim logo. That scared the bejeezus out of me.
As I got older, I was allowed to play more violent games. I got the Genesis version of MK1, and I really like the aesthetic of the original: the kumite tournament, the atmosphere, and being able to play as ninjas. I was super-big into ninjas growing up.
Craddock: What was your experience hacking ROMs before working on Mortal Kombat Arcade Edition?
Ferreira: I'd done a lot of hacks, but the most significant to me was Prince of Persia 2 Remastered Edition for the Sega Mega Drive. There was an unfinished prototype version. I took that and fixed the broken music instruments, finished an unbeatable level, and improved voice samples, colors, and some graphics so it looked, sounded, and played more accurately to the MS-DOS version. It's my most underrated project.
Chelios: This is my first hack experience. Previously I was producing a homebrew for Mega Drive.
Dias: I'd never worked with ROM hacks. I’m a game designer and pixel artist, and have worked on indie games like Oniken, Odallus, and Blazing Chrome. Working with this team was an amazing experience; I am happy to see a small portion of my work in a Mega Drive game.
Wicker: I was a big fan of romhacking.net back when I was 15. That was around 2006. I didn't have a very advanced computer, but I got into ROM hacking. We were seeing such hacks as Ultimate Mortal Kombat Trilogy. I was super-big on MK1 through Ultimate 3. I thought, I wish I was talented enough to get in there and do what these guys are doing. I've always enjoyed retro games. I can't get enough of them. I started hacking ROMs on my own around early 2016. I delved into hacking Super Mario World, which was another favorite game.
Over time, I got into assembly language. I wanted to start small. I contacted a gentleman named Tony Hedstrom. He is a huge member in the ROM hacking community. I told him I wanted to start off small by making Game Genie codes. He walked me through how the Sega Genesis worked, how a lot of Game Genie codes operated. The dos and don'ts, I guess.
“The number of palettes are still the same, but Chev Chelios and Danilo Dias tried to get the most detailed and colorful visuals possible.” -Master Linkuei
This is just a hobby for me. I started picking up ASM [assembly] code when the pandemic hit the U.S. This was around March or April 2020. I decided I didn't want to do Super Mario hacks anymore; I wanted to fix up games. One of the first projects I started was Ocean's The Addams Family and Terminator 2: The Arcade Game. There were certain things I didn't like about those games that I wanted to fix up.
I kept going from there, selecting games I wanted to hack and fix up. Honestly, I could go back even further to Ocean's The Addams Family Values, a top-down RPG I wanted to fix up. That was late 2019.
Craddock: I've noticed that ROM hackers concentrate more on the Genesis versions of MK ports. Am I off base there, or are Sega's ports more popular among that community?
Wicker: Oh, absolutely. The Genesis is easier to program for. There are so many ways you can approach writing code for it as opposed to the Super Nintendo. For example, when you want to write something to a RAM [memory] address, it's as simple as one line of code. On Super Nintendo, it takes around three commands.
Ferreira: Even liking the MK1 port for the Genesis because of the accurate gameplay and controls, I always thought it looked, sounded, and felt unpolished.
Craddock: Was that how the Arcade Edition hack got started, then?
Ferreira: Yes. I've always liked the Mortal Kombat port for the Genesis; it played accurately to the arcade game, but it always seemed unfinished. I wanted to complete it. I started with a color hack and then restored the original PCM samples over the strange narrator used in the Genesis port. [Author's note: "PCM" stands for pulse code modulation, and is a way to convert analog audio to digital form.]
Craddock: What was it like running the hack and seeing those first changes in action?
Ferreira: It's really awesome powering on your Mega Drive and being able to play your own project that you've worked on for months or years. It's a real pleasure.
“On the Courtyard stage, Shang Tsung and the monks were made from scratch. The arcade assets didn't match the other assets, so I had to draw everything.” -Chev Chelios
Craddock: One thing that was immediately apparent to me upon playing MK Arcade Edition is that your color palette seemed more robust. The Genesis and Mega Drive were legendary for many positive reasons, but one knock against it was its color palette being shallower than that of the Super Nintendo. How were you able to expand Sega's palette?
Ferreira: The number of palettes are still the same, but Chev Chelios and Danilo Dias tried to get the most detailed and colorful visuals possible.
Craddock: This next question is for Chev, Danilo, and Bill: How did you get involved in Mortal Kombat Arcade Edition?
Chelios: I've known Master Linkuei for a long time. I saw that he was working on this hack and I offered to help.
Dias: YouTube recommended a video from Master Linkuei. I saw the Mortal Kombat hack he was working on and was stunned. I saw he was Brazilian as well and contacted him asking if he needed some help with sprite work.
Wicker: In the summer of 2020, I was contacted about a boss hack for the Genesis version of Mortal Kombat through the Mortal Kombat project Discord. I followed that team's efforts on hacking the arcade games, and a random user messaged me, like, "Hey, I'd like some help fixing this up." I was very much a novice. I'd finished my very first Genesis hack, which was Eternal Champions: Special Edition, and I thought, Okay, maybe I'll look at the code.
As it turned out, the code that was handed to me didn't belong to the guy who'd contacted me. It was stolen code. For a while after that, I swore off doing a Mortal Kombat hack. Fast-forward to the summer of 2021, Master Linkuei contacted me. I told him about the previous year's situations and shared my reservations. He sent me a very early version of his ROM, and that was enough to convince me this guy was legit and to come aboard.
Craddock: Master Linkuei, how did you know Bill, Chev, and Danilo?
Ferreira: I met Bill after seeing all his SRAM hacks. The guy is a beast! */*/
Craddock: Bill, where did your "BillyTime!Games" handle come from?
Wicker: It started out as a YouTube channel. It was going to be Let's Plays in the same vein as Game Grumps. It was a shameless rip-off but with an iPhone camera hooked up to a TV. I had little technical know-how and worked within the budget I had. I'd wanted to make my own video game; it had been a dream of mine since childhood. Over time, I learned that not only is it more rewarding to hack games, but it gave me more of a following than I would get doing Let's Plays; that's an over-saturated market.
BillyTime is, at this point, a legacy handle. I'm too far in to change it. I'm just like, "Eh, it's fine how it is."
Craddock: Other projects such as Ultimate Mortal Kombat Trilogy are objectively larger in scope. What about Master Linkuei's goal to make a more arcade perfect adaptation of the original MK interested you?
Wicker: Presentation, first and foremost. Seeing that splash screen at the beginning with Kano and Raiden coming out of the arcade machine--I thought that was super cool. He was also inserting audio samples from the arcade. His graphics and audio presentation were down pat. Beyond that, the gameplay felt good. It felt a little faster than the original port.
Craddock: Billy, MK Arcade Edition's page on romhacking.net credits you with writing a system to save lists of winning streaks. Could you walk me through how you did that?
Wicker: I actually did a little more than the SRAM stuff, but that was probably my biggest contribution. When you accumulate a winning streak and are defeated, you have the option to enter your initials; doing so saves your score and your initials. This is saved automatically, so the next time you turn on the system, your high scores will be there. I figured that would be a cool usage of the SRAM battery. Back in the day, many companies figured it wasn't worth using batteries in cartridges to save data because that upped the cost of manufacturing cartridges. Many games that should have had high-score tables didn't save them.
Craddock: What were your other contributions?
Wicker: I helped code the announcer on the character-select screen. That was all custom code. There was nothing to work with that was scraped out of the wrong. I still have the Notepad file on which I wrote the code. I do all my hacking in hex, so everything is a bunch of annotated numbers in hexadecimal; the annotations help me keep track of what I was doing.
“Honestly, that's one of the best parts of ROM hacking: When you can use a game's code in a way that benefits you.” -Bill Wicker.
I also helped with general engine improvements. I helped find the graphics pointer. That allowed us to re-insert Sub-Zero's original arcade stance; in the original port, his stance was a palette swap of Scorpion's stance. I helped with HUD placement so we could place the score counter right above the life bars. I believe in the original Genesis version, the score was underneath life bars. We wanted to have a more condensed HUD to clean up the screen. I also helped with floor placement. In the original Genesis version, the characters stood a little too high or low on the floor of arenas. We found a way to reposition the characters.
Beyond that, I shared some of my coding knowledge with Master Linkuei. I can't tell you the extent of how that helped on his end of development, but he definitely took the ball and ran with it. The next thing I knew, he was showing me updates of things like Ermac being in the game. He was blowing my mind.
Craddock: Chev and Danilo, Master Linkuei credited both of you with much of the hack's graphics-oriented design. Could you go into detail on the areas you worked on, and what that work entailed?
Chelios: I redesigned stage assets, color palettes for some stages and characters, created some graphic animations, and fixed others. On the Courtyard stage, Shang Tsung and the monks were made from scratch. I also did part of the roof and recreated the color palette for it. The process mostly consists of taking arcade assets and reducing or redrawing them to the correct size of the Mega Drive with respect to the console's color limitations. For the monks, I ended up drawing from scratch. The arcade assets didn't match the other assets, so I had to draw everything.
I spent around half of my time on the hack reducing and redrawing those graphics. I designed Shang Tsung's clapping animation; that didn't exist in the arcade, so it's exclusive. I also made an adjustment to the animation of the monks when they move: Their heads were too narrow, and there was clipping around their ears. We reduced that clipping effect.
“I also fixed up some of the statues on the Warrior's Shrine stage. Specifically, I improved Goro's face and restored his balls. No joke.” -Danilo Dias
On the Palace Gates stage, I resized the palace and optimized its tiles to fit the clouds in the VRAM. I also drew the arcade clouds for the stage. The Throne Room stage had the most complicated job: Adding Shang Tsung's blue chair. I had to draw Shang Tsung from scratch, rearrange the entire table of contents for palettes—work programmed by Master Linkuei—and combine the two-layer tiles in addition to redesigning the rug to something less cartoonish. I also and repainted the frames.
Goro's Lair required me to completely redesign the characters' positions on the floor. The Warrior's Shrine needed redesigned palettes for the background and statues. These are just some of the tasks out of many our group has done; we all participated in the creation of the assets.
Dias: I’ve reworked and cleaned up Kano and Goro’s sprites. I also did some small work in the Warrior's Shrine background. Linkuei asked me to clean Kano's sprites. I used a custom palette made by Chev to replace Kano's frame colors and made lots of fixes to his sprites by hand, trying to be faithful to the arcade version. There were lots of artifacts and random junk in his sprites, so it was a very tedious process, but I managed to make his sprites way better than the original mega drive version.
Fixing up Goro was the same process, but he required more work. There were literally holes in his sprite. I redrew lots of his muscles and his belt. It was long, hard work.
I also fixed up some of the statues on the Warrior's Shrine stage. Specifically, I improved Goro's face and restored his balls. No joke.
Craddock: Including Ermac was a nice touch, but I was more excited to play as Reptile. It's been a dream of mine to play as a faster hybrid of Scorpion and Sub-Zero circa MK1. Playing as Reptile in Mortal Kombat Arcade Edition, you press a button to switch between Sub-Zero and Scorpion's moves and stances. Since you have so much knowledge of hacking, could you describe how the character works?
Wicker: From what I understand, there appears to be some code when you start the match. This was something I taught Master Linkuei, and something derived from the announcer code. There's a button check before the match begins, and it looks for specific values read from the controller. In this example, A and Start to select Reptile. The code checks to see if the A button and Start button are being held. From there, it executes custom code that not only changes Scorpion's colors to green and black, but Shang Tsung will announce him as Reptile, and he'll be able to switch move sets on the fly.
I'm not sure if that's outright changing a move set or if he's just changing to a green version of Sub-Zero, but it's definitely quite the workaround. Honestly, that's one of the best parts of ROM hacking: When you can use a game's code in a way that benefits you.
Craddock: Would it be possible to write code for Reptile to have both ninjas' special moves at once?
Wicker: I feel the button press to swap move sets is necessary. Without it, you're essentially custom-coding a new character from scratch. That wasn't within our project scope.
Craddock: For players who aren't familiar with how retro games were made—and how hacks for them are written now—what tools did you use to make MK Arcade Edition?
Wicker: Master Linkuei and I hack through a debugger and a hex editor. A lot of what we do is often educated guesses, and sometimes it's bad science. We take a line of code, redirect it to something else, and hope it doesn't break down.
Ferreira: Yes, there are several. I used the Gens emulator's debugger to trace code and find variables, conditions, and code jumps I want to change in the game's ROM. From there, the tools depend on what I need to do. I use HxD to edit code, HivePal to change color palettes, Goldwave to insert new samples or original samples from the arcade game, and Photoshop to make or edit artwork.
Another tool called GraphicsGale lets me arrange and sync 4bpp palette indexes between two or more pieces of art. To manipulate artwork, I use RNC to decompress art from the arcade game or to compress a new piece of art to the ROM. A program called Tile Molester is useful for editing graphic tiles, and another hacker, TaigoSC, wrote a custom tile map editor that made editing tile maps much easier.
Dias: Since I just worked with art files, I used Aseprite to edit sprites and backgrounds. I work daily with this pixel art tool.
Craddock: As a rough estimate, how much of Mortal Kombat Arcade Edition is new code, and how much of it is reworked code from the Genesis port in '93?
Wicker: I feel like the sound code is at least 85 percent replaced. Graphics, too. As far as the engine goes, aside from things like the announcer and the SRAM function, a lot of the general gameplay is roughly the same. The gameplay in the original port was great.
Craddock: A few years ago, I wrote a book on home conversions of arcade games and spoke to Paul Carruthers, the contract programmer Probe and Acclaim hired to port the arcade code to Genesis. He told me--and I've heard this from so many developers--that ports are not given high priority from publishers, not even when they're conversions of lucrative coin-op titles like Mortal Kombat. A single programmer was given two months, maybe three, to do the project. Some had the original code to work with, but others were sent a coin-op cabinet to play and reference as they did the conversion, or they'd have to go to an arcade and spend their own money to play and memorize as much of the game as they could.
Paul's port was missing a lot of things, like character names spoken at the select screen and after winning matches, but Paul was on a tight deadline. If he'd had more time and resources, do you think he could have created a more arcade perfect port, something like the Mortal Kombat Arcade Edition hack?
Wicker: Definitely. It really comes down to time and money. Even with ROM hacking, the one thing you don't want to do is burden the size of the scope you're working with. You get what you need and polish as best you can. After a while, you may forget what you were doing, or a bug could crop up and you might not know where or how to find it. Sometimes you're getting too many suggestions from people, and you're like, "I'm just one person."
Ferreira: I agree. Paul Carruthers is a master. From what I've read, he programmed this port in about two to three months. Considering that, he did a hell of a job. The quality of his program is really great, and he could have polished it more with more time.
Craddock: Was the goal of this hack to burn it to ROMs so someone could hypothetically buy a cartridge and play it on their Sega hardware?
Ferreira: That's right. From my tests, it works perfectly on any official Genesis or Mega Drive model, and even some of the rip-off models.
Craddock: That's good to know because it means you had to keep many of the same limitations Paul Carruthers and other old-school Sega programmers had to work with. Knowing that, how did you ensure that all the changes and additions you had in mind would work on a cartridge?
Ferreira: The main concern was to keep the project under 32 megabits, or four megabytes, of size so it could be played on any cartridge, emulator, or from a flash cart.
Craddock: What did you learn about Sega's hardware from working on Mortal Kombat Arcade Edition that you didn't know before, or that you know better now?
Chelios: Tile optimization was the biggest learning process. Looking to the future, I would very much like to work on a hack for TMNT: The Hyperstone Heist, restoring and bringing in new bosses, but that's a lot of work and I have other priorities right now.
To be honest, this was my first and last big project for hacks. It was an amazing experience to work with my friends and learn more about the Mega Drive platform, which is a favorite of mine, but I intend to follow up with a homebrew project. In the end I think the challenge of overcoming the limits of the platform is the most fun, and of course doing something for the Mega Drive.
Dias: As an artist I've learned a lot about the hardware's restrictions. I've also learned that those restrictions can be bent with some clever art and techniques such as dithering. [Author's note: Dithering is the practice of simulating colors that may not be natively available in a software's palette, such as red and blue pixels packed so closely together the human eye perceives the color purple.]
Ferreira: I learned a lot of Motorola 68000 assembly and ROM hacking tricks. Most importantly, I gained experience working as a team with BillyTime, Chev Chelios, and Danilo Dias. Chev and Danilo helped a ton with the new art and animations, and TiagoSC made the tile map editor to arrange the new art for the stages.
Wicker: I learned you can execute code just about any time you want. There's what's known as a main interrupter, or a main cycle. As the game's running, it's doing necessary stuff like updating the graphics processor frame by frame, checking for things like the match timer as it decrements from 99 to zero. It opens up a lot of possibilities for me as an idea man. For example, Okay, as the timer is ticking down, I can execute a piece of code to do such-and-such. If I want to set up something like holding a certain button to set up a sudden death mode, or the Kombat Kodes from Mortal Kombat 3, I could do that.
“It meant a lot to contribute improvements to a game that was a big part of my history as a kid.” -Danilo Dias
That was really cool for me to learn, but he also reaffirmed my skills as a coder. I'm always trying to improve.
Craddock: Was there anything you wanted to do with Mortal Kombat Arcade Edition but could not get working?
Ferreira: Probably the most requested change was to put character names inside health bars. Unfortunately, we had no free video RAM left for this.
Craddock: Of the many alterations you've made, does any change or addition stand out as your favorite?
Ferreira: All the new voice samples, for sure. The samples in the original port always sounded muffled.
Chelios: I can't choose a favorite between the arcade voice samples and the addition of Ermac.
Dias: The backgrounds and the gameplay improvements. It quickly became my favorite version to play.
Craddock: What has the reception of Mortal Kombat Arcade Edition been like so far?
Ferreira: It's been really great. I never thought it would get so much feedback.
Dias: It's been incredible. I don't feel like I did much in this hack, but I'm proud of my guys Master Linkuei, Chev, and BillyTime! As for me, it meant a lot to contribute improvements to a game that was a big part of my history as a kid.
Chelios: Yes, it's been really good. We've had a live chat with some friends and we've had comments from nice players.
Wicker: Overwhelming love. I still get notifications and retweets of the original post that dropped on Christmas Eve [2021]. I'll be checking my phone and be like, "Oh, somebody retweeted Mortal Kombat Arcade Edition. Nice." I'm on romhacking.net checking the queue status. I have multiple ROM hacks to be released, and every once in a while I'll see a review of Mortal Kombat Arcade Edition. Everything has been overwhelmingly positive.
Now many people are asking, "When are you guys going to work on Mortal Kombat II Arcade Edition?" I haven't been contacted about that, but I'd definitely be game for it.
Ferreira: Nothing, nothing can prepare you!
This post is part of Kool Stuff, a companion book to Long Live Mortal Kombat: Round 1 that contains interviews I was unable to do before hitting Long Live MK’s deadline. Subscribe to Episodic Content to keep up with news on Long Live MK’s Kickstarter (set for March 8) and to follow along with Kool Stuff as new chapters are published.