You Need a PC for PC Games: Sunsoft's Shanghai
There’s a problem with my current series on mahjong games– when I say “mahjong”, people in my home country of the United States of America probably don’t think of the 2-4 player competitive game. They think of the single-player tile-matching game, Mahjong Solitaire, also known as Shanghai, beloved of office-workers and casual gamers everywhere. And that’s popular in Japan too; popular enough to get arcade releases. How did Sunsoft bring Shanghai to arcades? Why is that even a question worth asking?
Born on the PC
The exact origins of the tile-matching game using mahjong tiles are unclear, but making it a video game is usually attributed to Brodie Lockard, who discovered the tile-matching game as he dealt with recovery from an injury that had left him paralyzed, porting it to the PLATO system. But it was the Activision-published 1986 release across computers that really made it a mainstream hit.
Shanghai presents you with an arrangement of mahjong tiles arranged in a multi-level structure. You can remove tiles from the structure, but you have to follow certain rules when doing so: to be removed, they must have an empty space on one side, and nothing on top of them. This is a nice brain teaser, and honestly I’m completely addicted to it.
Take a look at the 1986 Apple ][ version above. This uses the Apple’s “HIRES” directly-addressable pixel graphics mode; and while that’s normal for games on this platform, Shanghai pretty much necessitates using the directly-addressable pixel graphics modes whenever possible. Because the problem is that any tile could be on top of any other tile, and they can be on different levels. There’s no tile grid.
An interesting thing to note is that the tiles used in Shanghai don't match those used in Japanese riichi mahjong. Even putting aside the simplified labels used in the Apple release, the game has flower and season tiles, which aren't typically used in riichi, making it closer to Chinese variants of mahjong. (It also lacks the jokers used in American mahjong)<br>Given the demographics of English-speaking mahjong players and of people who read this blog, my guess is that among most readers, if they're familiar with any version of the competitive game at all, it's most likely going to be riichi.
And that’s what makes this game so interesting as a use case for comparing ports. Because while computers of this period generally have directly-addressable graphics modes, game-centric hardware usually did not, and that made this game hard to port. The Famicom port above is particularly pathetic; it uses colors to simulate the layers and tiles are limited to 16x16. It’s actually extremely playable and has catchy music, but it’s highly compromised visually. (Oddly, the CGA IBM PC release also used colors instead of levels)
We actually have a prototype version of this game, which made different compromises. (And was for the FDS, but that might've just been a development artifact) I think the final version turned out better, myself.
The Sega Master System version is far superior, with big tiles taking up almost the entire screen. This is because the Master System, while not having directly-addressable pixel modes (other than the legacy mode, used in F-16 Fighting Falcon for exactly this purpose, but thank goodness they didn’t use that), does have video RAM. But it doesn’t actually have enough video ram to tile this whole area. So how’s it doing this? Take a look at the tiles in an emulator like Emulicious.
Certain tiles from the top row of tiles are being redrawn mid-frame so they can fulfill double-duty as also covering the bottom row. You can also see how this game uses the majority of the sprite table in VRAM to act as additional tiles instead; the only sprites used are those that make up the cursor. It seems like such a simple screen, but they’re actually pushing the console here! This port was developed in-house at Sega, usually attributed to the famous Mark Cerny.
The Famicom version of Shanghai II draws properly overlapping tiles. Unfortunately, the Famicom can't rewrite CHR-RAM during active display like the Master System can, so the directly-addressable screen area is more limited in size.
It’s not just graphical issues. Look at the video of Shanghai on Famicom below. Notice how long it takes for the game to figure out how many moves the player has remaining. Sure, it’s not more than a few seconds, but that’s a lot of frames. Therefore, this version of Shanghai can’t end your game automatically when you have no moves left. I’ve often complimented the Famicom’s plucky little 1.7MHz almost-6502, but this is a complex combinatorial problem. (It’s a faster CPU than the Apple ][!)
You don't have a video tag support or something
It’s worth noting, though, that Shanghai II on the same platform does detect this automatically (though it still takes a few frames to notice), so it’s likely that the original game could’ve done this....