Difference between revisions of "Dragon Quest III:ROM map"

From Data Crystal
Jump to: navigation, search
(Notes)
Line 4: Line 4:
 
All values given are ROM offsets. They assume that a 512-byte copier header is ''not'' present. If there is a header present, you will have to add 512 ($200) to each offset lister here to get the correct offset in the ROM file.
 
All values given are ROM offsets. They assume that a 512-byte copier header is ''not'' present. If there is a header present, you will have to add 512 ($200) to each offset lister here to get the correct offset in the ROM file.
  
Note that the ROM is mapped into the SNES address space starting at $C00000. Therefore, if you want to use one of these ROM offsets as a breakpoint, you should add $C00000 to it.
+
Note that the ROM is mapped into the SNES address space starting at $C00000. Therefore, if you want to use one of these ROM offsets as a breakpoint, you should add $C00000 to it. I've given a few examples below that already do this.
  
 
==Menu Size Data==
 
==Menu Size Data==

Revision as of 19:53, 9 April 2008

Notes

All values given are ROM offsets. They assume that a 512-byte copier header is not present. If there is a header present, you will have to add 512 ($200) to each offset lister here to get the correct offset in the ROM file.

Note that the ROM is mapped into the SNES address space starting at $C00000. Therefore, if you want to use one of these ROM offsets as a breakpoint, you should add $C00000 to it. I've given a few examples below that already do this.

Menu Size Data

Almost every menu has a 16-bit (2-byte) value that determines its starting position (X/Y coordinates) and its width. Menu size data is stored in the following binary format:

%1WWW WWYY YYYX XXXX

  • WWWWW = menu width (not just usable space, this includes the edge characters)
  • YYYYY = vertical tile offset from top of screen
  • XXXXX = horizontal tile offset from left of screen

There is no value to determine the height of a menu. This is done internally by the drawing code for each individual menu.

Like almost everything else on the SNES, this data is in low-endian format. Thus, the YYYX XXXX byte comes first in the ROM, then the 1WWW WWYY byte.

Here are a few menu size values that I have found. Note again that this controls only menu width and position. Menu content string pointers are stored elsewhere.

  • $30348-$30349: Introductory menu (contains Begin a New Quest, Continue Quest, Copy Quest, etc., etc.)
  • $30024-$30025: Main walkabout menu (contains Talk, Spell, Item, Search, Status, Tactics)
  • $300FC-$300FD: Gold menu, associated with the main walkabout menu

Menu Padding Routine

Some menu entries have extra spaces padded onto the end that is not accounted for by the data at the expected pointers. These spaces are inserted by the use of a special routine located at $32B70 in the ROM. When this routine is called, the X register contains the number of spaces to insert. If you're doing some menu expansion, you may have to set breakpoints at $C32B70. Single-step through until RTL is executed, so you can see where it came from, and then back up four bytes from there. If these padding spaces are throwing off your menu borders, replace the JSL $C32B70 with four NOPs.

Calling $32B8D inserts a single dummy space. The "Change Message Speed" option on the "Tactics" menu uses this method, so look out for it if you're editing that menu item. There may be others I haven't found yet that do the same thing. Again, you can track down the originating JSL opcode by breaking on the subroutine start, stepping through until RTL is executed, and then backing up four bytes.

Related Articles

Links

None currently.