<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Akapype</id>
	<title>ModdingWiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Akapype"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/Akapype"/>
	<updated>2026-05-14T05:01:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=2440</id>
		<title>Jill of the Jungle Map Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=2440"/>
		<updated>2009-02-06T13:22:37Z</updated>

		<summary type="html">&lt;p&gt;Akapype: /* Object layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Jill of the Jungle map format&#039;&#039;&#039; is the format used to describe the levels played during the game.  The maps contain two layers - a background layer and an &amp;quot;object&amp;quot; layer.  The background layer is a grid of 16x16 pixel tiles, 128 tiles wide and 64 tiles high.  The object layer is made up of an arbitrary list of objects, with X and Y offsets in pixels.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The main map file starts off with the background layer, then immediately following it is the foreground layer.&lt;br /&gt;
&lt;br /&gt;
=== Background layer ===&lt;br /&gt;
&lt;br /&gt;
The background layer is quite simple.  It is an array of 8,192 16-bit values (128 tiles wide by 64 tiles high == 8192 tiles total.)  Each 16-bit value is a code, such as 0xC0D3.  The formula &amp;lt;b&amp;gt;((x * MAP_HEIGHT) + y) * 2&amp;lt;/b&amp;gt; (where MAP_HEIGHT is 64) will provide the offset (in bytes) into the map file where that grid&#039;s 16-bit code is located.&lt;br /&gt;
&lt;br /&gt;
Once the code is found, its lower three nybbles are isolated (e.g. &amp;lt;b&amp;gt;code &amp;amp; 0xFFF&amp;lt;/b&amp;gt;) which provides an ID that is listed in the tile mapping table (see below.)  The tile mapping table then provides an index into the graphics file for the image that should be displayed at that grid location.&lt;br /&gt;
&lt;br /&gt;
For example, if the 16-bit code is 0xC0D3, then isolating the lower three nybbles will provide the number 0x00D3.  At the entry for ID 0x00D3 in the tile mapping table, the value might be 0x1234.  This means that in the graphics file, tileset number 0x12 should be accessed, and tile number 0x34 within that tileset should be drawn at the grid coordinate.  Note that tilesets seem to start from one (not zero) so you may need to subtract one from the tileset value to get the correct tile.&lt;br /&gt;
&lt;br /&gt;
It is also important to note that these values are stored little-endian, like the [[SHA Format|SHA format]]. This means that for example the value 0xC0D3 is stored as the two bytes D3-C0, not as C0-D3.&lt;br /&gt;
&lt;br /&gt;
==== Tile mapping table ====&lt;br /&gt;
&lt;br /&gt;
There is a separate file in the game directory that contains mappings between tile codes in the background layer and the game&#039;s graphics.  In [[Jill of the Jungle]] this is called &amp;lt;tt&amp;gt;JILL.DMA&amp;lt;/tt&amp;gt; and in [[Xargon]] it is &amp;lt;tt&amp;gt;TILES.XR&amp;lt;i&amp;gt;x&amp;lt;/i&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This file is arranged as an array of entries, one after the other.  Each entry is in the following format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iMapCode||ID used in map file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iTileset||Index of tileset containing this tile&#039;s image&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iTile||Index into the tileset&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iFlags||Flags for this tile (can stand on, can hurt player, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iLength||Length of tile name&lt;br /&gt;
|-&lt;br /&gt;
|char cName[iLength]||&amp;lt;tt&amp;gt;iLength&amp;lt;/tt&amp;gt; characters for the tile name.  This string is &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; NULL-terminated.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* iTileset seems to contain some larger values too.  It is usually constrained for this reason (e.g. safe value = iTileset &amp;amp; 0x3F)&lt;br /&gt;
* iTileset seems to use 1 as the first tileset (not 0 as you might expect.)  This means you may have to subtract one to get the correct index to the tileset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;iFlags&amp;lt;/tt&amp;gt; is broken up as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Bit!!Hex!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
||-||0x0000||&amp;lt;i&amp;gt;&amp;lt;zero&amp;gt;&amp;lt;/i&amp;gt;||Default solid block&lt;br /&gt;
|-&lt;br /&gt;
|1||0x0001||F_PLAYERTHRU||Blocks you can walk, jump or fall through (background tiles, the path on the overhead map, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|2||0x0002||F_STAIR, F_NOTSTAIR (Xargon)||Blocks that you can stand on (can also jump up through when combined with F_PLAYERTHRU)&lt;br /&gt;
|-&lt;br /&gt;
|3||0x0004||F_VINE, F_NOTVINE (Xargon)||Can climb this block - usually combined with F_PLAYERTHRU (giving 0x0005)&lt;br /&gt;
|-&lt;br /&gt;
|4||0x0008||F_MSGTOUCH||Activates game-specific code when touched&lt;br /&gt;
|-&lt;br /&gt;
|5||0x0010||F_MSGDRAW|| Regular blocks have just one shape, f_msgdraw triggers &amp;lt;tt&amp;gt;msg_block(msg_draw)&amp;lt;/tt&amp;gt; for animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|6||0x0020||F_MSGUPDATE|| game-specific code (through &amp;lt;tt&amp;gt;msg_block(msg_update)&amp;lt;/tt&amp;gt;) at every frame. For animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|7||0x0040||F_INSIDE||This block contains text inside it&lt;br /&gt;
|-&lt;br /&gt;
|8||0x0080||F_FRONT|| object property : Foreground object&lt;br /&gt;
|-&lt;br /&gt;
|9||0x0100||F_TRIGGER||Unknown&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_BACK || object property: Background object (e.g. torches)&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_TINYTHRU|| (likely PlayerThru when player is in &#039;mini&#039; mode, unused in Xargon)&lt;br /&gt;
|-&lt;br /&gt;
|11||0x0400||F_ALWAYS|| object property : &amp;quot;Always updates object&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|12||0x0800||F_KILLABLE|| object property : monster can be killed with regular weapon.&lt;br /&gt;
|-&lt;br /&gt;
|13||0x1000||F_FIREBALL|| object property : object is a fireball&lt;br /&gt;
|-&lt;br /&gt;
|14||0x2000||F_WATER|| A water tile. regular player will sink, the S.U.B. and aquatic monster can swim through it, but not out of it&lt;br /&gt;
|-&lt;br /&gt;
|14||0x4000||F_NOT_WATER|| (Xargon) Not a water tile.&lt;br /&gt;
|-&lt;br /&gt;
|15||0x4000||F_WEAPON|| object property : object is a regular weapon&lt;br /&gt;
|-&lt;br /&gt;
|16||0x8000||(unused)||(unused)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the same &amp;quot;flag set&amp;quot; is used for both blocks and objects. Some properties only apply to blocks, some only apply to objects, some to both (&amp;lt;tt&amp;gt;f_msgtouch&amp;lt;/tt&amp;gt;), and some flags have a different meaning for blocks and tile (e.g. 0x200 and 0x2000).&lt;br /&gt;
&lt;br /&gt;
=== Object layer ===&lt;br /&gt;
&lt;br /&gt;
The object layer is drawn in front of the background layer, and contains all the interactive elements of the map, such as points and enemies.&lt;br /&gt;
&lt;br /&gt;
The object data starts straight after the background layer data, so that&#039;s at offset 16,384 bytes into the map file (8,192 tiles * two bytes per tile.)  The first two bytes in the object layer are a 16-bit integer ([[UINT16LE]]) that stores the number of objects in the map, and this is followed by the data for each object, one after the other.&lt;br /&gt;
&lt;br /&gt;
Each object is 31 bytes long, and is stored in the following structure:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iType||Object type (e.g. a &amp;quot;point item&amp;quot;, or an enemy.)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iX||X-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iY||Y-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iXD|| object horizontal speed&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iYD|| object vertical speed&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iWidth||Width of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iHeight||Height of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iState||Object sub-type (e.g. what type of &amp;quot;point item&amp;quot;), or current &amp;quot;State&amp;quot; (running, jumping, etc)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iSubState||&amp;lt;i&amp;gt;object-specific semantic&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iStateCount||&amp;lt;i&amp;gt;object-specific semantic, typically a frame counter&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iCounter||Various uses. Often used to link doors or switches to obstacles.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iFlags|| internally used for rendering.&lt;br /&gt;
|-&lt;br /&gt;
|UINT32 lPointer||Used internally. This is to keep a spot in memory during the game&#039;s execution and serves no other purpose.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iInfo1||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iZapHold||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At the present time it is assumed (perhaps hoped) that objects can be mapped to images in the same way as the tiles in the background layer can be mapped to images, but as yet there is no known way of doing this.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]].  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Jill of the Jungle]]&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Map Files]]&lt;/div&gt;</summary>
		<author><name>Akapype</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=2439</id>
		<title>Jill of the Jungle Map Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=2439"/>
		<updated>2009-02-06T13:09:31Z</updated>

		<summary type="html">&lt;p&gt;Akapype: /* Tile mapping table */ fixing formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Jill of the Jungle map format&#039;&#039;&#039; is the format used to describe the levels played during the game.  The maps contain two layers - a background layer and an &amp;quot;object&amp;quot; layer.  The background layer is a grid of 16x16 pixel tiles, 128 tiles wide and 64 tiles high.  The object layer is made up of an arbitrary list of objects, with X and Y offsets in pixels.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The main map file starts off with the background layer, then immediately following it is the foreground layer.&lt;br /&gt;
&lt;br /&gt;
=== Background layer ===&lt;br /&gt;
&lt;br /&gt;
The background layer is quite simple.  It is an array of 8,192 16-bit values (128 tiles wide by 64 tiles high == 8192 tiles total.)  Each 16-bit value is a code, such as 0xC0D3.  The formula &amp;lt;b&amp;gt;((x * MAP_HEIGHT) + y) * 2&amp;lt;/b&amp;gt; (where MAP_HEIGHT is 64) will provide the offset (in bytes) into the map file where that grid&#039;s 16-bit code is located.&lt;br /&gt;
&lt;br /&gt;
Once the code is found, its lower three nybbles are isolated (e.g. &amp;lt;b&amp;gt;code &amp;amp; 0xFFF&amp;lt;/b&amp;gt;) which provides an ID that is listed in the tile mapping table (see below.)  The tile mapping table then provides an index into the graphics file for the image that should be displayed at that grid location.&lt;br /&gt;
&lt;br /&gt;
For example, if the 16-bit code is 0xC0D3, then isolating the lower three nybbles will provide the number 0x00D3.  At the entry for ID 0x00D3 in the tile mapping table, the value might be 0x1234.  This means that in the graphics file, tileset number 0x12 should be accessed, and tile number 0x34 within that tileset should be drawn at the grid coordinate.  Note that tilesets seem to start from one (not zero) so you may need to subtract one from the tileset value to get the correct tile.&lt;br /&gt;
&lt;br /&gt;
It is also important to note that these values are stored little-endian, like the [[SHA Format|SHA format]]. This means that for example the value 0xC0D3 is stored as the two bytes D3-C0, not as C0-D3.&lt;br /&gt;
&lt;br /&gt;
==== Tile mapping table ====&lt;br /&gt;
&lt;br /&gt;
There is a separate file in the game directory that contains mappings between tile codes in the background layer and the game&#039;s graphics.  In [[Jill of the Jungle]] this is called &amp;lt;tt&amp;gt;JILL.DMA&amp;lt;/tt&amp;gt; and in [[Xargon]] it is &amp;lt;tt&amp;gt;TILES.XR&amp;lt;i&amp;gt;x&amp;lt;/i&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This file is arranged as an array of entries, one after the other.  Each entry is in the following format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iMapCode||ID used in map file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iTileset||Index of tileset containing this tile&#039;s image&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iTile||Index into the tileset&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iFlags||Flags for this tile (can stand on, can hurt player, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iLength||Length of tile name&lt;br /&gt;
|-&lt;br /&gt;
|char cName[iLength]||&amp;lt;tt&amp;gt;iLength&amp;lt;/tt&amp;gt; characters for the tile name.  This string is &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; NULL-terminated.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* iTileset seems to contain some larger values too.  It is usually constrained for this reason (e.g. safe value = iTileset &amp;amp; 0x3F)&lt;br /&gt;
* iTileset seems to use 1 as the first tileset (not 0 as you might expect.)  This means you may have to subtract one to get the correct index to the tileset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;iFlags&amp;lt;/tt&amp;gt; is broken up as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Bit!!Hex!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
||-||0x0000||&amp;lt;i&amp;gt;&amp;lt;zero&amp;gt;&amp;lt;/i&amp;gt;||Default solid block&lt;br /&gt;
|-&lt;br /&gt;
|1||0x0001||F_PLAYERTHRU||Blocks you can walk, jump or fall through (background tiles, the path on the overhead map, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|2||0x0002||F_STAIR, F_NOTSTAIR (Xargon)||Blocks that you can stand on (can also jump up through when combined with F_PLAYERTHRU)&lt;br /&gt;
|-&lt;br /&gt;
|3||0x0004||F_VINE, F_NOTVINE (Xargon)||Can climb this block - usually combined with F_PLAYERTHRU (giving 0x0005)&lt;br /&gt;
|-&lt;br /&gt;
|4||0x0008||F_MSGTOUCH||Activates game-specific code when touched&lt;br /&gt;
|-&lt;br /&gt;
|5||0x0010||F_MSGDRAW|| Regular blocks have just one shape, f_msgdraw triggers &amp;lt;tt&amp;gt;msg_block(msg_draw)&amp;lt;/tt&amp;gt; for animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|6||0x0020||F_MSGUPDATE|| game-specific code (through &amp;lt;tt&amp;gt;msg_block(msg_update)&amp;lt;/tt&amp;gt;) at every frame. For animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|7||0x0040||F_INSIDE||This block contains text inside it&lt;br /&gt;
|-&lt;br /&gt;
|8||0x0080||F_FRONT|| object property : Foreground object&lt;br /&gt;
|-&lt;br /&gt;
|9||0x0100||F_TRIGGER||Unknown&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_BACK || object property: Background object (e.g. torches)&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_TINYTHRU|| (likely PlayerThru when player is in &#039;mini&#039; mode, unused in Xargon)&lt;br /&gt;
|-&lt;br /&gt;
|11||0x0400||F_ALWAYS|| object property : &amp;quot;Always updates object&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|12||0x0800||F_KILLABLE|| object property : monster can be killed with regular weapon.&lt;br /&gt;
|-&lt;br /&gt;
|13||0x1000||F_FIREBALL|| object property : object is a fireball&lt;br /&gt;
|-&lt;br /&gt;
|14||0x2000||F_WATER|| A water tile. regular player will sink, the S.U.B. and aquatic monster can swim through it, but not out of it&lt;br /&gt;
|-&lt;br /&gt;
|14||0x4000||F_NOT_WATER|| (Xargon) Not a water tile.&lt;br /&gt;
|-&lt;br /&gt;
|15||0x4000||F_WEAPON|| object property : object is a regular weapon&lt;br /&gt;
|-&lt;br /&gt;
|16||0x8000||(unused)||(unused)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the same &amp;quot;flag set&amp;quot; is used for both blocks and objects. Some properties only apply to blocks, some only apply to objects, some to both (&amp;lt;tt&amp;gt;f_msgtouch&amp;lt;/tt&amp;gt;), and some flags have a different meaning for blocks and tile (e.g. 0x200 and 0x2000).&lt;br /&gt;
&lt;br /&gt;
=== Object layer ===&lt;br /&gt;
&lt;br /&gt;
The object layer is drawn in front of the background layer, and contains all the interactive elements of the map, such as points and enemies.&lt;br /&gt;
&lt;br /&gt;
The object data starts straight after the background layer data, so that&#039;s at offset 16,384 bytes into the map file (8,192 tiles * two bytes per tile.)  The first two bytes in the object layer are a 16-bit integer ([[UINT16LE]]) that stores the number of objects in the map, and this is followed by the data for each object, one after the other.&lt;br /&gt;
&lt;br /&gt;
Each object is 31 bytes long, and is stored in the following structure:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iType||Object type (e.g. a &amp;quot;point item&amp;quot;, or an enemy.)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iX||X-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iY||Y-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iXD||&amp;lt;i&amp;gt;(Unknown)&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iYD||&amp;lt;i&amp;gt;(Unknown)&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iWidth||Width of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iHeight||Height of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iState||Object sub-type (e.g. what type of &amp;quot;point item&amp;quot;), or current &amp;quot;State&amp;quot; (running, jumping, etc)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iSubState||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iStateCount||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iCounter||Various uses. Often used to link doors or switches to obstacles.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iFlags||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT32 lPointer||Used internally. This is to keep a spot in memory during the game&#039;s execution and serves no other purpose.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iInfo1||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iZapHold||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At the present time it is assumed (perhaps hoped) that objects can be mapped to images in the same way as the tiles in the background layer can be mapped to images, but as yet there is no known way of doing this.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]].  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Jill of the Jungle]]&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Map Files]]&lt;/div&gt;</summary>
		<author><name>Akapype</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=2438</id>
		<title>Jill of the Jungle Map Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=2438"/>
		<updated>2009-02-06T13:05:16Z</updated>

		<summary type="html">&lt;p&gt;Akapype: /* Tile mapping table */ adding information from INCLUDE/XARGON.H&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Jill of the Jungle map format&#039;&#039;&#039; is the format used to describe the levels played during the game.  The maps contain two layers - a background layer and an &amp;quot;object&amp;quot; layer.  The background layer is a grid of 16x16 pixel tiles, 128 tiles wide and 64 tiles high.  The object layer is made up of an arbitrary list of objects, with X and Y offsets in pixels.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The main map file starts off with the background layer, then immediately following it is the foreground layer.&lt;br /&gt;
&lt;br /&gt;
=== Background layer ===&lt;br /&gt;
&lt;br /&gt;
The background layer is quite simple.  It is an array of 8,192 16-bit values (128 tiles wide by 64 tiles high == 8192 tiles total.)  Each 16-bit value is a code, such as 0xC0D3.  The formula &amp;lt;b&amp;gt;((x * MAP_HEIGHT) + y) * 2&amp;lt;/b&amp;gt; (where MAP_HEIGHT is 64) will provide the offset (in bytes) into the map file where that grid&#039;s 16-bit code is located.&lt;br /&gt;
&lt;br /&gt;
Once the code is found, its lower three nybbles are isolated (e.g. &amp;lt;b&amp;gt;code &amp;amp; 0xFFF&amp;lt;/b&amp;gt;) which provides an ID that is listed in the tile mapping table (see below.)  The tile mapping table then provides an index into the graphics file for the image that should be displayed at that grid location.&lt;br /&gt;
&lt;br /&gt;
For example, if the 16-bit code is 0xC0D3, then isolating the lower three nybbles will provide the number 0x00D3.  At the entry for ID 0x00D3 in the tile mapping table, the value might be 0x1234.  This means that in the graphics file, tileset number 0x12 should be accessed, and tile number 0x34 within that tileset should be drawn at the grid coordinate.  Note that tilesets seem to start from one (not zero) so you may need to subtract one from the tileset value to get the correct tile.&lt;br /&gt;
&lt;br /&gt;
It is also important to note that these values are stored little-endian, like the [[SHA Format|SHA format]]. This means that for example the value 0xC0D3 is stored as the two bytes D3-C0, not as C0-D3.&lt;br /&gt;
&lt;br /&gt;
==== Tile mapping table ====&lt;br /&gt;
&lt;br /&gt;
There is a separate file in the game directory that contains mappings between tile codes in the background layer and the game&#039;s graphics.  In [[Jill of the Jungle]] this is called &amp;lt;tt&amp;gt;JILL.DMA&amp;lt;/tt&amp;gt; and in [[Xargon]] it is &amp;lt;tt&amp;gt;TILES.XR&amp;lt;i&amp;gt;x&amp;lt;/i&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This file is arranged as an array of entries, one after the other.  Each entry is in the following format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iMapCode||ID used in map file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iTileset||Index of tileset containing this tile&#039;s image&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iTile||Index into the tileset&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iFlags||Flags for this tile (can stand on, can hurt player, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iLength||Length of tile name&lt;br /&gt;
|-&lt;br /&gt;
|char cName[iLength]||&amp;lt;tt&amp;gt;iLength&amp;lt;/tt&amp;gt; characters for the tile name.  This string is &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; NULL-terminated.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* iTileset seems to contain some larger values too.  It is usually constrained for this reason (e.g. safe value = iTileset &amp;amp; 0x3F)&lt;br /&gt;
* iTileset seems to use 1 as the first tileset (not 0 as you might expect.)  This means you may have to subtract one to get the correct index to the tileset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;iFlags&amp;lt;/tt&amp;gt; is broken up as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Bit!!Hex!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
||-||0x0000||&amp;lt;i&amp;gt;&amp;lt;zero&amp;gt;&amp;lt;/i&amp;gt;||Default solid block&lt;br /&gt;
|-&lt;br /&gt;
|1||0x0001||F_PLAYERTHRU||Blocks you can walk, jump or fall through (background tiles, the path on the overhead map, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|2||0x0002||F_STAIR, F_NOTSTAIR (Xargon)||Blocks that you can stand on (can also jump up through when combined with F_PLAYERTHRU)&lt;br /&gt;
|-&lt;br /&gt;
|3||0x0004||F_VINE, F_NOTVINE (Xargon)||Can climb this block - usually combined with F_PLAYERTHRU (giving 0x0005)&lt;br /&gt;
|-&lt;br /&gt;
|4||0x0008||F_MSGTOUCH||Activates game-specific code when touched&lt;br /&gt;
|-&lt;br /&gt;
|5||0x0010||F_MSGDRAW|| Regular blocks have just one shape, f_msgdraw triggers =msg_block(msg_draw)= for animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|6||0x0020||F_MSGUPDATE|| game-specific code (through =msg_block(msg_update)=) at every frame. For animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|7||0x0040||F_INSIDE||This block contains text inside it&lt;br /&gt;
|-&lt;br /&gt;
|8||0x0080||F_FRONT|| object property : Foreground object&lt;br /&gt;
|-&lt;br /&gt;
|9||0x0100||F_TRIGGER||Unknown&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_BACK || object property: Background object (e.g. torches)&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_TINYTHRU|| (likely PlayerThru when player is in &#039;mini&#039; mode, unused in Xargon)&lt;br /&gt;
|-&lt;br /&gt;
|11||0x0400||F_ALWAYS|| object property : &amp;quot;Always updates object&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|12||0x0800||F_KILLABLE|| object property : monster can be killed with regular weapon.&lt;br /&gt;
|-&lt;br /&gt;
|13||0x1000||F_FIREBALL|| object property : object is a fireball&lt;br /&gt;
|-&lt;br /&gt;
|14||0x2000||F_WATER|| A water tile. regular player will sink, the S.U.B. and aquatic monster can swim through it, but not out of it&lt;br /&gt;
|-&lt;br /&gt;
|14||0x4000||F_NOT_WATER|| (Xargon) Not a water tile.&lt;br /&gt;
|15||0x4000||F_WEAPON|| object property : object is a laser bullet&lt;br /&gt;
|-&lt;br /&gt;
|16||0x8000||(unused)||(unused)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Object layer ===&lt;br /&gt;
&lt;br /&gt;
The object layer is drawn in front of the background layer, and contains all the interactive elements of the map, such as points and enemies.&lt;br /&gt;
&lt;br /&gt;
The object data starts straight after the background layer data, so that&#039;s at offset 16,384 bytes into the map file (8,192 tiles * two bytes per tile.)  The first two bytes in the object layer are a 16-bit integer ([[UINT16LE]]) that stores the number of objects in the map, and this is followed by the data for each object, one after the other.&lt;br /&gt;
&lt;br /&gt;
Each object is 31 bytes long, and is stored in the following structure:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iType||Object type (e.g. a &amp;quot;point item&amp;quot;, or an enemy.)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iX||X-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iY||Y-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iXD||&amp;lt;i&amp;gt;(Unknown)&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iYD||&amp;lt;i&amp;gt;(Unknown)&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iWidth||Width of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iHeight||Height of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iState||Object sub-type (e.g. what type of &amp;quot;point item&amp;quot;), or current &amp;quot;State&amp;quot; (running, jumping, etc)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iSubState||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iStateCount||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iCounter||Various uses. Often used to link doors or switches to obstacles.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iFlags||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT32 lPointer||Used internally. This is to keep a spot in memory during the game&#039;s execution and serves no other purpose.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iInfo1||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iZapHold||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At the present time it is assumed (perhaps hoped) that objects can be mapped to images in the same way as the tiles in the background layer can be mapped to images, but as yet there is no known way of doing this.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]].  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Jill of the Jungle]]&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Map Files]]&lt;/div&gt;</summary>
		<author><name>Akapype</name></author>
	</entry>
</feed>