This page is a raw work in progress.
This page describes the content of item 562 found in the graphics.dat file from:
This item is not found in any other version of the games (even in other Dungeon Master for Amiga 2.x versions).
The size of this item is always 1826 bytes but there are four variations in the content of this item:
This item is only used in Atari ST versions. All Amiga versions contain the equivalent data in the executable file itself and never read any data from this item.
It contains initialization data for global variables that was not included in the source code as an optimization to reduce the executable file size. This was because of the special way the C compiler worked on Atari ST, and this trick was not used on any other platform.
You may consult the names, values and usage of all these variables in the source code of ReDMCSB (search the source code for variable names containing “Graphic558”, “Graphic559”, “Graphic560”, “Graphic561” and “Graphic562”).
You may extract all values to text files with the data file decoder script at DM, CSB and DMII Data Files and Animations Decoders for PC.
All the notes below are the results of older research by credited people. They are incomplete and presented “as-is”.
Paul Stevens (CSBwin source code)
rain` (ADGE source code)
Offset CSB2xST DM12ST/20AM
000005C8: 02 00
000005C9: 10 60
i8 Byte1830[2]; // Start of graphic 0x232
String containing a single ‘Line Feed’ character
Values: 0A00
This string is used by a function to print a ‘Line Feed’ character in the message area on the bottom of the screen.
Two arrays of 4 longs containing masks
These masks are used when a character is printed over two consecutive blocks of 16 pixels in video memory.
The character is printed in two steps using a pair of masks, one from each array. The combination of the two masks contain 5 clear bits (each character is 5 pixels wide).
7FFF7FFF 3FFF3FFF 1FFF1FFF 0FFF0FFF
FFF0FFF0 FFF8FFF8 FFFCFFFC FFFEFFFE
Structure: 2x4 dwords
i32 Long1828[4]; // masks for text !not reversed!
i32 Long1812[4]; // masks for text !not reversed!
RectPos wRectPos1796; // … bottom of screen rect
RectPos wRectPos1788; // … right side of screen rect
RectPos wRectPos1780; // … top of screen rect
Structure: 22x8 bytes
SOUND sound1772[22]; // [Offset 58]
word[0-1] … graphic address. index de l’item SNDx dans le graphics.dat
byte[2] … unused
byte[3] … Timer type, always 0x70 (now unused)
byte[4] … length of time sound exists
byte[5] … unused
byte[6] … distance sound will travel as ’loud’
byte[7] … distance sound will travel as ‘soft’
struct SOUND
{
i16 word0;
i8 byte2;
i8 byte3;
i8 byte4;
i8 byte5;
i8 byte6;
i8 byte7;
};
This array contains the type of timer to create for each type of tile targetted by an actuator.
i8 Byte1596[8];
This word is modified by a copy protection routine but it is never used afterwards.
i16 Word1588;
This array contains the carry location indices in the order in which they are dropped on the floor when a champion dies.
i16 DropOrder[30];//1586
3 word values per champion (one for each bar graph).
Offset in bytes from the left of screen to the first 16 pixels block containing the bar graph
Structure:
i16 Word1526[4][3];
Each bar graph can be over two 16 pixels blocks. There are two words for each bar. Each bit in these words indicate if the corresponding pixel is to be drawn for the bar (there are exactly 4 consecutive bits set in each pair of words, all other bits are clear)
i16 Word1502[4][6];
RectPos wRectPos1454[4];
i8 SpecialChars[6]; //1422 comma,period,semi-colon,colon,space
Values: 44 46 59 58 32 0
i8 Byte1416[2]; String containing a single space character. Values: 32 0
i8 Byte1414[2]; String containing a underscore character. Values: 95 0
For each carry location (body parts only), this array contains a multiplier that is used when computing resistance to injuries.
i8 Byte1412[6]; // resistances to ouches (getting hurt…) :P
i16 Word1406[4]; // eye rectangle
i16 Word1398[4]; // mouth rectangle
This rectangle is used to extract a single portrait from the graphic containing all champion portraits
i8 Byte1390[4];
For each champion, this array contains the color index to use to draw the champion position icon and text messages about the champion
i8 Byte1386[4];
The color palette is available on Portrait Files.
When holding an object in hand, the mouse cursor represents the object with a shadow.
Palette changes are used to substitute some colors by others when drawing the cursor.
Each byte in a “Palette changes” is the replacement color index multiplied by 10.
For example, if the second byte is $3C = 60 this means the second color (index 1) must be replaced by color index 6.
Palette changes to apply to an icon to draw its shadow in a mouse cursor (objects in hand and champion position icon)
i8 Byte1382[16];
Palette changes to apply to an icon to draw the icon over its shadow in a mouse cursor (objects in hand and champion position icon)
These replacement colors allow the cursor to be displayed over the viewport without being affected by the dungeon luminance
i8 Byte1366[16];
The graphic is in Atari ST planar mode, 16x16 pixels, 4 colors.
i8 Byte1350[128];
The graphic is in Atari ST planar mode, 16x16 pixels, 4 colors.
i8 Byte1222[128];
Viewport area containing the floppy disk, Zzz and Cross icons. This rectangle is used to hide the icons when viewing a potential champion (a champion that is not yet in the party, before reincarnation of resurrection).
i8 Byte1094[8];
Table used to determine which color palette to use for the dungeon view based on the total luminance (Magical luminance + luminance produced by torches held in champion hands)
i16 PaletteBrightness[6];//1086
Values: 99 75 50 25 1 0
For example, with a luminance of 30, the 4th color palette would be used.
Table used to determine the luminance produced by:
i16 Word1074[16];
Values: 0 5 12 24 33 40 46 51 59 68 76 82 89 94 97 100
For example, an Illumulet (Luminous Power = 2) would add 12 to the total Luminance.
This array contains a mask for each carry location (30 in chanmpion inventory and 8 in chest) describing what kind of objects can be stored in that carry location.
i16 CarryLocation[38];
Check Dungeon Master and Chaos Strikes Back Items properties for the meaning of each bit in the masks.
Poisoned
Water
Food
Object Description Circle
Arrow Or Eye
Resurrect or Reincarnate Buttons / Open Scroll
RectPos wRectPos966;// poisoned draw rect box (static 48x12);
RectPos wRectPos958;// water (24x12) 12 = transparent pixel?
RectPos wRectPos950;// food (24x12) 12 = transparent pixel?
RectPos wRectPos942;// item circle (16x12) 12 = transparent pixel?
RectPos wRectPos934;// arrow/eye (8x8) 8 = transparent pixel?
RectPos wRectPos926;// empty inventory box rect: 8 = transparent pixel?
This word is used by the copy protection of the game.
i16 Unused918;//Word918; //
This array contains 46 entries: 8 for hands in portraits, 30 for clothing/backpack and 8 for chest.
Each entry is 6 bytes large:
1 word: X coordinate
1 word: Y coordinate
2 bytes: Object full type
ICONDISPLAY IconDisplay[46]; //916
For each torch charge count (0..15) this array contains the graphic to use to draw the torch.
i8 Byte640[1];
FILL(639,624)
This rectangle is used to clear the screen area where the name of the object held in hand is printed.
RectPos wRectPos624;
This data is never used in the game code. Probably a rectangle for an icon.
FILL(616,612)
Values: 00 0F 00 0F
This array contains the first object full type in each of the 7 graphics containing object icons.
i16 Word612[7];
This data is never used in the game code.
FILL(598,590)
Values: 0A 0B 0D 0C 0A 0D 06 0D
Each creature descriptor contains probabilities of injuring a champion Head, Torso, Legs or Feet. These 4 masks are used to apply the injuries to the champion.
ui8 uByte590[4];
Values:
$20: 32 Feet
$10: 16 Legs
$08: 8 Torso
$04: 4 Head
A creature’s word22 has direct relation to this. If a creature hits you, it
has a chance to do injuries from this table. it takes a nibble off the
least significant side of word22, if it is less than a random(0-15),
it landed a critical and uses the mask of ubyte590[0]. It then takes another nibble
and tests if that is less than the same random(0-15) as before. If it is
still less than it, it uses the mask of ubyte590[1], and moves all the way up
to ubyte590[3]. Creatures with low values for the least significant nibbles in
word22 will do ‘deep’ criticals which I assume deal many injuries. This explains why
a single hit from a dragon almost is a guaranteed injury
i8 Byte586[8][4];
These bytes might be filled with 0, 1, 2 or 3 and are responsible for the priority of sub-cells choosen by a monster to attack a character.
This doesn’t works for creature that have the “attack every position” flag set. In that case, the creature attacks random subcells.
I will use that notation:
Code: Select all
L R - L- left monster, R- right monster
A | B - A and B - 1st and 2nd char in a party
------
D | C - C and D - 3rd and 4th char in a party
So you can see that monster L stays right in front of a character occupying subcell A and monster R stays right in front of a character occupying subcell B.
In original code, there are four eight-byte words:
0 1 3 2 1 0 2 3
1 2 0 3 2 1 3 0
3 2 0 1 2 3 1 0
0 3 1 2 3 0 2 1
wchich you can read as:
Code: Select all
-----------------------------------
| LEFT | RIGHT |
| monster | monster |
| attack | attack |
| priority | priority |
| I II III IV | I II III IV |
-----------------------------------
| 0 1 3 2 | 1 0 2 3 | <= for party facing NORTH:
| | | 0=A 1=B 2=C 3=D
| 1 2 0 3 | 2 1 3 0 | <= for party facing EAST:
| | | 0=D 1=A 2=B 3=C
| 3 2 0 1 | 2 3 1 0 | <= for party facing SOUTH:
| | | 0=C 1=D 2=A 3=B
| 0 3 1 2 | 3 0 2 1 | <= for party facing WEST:
| | | 0=B 1=C 2=D 3=A
-----------------------------------
wchich means:
If party is facing NORTH, then LEFT monster attack priority is subcell A (priority I). If this subcell is empty (for example you have one character in party occupying subcell B, or character is dead), then a monster tries to attack character on subcell B (priority II). Then subcell C (priority III), and then subcell D (priority IV). RIGHT monster do the same, but in different order (BACD).
Second line is for a case when a party is facing EAST, but the current values for each line will be different (because each line represents different world quarter!). Third line is for party facing SOUTH and fourth for party facing WEST.
Originally, the code is set for monsters L and R to attack every possible subcell, but it can be chaged depending on the party facing set. For example, if we change the second line to 00003333, that would mean that when party facing WEST, the LEFT monster will attack only subcell D (priority order set to DDDD) and RIGHT monster will attack only subcell A (priority order AAAA). So if you have only two characters in a party, you could place them in subcells B and C so the monsters wouldn’t attack at all (the party would be safe in front of four skeletons when facing WEST).
For example, the code can be rearranged in a way that RIGHT monster doesn’t attack subcell B when party facing SOUTH. Or LEFT monster attacks subcell C only when party facing NORTH. Or all monsters attacks subcells C and D first (if they are empty, tries to attack A and B- so if you have a full party, they will attack back characters first). Or when a party is facing NORTH, monsters attacks only subcell A, when SOUTH- only B. Or when party is facing EAST, LEFT monster tries to attack C first, then AD (but doesn’t attack B at all), and when party is facing WEST, RIGHT monster attacks D first, then BC (but doesn’t attack A at all). Or whenever party is facing SOUTH, monsters only attack subcell A (so characters occupying BCD would be safe). Etc, etc. Its up to the designer.
[Credits: adamo]
This value is used by the copy protection of the game.
i16 Word554;
Each color palette is an arry of 16 integers (32 bytes). Each integer defines a color (512 colors possible).
Bits 15-12: unused
Bits 11-8: Red component
Bits 7-4: Green component
Bits 3-0: Blue component
Dungeon View Palettes (6 levels of luminance, from lightest to darkest)
Main Menu Color Palette
Credits Color Palette
Note the first dungeon view palette is always used to draw the top and bottom of the screen. The middle of the screen is drawn with one of the 6 palettes depending on the luminance in the dungeon.
The first dungeon view palette is the one described on Portrait Files.
PALETTE Palette552[6];
PALETTE Palette360;
PALETTE Palette328;
This array contains the indices of graphics that are always loaded in memory
ui16 DefaultGraphicList[70];
This array is used as palette changes when no changes are required: it replaces each color by itself. It is used to draw Clouds (D1 to D4), Missiles (D1), Damange Done, …
Values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150
i8 Byte156[16];
This section contains 17 rectangles:
Endgame Champion Portrait (This is for the first portrait, X+48 for other portraits)
Endgame Champion Mirror (This is for the first portrait, X+48 for other portraits)
Endgame_Restart_Inner
Endgame_Restart_Outer
Endgame_TheEnd
Dungeon Entrance Door Right
Dungeon Entrance Door Left
Dungeon Entrance Viewport
Dungeon Entrance Door Right (modifyable)
Dungeon Entrance Door Left (modifyable)
Dungeon Entrance Dungeon View
Title Screen_Presents
Title Screen_StrikesBack_Source
Title Screen_StrikesBack_Destination
Movement Arrows
Action Area
Spell Casting Area
i16 Word140[4]; // rect of first character’s graphic on screen,
i16 Word132[4]; // rect of first character’s death graphic. +48 again.
i16 Word124[4]; // some rect for ‘restarting’ the game, cleared when used
i16 Word116[4]; // some rect for ‘restarting’ the game, cleared when used
i16 Word108[4]; // “THE END” label rect (for graphic 6)
i16 Word100[4]; // entrance door (right) rect
i16 Word92[4]; // entrance door (left) rect
i16 Word84[4]; // saved rect from before opening doors (saves a quick ss of this rect)
i16 Word76[4]; // modifyable entrance door (right) rect
i16 Word68[4]; // modifyable entrance door (left) rect (moves it as u open)
i16 Word60[4]; // left part of interior rect as you open doors
i16 Word52[4]; // intro graphic rect to delay display (its around “presents”);
i16 Word44[4]; // into graphic rect to delay display (“presents” again???)
i16 Word36[4]; // into graphic rect for “stikes back”
i16 Word28[4]; // movement arrow key rects
i16 Word20[4]; // attack damage rect
i16 Word12[4]; // magic spell area rect