dqutils is a Python package for looking program data in Dragon Quest series.
This package provides the following features:
- (DQ3, 5 and 6) View all text data of scenatio and battle scene.
- (DQ3, 5 and 6) View all string data.
- (DQ3, 5 and 6) Dump arrays of structs.
As the package is not currently published on any package registry (e.g. PyPI), install directly from your local repositories. For example:
$ git clone https://github.com/showa-yojyo/dqutils $REPOSITORY_ROOT
...
$ cd $REPOSITORY_ROOT
$ hatch run pip install -e .Before run a dqutils tool, you must make one of the directory below:
$XDG_CONFIG_HOME/dqutils$HOME/.config/dqutils$HOME/.dqutils
Under one of the directory above, put a text file named config and edit as
follows:
# $XDG_CONFIG_HOME/dqutils/config example:
[ROM]
DRAGONQUEST3 = /path/to/DRAGONQUEST3.smc
DRAGONQUEST5 = /path/to/DRAGONQUEST5.smc
DRAGONQUEST6 = /path/to/DRAGONQUEST6.smcRun the following command under the project root directory:
hatch testTo build the package, run the build command provided by Hatch. The generated
files will be in the dist directory. For example:
cd $REPOSITORY_ROOT
hatch buildTo print all of the message data in Dragon Quest 3, run:
python -m dqutils.dq3 print-scenario-messages
python -m dqutils.dq3 print-battle-messages(Or hatch run python -m ... if this package has been installed in Hatch's
virtual environment as mentioned above.)
To print all of the string data in Dragon Quest 3, run:
python -m dqutils.dq3 print-stringsSubpackages dqutils.dq3, dqutils.dq5 and dqutils.dq6 provide a simple data
dump CLI tool. All tools have a common interface.
In the command line arguments, specify the address, object size and number of objects.
In stdin, specify the layout of the object (not user-friendly)
The tool outputs data in CSV. The first column of output is the object index, the rest is the data.
Suppose you want to dump the first five records of shop data. The data are stored at address 0xC30900. The size of each object is eight. The structure of a shop object is as follows:
| offset | bit mask |
|---|---|
| 0 | 0x7f |
| 0 | 0x80 |
| 1 | 0xff |
| 2 | 0xff |
| 3 | 0xff |
| 4 | 0xff |
| 5 | 0xff |
| 6 | 0xff |
| 7 | 0xff |
In this case, run the following command:
$ python -m dqutils.dq3.dumptool 0xC30900 8 5 --delimiter : <<< '#$00:#$007F
#$00:#$0080
#$01:#$00FF
#$02:#$00FF
#$03:#$00FF
#$04:#$00FF
#$05:#$00FF
#$06:#$00FF
#$07:#$00FF'The output is:
0000:06:1:08:1A:19:10:18:21:03
0001:02:1:77:B8:B9:BA:BB:00:00
0002:00:0:36:03:0D:3E:3F:55:79
0003:02:1:B8:B9:BA:BB:BF:00:00
0004:00:0:07:06:22:41:66:5C:00
As of version 1.1, it is possible to disassemble only the entire ROM image:
python -m dqutils.dq3.disasm
python -m dqutils.dq5.disasm
python -m dqutils.dq6.disasmTBW
See the LICENSE file under the installation directory.
- プレハブ小屋
- Web site (GitHub): showa-yojyo (プレハブ小屋)
- E-mail: yojyo@hotmail.com
- Twitter: @showa_yojyo