Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mega Man — PC/DOS, 1990

A byte-level study of the 29 loose files that make up Mega Man for MS-DOS: the EXEPACK'd executable, the one run-length codec that every image in the game goes through, five undocumented file formats, and the five compiled 8086 modules that hold most of the game's code.

Nothing here is emulation, patching or preservation advocacy. It is measurement: every number in these chapters carries the command that reproduces it, the predictions were written before the executable was unpacked and are scored whether they won or lost, and the formats are described in the docstrings of the tools that read them.


The short card

title Mega Man — not the NES game of 1987 and not a conversion of it
platform MS-DOS, EGA / Tandy / CGA, 320 × 200
year 1990 — all 28 game files are dated between 30 September and 29 November 1990
licensor Capcom© 1990 CAPCOM CO.,LTD. on the title screen, drawn as pixels
credited Stephen Rozner — design, graphics, programming and sound, one name, on CREDITS.STA
publisher not named anywhere in the object; file_id.diz, added in 2011, says Hi-Tech Expressions, Inc.
the folder 29 files, 346,995 bytes, 29 distinct SHA-1s, no directories
the executable 20,349 bytes, EXEPACK'd; unpacks to 211,712 of which 91.8 % is zero and 17,415 is program
the rest of the code 42,449 bytes in five per-stage .BIN modules — 71 % of the game's code is not in its executable
stages five: SECUR 200 × 14, SONIC 200 × 76, VOLT 240 × 80, DYNA 200 × 80, WILEY 200 × 66 tiles
bosses three, named in pixels on the stage-select screen: SONICMAN, VOLTMAN, DYNAMAN
the codec PackBits, with 0x80 meaning a run of 129 rather than a no-op — one coder for all four compressed families
the pixel 4 bits; backgrounds are four EGA planes interleaved per row, sprites five planes (mask first) interleaved per byte
tile 16 × 16 px = 128 bytes; a bank is 320 tiles + a 1,024-byte trailer = 41,984
screen 320 × 192 drawn into a 336 × 208 off-screen page — sixteen pixels of scroll margin
sprites 305 frames in 8 banks, 59.9 % opaque
audio PC speaker only. No sound file, no sound data, no sound chip touched
copy protection manual lookup: twelve creatures, twelve names, stored in the executable in a private alphabet
leftovers 34,308 bytes, 9.89 % — half of it artwork that was drawn and never placed
predictions 44 clauses written before unpacking; 24 hit, 10 half, 10 miss = 65.9 %

Everything above is derived in the chapters and every figure has a command.


The chapters

00 — the predictions forty-three bets placed before the executable was opened, plus the one inference everything else hung on
01 — the folder twenty-nine files that never say who made them, and where the separation between bytes and outside sources falls
02 — the spec sheet every number, with the command that reproduces it
03 — EXEPACK twenty thousand bytes that are nine tenths air
04 — the unpacked image twenty-two strings, four video modes, and a screen sixteen pixels too wide
05 — the codec and the pixel one run-length coder, two planar layouts, and a byte that is not a no-op
06 — .SCN five maps, thirteen bytes of header, and a checkerboard that reads as text
07 — .BLK 328 slots, 216 a stage can reach, and 1,024 bytes that are not tiles
08 — .FRM 305 frames, five planes a byte, and thirteen of them in every stage
09 — .BIN the only family that is not data, and the 234 bytes that gave it away
10 — .STA four pictures at 320 × 192, and the only place this game signs its name
11 — the copy protection twelve pictures, twelve answers, and one hyphen that proves the alphabet
12 — the clocks fifty-nine days of work, and a compressor that changed halfway through an evening
13 — against the collection what they were trying to fit, and into what
14 — open questions ten things this document could not close
15 — the scoring forty-four bets, and one wrong idea that cost eight of them
16 — the tools thirteen scripts, one rewritten because the branch's copy will not run here
17 — leftovers 34,308 bytes that nothing reads
18 — corrections eight errors in the briefing, five in this session's own work

Running the tools

The tools expect the game's files in the current directory and write everything they produce into _work/, which is not in this repository. No game asset, render or extracted image is committed here — this repository is text.

python tools/census.py .                      # what is in the folder
python tools/exepack.py MM.EXE --out _work/mm.unpacked.bin
python tools/rle.py --all .                   # every compressed file, decoded and checked
python tools/scn.py --all .                   # stage maps
python tools/blk.py --all .                   # tile banks
python tools/frm.py --all .                   # sprite banks
python tools/sta.py --all . --dir _work       # the four screens, rendered
python tools/binmod.py --all .                # the stage code modules
python tools/toolclass.py                     # every tool in exactly one class

Python 3. capstone for tools/dis16.py; Pillow for anything that draws. The decoders and their closure checks need neither.


What this is part of

One of a set of independent studies of individual game releases, indexed at pc-gamelist-doc.

Its direct sibling is pc-megaman3-docMega Man 3: The Robots are Revolting, the same studio, the same programmer and the same platform, twenty-one months later, and the second and last Mega Man on PC. The two programs share 1,855 bytes in runs of 32 or more, including 98 bytes of the options display list and the 32 bytes of both palette tables — which is what fills the Saga cell this document argued should stay empty until something did. Three of the ten open questions below are answered there; see 14.

The two nearest neighbours in method are pc-baronbaldric-doc and pc-tubularworlds-doc: same branch, same shape of object — a folder of loose files, a DOS executable, proprietary extension families, no installer.

About

Byte-level study of Mega Man (PC/DOS, 1990): 29 loose files, 346,995 bytes. Unpacks the EXEPACK'd executable, identifies the one PackBits variant the whole game uses, and closes .SCN/.BLK/.FRM/.STA/.BIN by arithmetic. Renders the credits (the object's only attribution) and recovers the twelve copy-protection answers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages