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.

Full screen, VGA
DrMarco full screen. A tall bottle in the middle holds red, yellow and blue viruses and one landed red and yellow capsule. The left panel reads Score 0000000, Level 08, Speed Low, Virus 36 and Fever. On the right are the next capsule, a cartoon doctor holding a pill, and three dancing germs.
Level 8, full screen on VGA. 36 viruses in the bottle. The next capsule waits top right, and the three germs below the doctor dance while you play.

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.

Title screen
The DrMarco window on the os8088 desktop: a large blue and red capsule reading DrMarco in yellow letters over a green checkerboard, then the lines Enter Start Game, H How to Play, LV 00 Low Fever, with the doctor on the left and three germs on the right.
The title screen, in a window on VGA. The picture is uncovered from the top down while the title tune plays. The keys work before it is finished.
How to play
The DrMarco window showing the help page: How to Play, Match four of the same color, Clear every virus to finish, and a list of the keys, beside the doctor and a small picture of four capsule halves in a row.
The help page. H opens it from the title screen, and H or Esc goes back.
Full screen, CGA
DrMarco full screen in four colours: black, green, red and yellow. The bottle holds green, red and yellow viruses, the left panel reads Level 08, Speed Low, Virus 36, and the doctor and germs are drawn in the same four colours.
Level 8 on CGA. CGA's 320 by 200 mode shows four colours at once, so green stands in for blue. Taken from the screen memory of an emulated IBM PC with a CGA card.
Title screen, CGA
The DrMarco window on a black and white CGA desktop: the capsule logo, the doctor and the germs drawn as white outlines on black.
The title screen on a CGA desktop. Windows on CGA are black and white, so the title picture is redrawn as a line drawing. Hercules gets a version too.

How it works

What keeps a falling capsule smooth on a 4.77 MHz processor.

The bottle

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:

Time DrMarco takes to draw on a 4.77 MHz IBM PC
drawingVGACGA
a capsule moves3.4 ms1.4 ms
nothing changed0.04 ms0.04 ms
the background, once506 ms94 ms

The game runs 54.6 frames a second full screen, which is 18.3 ms a frame.

The pictures

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 music

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 rules

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.

  1. Boot os8088 on a machine with a network card, and double-click The Wire on the desktop.

  2. Pick DrMarco from the list, and press Add to Disk. Choose a disk with room for 67KB. The Wire writes four files: DRMARCO.O88 and the three picture files that go beside it.

  3. 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.