KD tileinfo

Request patches for Keen Dreams.
Post Reply
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

KD tileinfo

Post by lemm »

I found what really look like 3 tile collision procedures in which ES:BX is set to seg:offs directly coded in the .exe

Procedure #1. Up/down blocking + slopechecking.

1FA5:D36
1fA5:16A2

(1FA5:0 contains the rlew flag, followed by the pointers to the data in the map file, and then the lengths of the huffman compressed headers, so it would make sense that the tileinfo follows shortly thereafter. I suspect that these are the locations of top and bottom blocking planes because I am seeing values from 0 to 11 in these two planes.)

Procedure #2A. Blocking leftwards movement.
ES:BX = 1FA5:11EC. (The updated position of box_left_x is checked)

Procedure #2B. Blocking rightwards movement.
ES:BX = 1FA5:1B58. (The updated position of box_right_x is checked)

All of these offsets are $4B6 = 1206 bytes apart. ckdtiles shows 67rows*18columns = 1206 tiles. :D


That leaves room for two more 1206-byte planes at 1FA5:3CA and 1FA5:880. Likely, background TimeFlag and AnimFlag

And EXACTLY room for three more 1206-byte planes at 1FA5:200E, :24C4, :297A, before the segment ends. Likely, Anim, Misc and Timeflags.

So it looks like the first plane of tileinfo begins at 1FA5:3CA = $1FE1A. And each plane is $4B6 bytes long.

Now... to figure out what all the different codes mean =).
User avatar
szemigi
Posts: 716
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Post by szemigi »

Nice. :D ^^
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Please tell me, how is this different from the Keen 4-6 tile code, aside from the different plane size? If there aren't any major differences I can have all the tile properties worked out in about half an hour.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

As far as I can tell, it is the same.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

It took me a while to figure a few things out, mainly due to how you worded things and how you found the tiles.

You missed the unmasked tile information (Look at the Keen 4-6 tileinfo format CK Guy wrote up.) I put it here: http://www.shikadi.net/moddingwiki/Keen ... nfo_Format

Umasked tile data starts at $1FC46, right after the maphead data (2 bytes magic word, 400 bytes header pointers 100 bytes header size.) It consists of the two unmasked planes of 1440 tiles (2880 in total) followed by the masked data, seven planes of 1206 tiles (8442 bytes total.)

I'm not sure about the plane order of the last three masked planes though, I think they may be different.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

Oh right there are 1440 unmasked tiles. Sorry about that.

I was going by the wording on the Ck456Tli readme.
Post Reply