Doomdark's Revenge: The Gate of Varenorn
by mike singleton

this document contains the data format for doomdark's revenge, it is not complete but gives a good start and understanding. for further information download DDR source this may help fill in some of the blanks. should you find any errors with this document or indeed have any information to add, please send me an email.


address 0x88e2 tokens
unlike LOM the tokens are not compressed they are terminated with a capital first letter. like LOM however you must scan through to find the required token.


00 Plains 01 Mountains 02 Forest 03 Hills 04 Gate 05 Temple 06 Pit 07 Palace
08 Fortress 09 Hall 0a Hut 0b Tower 0c City 0d Fountain 0e Stones 0f Frozen
10 Wastes 11 The 12 Of 13 Luxor 14 Morkin 15 Tarithel 16 Rorthron 17 Shareth
18 North 19 Northeast 1a East 1b Southeast 1c South 1d Southwest 1e West 1f Northwest
20 Moonprince 21 Free 22 Wise 23 Fey 24 Barbarian 25 Giant 26 Dwarf 27 Icelord
28 Heartstealer 29 On 2a In 2b At 2c To 2d Stands 2e Looking 2f Into
30 Mist 31 Tunnel 32 A 33 More 34 Is 35 Good 36 Strong 37 Forceful
38 Generous 39 Stubborn 3a Brave 3b Swift 3c Loyal 3d Evil 3e Weak 3f Reticent
40 Greedy 41 Fawning 42 Cowardly 43 Slow 44 Treacherous 45 Utterly 46 Extremely 47 Very
48 Quite 49 Somewhat 4a Slightly 4b Not 4c Not at all 4d Despondent 4e Tired 4f Reckless
50 And 51 Liege 52 Foe 53 Hundred 54 Score 55 No 56 One 57 Two
58 Three 59 Four 5a Five 5b Six 5c Seven 5d Eight 5e Nine 5f Ten
60 Eleven 61 Twelve Thirteen Fourteen Fifteen Sixteen Seventeen 67 Eighteen
68 Nineteen 69 Hour 6a Day 6b Remain 6c It 6d Whose 6e Power 6f Commands
70 Riders 71 Warriors 72 None 73 They 74 You 75 Holds 76 Moonguard 77 Iceguard
78 Here 79 Ahead 7a Army 7b Dragons 7c Wolves 7d Trolls 7e Skulkrin 7f Horses
80 Guidance 81 Shelter 82 Claws 83 Flames 84 Thorns 85 Blood 86 Languor 87 Springs
8a Night 89 Dawn 8a Despair 8b Courage 8c Death 8d Life 8e Crown 8f Runes
90 Spell 91 Spear 92 Axe 93 Hammer 94 Sword 95 Bow 96 Persuasion 97 Protection
9a Swiftness 99 Battle 9a Carries 9b Nothing 9c Has 9d Found 9e Slain 9f Them
a0 Can a1 Be a2 Hands a3 Prepares a4 Do a5 Fought a6 Won a7 Lost
a8 Victory a9 Slew aa Alone ab Sees ac An ad Underground ae Entrance af Rest
b0 Take b1 Give b2 Enter b3 Recruit b4 Post b5 Attack b6 Approach b7 Use
b8 Who b9 Owned ba By bb Since bc Rode bd Forth be Icemark bf Breaks
c0 Dead c1 Watchwords c2 Midnight c3 Are c4 Revealed c5 Fear c6 Mighty c7 Hosts
c8 Unto c9 We ca Go cb Worthy cc Noble cd Overwhelming ce Sure cf Quit
d0 Want d1 X d2 X d3 X d4 After d5 Return d6 Or d7 Countless
d8 Against d9 X


name tokens

the name tokens are in the same format as the normal tokens, however they are split into three separate tables. start, middle, end. names are generated by a function that takes a x,y coordinated and makes a name using these tables.
0x6107 name start - 25 tokens
0x6149 name middle - 16 tokens
0x6174 name end - 16 tokens


00 Img 01 Dol 02 Lor 03 Ush 04 Mor 05 Tal 06 Car 07 Ulf
08 As 09 Tor 0a Ob 0b F 0c Gl 0d S 0e Th 0f Gan
10 Mal 11 Im 12 Var 13 Hag 14 Zar 15 Anv 16 Ber 17 Kah
18 Ash
00 Ar 01 Or 02 Ir 03 En 04 Orth 05 Angr 06 Igr 07 Ash
08 El 09 In 0a Ul 0b Atr 0c Orm 0d Udr 0e Is  0f Ildr
00 Orn 01 Il 02 Iel 03 Im 04 Uk 05 Ium 06 Ia 07 Eon
08 Ay 09 Ak 0a Arg 0b And 0c Ane 0d Esh 0e Ad 0f Un



address 0x5f6c area name algorithm
when a location is asked to be named, if the terrain at the locations is anything other than plains, hills, mountains and forests then the actual location is used and passed to the name algorithm.
if it is any of the above four, then this algorithm takes this terrain type and traces the patch on the map that is the same terrain. it then takes the location at the northeast, west most point - and passes that to the name algorithm. It works by tracing around the outskirts of the patch.


