Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 41 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1,64 @@
# JUSToolkit
<div align="center">
<h1 align="center">JUSToolkit</h1>
</div>

Romhacking tools for Jump Ultimate Stars! (NDS)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://choosealicense.com/licenses/mit/)
<div align="center"><img src="docs/images/logo_full.webp"></div>

## Features

Done ✔️ To test / with issues ⚠️ Not done 🛑

### Containers

- Pack .aar ALAR3 ✔️
- Unpack .aar ALAR3 ✔️
- Pack .aar ALAR2 ✔️
- Unpack .aar ALAR2 ✔️

### Graphics

- Extract ALMT + DIG ✔️
- Import ALMT + DIG ✔️
- Extract DTX ✔️
- Import DTX 🛑

### Texts

- Extract and import ✔️
<p align="center"><em>Romhacking tools for Jump Ultimate Stars! (NDS).</em></p>

### Batch Features

- Extract every .dig from any .aar (ALAR2/ALAR3) to PNG ✔️
- Import multiple PNGs to an .aar ALAR3 container ✔️
<p align="center">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/priverop/JUSToolkit?color=blue">
<img alt="Build and release" src="https://github.com/priverop/JUSToolkit/actions/workflows/build-and-release.yml/badge.svg?branch=master">
<img alt="MIT License" src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat">
</p>

### Scripts
---

- **beta.sh:** generates a new beta translation rom if you have access to the
Translation repo.
- **copy_text_format:** generates a new text format.
- The rest are testing scripts for devs.

## Tinke

