Updates:

Fans are welcome!

Time to "compile" a list of all the data in the Labyrinth mode

Started by Jigglysaint, March 28, 2010, 03:51:00 PM

Previous topic - Next topic

Jigglysaint

See what I did there?  Anyway, since somebody has figured out pretty much all the corridor information, I figured that I should get to work in describing the Labyrinth mode data because somebody beats me to it.

So to start off with, at $14A7E is the start of the game's map data.  The structure is variable length, with the first byte being the control code.  The first nybble of the first byte controls what type of room it is.  Here a list of what each bit does:

00 - empty room(except for possible enemies)
10 - adds pointer, which is read after enemy index or item index, if present, is defined
20 - adds item index after enemy index(if present)
40 - miniboss room, adds item index which becomes miniboss index
70 - used when you want to have a room with chips.  Prevents them from comming back unless you refresh the area
80 - indicates a room or corridor

The second nybble is the length of the room.  The greater the length, the more the room contains:

02 - contains only the basic map definitions such as exit directions/key usage, and area index
03 - like 02 but with enemies, or miniboss room with item/boss index
04 - room contains pointeres to level data
05 - room contains pointers to level data + enemies
06 - room contains item index + enemies + level data

For interior rooms, 82 is used for corridors and password rooms.  A3 is used for shops and info rooms.  In either case, adding 80 to the room type will transform it into a corridor from 00 to 127.

More to come...

Grimgrin

Currently extending the game.

optomon

14A7E is a number I'll never forget...

0x16392: Items in the item index; the earlier numbers in the list correspond to items awarded after miniboss fights.
0x164D7: This looks like the pointer table that tells you what enemies will appear based on the maps enemy #.
0x1669E: Which miniboss will appear based on the map miniboss #; following this table is another one with boss pointers and values that correspond to the numbers in the miniboss table.

Jigglysaint

I take it you've tried to decode the data before, right?  The data's not that hard to figure out, but it's hard because there's only so much space and even one screen with enemies takes up 4 bytes.  Perhaps this is why the game was critticized for being repetitive.

$15210 - room template data.  Each byte represents 8 tiles on the screen.  Note that this data overlaps with the actual level data, and that some template indexes actually reference this level data...incorrectly.  If the actual level data was moved, there would be more room for indexes.

Level data itself has no proper start address, and can technically be stored anywhere in the bank.  Base data is 2 bytes, one template index and it's tile type.  The game can use up to 32 indexes, or $1F.  How it works is that the basic index is from $00 to $1F, and for every $20 you add to that value, the game reads a three byte object.  For example, $20 to $3F adds one object to the screen.  $40 to $5F reads 2 objects, and so forth.  Each object has a tile type, a location on screen, and it's direction/quantity.  How that works is that the first six bits tell if the tile is on or off.  Each object can be six tiles long, and each bit represents the individual tile switched on or not.  The last 2 bits determine direction.  There is horizontal, vertical, diagonally up and diagonally down.  $C1 tends to be used for single tiles such as item pods since it matches up properly with it's on screen co-ordinates(so $C1 is akin to telling the game to just the x/y in the previous byte).

Jigglysaint

Okay I've figured out the labyrinth exterior template data.

At $167C0 are pointers to the area's floor data.  The first byte is #05, and it's a length control byte.  The second byte is the X/Y location on the screen.  Since this is the floor data, it's set to zero.  After that is the metatile structure size.  For floor data, it means repeating tiles.  After those two bytes is the byte(s) of the tiles to use for the floor structure.

For walls and such, the pointers start at $167FA, and it's grouped into different metatile structures.  There are 4 for the 4 corners of the room, and 4 for the walls.  I assume that based on what bits are set in the map data, it will turn on and off the 4 wall structures.