The original program, on another 68000
The X68000 and the Neo Geo both run a Motorola 68000, so the game's compiled code runs unchanged. What it asks of the X68000 is answered by a layer written for this port, the shim: it stands in for Human68k (the DOS), the IOCS, the XSP sprite library the game links, the MCDRV music driver, the joystick and the video hardware. Every one of those interfaces is patched at build time to call it, and files the game would load from disk become data already in ROM. The game's working memory is laid out object by object so its live state fits the Neo Geo's 64 KB, with no extra RAM on the cartridge and no MVS backup RAM.
Graphics
XSP's sprites become Neo Geo sprite tiles, converted at build time; the X68000's background plane becomes columns of sprites, its text plane the fix layer, and its palettes Neo Geo colours. The shim answers XSP's own calls with them every frame.
The screen
Pixels are 1:1. The original's field is 256×256; the Neo Geo shows 224 lines of it at a time, and the view follows the ship only as far as it must to keep it whole, preferring the top of the field, where enemies come from. The 32-pixel strips on either side hold a still metal frame (generated art, reduced to pixel art) on the fix layer. The score and lives sit at the original's places, fixed while the view scrolls; the bombs are pinned 8 lines above the screen's bottom, so a CRT that crops it still shows them: the one declared difference from the original's picture.
Sound
The original's three tunes are recorded from the original running in MAME's X68000 driver, each with its loop point measured, and played back as YM2610 ADPCM-B by a Z80 driver on the cartridge. The 25 effects are decoded from the game's own ADPCM files and re-encoded as ADPCM-A. The driver takes its cues from the game's own music and effect calls, so they start on the same events.
Checked against the original
The original runs in MAME's X68000 driver and the Neo Geo build in MAME's Neo Geo driver, fed the same input at every game step, and their game state is compared after each step: the lock-step. Over the whole game (stages 1 and 2, their bosses, the bonus stage and its two bosses, 35,028 steps), through deaths, game overs and a CONTINUE, and through the CONFIG menu, the state is identical at every step, on the MVS and the AES. The one byte allowed to differ, the sound-effect priority, does so only in a few short windows where the two machines' sound timing meets a step boundary. Whole frames are compared pixel for pixel at 24 moments of the game, and at 31 more across the title, its menus, game overs and CONTINUE: all equal.
Two players on the original's code
Player 2 is not a second ship written from scratch: each game step runs the original's own ship code a second time, with player 2's state swapped in. Movement, shots, power levels, bombs, death and respawn are then the same for both players by construction. A thin layer makes the shared parts (collision, scoring, aiming, items, the view, the HUD) know there are two ships. Player 2's ship and shots take their own palettes, the originals turned a third of the way round the colour wheel. Until a second player comes in, none of it touches the game: one-player play stays identical in the lock-step, and the demo stays one-player.
Speed, and the limits
- One game step runs per Neo Geo frame, 59.19 a second: about 20% slower than the original's 73.94, a choice made for smoothness. The original's own slowdown in busy scenes is not reproduced.
- Where a step runs past its frame, the last picture shows again: 753 frames over a whole one-player game. Two players run every shot and every enemy, nothing trimmed, so busy scenes slow down more: 1,465 frames over the same game.
- Tested in MAME 0.289 (MVS and AES) and on a Recalbox (libretro MAME 0.258). Not yet on real MVS or AES hardware.