ROM Mapping

Each Alex Kidd in Miracle World ROM is 128KB in size and uses mapping in slot 2. That is, the first 32KB of the ROM is always mapped into Z80 address space at $0000 - $7fff [1]. The remainder of the ROM is composed of 6 banks, each 16KB in size. These banks are mapped, one at a time, into Z80 address space at $8000 - $bfff.

ROM Version Differences

The following code is present in the ROM "Alex Kidd in Miracle World [v1]" but not in "Alex Kidd in Miracle World [v0]":

 3AC7: 7A           LD A,D
 3AC8: DD 86 0E     ADD (IX+0Eh)
 3ACB: FE BF        CP BFh
 3ACD: D0           RET NC

This code is executed when Alex is falling. If the RET NC at $3acd is not taken, the fall may end: Alex's falling sprite may be replaced by his walking sprite.

When the code runs, the D register contains Alex's height (24 pixels) plus the distance to fall this frame (0-4 pixels). (IX+0Eh) contains the the Y-coordinate of Alex's sprite (recall that this will be 0 for scanline 1, etc). Their sum, calculated at $3ac8, is the Y-coordinate of the bottom of the sprite at the end of this frame. If this is greater than or equal to $bf (191 decimal), the bottom of Alex's sprite will be below the bottom of the screen (Y-coordinate 190, scanline 191).

The code above, therefore, forces Alex to continue falling when he reaches the bottom of the screen. The effect of this can be seen only on those levels where it is possible to fall from one room to another. In v0, Alex will fall to the bottom of the screen and then the fall will end: the transition to the next room will occur with Alex's walking sprite shown. Once the transition is complete, Alex will resume falling correctly. In v1, thanks to the above code, the fall uses the correct animation frames throughout.

Room Transition [v0]Room Transition [v1]
(MEKA savestate)(MEKA savestate)

This is believed to be the only difference between the v0 and v1 ROMs.

The above bug fix is also present in "Alex Kidd in Miracle World [BIOS]", but not in "Alex Kidd in Miracle World [SMS-GG] (TW)", "Alex Kidd no Miracle World (JP)" nor "Alex Kidd in Miracle World [BIOS] (KR)".

Demo

If no buttons are pressed on the title screen, one of four demos will begin. Alex's movements during the demo are driven by simulated input - the data for this is in "TransBot" format and is located at $14d35-$1508d in the v1 ROM. In between the data for each demo is an unreferenced zero byte.

Level Structure

Levels are stored as a sequence of screens, each 256x192 pixels in size. The screens are described by arrays of 16x12 bytes, where each byte is the index of a 16x16 pixel metatile. These arrays are compressed individually, using the "Phantasy Star" RLE format (without deinterleaving), and located in the v1 ROM within $18000 - $1bdb8. At runtime, one array at a time is decompressed to RAM at $d700 - $d7bf.

Each metatile index is used to access a table of pointers. There are two of these tables, one at $14000 - $141ff and a second at $14200 - $143ff (used only for levels 14, 16 and 17). Each address in these tables is a slot 2 pointer into $14450 - $14d34; this region contains the four name table entries (8 bytes) to use for each metatile.

Level Descriptors

There are 17 pointers, one per level, at $066d6 - $066f7 within the v1 ROM. These point into $066f8 - $067c3, where there is a 12 byte descriptor for each level. Each descriptor contains the following information:

OffsetLengthContents
01 byteBank number containing the level layout data (Always $86) [2]
12 bytesSlot 2 pointer into the level layout data
32 bytesA second slot 2 pointer into the level layout data
55 bytesUnknown
102 bytesSlot 2 address of metatile name table entry pointer table

ROM Map

This table summarises the contents of the Alex Kidd in Miracle World [v1] ROM (Size: 128KB; CRC32: aed9aac4):

