General (dqmj1_util)

exception dqmj1_util.Dmqj1BytesToStringDecodingError(bs: list[int] | bytes)
add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
exception dqmj1_util.GetBytesMatchError(a: list[int] | bytes, b: list[int] | bytes)
add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
exception dqmj1_util.StringToDmqj1BytesEncodingError(string: str)
add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
class dqmj1_util.CharacterEncoding(byte_to_char_map: list[tuple[list[int], str]])
bytes_to_string(bs: list[int] | bytes) str
read_string(bs: list[int] | bytes) str
string_to_bytes(string: str) bytes
class dqmj1_util.GuideData(skills: 'list[Skill]', skill_sets: 'list[SkillSet]', encounters: 'list[Encounter]')
encounters: list[Encounter]
skill_sets: list[SkillSet]
skills: list[Skill]
class dqmj1_util.Region(*values)

Region that a ROM was created for distribution in.

Europe = 1
Japan = 2
NorthAmerica = 0
class dqmj1_util.Rom(filepath: PathLike[Any] | str, region: Region = Region.NorthAmerica)

ROM containing the game’s internal binaries and data files.

Used to read data from and write data to the game ROM.

Create a ROM object from the filepath to the ROM file.

If not using a North American ROM file, you must provide the region the ROM is from.

Parameters:
  • filepath – Filepath to the ROM file to work with.

  • region – Region the ROM file is for.

write(filepath: PathLike[Any] | str) None

Writes the ROM (with any applied modifications) to the given filepath.

Make sure you have applied any modifications you want to make prior to calling this method. You can do that by assigning modified data to properties like btl_enmy_prm or skill_tbl.

property btl_enmy_prm: BtlEnmyPrm

Encounters table containing data on monsters encountered in battles, received as gifts, or obtained as starters.

Read and write

property encounters: list[Encounter]

Encounters table containing data on monsters encountered in battles, received as gifts, or obtained as starters.

Read-only, to write/modify use btl_enmy_prm instead.

property filepath: Path

Filepath the ROM was read from.

property region: Region

Region the rom is for (North America, Europe, Japan).

Based on the region that was provided to the constructor.

property rom: NintendoDSRom

Instance of the ndspy.rom.NintendoDSRom object this class uses to read/modify/write the game’s ROM.

Can be mutated in order to apply custom changes to the game’s code and data files.

property skill_sets: list[SkillSet]

Skill sets that reward monsters with skill and/or traits as they allocate skill points.

Read-only, to write/modify use skill_tbl instead.

property skill_tbl: SkillTbl

Skill sets that reward monsters with skill and/or traits as they allocate skill points.

Read and write

property skills: list[Skill]

Skills that monsters can obtain and use in battle.

Read-only, no read/write interface currently.

property string_tables: StringTables

String tables stored in the ROM’s binaries.

Read-only, no read/write interface currently.

class dqmj1_util.StringTables(species_names: list[str], skill_names: list[str], trait_names: list[str], skill_set_names: list[str], item_names: list[str])

Tables of strings stored in the ROM’s binaries.

Used for looking up the names of monster species, skills, traits, etc. based on their id number.

static from_rom(rom: NintendoDSRom, region: Region) StringTables

Reads StringTables from the given ROM.

The locations in the binaries that the string tables are read from is dependant on the provided region.

Generally you don’t need to call this directly, as Rom calls it as a part of Rom.string_tables.

Parameters:
  • rom – ROM to read string tables from.

  • region – Region the ROM is for.

item_names: list[str]
skill_names: list[str]
skill_set_names: list[str]
species_names: list[str]
trait_names: list[str]
dqmj1_util.write_guide(guide_data: GuideData, output_directory: PathLike[Any] | str) None