Manic Miner (Dragon 32) Room Format
Version 1.0: 1 January 2006
by John Elliott
Disclaimer: I do not guarantee this information to be correct. This is my best guess at what is going on inside Dragon 32 Manic Miner, after wandering around inside it with a disassembler.
Dragon 32 Manic Miner is, in some ways, a superset of Spectrum Manic Miner. It has a very different game engine and data format; room definitions are compressed in order to fit within the Dragon's limited memory. The other obvious difference is that everything is in black and white; items blink on and off to stand out.
Rooms
There is a table of 22 pointers to rooms at 49C2h. Each word points to a compressed room definition. The byte at 4983h holds the current room number.
Guardians
The room starts with guardian definitions:
DB guardian_count
Then for each guardian:
DB type ;G0 0 for horizontal, 1 for vertical ;Horiz Vert DB x1 ;G1 Stored as (x1-1)*8 ;Y X DB x2 ;G2 Stored as (x2-1)*8 ;Lbound Ubound DB x3 ;G3 Stored as (x3-1)*8 ;Rbound Lbound DB x4 ;G4 Stored as x4,0 ;Direction 0=L 8=R DB x5 ;G6 Stored as (x5-1)*8 ;X Y DB x6 ;G7 Stored as x6 ;Sprite number DB x7 ;G8 Stored as x7 ;} Horizontal ticker DB x8 ;G9 Stored as x8 ;} 1=normal 2=slow DB x9 ;GA Stored as x9 ;Vertical speed 2=fast DB xa ;GB Stored as xa ;Sprite width?
Skylabs are stored similarly to other vertical guardians, except that the 'direction' byte (x4) is greater than 8 (I don't know what significance it has in this case), and the 'sprite page' byte appears to be a countdown, similar to the JSW arrow, of how long before the skylab appears. Dragon Skylabs don't move sideways; instead, there is a separate skylab for each position one can be in.
Since guardian sprites are stored separately from guardian definitions, the game engine (like JSW) supports multiple guardian types in a room. The two extra rooms take full advantage of this.
Room layout
After the guardians, we have the room layout. As in Dragon JSW, this is stored as a set of vertical and horizontal strips. In general, a strip-set is formed:
DB count
If count is nonzero, this is followed by:
DB tile ;Tile pattern. Each strip gives its own ;meaning to the tile pattern byte.
And then "count" repetitions of:
DB y ;Y-coordinate, 1-16 DB x ;X-coordinate, 1-32 DB repeats ;Height or width of strip
The strip-sets that make up the room layout are:
- Vertical water strips. The tile pattern is an index into a table of words at 4A04h. Each word points at the 8x8 cell pattern.
- Horizontal water strips. The tile pattern is an index into a table of 8x8 bitmaps at 4EB7h.
- Horizontal crumbling strips. The tile pattern is an index into a table of 8x8 bitmaps at 4EB7h.
- Conveyors. The count is either 0 or 1. The tile pattern gives the conveyor direction (8 for left, 0 for right). The 8x8 bitmap used is always the one at 4E97h.
- Vertical earth strips. There is no tile pattern byte:
DB count DB y,x,repeats ;repeated 'count' times
The 8x8 bitmap used is always the one at 4F0Fh. - Horizontal earth strips. As with the vertical ones, there is no
tile pattern byte:
DB count DB y,x,repeats ;repeated 'count' times
The 8x8 bitmap used is always the one at 4F0Fh. - Items. These are similar to strips:
DB count
If count is not zero:DB tile DB y,x ;repeated 'count' times
The tile number is an index into a table of pointers at 49EEh. Each pointer then points at the 8x8 cell pattern. - Fire cells. The format of these is:
DB count DB tile,y,x ;repeated 'count' times
The tile number is an index into a table of 8x8 cells at 4F17h.
After the room layout are various miscellaneous data:
DB portal y DB portal x DB willy initial y DB willy initial x DB Unknown 1 DB Unknown 2 DB length of room title DB room title DW Unknown 3 ;Seems to be used in a delay loop.
The room title uses the game's internal character set (see 'Font' below).
Sprites
Sprite numbers for horizontal guardians refer to 256-byte sprite pages starting at 5F53h (all horizontal guardians are bidirectional). Sprite numbers for vertical guardians refer to 128-byte sprite pages starting at 6F9Fh. The Skylab sprite page is at 74D3h; Kong is at 7453h.
Sprite storage format is 32 bytes. The first 16 give the right-hand column of 8 pixels; the second 16 give the left-hand column of 8.
Unlike in Spectrum Manic Miner and JSW, sprite images for horizontal sprites are not offset by two pixels per frame. Therefore the game engine must draw the sprites on arbitrary pixel boundaries, rather than rounding to the nearest 8 pixels as in Spectrum MM/JSW.
The game-engine also has the following sprites in the same format:
4D74h: Willy. There are only 6 frames because of the not-offsetting thing; frames 2 and 5 are used twice over. 4FDFh: Portal. There are two portal graphics (normal and inverted); when a portal is blinking, this is done by drawing one and then the other. 501Fh: Plinth 503Fh: Boot
The font
The font starts at 4BB9h. It covers the following letters:
00 = Space 01 = A 02 = B 03 = C 04 = D 05 = E 06 = F 07 = G 08 = H 09 = I 0A = K 0B = L 0C = M 0D = N 0E = O 0F = P 10 = R 11 = S 12 = T 13 = U 14 = V 15 = W 16 = X 17 = Y 18 = J 19 = Copyright 1A = = 1B = 0 1C = 1 1D = 2 1E = 3 1F = 4 20 = 5 21 = 6 22 = 7 23 = 8 24 = 9
At 4FCFh are the two 8x8 graphics for the switches.
The title screen
In the snapshot, the top 80 rows of the title screen occupy 1E00h-27FFh. They are stored 32 bytes to the line.
The scrolling message occupies 47D3h to 4906h. The last 20 characters of the message (48F3h to 4906h) read "PRESS ENTER TO START" and are displayed on the title screen.
Other Differences
As far as I can tell, there is no solar power and no SwordFish sequence.
If Willy leaves the screen at the side, he reappears on the other side. This behaviour is used in 'The End'.
Willy does not fall off the bottom of the screen; he stands on the room title. This behaviour is also used in 'The End'.
There is no 'fast crumbling' bug.
John Elliott 1-1-2006.