Skip to content

Latest commit

 

History

167 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dqix-functions

dq9 function name sharing project using resymgen that comes with pmdsky-debug project Currently only a handful of functions from the jp version are provided

It includes some functions for division and decimal point processing, and by sharing them, the purpose is to omit some of the tedious discrimination work. I'm not going to do a complete analysis.

See the issue for instructions on how to import. #2

motivation

The dqix-functions repository was created to address the following issues:

  • Ghidra provides only limited and unintuitive methods for exporting information such as function names
  • Due to unexpected failures or other incidents, the analysis environment may need to be replaced frequently, which can result in the loss of previously identified functions
  • By importing this repository into Ghidra, simply viewing a function’s name can help infer its behavior, reducing the need to inspect the function’s implementation directly

Why resymgen?

  • There are limited legal methods for sharing function information, and could unintentionally lead to noncompliant distribution.
  • For this reason, resymgen was chosen as the format for sharing function data.
  • Also, resymgen comes with a formatter that allows for clean merging.

Contributing

  • Create a fork of this repository
  • Configure Git on your computer and clone the forked repository
  • Edit the symbol files in YAML format using your preferred text editor, such as VS Code, Sublime Text 4, or PhpStorm (paid)

Tip

(Optional, for Windows users) Download resymgen from the link below to check for syntax errors and reformat symbol files automatically
https://drive.google.com/file/d/1ISqVxmTNlTDi5T2dlgCUzkvo760OGkcZ/view?usp=sharing
Syntax errors can be checked with the following commands:

resymgen.exe fmt .\symbols\arm9_ram.yml
resymgen.exe fmt .\symbols\arm9_field.yml
resymgen.exe fmt .\symbols\arm9_battle.yml
  • Commit your changes
  • Open a pull request to request review and merging

Known Overlays

overlay 0: Player Controls  in field, battle code? etc?
overlay 1: Event Movie Progression
overlay 2: maybe Standard menu????
overlay 3: Player Control in Villages?
overlay 4: Adventure Overview + Character Control in grotto?
overlay 8: Stella(sandy) Interrupt Window
overlay 9: maybe ending
overlay 14: Monster encyclopedia
overlay 15: Character Viewer?
overlay 16: movie engine(Independent)
overlay 17 maybe Main screen engine, Battle, Event loop?
overlay 19: Save Data Rescue?
overlay 20: logo
overlay 23: DLC Data Handler
overley 29: Maybe DS protect
overlay 31: wi-fi setting and nitro wi-fi api
32: ?
33: ?

Thank you Eakeys

00 0 battle
01 0 event
02 0 topmenu
03 0 shisetsu
04 0 menucallback
05 0 equipmenu
06 0 renkin
07 1 debug
08 1 jourecode
09 1 charamake2
10 1 pitfall
11 1 menusys
12 1 prof
13 1 skillup
14 1 subjugation
15 2 charaview
16 2 movieview
17 2 gamemain
18 2 mapjump
19 2 readerror
20 2 title
21 2 charamake
22 3 sub_debug
23 3 sub_menu
24 3 sub_battle
25 3 sub_round
26 3 sub_command
27 3 sub_staffroll
28 3 sub_hoge
29 3 sub_makescn
30 3 sub_libmb
31 4 wifi
32 4 sound
33 5 bgload1
34 5 bgload2

Glossary

LCG

Abbreviation for Linear congruential generator. It is a random number that is updated using the following formula.

((seed * constant1) + constant2) mod (2^64 or 2^32)

https://en.wikipedia.org/wiki/Linear_congruential_generator

AT

This is the first random number in the game where the 32-bit LCG algorithm is used. It is used for the following purposes

  • Monster spawn
  • Field-related random numbers
  • In-game animations
  • Monster treasure chest drops
  • Symbol movement direction determination
  • Monster determination of encounters at sea
  • Lottery for too stunned to move

will be updated with the following expression

rand = ((rand * 0x41C64E6D) + 0x3039 & 0xFFFFFFFF)

BT

It is the second random number in the game and uses a 64-bit LCG algorithm. In Japan, it is called a Hoimi table. AT and BT share the same seed value, and in 3ds the initial seed is very narrow and the way it advances is predictable and consistent, allowing the initial seed to be identified and tracked

Some of the intended uses are

  • Lottery for the great alchemical success
  • Recovery on feeds
  • Rewards from the Demon King or Map Boss
  • Lottery for items from the Fountain
  • Shuffling of member gestures and lottery for delayed animation start period
  • Lottery for the number of encounters and types of the second and subsequent groups on the ground
  • Consumed during super special moves
  • Lottery for Zaoral
  • Lottery for flee
  • Lottery for messages of examine command
  • Lottery for name plate color
  • The number of enemies in normal encounters and the drawing of friends

will be updated with the following expression

seed(64bit) = ((seed * 0x5d588b656c078965) + 0x269ec3) & 0xFFFFFFFFFFFFFFFF

CT

It is the third random number in the game and is used to randomize combat actions. An initial seed is generated at the start of each battle and is 48 bits wide, making it difficult to predict. It is also used as a camera-related random number.

will be updated with the following expression

seed(64bit) = ((seed * 0x5d588b656c078965) + 0x269ec3) & 0xFFFFFFFFFFFFFFFF

About

Function information already discovered in dq9, DRAGON QUEST IX: SENTINELS OF THE STARRY SKIES (jp only, some only)

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors