The current URL is datacrystal.tcrf.net.
Wizardry: Knight of Diamonds (NES)/ROM map
The following article is a ROM map for Wizardry: Knight of Diamonds (NES).
Premade Character Stats
This is the data for the group of 6 pre-made characters in a "brand new game state". Each character uses 96 bytes of data, and the data begins at 0x8E4B. All values are hexadecimal values unless otherwise specified. If a range or table of values is given, presume going outside of the specified values is, at best, inadvisable. Character one will be discussed byte-by-byte; the same format is used for characters 2-6.
- 0x8E4B to 0x---- (0001) = Should always be #$02. As a whole, this character byte determines the "meta-status" of the character--if they're available to be picked, if the data associated with them is safe to erase, etc. #$02 is the "character is available for selection" status.
- 0x8E4C to 0x---- (0001) = Length of the character's name
- 0x8E4D to 0x8E55 (0008) = The character's name. This is visible in plaintext in the ROM. If less than 8 characters, right-padded with spaces (#$20)
- 0x8E56 to 0x---- (0001) = The Race, Class, and Alignment of your character.
First, determine the race, as follows:
00 = Human
20 = Elf
40 = Dwarf
60 = Gnome
80 = Hobbit
Then add the following values for your character's class:
00 = Fighter
04 = Mage
08 = Cleric/Priest (In the Famicom version)
0C = Thief
10 = Wizard/Bishop (In the Famicom version)
14 = Samurai
18 = Lord
1C = Ninja
Finally, add 00, 01, 02 or 03 to these numbers to determine their alignment.
00 = Good
01 = Neutral
02 = Evil
03 = (Also Neutral. My guess without digging into the code is that the game is checking the smallest bit for the Neutral status, then only moving to check Good/Evil if it determines the Neutral bit is 0)
So, as an example, setting this value to #$4A will give you a Dwarven (40) Cleric (08) that is Evil (02)
- 0x8E57 to 0x---- (0001) = The character's starting Strength
- 0x8E58 to 0x---- (0001) = The character's starting I.Q.
- 0x8E59 to 0x---- (0001) = The character's starting Piety
- 0x8E5A to 0x---- (0001) = The character's starting Vitality
- 0x8E5B to 0x---- (0001) = The character's starting Agility
- 0x8E5C to 0x---- (0001) = The character's starting Luck
- 0x8E5D to 0x8E62 (0006) = How much Gold the character is carrying. Notably, this is not hex, but the literal decimal values. In other words, if these six values are 00 00 00 25 37 16, it means your character has 253716 Gold.
- 0x8E63 to 0x8E68 (0006) = How much Experience the character has. Again, this is the literal decimal values.
- 0x8E69 to 0x8E6A (0002) = Current character HP, smaller byte first
- 0x8E6B to 0x8E6C (0002) = Maximum character HP, smaller byte first
- 0x8E6D to 0x8E6E (0002) = Character level, larger byte first
- 0x8E6F to 0x---- (0001) = Character status:
00 = Ok
01 = Asleep
02 = Afraid
03 = Paralyze
04 = Petrify
05 = Dead
06 = Ashes
07 = Lost
08 = Poisoned
09 = P-Lyze (NOTE: I'm not sure what the difference is between this and 03, if any. It may just be a display thing, where one displays on your bottom bar and the other when you go to inspect the character.)
0A = Ok
- 0x8E70 to 0x---- (0001) = Character Age
- 0x8E71 to 0x---- (0001) = ????
- 0x8E72 to 0x---- (0001) = Character Armor Class. If less than 0, begins counting down from $#FF = -1, $#FE = -2, etc. -99 is as low as the game will "normally" go, and even this requires a level several-hundred Ninja. Around -20 is as low as you're "typically" likely to see.
- 0x8E73 to 0x---- (0001) = Number of Level 1 Mage Spell casts. The first ("bigger") nibble is your current casts, the second ("smaller") is your maximum. EG: #$34 in here you have 3 Level 1 mage casts remaining out of a maximum of 4. Both max out at 9. Subsequent spell cast bytes work the same way.
- 0x8E74 to 0x---- (0001) = Number of Level 2 Mage Spell casts
- 0x8E75 to 0x---- (0001) = Number of Level 3 Mage Spell casts
- 0x8E76 to 0x---- (0001) = Number of Level 4 Mage Spell casts
- 0x8E77 to 0x---- (0001) = Number of Level 5 Mage Spell casts
- 0x8E78 to 0x---- (0001) = Number of Level 6 Mage Spell casts
- 0x8E79 to 0x---- (0001) = Number of Level 7 Mage Spell casts
- 0x8E7A to 0x---- (0001) = Number of Level 1 Cleric Spell casts
- 0x8E7B to 0x---- (0001) = Number of Level 2 Cleric Spell casts
- 0x8E7C to 0x---- (0001) = Number of Level 3 Cleric Spell casts
- 0x8E7D to 0x---- (0001) = Number of Level 4 Cleric Spell casts
- 0x8E7E to 0x---- (0001) = Number of Level 5 Cleric Spell casts
- 0x8E7F to 0x---- (0001) = Number of Level 6 Cleric Spell casts
- 0x8E80 to 0x---- (0001) = Number of Level 7 Cleric Spell casts
- 0x8E81 to 0x---- (0001) = Representation of which Level 1 Mage spells you've learned. Each bit in the byte represents a particular spell, beginning with the smallest. Which spells correspond to which values will eventually be uploaded to a separate table. Subsequent spell bytes work the same way.
- 0x8E82 to 0x---- (0001) = Level 2 Mage spells learned
- 0x8E83 to 0x---- (0001) = Level 3 Mage spells learned
- 0x8E84 to 0x---- (0001) = Level 4 Mage spells learned
- 0x8E85 to 0x---- (0001) = Level 5 Mage spells learned
- 0x8E86 to 0x---- (0001) = Level 6 Mage spells learned
- 0x8E87 to 0x---- (0001) = Level 7 Mage spells learned
- 0x8E88 to 0x---- (0001) = Level 1 Cleric spells learned
- 0x8E89 to 0x---- (0001) = Level 2 Cleric spells learned
- 0x8E8A to 0x---- (0001) = Level 3 Cleric spells learned
- 0x8E8B to 0x---- (0001) = Level 4 Cleric spells learned
- 0x8E8C to 0x---- (0001) = Level 5 Cleric spells learned
- 0x8E8D to 0x---- (0001) = Level 6 Cleric spells learned
- 0x8E8E to 0x---- (0001) = Level 7 Cleric spells learned
- 0x8E8F to 0x---- (0001) = Status of Inventory Item 1 for the character.
00 = Item not equipped
20 = Item not identified
40 = Character is cursed with the item
80 = Item is equipped
Values are additive, so EG #$A0 means you've equipped an unidentified item. Subsequent inventory item status bytes work the same way.
- 0x8E90 to 0x---- (0001) = Status of Inventory Item 2 for the character
- 0x8E91 to 0x---- (0001) = Status of Inventory Item 3 for the character
- 0x8E92 to 0x---- (0001) = Status of Inventory Item 4 for the character
- 0x8E93 to 0x---- (0001) = Status of Inventory Item 5 for the character
- 0x8E94 to 0x---- (0001) = Status of Inventory Item 6 for the character
- 0x8E95 to 0x---- (0001) = Status of Inventory Item 7 for the character
- 0x8E96 to 0x---- (0001) = Status of Inventory Item 8 for the character
- 0x8E97 to 0x8E9E (0008) = Your inventory. 8E97 is your first item, 8E98 your second, etc. Each value from #$00 to #$89 corresponds to an item, the table of which will eventually be uploaded separately. #$FF means the slot is blank.
- 0x8E9F to 0x---- (0001) = How many items are in the character's inventory. If editing character inventories, remember to edit this byte as well or your edits will not display or otherwise "stick".
- 0x8EA3 to 0x---- (0001) = Markers that denote your character status in terms of having beaten the trilogy of games, found on the Character Status screen after their name. Normally in the US version you can only have one of 00, 02, or 08, due to a lack of file transfer from game to game. The other statuses are still in the game, though. These are also additive (With the exception of 02 and 08--02 overrides 08), so EG a character with this byte set to 03 will have [>G] next to their name in the status screen.
00 = No symbols
01 = [>] (The "Chevron of Elite Rank", denoting a character who has beaten Wizardry: Proving Grounds of the Mad Overlord
02 = [G] (The "Mark of Gnilda", for the character who returned from the Ruins with the Staff of Gnilda in Wizardry: The Knight of Diamonds
04 = [*] (The "Star of Llylgamyn", for a character who returned from the Legacy of Llygamyn with the Orb of Earithin)
08 = [K] (The "Knight of the City" marker, referring to a character who helped in Wizardry: The Knight of Diamonds)
At present, it's unclear what the remaining 11 character bytes do, but 0x8EA5, 0x8EA9 and 0x8EAA appear to be related to whether the character is in your party or not. 0x8EA5 in particular appears to be 00 = Not in party and 80 = In party.
- 0x8EAB to 0x8F0A (0060) = Character 2's data
- 0x8F0B to 0x8F6A (0060) = Character 3's data
- 0x8F6B to 0x8FCA (0060) = Character 4's data
- 0x8FCB to 0x902A (0060) = Character 5's data
- 0x902B to 0x908A (0060) = Character 6's data
Dungeon Data
The dungeon data is contained in a 9600-byte chunk beginning at 0x1201E. Each Floor takes up 1200 bytes, divided up into 3 400-byte "sub-chunks". Each "sub-chunk" defines a different characteristic of the maze--the first is the wall data for each square, the second is the "type" of square, and the third internally defines which room a given square is in (For determining, eg, spike tile triggering).
- 0x1201E to 0x121AD (0190) = Floor 1's wall data
- 0x121AE to 0x1233D (0190) = Floor 1's tile data
- 0x1233E to 0x124CD (0190) = Floor 1's room data
- 0x124CE to 0x1265D (0190) = Floor 2's wall data
- 0x1265E to 0x127ED (0190) = Floor 2's tile data
- 0x127EE to 0x1297D (0190) = Floor 2's room data
- 0x1297E to 0x12B0D (0190) = Floor 3's wall data
- 0x12B0E to 0x12C9D (0190) = Floor 3's tile data
- 0x12C9E to 0x12E2D (0190) = Floor 3's room data
- 0x12E2E to 0x12FBD (0190) = Floor 4's wall data
- 0x12FBE to 0x1314D (0190) = Floor 4's tile data
- 0x1314E to 0x132DD (0190) = Floor 4's room data
- 0x132DE to 0x1346D (0190) = Floor 5's wall data
- 0x1346E to 0x135FD (0190) = Floor 5's tile data
- 0x135FE to 0x1378D (0190) = Floor 5's room data
- 0x1378E to 0x1391D (0190) = Floor 6's wall data
- 0x1391E to 0x13AAD (0190) = Floor 6's tile data
- 0x13AAE to 0x13C3D (0190) = Floor 6's room data
How Wall Data Works
In each 00-byte chunk of wall data, the first byte is 0 East 0 North, the next byte is 1 East 0 North, the next 2 East 0 North, then so on to 19 East 0 North. The byte after that is 0 East 1 North, then 1 East 1 North, then 2 East 1 North, and so on until you get to 19 East 19 North. Follow the table below to put a wall or door in a given direction. Because each square defines its directions individually, this means you can make EG, 1-way doors by only defining a door in one direction.
Add this value | To do this |
---|---|
00 | Nothing! (Open space all around) |
01 | North Wall |
02 | North Door |
03 | North Secret Door |
04 | East Wall |
08 | East Door |
0C | East Secret Door |
10 | South Wall |
20 | South Door |
30 | South Secret Door |
40 | West Wall |
80 | West Door |
C0 | West Secret Door |
Example: a value of "16" means there is a door to the north, a wall to the east, a wall to the south, and open space to the west (02 + 04 + 10 = 16).
How Tile Data Works
Here, a value of 00 to 1F is an ordinary tile. 20 to 2F are special tiles; their exact data is specified elsewhere in the ROM. Where ad what it means will be defined later/another time. For now, just know each floor defines these differently ("23" is nothing on Floor 1, the "Three roads to follow..." message in Floor 2, and "Rock!" on Floor 5, for instance). While they're not intended to be used in this way, if you want to be sadistic, 30, 31, and 32 are the various "Your teleport went catastrophically wrong and your bodies have been dumped back at the castle" messages ("You teleported into rock!", "You materialized in mid-air..." and "You appeared in the Castle moat..." respectively). Adding 40 to these values make a Dark tile, and adding 80 is, I believe, for a "spiked encounter" when going through a door.