You can use [Tinke by pleonex](https://github.com/pleonex/tinke) to unpack
containers and view .dig files.

## Build

The build system requires
[.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0).

## How To Use
## Features

`./JUS.CLI jus [type] [feature] [args]`
- **Containers** - Unpack and pack **ALAR** files (.aar).
- **Texts** - Export and import _.bin_ files, including the **JQuiz**.
- **Textures** - Export and import **DIG** (_.dig_) + **ALMT** (_.atm_).
- **Sprites** - Export and import **DTX**, including **Komas**.
- **Automatizations** - Utilities to batch export and import multiple files.

- graphics
- export-dtx
- export-dig
- import-dig
- containers
- export-alar3
- import-alar3
- export-alar2
- import-alar2
- import
- export
- batch
- export-alar-png
- import-png-alar3
- game
- import
Check [**usage**](https://priverop.github.io/JUSToolkit/docs/tool/usage.html)
for more info.

To get the arguments of a feature you can use:
`./JUS.CLI jus [type] [feature] -h`
## Requirements

Examples:
`./JUS.CLI jus containers export-alar3 --container test.aar --output myDirectory`
`./JUS.CLI jus containers export-alar3 -h`
The utility requires the
[.NET 10.0 runtime](https://dotnet.microsoft.com/en-us/download/dotnet/10.0),
and works in every OS.

## Documentation

### Documents

You can find these documents in our [`docs/articles/dev`](docs/articles/)
folder:

- Alar Specification
- Text Specification
- DTX Specification by pleonex
- DTX Research by pleonex
- [FileFormats by Uknown Hacker](https://web.archive.org/web/20100111220659/http://jumpstars.wikispaces.com/File+Formats#toc10)

### Videos
Check our [documentation page](https://priverop.github.io/JUSToolkit/docs/tool/index.html)
for guides on installation, how to use the tool, scripts, format research, and more!

pleonex did some research on Streaming:
## Tinke and SceneGate

- [DIRECTO ROM Hacking: Triple reto de imágenes](https://www.youtube.com/watch?v=r1Rsx6RRe1U)
- [DIRECTO Domingos de desensamblador: imágenes de Devil Survivor y JUS y ordenar textos de MetalMax 3](https://www.youtube.com/watch?v=R2h-UEcO_-k)
- [DIRECTO Predomingos de desensamblador: CLYT de 3DS y el complejo caso de los sprites de JUS](https://www.youtube.com/watch?v=1KT4u_Kvaws)
You can use [Tinke by pleonex](https://github.com/pleonex/tinke), which has a
built-in plugin to unpack JUS containers, and view .dig files.

## Stack
Also, we've developed an auto-discovery plugin for [SceneGate by pleonex](https://code.pleonex.dev/sceneGate/scenegate).
Check [this article](https://priverop.github.io/JUSToolkit/docs/tool/scenegate.html) for more info.

- C# / .NET 8.0
- [Yarhl by pleonex](https://code.pleonex.dev/sceneGate/yarhl)
- [PleOps.Cake by pleonex](https://codeberg.org/pleonex/PleOps.Cake)

## Credits

Special thanks to [pleonex](https://fosstodon.org/@pleonex) for his help, for
Yarhl, and PleOps.Cake.
- [**pleonex**](https://fosstodon.org/@pleonex) - Friend, creator, and maintainer
of [Yarhl](https://code.pleonex.dev/sceneGate/yarhl),
[Tinke](https://code.pleonex.dev/sceneGate/tinke),
[Ekona](https://code.pleonex.dev/sceneGate/ekona), and
[PleOps.Cake](https://codeberg.org/pleonex/PleOps.Cake).
- [**Darkc0m**](https://github.com/Darkc0m) - Co-developer, and co-leader of the
project.
- [**TraduSquare**](https://tradusquare.es) - Spanish Fantranslation community.
- **Ganbarion** - For creating this amazing game!

Thanks to [TraduSquare](https://tradusquare.es) for the inspiration and support.

Thanks to the Jump Ultimate Stars! devs for this amazing game.
<div align="center"><img src="docs/images/logo_pirate.webp" width="20%">
<p><small>Arr! Don't forget to star the repo!</small></p></div>
52 changes: 52 additions & 0 deletions Resources/desmume_jus.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/desmume/src/debug.cpp b/desmume/src/debug.cpp
index bdbee09b..4c0ea56a 100644
--- a/desmume/src/debug.cpp
+++ b/desmume/src/debug.cpp

void HandleDebugEvent_Execute()
{
+ extern bool nds_debug_continuing[2];
+ if (nds_debug_continuing[DebugEventData.procnum]) {
+ nds_debug_continuing[DebugEventData.procnum] = false;
+ return;
+ }
+
+ nds_debug_continuing[DebugEventData.procnum] = true;
+
+ const unsigned int JUS_OPEN_AAR_FUNC = 0x020101f4;
+ const unsigned int JUS_OPEN_AAR_FILE_FUNC = 0x0203341c;
+ if (DebugEventData.addr == JUS_OPEN_AAR_FUNC) {
+ armcpu_t* cpu = DebugEventData.cpu();
+ u32 filenameAddress = cpu->R[0];
+ u32 param_2 = cpu->R[1];
+
+ char* filename = (char*)(MMU.MAIN_MEM + (filenameAddress & _MMU_MAIN_MEM_MASK32));
+ printf("[JUS] Opening AAR: %s (%d)\n", filename, param_2);
+ } else if (DebugEventData.addr == JUS_OPEN_AAR_FILE_FUNC) {
+ armcpu_t* cpu = DebugEventData.cpu();
+ u32 filenameAddress = cpu->R[0];
+ u32 param_2 = cpu->R[1];
+ u32 param_3 = cpu->R[2];
+
+ char* filename = (char*)(MMU.MAIN_MEM + (filenameAddress & _MMU_MAIN_MEM_MASK32));
+ printf("[JUS] Opening subfile: %s (%d, %d)\n", filename, param_2, param_3);

+ }
+
+ if (!debug_acl) return;
+ if (DebugEventData.procnum != ARMCPU_ARM9) return; //acl only valid on arm9
+ acl_check_access(DebugEventData.addr, CP15_ACCESS_EXECUTE);
}

diff --git a/desmume/src/debug.h b/desmume/src/debug.h
index 5dfda56a..a694e613 100644
--- a/desmume/src/debug.h
+++ b/desmume/src/debug.h
@@ -187,6 +187,7 @@ extern u32 debugFlag;

FORCEINLINE bool CheckDebugEvent(EDEBUG_EVENT event)
{
+ return true;
//for now, debug events are only handled in dev+ builds
#ifndef DEVELOPER
return false;
File renamed without changes.
14 changes: 14 additions & 0 deletions docs/articles/specs/other-research.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# JUSToolkit: Research documents

Here I list research info from other hackers.

- [DTX Research notes by pleonex](./koma-research.md): we can remove this as soon as we finish the koma.md docs.
- [FileFormats by Uknown Hacker](./file-formats.md): the hacker of the English translation made this document in his website.

## Videos

pleonex did some research on Streaming:

- [DIRECTO ROM Hacking: Triple reto de imágenes](https://www.youtube.com/watch?v=r1Rsx6RRe1U)
- [DIRECTO Domingos de desensamblador: imágenes de Devil Survivor y JUS y ordenar textos de MetalMax 3](https://www.youtube.com/watch?v=R2h-UEcO_-k)
- [DIRECTO Predomingos de desensamblador: CLYT de 3DS y el complejo caso de los sprites de JUS](https://www.youtube.com/watch?v=1KT4u_Kvaws)
128 changes: 64 additions & 64 deletions docs/articles/specs/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,51 @@ data structures, stored in files with `.bin` extension. Typically, we have
pointers and sentences, but each file is different, that's why we have a format
for each type of file. The [text specification](./texts.md) have more details.

- `battle/tutorial*.bin`: battle tutorial text
- `bin/ability_t.bin`: abilities
- `bin/bgm.bin`: battle background music
- `bin/chr_b_t.bin`: battle character abilities
- `bin/chr_s_t.bin`: support character abilities
- `bin/clearlst.bin`: stage goals
- `bin/commwin.bin`: common window messages
- `bin/demo.bin`: world names in demo player menu
- `bin/InfoDeck.aar/*`: koma explanation in gallery menu
- `bin/infoname.bin`: main menu helper names
- `bin/komatxt.bin`: koma names
- `bin/location.bin`: player location
- `bin/piece.bin`: manga author and info
- `bin/pname.bin`: player name titles
- `bin/rulemess.bin` stage rules
- `bin/stage.bin` stage names
- `bin/title.bin` manga names
- `deck/Deck.aar/*/*`: deck texts
- `deckmake/tutorial.bin`: deck tutorials
- `ending/ending.aar/ending/StaffRoll.bin`: TBD
- `ending/ending.aar/ending/TitleOrder.bin`: TBD
- `jgalaxy/jgalaxy.aar/jgalaxy/battle.bin`: JGalaxy battle texts
- `jgalaxy/jgalaxy.aar/jgalaxy/jgalaxy.bin`: JGalaxy texts
- `jgalaxy/jgalaxy.aar/jgalaxy/mission.bin`: JGalaxy mission texts
- `jquiz/jquiz_pack.aar/jquiz/jquiz.bin`: quiz questions
- `battle/tutorial*.bin`: tutorials.
- `bin/ability_t.bin`: helper character abilities.
- `bin/bgm.bin`: background music titles.
- `bin/chr_b_t.bin`: battle character abilities.
- `bin/chr_s_t.bin`: support character abilities.
- `bin/clearlst.bin`: stage goals.
- `bin/commwin.bin`: online communication messages.
- `bin/demo.bin`: world names in demo player menu (database).
- `bin/InfoDeck.aar/*`: menu helper explanations.
- `bin/infoname.bin`: menu helper names.
- `bin/komatxt.bin`: koma names.
- `bin/location.bin`: player locations.
- `bin/piece.bin`: manga synopsis, author and info.
- `bin/pname.bin`: player name titles.
- `bin/rulemess.bin` stage rules.
- `bin/stage.bin` stage names.
- `bin/title.bin` manga titles.
- `deck/Deck.aar/*/*`: pre-created deck names.
- `deckmake/tutorial.bin`: deck making tutorial.
- `ending/ending.aar/ending/StaffRoll.bin`: TBD.
- `ending/ending.aar/ending/TitleOrder.bin`: TBD.
- `jgalaxy/jgalaxy.aar/jgalaxy/battle.bin`: JGalaxy battle types.
- `jgalaxy/jgalaxy.aar/jgalaxy/jgalaxy.bin`: JGalaxy world and galaxy names.
- `jgalaxy/jgalaxy.aar/jgalaxy/mission.bin`: JGalaxy mission names.
- `jquiz/jquiz_pack.aar/jquiz/jquiz.bin`: JQuiz questions and answers.

## Fonts

The fonts are in the `font` folder with `ALFT` format.

- `font/DSFont.aft`
- `font/js8font.aft`
- `font/jskfont_q.aft`
- `font/jskfont.aft`
.
Comment thread
priverop marked this conversation as resolved.
- `font/DSFont.aft`.
- `font/js8font.aft`.
- `font/jskfont_q.aft`.
- `font/jskfont.aft`.

## Graphics

The main formats for images are:

- [`DSTX`](./dtx.md): textures
- `ALMT`: tile map
- `DSIG`: indexed image
- `ALTM`: tile map
- `ALOD`: unknown.
- `NCCL`: palette
- `ALMT`: tile map.
- `DSIG`: indexed image.
- `ALTM`: tile map.
- `ALOD`: unknown.
- `NCCL`: palette.

Additionally, _komas_ have their own format documented in the
[koma specification](./koma.md).
Expand All @@ -74,37 +74,37 @@ Additionally, _komas_ have their own format documented in the
The video codec is `VXDS` from Mobiclip. This codec was a previous version to
`MODS`. There are no known documentation or tools for this format.

- `opening/opening.vx`
- `opening/opening.vx`.

## Data structures

These files have different data structures to support different game features.

- `bin/ability.bin`
- `bin/chr_b.bin`
- `bin/chr_s.bin`
- `bin/clear.bin`
- `bin/exadd.bin`
- `bin/jpower.bin`
- `bin/secret.bin`
- `bin/state.bin`
- `ChildRom/`: download-play transferable ROM and icon
- `chr/ChrBin.aar/chr/ai/ai_param.bin`
- `chr/ChrBin.aar/chr/ai/*` (`AIPM`)
- `chr/ChrBin.aar/chr/ai/move/*` (`AIMV`)
- `chr/ChrBin.aar/chr/col/*`
- `chr/ChrBin.aar/chr/effect/*`
- `chr/ChrBin.aar/chr/shot/*`
- `demo/demo.aar/demo/*.mdf`
- `dwc/utility.bin`: assets for the online communication
- `item/item.aar/item/itemprob.ipf`
- `jgalaxy/jgalaxy.aar/jgalaxy/*.bin` (except the one in text)
- `opening/opening.aar/opening/star.bin`
- `opening/PassMark.bin`
- `opening/pattern.bin`
- `stage/stage.aar/stage/*.bin`
- `stage/stage.aar/stage/*.cam`
- `stage/stage.aar/stage/*.mob`
- `stage/stage.aar/stage/SuddenDeath.bin`
- `title/title.aar/title/*.bin`
- `topmenu/topmenu.aar/topmenu/*.bin`
- `bin/ability.bin`.
- `bin/chr_b.bin`.
- `bin/chr_s.bin`.
- `bin/clear.bin`.
- `bin/exadd.bin`.
- `bin/jpower.bin`.
- `bin/secret.bin`.
- `bin/state.bin`.
- `ChildRom/`: download-play transferable ROM and icon.
- `chr/ChrBin.aar/chr/ai/ai_param.bin`.
- `chr/ChrBin.aar/chr/ai/*` (`AIPM`).
- `chr/ChrBin.aar/chr/ai/move/*` (`AIMV`).
- `chr/ChrBin.aar/chr/col/*`.
- `chr/ChrBin.aar/chr/effect/*`.
- `chr/ChrBin.aar/chr/shot/*`.
- `demo/demo.aar/demo/*.mdf`.
- `dwc/utility.bin`: assets for the online communication.
- `item/item.aar/item/itemprob.ipf`.
- `jgalaxy/jgalaxy.aar/jgalaxy/*.bin` (except the one in text).
- `opening/opening.aar/opening/star.bin`.
- `opening/PassMark.bin`.
- `opening/pattern.bin`.
- `stage/stage.aar/stage/*.bin`.
- `stage/stage.aar/stage/*.cam`.
- `stage/stage.aar/stage/*.mob`.
- `stage/stage.aar/stage/SuddenDeath.bin`.
- `title/title.aar/title/*.bin`.
- `topmenu/topmenu.aar/topmenu/*.bin`.
3 changes: 3 additions & 0 deletions docs/articles/specs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- name: Overview
href: ./summary.md

- name: 🔎 Research documents
href: other-research.md

- name: 📁 Containers
- name: AAR / ALAR
href: alar.md
Expand Down
Binary file added docs/articles/tool/images/scenegate-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/articles/tool/images/scenegate-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/articles/tool/images/scenegate-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading