Author of this documentation: kentaro.k-21
It will be simple to read.
I took the 1st raw data from dm2 amiga graphics.dat.
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF
————————————————————————-
0000000 80 01 27 3D 00 07 54 01 49 01 44 01 53 01 46 01 ..’=..T.I.D.S.F.
0000010 47 01 50 02 00 00 08 00 00 00 00 01 00 00 0B 00 G.P………….
0000020 00 00 00 2B 00 01 00 00 00 FE 00 02 01 00 04 00 …+…………
0000030 00 00 00 F3 01 00 05 06 10 00 00 F8 01 00 05 06 …………….
The 1st highlighted word value (27 3D) represents how many entries exist in this binary.
Read this value as a big endian word value even if the target platform is oriented in little endian.
In this case, the value is obtained with expression 0x27 * 256 + 0x3D.
It is 10045. There are 10045 entries in dm2 amiga graphics.dat.
The offset of 1st entry begins at 0x00000014.
Each entry has 8 bytes long.
Next table shows known spec information with 1st entry00000014: 00 00 08 00 00 00 00 01
Position | Binary | Known meaning |
---|---|---|
1st byte | 00 | Main Category. One of following values. 0x00: Unknown 0x01: Unknown (for Graphical Interface?) 0x02: No applicable data 0x03: Unknown (Text message in scrolls and message board?) 0x04: No applicable data 0x05: Unknown 0x06: Unknown 0x07: Unknown (for Graphical Interface in inventory window?) 0x08: Unknown (for wall and tile images?) 0x09: Unknown (for Wall Graphics used in dungeon.dat?) 0x0A: Unknown (for Pad Graphics used in dungeon.dat?) 0x0B: Unknown (for Ornate Graphics used in dungeon.dat?) 0x0C: Unknown 0x0D: Unknown (for magical effect images?) 0x0E: Door entry 0x0F: Creature entry 0x10: Weapon entry 0x11: Cloth entry 0x12: Scroll entry 0x13: Potion entry 0x14: Chest entry (contains magical minion maps) 0x15: Miscellaneous item entry 0x16: Hero entry 0x17: Unknown (for weather images?) 0x18: Unknown 0x19: No applicable data 0x1A: Dialogue Interface |
2nd byte | 00 | Data index in Main Category. |
3rd byte | 08 | Data representation. One of following values. 0x01: Images 0x05: Text Other: Unknown |
4th byte | 00 | Depending on what kind of “Data representation”. |
5th byte | 00 | Depending on what kind of “Data representation”. |
6th byte | 00 | Depending on what kind of “Data representation”. |
7th and 8th byte | 00 01 | This entry may store the binary index in graphics.dat to represent data. *If this represents the binary index, it is always stored in big endian format. Depending on what kind of “Data representation”. 0x01: The value indicates an index to stored image. 0x05: The value indicates an index to stored text. Other: Unknown |
This is a sample for image entry.0001313C: 1A 00 01 00 00 FF 00 11
Position | Binary | Meaning |
---|---|---|
1st byte | 1A | Main Category. |
2nd byte | 00 | Index in Main Category. |
3rd byte | 01 | It represents an image. |
4th byte | 00 | - |
5th byte | 00 | - |
6th byte | FE | - |
7th and 8th byte | 00 11 | 0x00 * 256 + 0x11 = 17. 17th raw data (0 based index) has an image for this entry. |
This is a sample for text entry.0001315C: 1A 00 05 14 10 FF 00 12
Position | Binary | Meaning |
---|---|---|
1st byte | 1A | Main Category. |
2nd byte | 00 | Index in Main Category. |
3rd byte | 05 | It represents a text. |
4th byte | 14 | - |
5th byte | 10 | - |
6th byte | FF | - |
7th and 8th byte | 00 12 | 0x00 * 256 + 0x12 = 18. 18th raw data (0 based index) has a text for this entry. |
This is a binary dump of DM2 PC specific image to be described.
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF
------------------------------------------------------------------------
0000000 0C 00 07 7C 00 00 03 00 BD 0A 22 00 27 2A 2A 27 ...|......".'**'
0000010 44 01 27 EF 2A 2D 2D 2A 44 01 2A 3B 3F CF 3F 3B D.'.*--*D.*;?.?;
0000020 2A 27 41 01 C0 02 2D 3B 9F 3F 2D 27 00 00 01 03 *'A...-;.?-'....
0000030 A0 01 2D 10 41 06 C3 01 A5 07 81 03 27 00 09 ?? ..-.A.......'..
It is 1620th binary (0 based index) in DM2 PC GRAPHICS.DAT, and is the compressed image of Blue gem.
The DM2 PC specific compressed image has 8 bytes for prefix and sequent bytes for body of compressed image. It has no suffix.
Part | Heading hexa binary |
---|---|
Prefix | 0C 00 07 **7C** 00 00 03 00 |
Body | BD 0A 22 00 27 2A 2A 27 44 01 27 EF 2A 2D 2D 2A 44... |
The 4th byte in Prefix is highlighted. It may be used to know that this image is formatted in DM2 PC specific image.
Majority images has 4th byte fixed in 0x7C.
There are command control byte and sequent 8 primitives in a set.
Command control byte |
---|
If 1st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
If 2st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
If 3st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
If 4st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
If 5st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
If 6st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
If 7st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
If 8st bit is set in command control byte, here is a pixel(1 byte), otherwise here is repetition command(2 bytes) |
Command control byte |
… |
A pixel is represented in 1 byte and is a 8-bit indexed palette in DM2.
It renders only 1 pixel per pixel command.
This command is to copy pixels from previous rendered pixels. It has 2 following scalar factors
It is always consisted with 2 bytes.
First byte is variant against each image prefix. They will be grouped in ‘Type’.
Type | Format of 1st byte (from MSB to LSB) |
---|---|
Type 2 | XXXXyyyy (leading 4 bits for X, sequent 4 bits for Y) |
Type 3 | XXXyyyyy (leading 3 bits for X, sequent 5 bits for Y) |
X and Y are defined for expression.
Second byte is a unsigned byte value and defined as B for expression.
negative_offset and copy_length are figured out as next table shows.
Type | Expression |
---|---|
Type 2 | negative_offset = X + (16 * B) copy_length = Y + 3 |
Type 3 | negative_offset = X + (8 * B) copy_length = Y + 3 |
This is prefix part of the image: 0C 00 07 7C 00 00 03 00
The 7th byte, the highlighted part shows the Type of decompression factor.
If it is 02, it is Type2 factor applied compressed image.
If it is 03, it is Type3 factor applied compressed image.
Here is reading sample for the 1620th compressed image.
This is Type3 factor applied compressed image.
Index in c.c.b. | Binary | Reading |
---|---|---|
BD | Command control byte.bit array is 1011 1101 | |
1st | 0A | Pixel 0A |
2nd | 22 00 | Repetition command. negative_offset is (1 + 8 * 0) = 1 copy_length is (3 + 2) = 5 Pixels are 0A 0A 0A 0A 0A |
3rd | 27 | Pixel 27 |
4th | 2A | Pixel 2A |
5th | 2A | Pixel 2A |
6th | 27 | Pixel 27 |
7th | 44 01 | Repetition command. negative_offset is (2 + 8 * 1) = 10 copy_length is (3 + 4) = 7 Pixels are 0A 0A 0A 0A 0A 0A 27 |
8th | 27 | Pixel 27 |
EF | Command control byte.bit array is 1110 1111 | |
1st | 2A | Pixel 2A |
2nd | 2D | Pixel 2D |
3rd | 2D | Pixel 2D |
4th | 2A | Pixel 2A |
5th | 44 01 | Repetition command. negative_offset is (2 + 8 * 1) = 10 copy_length is (3 + 4) = 7 Pixels are 0A 0A 0A 0A 27 27 2A |
6th | 2A | Pixel 2A |
7th | 3B | Pixel 3B |
8th | 3F | Pixel 3F |
CF | Command control byte.bit array is 1100 1111 | |
1st | 3F | Pixel 3F |
2nd | 3B | Pixel 3B |
3rd | 2A | Pixel 2A |
4th | 27 | Pixel 27 |
5th | 41 01 | Repetition command. negative_offset is (2 + 8 * 1) = 10 copy_length is (3 + 1) = 4 Pixels are 27 27 2A 2A |
6th | C0 02 | Repetition command. negative_offset is (6 + 8 * 2) = 22 copy_length is (3 + 0) = 3 Pixels are 2A 2D 2D |
7th | 2D | Pixel 2D |
8th | 3B | Pixel 3B |
9F | Command control byte.bit array is 1001 1111 | |
1st | 3F | Pixel 3F |
2nd | 2D | Pixel 2D |
3rd | 27 | Pixel 27 |
4th | 00 | Pixel 00 |
5th | 00 | Pixel 00 |
6th | 01 03 | Repetition command. negative_offset is (0 + 8 * 3) = 24 copy_length is (3 + 1) = 4 Pixels are 27 27 2A 2A |
7th | A0 01 | Repetition command. negative_offset is (5 + 8 * 1) = 13 copy_length is (3 + 0) = 3 Pixels are 2D 2D 2D |
8th | 2D | Pixel 2D |
10 | Command control byte.bit array is 0001 0000 | |
1st | 41 06 | Repetition command. negative_offset is (2 + 8 * 6) = 50 copy_length is (3 + 1) = 4 Pixels are 2A 27 0A 0A |
2nd | C3 01 | Repetition command. negative_offset is (6 + 8 * 1) = 14 copy_length is (3 + 3) = 6 Pixels are 00 00 27 27 2A 2A |
3rd | A5 07 | Repetition command. negative_offset is (5 + 8 * 7) = 61 copy_length is (3 + 5) = 8 Pixels are 2A 2A 27 0A 0A 0A 0A 0A |
4th | 81 03 | Repetition command. negative_offset is (4 + 8 * 3) = 28 copy_length is (3 + 1) = 4 Pixels are 00 00 27 27 |
5th | 27 | Pixel 27 |
6th | 00 09 | Repetition command. negative_offset is (0 + 8 * 9) = 72 copy_length is (3 + 0) = 3 Pixels are 27 0A 0A |
I’m not good at explain in English, so I prepared enough screen shots to explain.
This explanation refers to the DM2 GRAPHICS.DAT of Amiga version, which is formatted in big endian.
I’ll show how to extract the next image.
This operation uses 3 images to combine and merges into one complete image.
+ + =
In convenience, I allocate the index number for them. The index is based on order from GRAPHICS.DAT.
#4537 + #4539 + #4540 = New #4540 Image
You can extract the first image(#4537) easily.
Please visit Data Files for further information about IMG3 and IMG4 formats. It’s great resource!
This image requires to combine with 2nd image.
Generally, it appears to be the messed up image.
I’ll explain with the next figure.
This shows the binary image of 2nd image(#4539).
This tool divides a raw data into 3 parts automatically.
They are Prefix, Compressed Binary bytes and Suffix.
Part | Size of each part (in bytes) |
---|---|
Prefix | 7 |
Binary | 2,348 |
Suffix | 16 |
Total | 2,371 |
I copied the each heading binary into a table.
Part | Heading hex binary |
---|---|
Prefix | 00 A0 00 74 **96 F1 2D** |
Binary | FF F0 54 C2 D3 2D F8 4A 01 0D 28 19 0A 0D F7 E2 ... |
Suffix | 00 E9 EB A8 A6 AA 58 00 BC 3D 00 8C E7 ED 00 EF |
I highlighted the 6 components of “Prefix” (9, 6, F, 1, 2, D) and the entire “Binary”.
The 6 components means “Local palette of 6 most used colors in image” (from Christophe’s Data files description).
Generally, It is believed that the compressed image starts from “Binary”.
However, this 2nd image is some bit different.
Part | Heading hex binary |
---|---|
Prefix | 00 A0 00 74 **96 F1 2*****D*** |
Binary | FF F0 54 C2 D3 2D F8 4A 01 0D 28 19 0A 0D F7 E2 ... |
Suffix | 00 E9 EB A8 A6 AA 58 00 BC 3D 00 8C E7 ED 00 EF |
The 2nd image starts from 52th bit (8*6+4) in “Prefix”.
If decompression work start from 52th bit, You can get the next image.
In this case, the last component of “Prefix” (0xD) is part of compressed image.
So, you should not contain it to decode Local palette.
They should be consisted from 5 components (9, 6, F, 1, 2).
Next problem is “What’s the mask color? or transparent color?”
I brought 2 words in my discretion. (I may need the correct for these expression.)
Empty color: from Christophe’s Data files description. “Copy pixels from the previous line of the image”
Transparent color: Copy the pixels from previous image at same position. In this case, it’s the 1st image.
Allocation for “Empty color” is same as IMG3 or IMG4 (described at Christophe’s Data files description).
Allocation for “Transparent color”.
I tried and decided the colors with my feeling. They are 6th Color and 14th Color.
I arranged role of colors/palettes to next table. ("-" means it doesn’t change the existing role.)
Colour | Role | Colour | Role | |
---|---|---|---|---|
1st | Color:0 | - | Palette:0 | - |
2nd | Color:1 | - | Palette:1 | - |
3rd | Color:2 | - | Palette:2 | - |
4th | Color:3 | - | Palette:3 | - |
5th | Color:4 | - | Palette:4 | - |
6th | Color:5 | Transparent color | Palette:5 | - |
7th | Color:6 | - (Empty color) | Palette:6 | - |
8th | Color:7 | - | Palette:7 | - |
9th | Color:8 | - | Palette:8 | - |
10th | Color:9 | - | Palette:9 | - |
11th | Color:10 | - | Palette:10 | - |
12th | Color:11 | - | Palette:11 | - |
13th | Color:12 | - | Palette:12 | - |
14th | Color:13 | Transparent color | Palette:13 | - |
15th | Color:14 | - (Empty color) | Palette:14 | - |
16th | Color:15 | - | Palette:15 | - |
If combine work proceeded successfully, You can finally get the next image.
+ =
It’s the same way as method against 2nd image.
Please remember this screen shot.
The raw data at “0001” is that.
The next heading binary from this entry.
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF
------------------------------------------------------------------------
0000000 00 0B 00 38 00 11 00 03 00 38 00 11 00 45 00 6D ...8.....8...E.m
0000010 00 6D 00 77 00 77 00 03 00 7E 00 77 00 DB 00 DA .m.w.w...~.w....
0000020 00 DE 00 DD 00 E5 00 E1 00 E7 00 E6 00 EA 00 E6 ................
0000030 00 EB 00 EA 00 ED 00 F2 00 EE 00 DF 00 F0 00 EF ................
This raw data is read as next table shows.
Offset | What image do you want to render | That image inherits from the following image |
---|---|---|
0000 | 000B | 0038 |
0004 | 0011 | 0003 |
0008 | 0038 | 0011 |
000C | 0045 | 006D |
… | … | … |
0F68 | 11BB (4539, the 2nd img) | 11B9 (4537, the 1st img) |
0F6C | 11BC (4540, the 3rd img) | 11BB (4539, the 2nd img) |
… | … | … |
I arranged in logical consideration for extraction.
To render image #4540, it requires #4539 has been already rendered.
To render image #4539, it requires #4537 has been already rendered.
To render image #4537, it doesn’t require any image has been rendered.
Renders #4537 as 1st image.
Renders #4539 as 2nd image and overrides the previous image.
Renders #4540 as 3rd image and overrides the previous image.
Done.
These explanations are way how to read some messed up images in DM2 GRAPHICS.DAT.
And this document doesn’t have complete information.
This means that some images can be obtained with this method but other images won’t be able to be obtained correctly with this method.
So I’m welcome to have any correction for this document.
Thanks.
This is a binary of encoded text.AB B6 BC A8 D4 A7 D9 AA A8 A2 D5 A0 AB AD D1 A3 AE 9B 99 A7 99 CA A5 9F 94 9B C4 E4
The decoded text represents:
THAT’S NOT THE MASTER DISK!
The next table shows how to decode.
Binary | Add the value with | Added Result | Logical Xor between prior value and 0xFF | Decoded character |
---|---|---|---|---|
0xAB | +0 | 0xAB | 0x54 | T |
0xB6 | +1 | 0xB7 | 0x48 | H |
0xBC | +2 | 0xBE | 0x41 | A |
0xA8 | +3 | 0xAB | 0x54 | T |
0xD4 | +4 | 0xD8 | 0x27 | ' |
0xA7 | +5 | 0xAC | 0x53 | S |
0xD9 | +6 | 0xDF | 0x20 | |
0xAA | +7 | 0xB1 | 0x4E | N |
0xA8 | +8 | 0xB0 | 0x4F | O |
0xA2 | +9 | 0xAB | 0x54 | T |
0xD5 | +10 | 0xDF | 0x20 | |
0xA0 | +11 | 0xAB | 0x54 | T |
0xAB | +12 | 0xB7 | 0x48 | H |
0xAD | +13 | 0xBA | 0x45 | E |
0xD1 | +14 | 0xDF | 0x20 | |
0xA3 | +15 | 0xB2 | 0x4D | M |
0xAE | +16 | 0xBE | 0x41 | A |
0x9B | +17 | 0xAC | 0x53 | S |
0x99 | +18 | 0xAB | 0x54 | T |
0xA7 | +19 | 0xBA | 0x45 | E |
0x99 | +20 | 0xAD | 0x52 | R |
0xCA | +21 | 0xDF | 0x20 | |
0xA5 | +22 | 0xBB | 0x44 | D |
0x9F | +23 | 0xB6 | 0x49 | I |
0x94 | +24 | 0xAC | 0x53 | S |
0x9B | +25 | 0xB4 | 0x4B | K |
0xC4 | +26 | 0xDE | 0x21 | ! |
0xE4 | +27 | 0xFF | 0x00 |
The next table is for decoding alphabet characters and symbols in English language.
I don’t check about unfilled part.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | NUL | SPC | P | LO | BRO | |||||||||||
1 | A | Q | UM | GOR | ||||||||||||
2 | B | R | ON | KU | ||||||||||||
3 | C | S | EE | ROS | ||||||||||||
4 | D | T | PAL | DAIN | ||||||||||||
5 | E | U | MON | NETA | ||||||||||||
6 | F | V | YA | RA | ||||||||||||
7 | G | W | VI | SAR | ||||||||||||
8 | H | X | OH | |||||||||||||
9 | I | Y | FUL | |||||||||||||
A | LF | J | Z | DES | ||||||||||||
B | K | ZO | ||||||||||||||
C | L | VEN | ||||||||||||||
D | M | EW | ||||||||||||||
E | N | KATH | ||||||||||||||
F | O | IR |
There are two tables in PC9801 version.
This is the encoded text in PC9801 version.0F 6C 0D 35 16 FA F9
This is decoded binary.F0 92 F0 C7 E5 00 00
If the character starts in 0xF0, It references the 2nd table with 2nd byte, and get forward 2 bytes.
Otherwise just reference the 1st table with 1st byte, and get forward 1 byte.
Example.
Binary | How to read |
---|---|
F0 92 | Find the character # 0x92 from 2nd table. |
F0 C7 | Find the character # 0xC7 from 2nd table. |
E5 | Find the character # 0xE5 from 1st table. |
00 | End |
This is 1st table.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | NUL | 0 | @ | P | LO | BRO | 「 | シ | ム | き | に | 炎 | 楯 | |||
1 | ! | 1 | A | Q | UM | GOR | 」 | ス | メ | ぎ | の | 下 | 上 | |||
2 | " | 2 | B | R | ON | KU | ィ | セ | ヨ | く | は | 回 | 杖 | |||
3 | # | 3 | C | S | EE | ROS | ォ | タ | ラ | ぐ | べ | 鎧 | 食 | |||
4 | $ | 4 | D | T | PAL | DAIN | ャ | チ | リ | け | ま | 割 | 振 | |||
5 | % | 5 | E | U | MON | NETA | ッ | ツ | ル | げ | み | 兜 | 石 | |||
6 | & | 6 | F | V | YA | RA | - | テ | ロ | こ | む | 脚 | 切 | |||
7 | ' | 7 | G | W | VI | SAR | ア | ト | ン | さ | よ | 剣 | 打 | |||
8 | ( | 8 | H | X | OH | イ | ニ | ゙ | し | り | 鍵 | 叩 | ||||
9 | ) | 9 | I | Y | FUL | ウ | ノ | ゚ | す | る | 斬 | 投 | ||||
A | LF | * | : | J | Z | DES | カ | ハ | あ | せ | れ | 刺 | 突 | |||
B | + | ; | K | [ | ZO | キ | フ | い | ち | ろ | 時 | 秘 | ||||
C | , | < | L | \ | VEN | ク | ヘ | う | つ | わ | 射 | 払 | ||||
D | - | = | M | ] | EW | ケ | ホ | え | て | を | 取 | 薬 | ||||
E | . | > | N | ^ | KATH | コ | マ | か | で | ん | 出 | 了 | ||||
F | / | ? | O | _ | IR | サ | ミ | が | な | 飲 | 術 | 絆 |
This is 2nd table.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | ・ | た | 王 | 巻 | 穴 | 妻 | 蛇 | 精 | 壇 | 胴 | 付 | 矢 | ||||
1 | ァ | と | 黄 | 完 | 結 | 済 | 邪 | 製 | 弾 | 銅 | 斧 | 妖 | ||||
2 | ェ | ど | 可 | 間 | 血 | 祭 | 手 | 青 | 断 | 毒 | 符 | 用 | ||||
3 | ュ | ね | 火 | 眼 | 月 | 使 | 首 | 赤 | 着 | 読 | 武 | 陽 | ||||
4 | ョ | ば | 花 | 器 | 験 | 士 | 終 | 絶 | 中 | 肉 | 復 | 嵐 | ||||
5 | エ | ひ | 貨 | 気 | 現 | 師 | 酋 | 戦 | 長 | 虹 | 物 | 裏 | ||||
6 | オ | ぶ | 壊 | 騎 | 護 | 枝 | 十 | 僧 | 釘 | 入 | 閉 | 流 | ||||
7 | ナ | め | 海 | 技 | 口 | 止 | 書 | 造 | 鉄 | 忍 | 宝 | 侶 | ||||
8 | ネ | も | 絵 | 弓 | 向 | 死 | 唱 | 賊 | 凍 | 認 | 法 | 療 | ||||
9 | ヒ | ら | 開 | 胸 | 降 | 歯 | 小 | 族 | 刀 | 能 | 暴 | 良 | ||||
A | モ | 悪 | 階 | 玉 | 高 | 字 | 晶 | 太 | 盗 | 爆 | 棒 | 縁 | ||||
B | レ | 暗 | 骸 | 禁 | 黒 | 治 | 城 | 対 | 灯 | 箱 | 本 | 霊 | ||||
C | ワ | 衣 | 確 | 金 | 骨 | 室 | 飾 | 袋 | 当 | 反 | 魔 | 裂 | ||||
D | じ | 違 | 覚 | 銀 | 込 | 実 | 色 | 大 | 筒 | 板 | 眠 | 炉 | ||||
E | ず | 一 | 活 | 空 | 催 | 者 | 水 | 炭 | 闘 | 皮 | 木 | 棍 | ||||
F | そ | 稲 | 鎌 | 型 | 再 | 車 | 星 | 短 | 同 | 不 | 目 | 鉈 |
The entry is an item stored in ENT1 format (check ENT1 section at Data Files).
XX = Entry category
YY = Entry index
ZZ = Entry type
AA = Entry name 1st byte.
BB = Entry name 2nd byte.
CC = Entry name 3rd byte.
A color representation. 4 bytes per palette entry.
I = Index
R = Red intensity
G = Green intensity
B = Blue intensity
They are all known image formats. Each of DM2 versions supports some of them.
Short name | Format name | Spec | Notes |
---|---|---|---|
C4 | IMG3,4,7,8 | 4bpp, compressed | 3=little & full 4=big & full 7=little & differential 8=big & differential Note: DM2 Sega, PC Beta, FM-Towns versions don’t contain image palette at image’s suffix. Other versions contain. |
U4 | IMG6 | 4bpp, uncompressed | 6=little |
C8 | IMG9 | 8bpp, compressed | 9=little |
U8 | IMG? | 8bpp, uncompressed |
Each of DM2 versions has different palette management due to hardware limitation.
Although images have palette, it seems not to be used.
Instead, there are IRGB palettes which depends on scene.
Known palettes:
Scene | Palette in entry… | Application | Palettes list |
---|---|---|---|
Inventory interface | entry 01 00 09 00 04 FF | Full screen | 246 Interface - Main Screen, 0, b1=“00” b2=“04” b3=“FF” => 16 colors |
? | entry 01 00 09 01 04 FF | ? | 245 Interface - Main Screen, 0, b1=“01” b2=“04” b3=“FF” => 16 colors, all black |
— | |||
Credits paper? | entry 05 00 09 01 04 00 | Full screen | 214 Main Menu and Credits, 0, b1=“01” b2=“04” b3=“00” => 16 colors |
Main menu | entry 05 00 09 04 04 00 | Full screen | 215 Main Menu and Credits, 0, b1=“04” b2=“04” b3=“00” => 16 colors |
? | entry 05 00 09 05 04 00 | ? | 212 Main Menu and Credits, 0, b1=“05” b2=“04” b3=“00” => 16 colors |
? | entry 05 00 09 06 04 00 | ? | 213 Main Menu and Credits, 0, b1=“06” b2=“04” b3=“00” => 16 colors |
— | |||
0: Blue zone | entry 08 00 09 00 04 00 | Dungeon viewport | 2346 Dungeon Graphics, 0, b1=“00” b2=“04” b3=“00” => 16 colors + 5*16 colors for light gradient |
1: Outside | entry 08 01 09 00 04 00 | Dungeon viewport | 2319 Dungeon Graphics, 1, b1=“00” b2=“04” b3=“00” => 16 colors + 5*16 colors for light gradient |
2: Cave | entry 08 02 09 00 04 00 | Dungeon viewport | 2176 Dungeon Graphics, 2, b1=“00” b2=“04” b3=“00” => 16 colors + 5*16 colors for light gradient |
3: Interior | entry 08 03 09 00 04 00 | Dungeon viewport | 2117 Dungeon Graphics, 3, b1=“00” b2=“04” b3=“00” => 16 colors + 5*16 colors for light gradient |
4: Skullkeep roof | entry 08 04 09 00 04 00 | Dungeon viewport | 2280 Dungeon Graphics, 4, b1=“00” b2=“04” b3=“00” => 16 colors + 5*16 colors for light gradient |
5: Mist | entry 08 05 09 00 04 00 | Dungeon viewport | 2245 Dungeon Graphics, 5, b1=“00” b2=“04” b3=“00” => 16 colors + 5*16 colors for light gradient |
— | |||
Flutter wheel | entry 09 51 09 0A 04 00 | ? | 2823 Wall Decorations, 81, b1=“0A” b2=“04” b3=“00” => 6 or 16 colors |
Sleep machine | entry 09 5B 09 09 04 00 | ? | 2586 Wall Decorations, 91, b1=“09” b2=“04” b3=“00” => 6 or 16 colors |
Sleep machine | entry 09 5B 09 0A 04 00 | ? | 2585 Wall Decorations, 91, b1=“0A” b2=“04” b3=“00” => 6 or 16 colors |
? | none | ? | 1 RAW data before: 2435 |
Shop vendor panel | entry 09 72 09 0A 04 00 | ? | 2433 Wall Decorations, 114, b1=“0A” b2=“04” b3=“00” => 6 or 16 colors |
— | |||
? | none | ? | 4 RAW data before: 3377, 3378, 3356, 3353 |
Power crystal | entry 0F 11 09 09 04 00 | ? | 4226 Creatures, 17, b1=“09” b2=“04” b3=“00” => 6 or 16 colors |
? | none | ? | 4 RAW data before: 3487, 3488, 3402, 3486 |
Archer-guard | entry 0F 1D 09 09 04 00 | ? | 3474 Creatures, 29, b1=“09” b2=“04” b3=“00” => 6 or 16 colors |
Archer-guard | entry 0F 1D 09 0A 04 00 | ? | 3473 Creatures, 29, b1=“0A” b2=“04” b3=“00” => 6 or 16 colors |
Credits: Dungeon Files for Map graphics style. GreatStone for Palettes list.
Creature palettes:
Some creatures have one or more dedicated color. It is like creature specific color found in DM1. Its support is done by altering hardware palette.
Archer-guard has 2 colors:
entry (0F 1D 09 09 04 00) has alternate color for color9.
entry (0F 1D 09 0A 04 00) has alternate color for color10.
Raw data format is: 6 set of IRGB entry. It maps from brightest to darkness.
It has a palette with 256 colors.
The palette is stored at entry (01 00 09 FE 08 00).
It has a palette with 256 colors.
The palette is stored at entry (01 00 07 FE 08 00).
It has a palette with 256 colors.
The palette is stored at entry (01 00 09 FE 08 00).
Not yet.
It has a palette with 256 colors.
The palette is stored at entry (01 00 09 FE 08 00).
Not yet.
It has a palette with 256 colors.
The palette is stored at entry (01 00 09 FE 08 00).
It has a palette with 256 colors.
The palette is stored at entry (01 00 09 FE 08 00).
Not yet.
Pattern | Note | DM2 versions |
---|---|---|
No | Image has no palette. | DM2 Sega DM2 FM-Towns |
Suffix | It is placed after image bits. Always 16 bytes. | DM2 PC DM2 Mac DM2 Amiga DM2 PC98 DM2 PS/V DM2 Mac JP |
Separated | Image has no palette. It is stored at another entry in graphics.dat. Always 16 bytes. Image entry (?? ?? 01 ?? ?? ??) entry’s palette is at entry (?? ?? 0D ?? ?? ??). In case of lack of the image palette, default palette’ll be used. entry (?? ?? 01 ?? ?? ??) → entry (?? ?? 0D FE 00 00) e.g. Image entry (0F 04 01 12 00 00) (e.g. Bush) ’s palette is at entry (0F 04 0D 12 00 00). It is present and available. e.g. Image entry (0F 02 01 00 00 00) (e.g. Vortex) ’s palette is at entry (0F 02 0D 00 00 00). However it is absent. Use default palette at entry (0F 02 0D FE 00 00) instead. | PC Beta |
Just guess from dungeon.dat!
Check dungeon.dat.
e.g.
Thorn demon will appear on Outside area map style. So, apply the Outside area’s palette.
It uses mapping information stored in the file DM2PerImgPalDesc.csv.
(File sample: Dungeon Master II - DM2PerImgPalDesc )
(Format)
It indicates what palette should be applied for each creature and each ornate.
Color count | Note |
---|---|
0 | Main title, credits, etc. |
1 | Creatures, items, etc |
2 | Such as gates within 0A Floor Ornates class. One is transparent mask, two is mask for displaying over there. The entry (?? ?? 0B 04 00 00) will be Colorkey1 (transparent), if it needs another selection. (Valid for Creatures, Wall/Floor ornates) The entry (08 ?? 0B 64 00 00) will be default Colorkey1 of 0A Dungeon Graphics’s. The entry (?? ?? 0B 11 00 00) entry’ll be Colorkey2 (over there). |