address 0x6011 name algorithm
the names are generated by using a location and pumping it through this function. this in turn creates a name using the name tokens. all names are made from one of each of the three tables.
the algorithm takes the coordinates and performs the following equation on them;

result = ( 444 * (y*64) + x ) mod 6151

and the resulting number is split up like

unused start middle end
- - - 1 1 1 1 1 2 2 2 2 3 3 3 3


address 0x9bfd save game area
type offset description
WORD 00 days - days since the start of the game
BYTE 02 char - current selected character
TABLE 0x9c00 tables
TABLE 0xa800 map



address 0x9c00 tables
the tables data is stored in a peculiar way, although it may have given Mike some extra speed or small access functions or something? anyway the table is accessed like a 2d array. eg. tables[ table ][ index] where index is 0 - 127
offset table description
0x9c00 00 location, x coordinate
0x9c80 01 location, y coordinate
object info
the objects map directly to the fortress's for their names
the first 5 are the special objects.
table entry 13 is used to give both the object type and object use
0x9d00 02 location, x coordinate
0x9d80 03 location, y coordinate
      if x is 0xff then the object is being carried by the character stored in the y coordinate
armies info
armies 0 - 127 belong to characters 0 - 127
and armies 128 - 255 are in the fortress's
0x9e00 04 killed in battle - ( armies 128 - 255 )
0x9e80 05 lost in battle -  ( armies 128 - 255 )
0x9f00 06 unit size / 5 - characters  ( armies ie: 0 - 127 )
0x9f80 07 unit size / 5 -  ( armies 128 - 255 )
0xa000 08 Race  ( armies 0 - 127  )
0xa080 09 Fortress Owner ( armies 128 - 255 )
characters info
the first few characters are
0 luxor
1 morkin
2 rorthron
3 tarithel
4 shareth
the remaining map directly to the fortress location, which gives them their name and strangely enough fortress that they own.
0xa100 10 Location, x coordinate
0xa180 11 Location, y coordinate
0xa200 12
flags 1
L = Looking Direction
T = Time of day, 0x00 = night, 0x1f = dawn
0xa280 13
flags 2
r = race for characters
o = orders
=object type for objects
r = object use for objects
0xa300 14
flags 3
L = Loyalty - see loyalty
K = Killed his foe?
B = In Batle
W = Won Battle
T = In Tunnel
O = Used Object
0xa380 15 Energy
0xa400 16 Fighting who if K is set in flags 3 then this person is dead
0xa480 17 Foe
0xa500 18 Liege
0xa580 19 recklessness DEAD if 0
0xa600 20 object carried If dead then this is who/what killed him < 128 then who
0xa680 21
positive attributes
7 6 5 4 3 2 1 0
0 = Good
1 = Strong
2 = Forceful
3 = Generous
4 = Stubborn
5 = Brave
6 = Swift
7 = Loyal
0xa700 22
negative attributes
7 6 5 4 3 2 1 0
0 = Evil
1 = Week
2 = Reticent
3 = Greedy
4 = Fawning
5 = Cowardly
6 = Slow
7 = Treacherous
0xa780 23 despondency


graphic types
0x00 Luxor on horse 0x01 Luxor On Foot 0x02 Morkin on Horse 0x03 Morkin on foot
0x04 Rorthron on Horse 0x05 Rorthron on foot 0x06 Fey on Horse 0x07 Fey on foot
0x08 Barbarian on Horse 0x09 Barbarian on foor 0x0a Icelord on Horse 0x0b Icelord on foor
0x0c Tarithel 0x0d Giant 0x0e Shareth 0x0fDwarf
0x10 Dragon 0x11 Wolf 0x12 Troll 0x13 Skulkrin
0x14 Horse      


address 0x7151 creatures and objects
this table holds what may be found at a location. if the location has it object bit set then the routine that calculates a name is used to give a number between 0 and 3. Access the table with terrain type
type offset description
BYTE 00..03 type - see Objects and Creature table


Plains  dragons  skulkrin  wolves  horses
Mountains  dragons  dragons  trolls  wolves
Forest  dragons  skulkrin  wolves  wolves
Hills  dragons  trolls  wolves  wolves
Gate  dragons  claws  flames  blood
Temple  flames  thorns  blood  languor
Pit  trolls  wolves  thorns  springs
Palace  dragons  horses  claws  blood
Fortress  dragons  wolves  shelter  shelter
Hall  trolls  shelter  shelter  blood
Hut  skulkrin  wolves  shelter  shelter
Tower  guidance  guidance  guidance  guidance
City  dragons  shelter  shelter  springs
Fountain  skulkrin  springs  springs  springs
Stones  dragons  flames  flames  languor
Tunnel  dragons  skulkrin  trolls  trolls


address 0x7285 character race tiredness table
this table holds the decrement for standard tiredness for character races
access with race index
type offset description
BYTE 00 tiredness


moonprince 1 barbarian 2
moonprince rider 2 barbarian rider 4
free 2 ice lord 1
free rider 4 ice lord rider 2
wise 0 tarithel 1
wise rider 1 giant 2
fey 2 heartstealer 0
fey rider 3 dwarf 3


address 0x7344 feature travel time
this table holds the length of time this terrain takes to travel across. it is used in the calculation for travel time and tiredness - access with terrain type
type offset description
BYTE 00 time


Plains 1 Fortress 2
Mountains 8 Hall 2
Forest 4 Hut 2
Hills 3 Tower 2
Gate 2 City 2
Temple 2 Fountain 2
Pit 2 Stones 2
Palace 2 Wastes 2


address 0x7354 race travel feature
this table hold the terrain type that a race can travel across without taking the feature travel time penalty. access with race type
NOTE: there was a bug in the original spectrum version of the routine that accessed this table. the table was never actually pointed to so the routine would access data stored at (0x7344+ terrain type) and use that as the table.
in the commodore 64 version, this code was fixed, but a different table was used than the unused on in the spectrum version.
type offset description
BYTE 00 feature


barbarian rider FOREST HILLS FOREST


address 0x7364 race travel time
this table holds the length of time it takes for the races to make a single movement. access with race index
type offset description
BYTE 00 time


moonprince 3 barbarian 5
moonprince rider 6 barbarian rider 8
free 3 ice lord 3
free rider 6 ice lord rider 5
wise 2 tarithel 2
wise rider 4 giant 5
fey 3 heartstealer 2
fey rider 6 dwarf 5


address 0x80ad army race tiredness table
this table holds the decrement for standard tiredness for army races - access with army race
type offset description
BYTE 00 tiredness


moonprince dc barbarian b4
moonprince rider b4 barbarian rider 8c
free dc ice lord dc
free rider b4 ice lord rider b4
wise dc tarithel dc
wise rider b4 giant b4
fey c8 heartstealer dc
fey rider 96 dwarf a0


object use

the description table is held at 0x784f and holds the token that describes the object use
0x00 persuasion
0x01 persuasion
0x02 persuasion
0x03 persuasion
0x04 protection
0x05 protection
0x06 battle
0x07 battle
0x08 battle
0x09 battle
0x0a battle
0x0b battle
0x0c swiftness
0x0d battle
0x0e presuasion
0x0f battle

object type

the description table is held at 0x783f and holds the token that describes the object type
0x00 crown
0x01 crown
0x02 crown
0x03 crown
0x04 runes
0x05 runes
0x06 bow
0x07 bow
0x08 spear
0x09 spear
0x0a sword
0x0b sword
0x0c spell
0x0d hammer
0x0e crown
0x0f axe


character races

the description table is held at 0x6357 and holds the token that describes the characters race
0x00 moonprince
0x01 moonprince rider
0x02 free
0x03 free rider
0x04 wise
0x05 wise rider
0x06 fey
0x07 fey rider
0x08 barbarian
0x09 barbarian rider
0x0A ice lord
0x0B ice lord rider
0x0C tarithel
0x0D giant
0x0E heartstealer
0x0F dwarf


the description table is held at 0x7cc9 and holds the token that describes the loyalty
0x00 moonprince
0x01 heartstealer
0x02 fey
0x03 barbarians
0x04 giants
0x05 dwarfs


objects and creatures

0x00 Dragons
0x01 Wolves
0x02 Trolls
0x03 Skulkrin
0x04 Horses
0x05 Guidance
0x06 Shelter
0x07 Claws
0x08 Flames
0x09 Thorns
0x0a Blood
0x0b Languor
0x0c Springs
0x0d Nothing

terrain types

0x00 Plains
0x01 Mountains
0x02 Forest
0x03 Hills
0x04 Gate
0x05 Temple
0x06 Pit
0x07 Palace
0x08 Fortress
0x09 Hall
0x0a Hut
0x0b Tower
0x0c City
0x0d Fountain
0x0e Stones
0x0f Wastes





army races

the description table is held at 0x773f and holds the token that describes the armies race
0x00 moonguard
0x01 moonguard
0x02 moonguard
0x03 moonguard
0x04 moonguard
0x05 moonguard
0x06 fey
0x07 fey
0x08 barbarian
0x09 barbarian
0x0A iceguard
0x0B iceguard
0x0C unused
0x0D giant
0x0E iceguard
0x0F dwarf

terrain preposition

the description table is held at 0x6367 and holds the token that describes how a character is with terrain
0x00 on
0x01 in
0x02 in
0x03 in
0x04 at
0x05 at
0x06 at
0x07 at
0x08 at
0x09 at
0x0A at
0x0B at
0x0C at
0x0D at
0x0E at
0x0F in


address 0xa800 terrain map
64x95 byte map running x - y
type offset description
location flags
F  = terrain feature - see terrain table
O = Object - see creature and objects
A = Army
M = Mist
T = Tunnel