Spotlight › DrMarco
DrMarco, a capsule puzzle for the 8088
Capsules with two coloured halves fall into a bottle full of viruses. Line up four of one colour and they vanish. This is a new game in 8086 assembly after Nintendo's Dr. Mario of 1990, and it plays at full speed on a 4.77 MHz IBM PC.
- levels
- 0 to 20
- graphics cards
- VGA, CGA
- a move, 4.77 MHz
- 1.4 ms on CGA
DrMarco is not on the release disks. Get it from The Wire, or build it from source.
What it is
A puzzle game from 1990, rebuilt for a machine from 1981.
Dr. Mario was a puzzle game Nintendo released in 1990 for its home console, the NES, and its handheld, the Game Boy. A medicine bottle holds viruses in three colours. Capsules fall into it one at a time, each made of two halves, and each half is red, yellow or blue. You move and turn each capsule as it drops. When four or more cells of one colour line up across or down, capsule halves and viruses together, they disappear. Halves left with nothing under them fall, and can line up again on the way down. Clear every virus and the level is done.
DrMarco is a new program for the 8086 that plays by those rules. Nothing of the NES is emulated. The rules, the order the capsules come in, the colour tables and the speeds follow a published disassembly of the NES game, which is its program turned back into readable source. The capsule and virus pictures and the music come from it too, with the music rearranged for a PC sound card. The doctor, the laboratory and the title screen are new artwork made for this game. DrMarco is an adaptation, not a Nintendo product, and is not made or endorsed by Nintendo.
There are 21 levels, from 4 viruses at level 0 to 84 at level 20, at three speeds. The title screen opens in a window. Enter starts a game full screen, and Esc goes back to the desktop with the game kept where you left it.
Left and Right move a capsule, Down makes it fall faster, and Z and X turn it (Up turns it too). P pauses, N starts the level again, and M switches the music between two tunes, Fever and Chill, and off. On the title screen, Left and Right choose the level, S the speed, and H opens the help page.
See it running
On VGA and on CGA, the colour card IBM sold with the first PC.
How it works
What keeps a falling capsule smooth on a 4.77 MHz processor.
Only the cells that changed
The bottle is 8 cells wide and 16 tall, and the game keeps a copy of what each cell showed last. Moving a capsule compares its two old cells and two new ones and draws only those. A frame where nothing moved writes nothing to the screen. Measured on an emulated IBM PC with an 8088 at 4.77 MHz, counting the processor's own cycles:
| drawing | VGA | CGA |
|---|---|---|
| a capsule moves | 3.4 ms | 1.4 ms |
| nothing changed | 0.04 ms | 0.04 ms |
| the background, once | 506 ms | 94 ms |
The game runs 54.6 frames a second full screen, which is 18.3 ms a frame.
Drawn once, when full screen starts
The laboratory around the bottle is stored compressed and unpacked straight onto the screen once, when the game goes full screen. After that no frame touches it. The viruses wiggle, the doctor blinks about every five seconds, and the germs react when their colour is cleared. Each of those is a small list of bytes to copy, and they are spread across different frames so that no single frame carries all of them. The busiest step, with 84 viruses wiggling at once, takes 27.5 ms on VGA and 14.7 ms on CGA.
The title and help pictures live in three files beside the program, one per kind of graphics card, and are read from disk only when the title screen needs them.
The NES score, on a PC sound card
Fever, Chill, the title tune and the short pieces between levels are rearranged from the NES game's own music. On an AdLib or Sound Blaster card, three instruments play the music on the card's FM synthesiser, a chip that makes several voices at once, and a fourth plays the sound effects. With no card, the PC speaker plays the tune and lets effects interrupt it. The NES's drums are left out.
To keep the game smooth, no more than two notes change in any one frame. A third waits a frame.
The NES's tables, a PC's clock
The order the capsules come in, the colours and the way the speed rises are taken from the NES game's tables. The NES counts time 60 times a second and this game counts it 54.6 times, so the speeds are converted to match. Viruses are placed by the NES game's rules: how high they may reach on each level, and no two of one colour too close together.
What it does not do
Where it differs from the NES game.
- It is one player only. There is no two-player match.
- There is no demonstration mode and there are no ending scenes.
- Timing follows the PC's clock, so it is close to the NES game but not identical to it.
- The game itself needs VGA or CGA. On Hercules, the black and white card, you can see the title and help pages and hear the music, but not play.
- On CGA, blue is shown as green, because that mode has no blue alongside red and yellow.
- The NES music's drums are not played.
Run it
From The Wire, or built from source.
-
Boot os8088 on a machine with a network card, and double-click The Wire on the desktop.
-
Pick DrMarco from the list, and press Add to Disk. Choose a disk with room for 67KB. The Wire writes four files:
DRMARCO.O88and the three picture files that go beside it. -
Open that disk and double-click
DRMARCO.O88. Press Enter to play.
DrMarco is not on the release disks, the live USB image or the live CD. To build it from the source code you need your own copy of the Dr. Mario disassembly, which the build reads for the pictures and the music. Run make drmarcodisk, with DRMARIO_SOURCE pointing at that copy. That makes a DrMarco floppy at 360KB, 720KB, 1.2MB and 1.44MB.
Keep the three DRMARCO.VGA, .CGA and .HRC files in the same folder as the program when you copy it. They hold the title and help pictures.