Address RangeContents
$00000 - $0bfffUnknown
$0c000 - $0c47f4bpp Uncompressed Tiles: Boxes
$0c480 - $0c4a1Level Main Tile Set Pointer Table
$0c4a2 - $0c5824bpp Compressed Tiles: Bag of Gold Coins, Cloud
$0c583 - $0c9e04bpp Compressed Tiles: Additional Set for Levels 1, 3, 5, 9, 16 and 17
$0c9e1 - $0ce644bpp Compressed Tiles: Additional Set for Levels 2, 6, 8, 10, 12, 13 and 15
$0ce65 - $0cecd4bpp Compressed Tiles: Additional Set for Levels 2, 5, 9 and 13
$0cece - $0d1574bpp Compressed Tiles: Main Set for Levels 1, 5 and 9
$0d158 - $0d3164bpp Compressed Tiles: Main Set for Levels 2, 10, 13 and 15 (Also used for levels 6 & 12)
$0d317 - $0d5694bpp Compressed Tiles: Main Set for Level 3 (Also used for level 17)
$0d56a - $0db814bpp Compressed Tiles: Main Set for Level 4
$0db82 - $0df1c4bpp Compressed Tiles: Main Set for Levels 6 and 12
$0df1d - $0e24b4bpp Compressed Tiles: Main Set for Level 7
$0e24c - $0ea044bpp Compressed Tiles: Main Set for Level 8
$0ea05 - $0ee324bpp Compressed Tiles: Main Set for Level 11 (Also used for level 14)
$0ee33 - $0f1164bpp Compressed Tiles: Main Set for Level 16
$0f117 - $0f49a4bpp Compressed Tiles: Main Set for Level 17
$0f49b - $0f75b4bpp Compressed Tiles: Main Set for Level 14
$0f75c - $0f7f54bpp Compressed Tiles: Additional Set for Level 17
$0f7f6 - $0f8954bpp Uncompressed Tiles: Additional Set for Levels 1, 3 and 5
$0f896 - $0f9694bpp Compressed Tiles: Additional Set for Levels 3, 5 and 9
$0f96a - $0fc67Ending Sequence Text Data
$0fc68Unused
$0fc69 - $0ffdb4bpp Compressed Tiles: Alex Kidd Eating Rice Ball
$0ffdc - $0ffffUnused
$10000 - $1005fAlex Kidd Frame Description Pointers
$10060 - $10340Alex Kidd Frame Descriptions (Including pointers to tiles) [3]
$10341 - $118e83bpp Uncompressed Tiles: Alex Kidd
$118e9 - $11bb44bpp Compressed Tiles: Janken Match
$11bb5 - $11e664bpp Compressed Tiles: Stone Head
$11e67 - $120a74bpp Compressed Tiles: Scissors Head
$120a8 - $123564bpp Compressed Tiles: Paper Head
$12357 - $12ac14bpp Compressed Tiles: Janken the Great
$12ac2 - $12d9dJanken the Great Petrifaction Data
$12d9e - $13331Uncompressed Name Table Entries: Title Screen
$13332 - $13eda4bpp Compressed Tiles: Title Screen
$13edb - $13fba1bpp Uncompressed Tiles: Sega Mark III Logo
$13fbb - $13fffUnused
$14000 - $143ffMetatile Name Table Entry Pointer Tables
$14400 - $1441fUncompressed Name Table Entries: Empty Octopus Pots
$14420 - $1444fUncompressed Name Table Entries: Open Door (Cragg Lake)
$14450 - $14d34Metatile Name Table Entries [4]
$14d35 - $1508dDemo Simulated Input Data
$1508e - $153f2Compressed Name Table Entries: Shop Interior
$153f3 - $157ff4bpp Compressed Tiles: Shop Interior
$15800 - $1583fUncompressed Name Table Entries: Shop Exit Door
$15840 - $159234bpp Compressed Tiles: Shop Exit Door
$15924 - $15ad3Uncompressed Name Table Entries: Hirotta Stone Close-up
$15ad4 - $15e444bpp Compressed Tiles: Hirotta Stone Close-up
$15e45 - $161d4Map Data
$161d5 - $16f104bpp Compressed Tiles: Map
$16f11 - $172b04bpp Uncompressed Tiles: Shop Items, Currency Symbol
$172b1 - $178524bpp Compressed Tiles: ASCII Characters $20 - $5a, ©SEGA
$17853 - $17ed24bpp Uncompressed Tiles: Water, Mud, Level 4 Lava, Level 16 Foam, Level 7 Lava
$17ed3 - $17fffUnused
$18000 - $1bdb8Level Layout Data
$1bdb9 - $1be44Subscreen Item Data
$1be45 - $1bfaaShop Data
$1bfab - $1bfffUnused
$1c000 - $1c0684bpp Compressed Tiles: "Score"
$1c069 - $1f1084bpp Uncompressed Tiles
$1f109 - $1fc9dText Box Data
$1fc9e - $1fe9dLevel Palettes [5]
$1fe9e - $1ff85Uncompressed Name Table Entries
$1ff86 - $1ffffUnused

  1. ^ All address ranges on this page are inclusive.
  2. ^ Bank numbers used by Alex Kidd in Miracle World often have bit 7 set.
  3. ^ There is at least one pointer to every tile in the range $10341 - $118e8, except for those in $108e1 - $109a0 and $115e9 - $11678.
  4. ^ There is an unused zero byte at $1464b.
  5. ^ Each palette contains 32 colours. They are stored in the following level order: 1, 15, 3, 4, 5, 6, 7, 8, 11, 9, 10, 12, 2 & 13, 14, 16, 17.

Researched by Paul Baker




Return to top
0.244s