diff --git a/README.md b/README.md index f0e9a0f8..cd0c8e2b 100644 --- a/README.md +++ b/README.md @@ -1,112 +1,64 @@ -# JUSToolkit +
+

JUSToolkit

+
-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/) +
-## 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 ✔️ +

Romhacking tools for Jump Ultimate Stars! (NDS).

-### Batch Features -- Extract every .dig from any .aar (ALAR2/ALAR3) to PNG ✔️ -- Import multiple PNGs to an .aar ALAR3 container ✔️ +

+GitHub last commit +Build and release +MIT License +

-### 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. +
+

Arr! Don't forget to star the repo!

diff --git a/Resources/desmume_jus.diff b/Resources/desmume_jus.diff new file mode 100644 index 00000000..99db7e7a --- /dev/null +++ b/Resources/desmume_jus.diff @@ -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; diff --git a/docs/articles/specs/FileFormats.md b/docs/articles/specs/file-formats.md similarity index 100% rename from docs/articles/specs/FileFormats.md rename to docs/articles/specs/file-formats.md diff --git a/docs/articles/specs/other-research.md b/docs/articles/specs/other-research.md new file mode 100644 index 00000000..85fa1deb --- /dev/null +++ b/docs/articles/specs/other-research.md @@ -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) diff --git a/docs/articles/specs/summary.md b/docs/articles/specs/summary.md index f685fe3a..c17026cc 100644 --- a/docs/articles/specs/summary.md +++ b/docs/articles/specs/summary.md @@ -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` +. +- `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). @@ -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`. diff --git a/docs/articles/specs/toc.yml b/docs/articles/specs/toc.yml index 86045b08..b46c7a7a 100644 --- a/docs/articles/specs/toc.yml +++ b/docs/articles/specs/toc.yml @@ -2,6 +2,9 @@ - name: Overview href: ./summary.md +- name: 🔎 Research documents + href: other-research.md + - name: 📁 Containers - name: AAR / ALAR href: alar.md diff --git a/docs/articles/tool/images/scenegate-1.png b/docs/articles/tool/images/scenegate-1.png new file mode 100644 index 00000000..03fc87b1 Binary files /dev/null and b/docs/articles/tool/images/scenegate-1.png differ diff --git a/docs/articles/tool/images/scenegate-2.png b/docs/articles/tool/images/scenegate-2.png new file mode 100644 index 00000000..10eed296 Binary files /dev/null and b/docs/articles/tool/images/scenegate-2.png differ diff --git a/docs/articles/tool/images/scenegate-3.png b/docs/articles/tool/images/scenegate-3.png new file mode 100644 index 00000000..74c94bec Binary files /dev/null and b/docs/articles/tool/images/scenegate-3.png differ diff --git a/docs/articles/tool/install.md b/docs/articles/tool/install.md index 9814babb..559431e3 100644 --- a/docs/articles/tool/install.md +++ b/docs/articles/tool/install.md @@ -21,31 +21,3 @@ Preview versions can be downloaded from the project But they expire after a few days. You may want to follow the [source code README file](https://github.com/priverop/JUSToolkit) to build the latest version yourself. - -## How to use - -`./JUS.CLI jus [type] [feature] [args]` - -- 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 - -To get the arguments of a feature you can use: -`./JUS.CLI jus [type] [feature] -h` - -Examples: -`./JUS.CLI jus containers export-alar3 --container test.aar --output myDirectory` -`./JUS.CLI jus containers export-alar3 -h` diff --git a/docs/articles/tool/scenegate.md b/docs/articles/tool/scenegate.md new file mode 100644 index 00000000..351d6c33 --- /dev/null +++ b/docs/articles/tool/scenegate.md @@ -0,0 +1,27 @@ +# JUSToolkit: SceneGate plugin + +[SceneGate](https://code.pleonex.dev/SceneGate/SceneGate) is a UI tool for reverse +engineering analysis. You can import your custom Yarhl converters to analyze your +own games. + +In this guide we'll see how to import the JUSToolkit converters. + +## How to + +1. Download the [latest SceneGate release](https://code.pleonex.dev/SceneGate/SceneGate/releases). + +2. Compile this tool (JUSToolkit) and copy `src/JUS.Tool/bin/Debug/net10.0/JUS.Tool.dll`, +and `src/JUS.SceneGatePlugin/bin/Debug/net10.0/JUS.SceneGatePlugin.dll`, to the +downloaded `SceneGate` folder, with the rest of .dll. + +3. Run `SceneGate.Destktop`, open your legal dump of the game, select it, and +double click in the Suggested Converter `Binary2NitroRom`. + +![scenegate-nitrorom](./images/scenegate-1.png) + +1. You can now navigate through the game files, and convert them using the Suggested +Converters. You can display by double clicking after the conversion. +For _.dig + .atm_ convert both, and double click on the _.atm_. + +![scenegate-suggestedconverters](./images/scenegate-2.png) +![scenegate-dig](./images/scenegate-3.png) diff --git a/docs/articles/tool/scripts.md b/docs/articles/tool/scripts.md new file mode 100644 index 00000000..8b30a247 --- /dev/null +++ b/docs/articles/tool/scripts.md @@ -0,0 +1,12 @@ +# JUSToolkit: Scripts + +These are some dev scripts to make our life easier. + +- **beta.sh:** generates a new beta translation rom if you have access to the + Translation repo. + +- **export_aar.sh:** exports every .aar of a specific folder using the tool. + **TODO: migrate to a command.** + +- **game_formats_analyzer:** analyzes all the game files, getting their magic id, +and first bytes. Creates a CSV with the info. **TODO: migrate to a command.** diff --git a/docs/articles/tool/toc.yml b/docs/articles/tool/toc.yml index 7f712516..5e66fafe 100644 --- a/docs/articles/tool/toc.yml +++ b/docs/articles/tool/toc.yml @@ -5,3 +5,12 @@ - name: 🛠️ JUSToolkit console - name: Installation href: install.md + +- name: How to use + href: usage.md + +- name: Scripts + href: scripts.md + +- name: SceneGate Plugin + href: scenegate.md diff --git a/docs/articles/tool/usage.md b/docs/articles/tool/usage.md new file mode 100644 index 00000000..f84711e8 --- /dev/null +++ b/docs/articles/tool/usage.md @@ -0,0 +1,33 @@ +# JUSToolkit: How to use + +`./JUS.CLI jus [format_type] [feature] [args]` + +To get the arguments of a feature you can use: +`./JUS.CLI jus [format_type] [feature] -h` + +**Example:** `./JUS.CLI jus containers export-alar3 --container test.aar --output myDirectory` + +--- + +## Format Types + +**Containers:** _ALAR_. We can export every file from a container, or import a +folder of files into a container. The import only replaces existing files, it +doesn't add news. It autodetects the format (ALAR2 or ALAR3). + +**Graphics:** _DSIG_, _ALMT_, _DTX_, and komas (_DTX_ + _koma.bin_ + _kshape.bin_ + _koma.aar_). +Export and import graphics. For the _DTX_ type 03 TX, we can export a .yaml file +with the segments metadata, to modify them in the importing. We can also export +the base image of the _DTX_ files. For komas, we can export a single one, or all +of them in batch. We have a `merge-dig` command for importing comics, where a +single `.dig` file can have multiple `.atm`. + +**Texts:** _.bin_. Export text files into .po, or import .po into text files. We +can export/import a single file, or folder with files/.po. Deck, and jQuiz are +big .bin split into multiple .po, that's why they have their specific commands. + +**Batch:** These commands mix commands and graphics exports. We can export/import +graphics from .aar directly. Here we also have generic util commands. + +**Game:** These commands import graphics, .po files, or the modified font, directly +to the game using Ekona. Generating a modified ROM. diff --git a/docs/docfx.json b/docs/docfx.json index 82d0102e..b740b8b7 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -1,66 +1,81 @@ { - "metadata": [ - { - "src": [ - { - "files": [ - "JUS.Tool/*.csproj" - ], - "src": "../src" - } - ], - "dest": "api", - "includePrivateMembers": false, - "disableGitFeatures": false, - "disableDefaultFilter": false, - "noRestore": false, - "namespaceLayout": "flattened", - "memberLayout": "samePage", - "EnumSortOrder": "alphabetic", - "allowCompilationErrors": false - } - ], - "build": { - "content": [ + "metadata": [ + { + "src": [ { "files": [ - "api/**.yml", - "api/index.md" - ] - }, - { "files": "**/*.{md,yml}", "src": "articles", "dest": "docs" }, - { "files": [ "toc.yml", "*.md" ] } - ], - "resource": [ - { - "files": [ "**/images/**", "**/resources/**" ], - "exclude": [ "_site/**", "obj/**" ] + "JUS.Tool/*.csproj" + ], + "src": "../src" } ], - "output": "_site", - "globalMetadata": { - "_appTitle": "JUS Toolkit", - "_appName": "JUS Toolkit", - "_appFooter": "Copyright (c) 2019 Pablo Rivero", - // "_appLogoPath": "images/logo_48.png", - // "_appFaviconPath": "images/favicon.png", - "_enableSearch": true, - "_enableNewTab": true, - "_lang": "en" - }, - "fileMetadataFiles": [], - "template": [ - "default", - "modern", - "template" - ], - "postProcessors": [], - "keepFileLink": false, + "dest": "api", + "includePrivateMembers": false, "disableGitFeatures": false, - "sitemap": { - "baseUrl": "https://priverop.github.io/JUSTollkit", - "priority": 0.5, - "changefreq": "monthly" + "disableDefaultFilter": false, + "noRestore": false, + "namespaceLayout": "flattened", + "memberLayout": "samePage", + "EnumSortOrder": "alphabetic", + "allowCompilationErrors": false + } + ], + "build": { + "content": [ + { + "files": [ + "api/**.yml", + "api/index.md" + ] + }, + { + "files": "**/*.{md,yml}", + "src": "articles", + "dest": "docs" + }, + { + "files": [ + "toc.yml", + "*.md" + ] + } + ], + "resource": [ + { + "files": [ + "**/images/**", + "**/resources/**" + ], + "exclude": [ + "_site/**", + "obj/**" + ] } + ], + "output": "_site", + "globalMetadata": { + "_appTitle": "JUS Toolkit", + "_appName": "JUS Toolkit", + "_appFooter": "Copyright (c) 2019 Pablo Rivero", + "_appLogoPath": "images/icon_50.webp", + "_appFaviconPath": "images/favicon.webp", + "_enableSearch": true, + "_enableNewTab": true, + "_lang": "en" + }, + "fileMetadataFiles": [], + "template": [ + "default", + "modern", + "template" + ], + "postProcessors": [], + "keepFileLink": false, + "disableGitFeatures": false, + "sitemap": { + "baseUrl": "https://priverop.github.io/JUSTollkit", + "priority": 0.5, + "changefreq": "monthly" } -} + } +} \ No newline at end of file diff --git a/docs/images/favicon.webp b/docs/images/favicon.webp new file mode 100644 index 00000000..62dce353 Binary files /dev/null and b/docs/images/favicon.webp differ diff --git a/docs/images/icon_50.webp b/docs/images/icon_50.webp new file mode 100644 index 00000000..d55f32e9 Binary files /dev/null and b/docs/images/icon_50.webp differ diff --git a/docs/images/logo_full.webp b/docs/images/logo_full.webp new file mode 100644 index 00000000..0b34a7ef Binary files /dev/null and b/docs/images/logo_full.webp differ diff --git a/docs/images/logo_j.webp b/docs/images/logo_j.webp new file mode 100644 index 00000000..52b6cc90 Binary files /dev/null and b/docs/images/logo_j.webp differ diff --git a/docs/images/logo_pirate.webp b/docs/images/logo_pirate.webp new file mode 100644 index 00000000..b87c748a Binary files /dev/null and b/docs/images/logo_pirate.webp differ diff --git a/docs/index.md b/docs/index.md index 5f027e5c..459e2aa8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,40 +1,28 @@ -# JUSToolkit +

JUSToolkit

-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/) +

Romhacking tools for Jump Ultimate Stars! (NDS).

-## Features - -Done ✔️ To test / with issues ⚠️ Not done 🛑 - -### Containers - -- Pack .aar ALAR3 ✔️ -- Unpack .aar ALAR3 ✔️ -- Pack .aar ALAR2 ✔️ -- Unpack .aar ALAR2 ✔️ - -### Graphics +

+GitHub last commit +Build and release +MIT License +

-- Extract ALMT + DIG ✔️ -- Import ALMT + DIG ✔️ -- Extract DTX ✔️ -- Import DTX 🛑 +--- -### Texts - -- Extract and import ✔️ +## Features -### Batch Features +- **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. -- Extract every .dig from any .aar (ALAR2/ALAR3) to PNG ✔️ -- Import multiple PNGs to an .aar ALAR3 container ✔️ +Check [**usage**](https://priverop.github.io/JUSToolkit/docs/tool/usage.html) for more info. ## Credits -Special thanks to [pleonex](https://fosstodon.org/@pleonex) for his help, for -Yarhl, and PleOps.Cake. - -Thanks to [TraduSquare](https://tradusquare.es) for the inspiration and support. - -Thanks to the Jump Ultimate Stars! devs for this amazing game. +- [**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! \ No newline at end of file diff --git a/scripts/beta_migration.sh b/scripts/beta_migration.sh deleted file mode 100755 index 64867685..00000000 --- a/scripts/beta_migration.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash - -## This script was used to migrate the translations from the old format in Weblate to the new format, for Weblate. - -set -e - -clear - -JUS_PATH='JUSToolkit/src/JUS.CLI' -BETA_PATH='/beta_textos' -ROM_PATH=$JUS_PATH/bin/Debug/net8.0/jump_en.nds - -rm -f $BETA_PATH/new_game.nds -rm -f $BETA_PATH/new_game_font.nds - -cd $JUS_PATH -# dotnet build -cd $JUS_PATH/bin/Debug/net8.0 - -## TUTORIAL -# PO -#./JUS.CLI jus texts batchExport --directory $BETA_PATH/en_rom/battle --output $BETA_PATH/en_rom/battle_po -# Deckmake PO -#./JUS.CLI jus texts export --bin $BETA_PATH/en_rom/deckmake/tutorial.bin --output $BETA_PATH/en_rom/deckmake_po -# Pomerge -#pomerge --from $BETA_PATH/old_weblate/tutorial/**.po --to $BETA_PATH/new_weblate/tutorial/**.po -# Insertar a BIN -#./JUS.CLI jus texts batchImport --directory $BETA_PATH/new_weblate/tutorial --output $BETA_PATH/new_rom/tutorial_bin -# Insertar a la ROM -# ./JUS.CLI jus game import --game $ROM_PATH --input $BETA_PATH/new_rom/tutorial --output $BETA_PATH - -## UNICOS -# PO -# ./JUS.CLI jus texts batchExport --directory $BETA_PATH/en_rom/bin --output $BETA_PATH/en_rom/bin_po -# cp -r $BETA_PATH/en_rom/bin_po/ $BETA_PATH/new_weblate/bin/ -# Pomerge -# pomerge --from $BETA_PATH/old_weblate/unicos_new/**.po --to $BETA_PATH/new_weblate/bin/**.po -# Borramos la primera linea por el bug de pomerge -# for archivo in "$BETA_PATH/new_weblate/bin"/*.po; do -# sed -i '' '1d' "$archivo" -# done -# Insertar a BIN -# ./JUS.CLI jus texts batchImport --directory $BETA_PATH/new_weblate/bin --output $BETA_PATH/new_rom/bin_bin -# Insertar a la ROM -# ./JUS.CLI jus game import --game $ROM_PATH --input $BETA_PATH/new_rom/bin_bin --output $BETA_PATH - -## JGALAXY -# PO -# ./JUS.CLI jus texts batchExport --directory $BETA_PATH/en_rom/jgalaxy --output $BETA_PATH/en_rom/jgalaxy_po -# cp -r $BETA_PATH/en_rom/jgalaxy_po/ $BETA_PATH/new_weblate/jgalaxy/ -# Pomerge -# pomerge --from $BETA_PATH/old_weblate/jgalaxy/**.po --to $BETA_PATH/new_weblate/jgalaxy/**.po -# Borramos la primera linea por el bug de pomerge -# for archivo in "$BETA_PATH/new_weblate/jgalaxy"/*.po; do -# sed -i '' '1d' "$archivo" -# done -# Insertar a BIN -# ./JUS.CLI jus texts batchImport --directory $BETA_PATH/new_weblate/jgalaxy --output $BETA_PATH/new_rom/jgalaxy_bin -# Insertar a la ROM -# ./JUS.CLI jus game import --game $ROM_PATH --input $BETA_PATH/new_rom/jgalaxy_bin --output $BETA_PATH - -## INFODECK (Deck) -# RENAME -# for archivo in "$BETA_PATH/en_rom/infodeck/deck"/*.bin; do -# nombre_archivo=$(basename "$archivo") -# nuevo_nombre="bin-deck-$nombre_archivo" -# mv "$archivo" "$BETA_PATH/en_rom/infodeck/deck/$nuevo_nombre" -# done -# PO -# ./JUS.CLI jus texts batchExport --directory $BETA_PATH/en_rom/infodeck/deck --output $BETA_PATH/en_rom/infodeck_deck_po -# cp -r $BETA_PATH/en_rom/infodeck_deck_po/ $BETA_PATH/new_weblate/infodeck/ -# Pomerge -# pomerge --from $BETA_PATH/old_weblate/InfoDeck/**.po --to $BETA_PATH/new_weblate/InfoDeck/**.po -# Borramos la primera linea por el bug de pomerge -# for archivo in "$BETA_PATH/new_weblate/InfoDeck"/*.po; do -# sed -i '' '1d' "$archivo" -# done -# Insertar a BIN -# ./JUS.CLI jus texts batchImport --directory $BETA_PATH/new_weblate/InfoDeck --output $BETA_PATH/new_rom/InfoDeck_bin -# Insertar a la ROM -# ./JUS.CLI jus game import --game $ROM_PATH --input $BETA_PATH/new_rom/InfoDeck_bin --output $BETA_PATH - -## DECK -# PO -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/jadv --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/jard --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/jard_p --pdeck --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/jarg --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/jarg_p --pdeck --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/play --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/priv --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/smpl --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/smpl_p --pdeck --output $BETA_PATH/en_rom/deck_po -# ./JUS.CLI jus texts deckExport --directory $BETA_PATH/en_rom/deck/test --output $BETA_PATH/en_rom/deck_po -# cp -r $BETA_PATH/en_rom/deck_po/ $BETA_PATH/new_weblate/deck/ -# Pomerge -# pomerge --from $BETA_PATH/old_weblate/deck/**.po --to $BETA_PATH/new_weblate/deck/**.po -# Borramos la primera linea por el bug de pomerge -# for archivo in "$BETA_PATH/new_weblate/deck"/*.po; do -# sed -i '' '1d' "$archivo" -# done -# Insertar a BIN -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-jadv.po --output $BETA_PATH/new_rom/deck_bin/jadv/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-jard.po --output $BETA_PATH/new_rom/deck_bin/jard/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-jard_p.po --pdeck --output $BETA_PATH/new_rom/deck_bin/jard_p/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-jarg.po --output $BETA_PATH/new_rom/deck_bin/jarg/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-jarg_p.po --pdeck --output $BETA_PATH/new_rom/deck_bin/jarg_p/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-play.po --output $BETA_PATH/new_rom/deck_bin/play/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-priv.po --output $BETA_PATH/new_rom/deck_bin/priv/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-smpl.po --output $BETA_PATH/new_rom/deck_bin/smpl/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-smpl_p.po --pdeck --output $BETA_PATH/new_rom/deck_bin/smpl_p/ -# ./JUS.CLI jus texts deckImport --po $BETA_PATH/new_weblate/decktest/deck-test.po --output $BETA_PATH/new_rom/deck_bin/test/ -# Importar al juego -# ./JUS.CLI jus game import --game $ROM_PATH --input $BETA_PATH/new_rom/deck_bin/jadv --output $BETA_PATH -# ./JUS.CLI jus game import --game $BETA_PATH/new_game.nds --input $BETA_PATH/new_rom/deck_bin/jard --output $BETA_PATH -# ./JUS.CLI jus game import --game $BETA_PATH/new_game.nds --input $BETA_PATH/new_rom/deck_bin/jarg --output $BETA_PATH -# ./JUS.CLI jus game import --game $BETA_PATH/new_game.nds --input $BETA_PATH/new_rom/deck_bin/play --output $BETA_PATH -# ./JUS.CLI jus game import --game $BETA_PATH/new_game.nds --input $BETA_PATH/new_rom/deck_bin/priv --output $BETA_PATH -# ./JUS.CLI jus game import --game $BETA_PATH/new_game.nds --input $BETA_PATH/new_rom/deck_bin/smpl --output $BETA_PATH -# ./JUS.CLI jus game import --game $BETA_PATH/new_game.nds --input $BETA_PATH/new_rom/deck_bin/test --output $BETA_PATH - -## JQuiz -# PO -# ./JUS.CLI jus texts exportJQuiz --bin $BETA_PATH/en_rom/jquiz/jquiz.bin --output $BETA_PATH/en_rom/jquiz_po -# cp -r $BETA_PATH/en_rom/jquiz_po/ $BETA_PATH/new_weblate/jquiz/ -# Pomerge I didn't really need to Merge anything because they were the same. The only change was the name of the files 0 -> 00, 1 -> 01, etc. -# Insertar a BIN -# ./JUS.CLI jus texts importjquiz --container $BETA_PATH/new_weblate/jquiz/ --output $BETA_PATH/new_rom/jquiz_bin/ -# Importar al juego -# ./JUS.CLI jus game import --game $ROM_PATH --input $BETA_PATH/new_rom/jquiz_bin/ --output $BETA_PATH - -## Font -./JUS.CLI jus game importFont --game $BETA_PATH/new_game.nds --font $BETA_PATH/new_rom/font/jskfont_esp.aft --output $BETA_PATH - -# Abrimos el juego -/Applications/melonDS.app/Contents/MacOS/melonDS $BETA_PATH/new_game_font.nds - diff --git a/scripts/copy_text_format.sh b/scripts/copy_text_format.sh deleted file mode 100755 index d629b24d..00000000 --- a/scripts/copy_text_format.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -# Script to copy and rename text format files with proper casing -# Usage: ./copy_text_format.sh new_format old_format - -set -e # Exit on error - -# Error handling function -error() { - echo "Error: $1" >&2 - exit 1 -} - -if [ $# -ne 2 ]; then - error "We need two arguments. Usage: ./copy_text_format.sh new_format old_format" -fi - -NEW_FORMAT=$1 -OLD_FORMAT=$2 - -# Get the script's directory and set relative paths -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -BASE_DIR="$(dirname "$SCRIPT_DIR")" -SRC_DIR="$BASE_DIR/src" - -# Convert format names to proper casing -OLD_FORMAT_LOWER=$(echo "${OLD_FORMAT}" | awk '{print tolower(substr($1,1,1))substr($1,2)}') -NEW_FORMAT_LOWER=$(echo "${NEW_FORMAT}" | awk '{print tolower(substr($1,1,1))substr($1,2)}') - -# Process files in Formats directory -FORMATS_DIR="$SRC_DIR/JUS.Tool/Texts/Formats" -[ -d "$FORMATS_DIR" ] || error "Formats directory not found: $FORMATS_DIR" -cd "$FORMATS_DIR" || error "Failed to change to Formats directory" - -# Copy and modify format files -for FILE_PAIR in \ - "${OLD_FORMAT}.cs:${NEW_FORMAT}.cs" \ - "${OLD_FORMAT}Entry.cs:${NEW_FORMAT}Entry.cs" -do - OLD_FILE="${FILE_PAIR%%:*}" - NEW_FILE="${FILE_PAIR##*:}" - [ -f "$OLD_FILE" ] || error "Source file not found: $OLD_FILE" - cp "$OLD_FILE" "$NEW_FILE" || error "Failed to copy $OLD_FILE to $NEW_FILE" - sed -i "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "$NEW_FILE" - sed -i "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "$NEW_FILE" -done - -# Process files in Converters directory -CONVERTERS_DIR="../Converters" -[ -d "$CONVERTERS_DIR" ] || error "Converters directory not found: $CONVERTERS_DIR" -cd "$CONVERTERS_DIR" || error "Failed to change to Converters directory" - -# Copy and modify converter files -for FILE_PAIR in \ - "${OLD_FORMAT}2Po.cs:${NEW_FORMAT}2Po.cs" \ - "Binary2${OLD_FORMAT}.cs:Binary2${NEW_FORMAT}.cs" -do - OLD_FILE="${FILE_PAIR%%:*}" - NEW_FILE="${FILE_PAIR##*:}" - [ -f "$OLD_FILE" ] || error "Source file not found: $OLD_FILE" - cp "$OLD_FILE" "$NEW_FILE" || error "Failed to copy $OLD_FILE to $NEW_FILE" - sed -i "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "$NEW_FILE" - sed -i "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "$NEW_FILE" -done - -# Process files in Tests directory -TESTS_DIR="$SRC_DIR/JUS.Tests/Texts" -[ -d "$TESTS_DIR" ] || error "Tests directory not found: $TESTS_DIR" -cd "$TESTS_DIR" || error "Failed to change to Tests directory" - -# Copy and modify test files -TEST_OLD_FILE="${OLD_FORMAT}FormatTest.cs" -TEST_NEW_FILE="${NEW_FORMAT}FormatTest.cs" -[ -f "$TEST_OLD_FILE" ] || error "Source test file not found: $TEST_OLD_FILE" -cp "$TEST_OLD_FILE" "$TEST_NEW_FILE" || error "Failed to copy $TEST_OLD_FILE to $TEST_NEW_FILE" -sed -i "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "$TEST_NEW_FILE" -sed -i "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "$TEST_NEW_FILE" - -echo "Successfully created and modified all files for format: $NEW_FORMAT" diff --git a/scripts/copy_text_format_osx.sh b/scripts/copy_text_format_osx.sh deleted file mode 100644 index 2ea4e1e0..00000000 --- a/scripts/copy_text_format_osx.sh +++ /dev/null @@ -1,36 +0,0 @@ -#/bin/bash - -NEW_FORMAT=$1 -OLD_FORMAT=$2 -DIRECTORY=".../JUSToolkit/src/" - -if [ $# -ne 2 ]; then - echo "We need two arguments. Usage: ./copy_text_format new_format old_format" - exit 1 -fi - -OLD_FORMAT_LOWER=`echo "${OLD_FORMAT}" | awk '{$1=tolower(substr($1,0,1))substr($1,2)}1'` -NEW_FORMAT_LOWER=`echo "${NEW_FORMAT}" | awk '{$1=tolower(substr($1,0,1))substr($1,2)}1'` - -cd "${DIRECTORY}/JUS.Tool/Texts/Formats" -cp "${OLD_FORMAT}.cs" "${NEW_FORMAT}.cs" -sed -i "" "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "${NEW_FORMAT}.cs" -sed -i "" "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "${NEW_FORMAT}.cs" - -cp "${OLD_FORMAT}Entry.cs" "${NEW_FORMAT}Entry.cs" -sed -i "" "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "${NEW_FORMAT}Entry.cs" -sed -i "" "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "${NEW_FORMAT}Entry.cs" - -cd "../Converters" -cp "${OLD_FORMAT}2Po.cs" "${NEW_FORMAT}2Po.cs" -sed -i "" "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "${NEW_FORMAT}2Po.cs" -sed -i "" "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "${NEW_FORMAT}2Po.cs" - -cp "Binary2${OLD_FORMAT}.cs" "Binary2${NEW_FORMAT}.cs" -sed -i "" "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "Binary2${NEW_FORMAT}.cs" -sed -i "" "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "Binary2${NEW_FORMAT}.cs" - -cd "${DIRECTORY}/JUS.Tests/Texts/" -cp "${OLD_FORMAT}FormatTest.cs" "${NEW_FORMAT}FormatTest.cs" -sed -i "" "s/${OLD_FORMAT}/${NEW_FORMAT}/g" "${NEW_FORMAT}FormatTest.cs" -sed -i "" "s/${OLD_FORMAT_LOWER}/${NEW_FORMAT_LOWER}/g" "${NEW_FORMAT}FormatTest.cs" diff --git a/scripts/demo.sh b/scripts/demo.sh deleted file mode 100644 index 6b249d10..00000000 --- a/scripts/demo.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -set -e -## This is the script I was to import the Demo images into the game. - -# In the DEBUGDIR I create a directory (DEMODIR) with a directory for each manga with its .png, .dig and .atm. - -WORKDIR='/JUSToolkit/src/JUS.CLI' -DEBUGDIR='./bin/Debug/net6.0' -DEMODIR=/ # This is the home folder where you have your files -TESTDIR='where you have the game unpacked' - -MANGA='bb' - -cd $WORKDIR -dotnet build -cd $DEBUGDIR - -# Singles -echo 'Singles' -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_02.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_02.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_02.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_04.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_04.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_04.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_06.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_06.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_06.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_08.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_08.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_08.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_10.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_10.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_10.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_11.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_11.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_11.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_title.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_title.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_title.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics import-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_c_01.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_c_01.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_c_01.atm --output ${DEMODIR}/${MANGA}_output -# Specials -echo 'Specials' -./JUS.CLI jus graphics merge-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_03.png ${DEMODIR}/${MANGA}_input/${MANGA}_m_00.png ${DEMODIR}/${MANGA}_input/${MANGA}_n_00.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_03.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_03.atm ${DEMODIR}/${MANGA}_input/${MANGA}_m_00.atm ${DEMODIR}/${MANGA}_input/${MANGA}_n_00.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics merge-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_05.png ${DEMODIR}/${MANGA}_input/${MANGA}_m_01.png ${DEMODIR}/${MANGA}_input/${MANGA}_n_01.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_05.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_05.atm ${DEMODIR}/${MANGA}_input/${MANGA}_m_01.atm ${DEMODIR}/${MANGA}_input/${MANGA}_n_01.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics merge-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_07.png ${DEMODIR}/${MANGA}_input/${MANGA}_m_02.png ${DEMODIR}/${MANGA}_input/${MANGA}_n_02.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_07.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_07.atm ${DEMODIR}/${MANGA}_input/${MANGA}_m_02.atm ${DEMODIR}/${MANGA}_input/${MANGA}_n_02.atm --output ${DEMODIR}/${MANGA}_output -./JUS.CLI jus graphics merge-dig --input ${DEMODIR}/${MANGA}_input/${MANGA}_09.png ${DEMODIR}/${MANGA}_input/${MANGA}_m_03.png ${DEMODIR}/${MANGA}_input/${MANGA}_n_03.png --insertTransparent --dig ${DEMODIR}/${MANGA}_input/${MANGA}_09.dig --atm ${DEMODIR}/${MANGA}_input/${MANGA}_09.atm ${DEMODIR}/${MANGA}_input/${MANGA}_m_03.atm ${DEMODIR}/${MANGA}_input/${MANGA}_n_03.atm --output ${DEMODIR}/${MANGA}_output -# Compress into alar3 -echo 'Compress into alar3' -./JUS.CLI jus containers import-alar3 --container ${DEMODIR}/demo.aar --input ${DEMODIR}/${MANGA}_output --output ${DEMODIR}/${MANGA}_output -# Copy the generated .aar to the unpacked game directory -cp ${DEMODIR}/${MANGA}_output/imported_${DEMODIR}/demo.aar $TESTDIR/data/demo/demo.aar -# Copy the generated .aar to the DEMODIR so that you can use it for the next manga -cp ${DEMODIR}/${MANGA}_output/imported_${DEMODIR}/demo.aar ${DEMODIR}/demo.aar -# Generate the build -cd $TESTDIR -./ndstool -c build.nds -9 arm9.bin -7 arm7.bin -y9 y9.bin -y7 y7.bin -d data -y overlay -t banner.bin -h header.bin\ \ No newline at end of file diff --git a/scripts/demo_test.sh b/scripts/demo_test.sh deleted file mode 100755 index c70661a2..00000000 --- a/scripts/demo_test.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -set -e - -# In the DEBUGDIR I create a directory (DEMODIR) with a directory for each manga with its .png, .dig and .atm. - -WORKDIR='//JUSToolkit/src/JUS.CLI' -DEBUGDIR='./bin/Debug/net8.0' -DEMODIR=18-demo -FULL_DEMODIR=$WORKDIR'/bin/Debug/net8.0/'$DEMODIR -TESTDIR='//JUSToolkit/src/JUS.CLI/bin/Debug/net8.0/18-demo/unpacked' - -MANGA='dn' - -cd $WORKDIR -# dotnet build -cd $DEBUGDIR - -rm -rf ${FULL_DEMODIR}/${MANGA}_output - -# Singles -# echo 'Singles' -# ./JUS.CLI jus graphics import-dig --input ${FULL_DEMODIR}/${MANGA}_02.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_02.dig --atm ${FULL_DEMODIR}/${MANGA}_02.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics import-dig --input ${FULL_DEMODIR}/${MANGA}_04.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_04.dig --atm ${FULL_DEMODIR}/${MANGA}_04.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics import-dig --input ${FULL_DEMODIR}/${MANGA}_06.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_06.dig --atm ${FULL_DEMODIR}/${MANGA}_06.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics import-dig --input ${FULL_DEMODIR}/${MANGA}_08.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_08.dig --atm ${FULL_DEMODIR}/${MANGA}_08.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics import-dig --input ${FULL_DEMODIR}/${MANGA}_10.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_10.dig --atm ${FULL_DEMODIR}/${MANGA}_10.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics import-dig --input ${FULL_DEMODIR}/${MANGA}_11.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_11.dig --atm ${FULL_DEMODIR}/${MANGA}_11.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics import-dig --input ${FULL_DEMODIR}/${MANGA}_title.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_title.dig --atm ${FULL_DEMODIR}/${MANGA}_title.atm --output ${FULL_DEMODIR}/${MANGA}_output -# Specials -echo 'Specials' -./JUS.CLI jus graphics merge-dig --input ${FULL_DEMODIR}/${MANGA}_03.png ${FULL_DEMODIR}/${MANGA}_m_00.png ${FULL_DEMODIR}/${MANGA}_n_00.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_03.dig --atm ${FULL_DEMODIR}/${MANGA}_03.atm ${FULL_DEMODIR}/${MANGA}_m_00.atm ${FULL_DEMODIR}/${MANGA}_n_00.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics merge-dig --input ${FULL_DEMODIR}/${MANGA}_05.png ${FULL_DEMODIR}/${MANGA}_m_01.png ${FULL_DEMODIR}/${MANGA}_n_01.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_05.dig --atm ${FULL_DEMODIR}/${MANGA}_05.atm ${FULL_DEMODIR}/${MANGA}_m_01.atm ${FULL_DEMODIR}/${MANGA}_n_01.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics merge-dig --input ${FULL_DEMODIR}/${MANGA}_07.png ${FULL_DEMODIR}/${MANGA}_m_02.png ${FULL_DEMODIR}/${MANGA}_n_02.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_07.dig --atm ${FULL_DEMODIR}/${MANGA}_07.atm ${FULL_DEMODIR}/${MANGA}_m_02.atm ${FULL_DEMODIR}/${MANGA}_n_02.atm --output ${FULL_DEMODIR}/${MANGA}_output -# ./JUS.CLI jus graphics merge-dig --input ${FULL_DEMODIR}/${MANGA}_09.png ${FULL_DEMODIR}/${MANGA}_m_03.png ${FULL_DEMODIR}/${MANGA}_n_03.png --insertTransparent --dig ${FULL_DEMODIR}/${MANGA}_09.dig --atm ${FULL_DEMODIR}/${MANGA}_09.atm ${FULL_DEMODIR}/${MANGA}_m_03.atm ${FULL_DEMODIR}/${MANGA}_n_03.atm --output ${FULL_DEMODIR}/${MANGA}_output -# Compress into alar3 -echo 'Compress into alar3' -./JUS.CLI jus containers import-alar3 --container ${FULL_DEMODIR}/demo.aar --input ${FULL_DEMODIR}/${MANGA}_output --output ${FULL_DEMODIR}/${MANGA}_output -# Copy the generated .aar to the unpacked game directory -cp ${FULL_DEMODIR}/${MANGA}_output/imported.aar $TESTDIR/data/demo/demo.aar -# Copy the generated .aar to the DEMODIR so that you can use it for the next manga -cp ${FULL_DEMODIR}/${MANGA}_output/imported.aar ${FULL_DEMODIR}/demo.aar -# Generate the build -cd $TESTDIR -./ndstool -c build.nds -9 arm9.bin -7 arm7.bin -y9 y9.bin -y7 y7.bin -d data -y overlay -t banner.bin -h header.bin - -/Applications/melonDS.app/Contents/MacOS/melonDS $TESTDIR/build.nds \ No newline at end of file diff --git a/scripts/export_texts.sh b/scripts/export_texts.sh deleted file mode 100755 index 760b388a..00000000 --- a/scripts/export_texts.sh +++ /dev/null @@ -1,21 +0,0 @@ -#/bin/bash - -cd "/Users//Dev/JUSToolkit/src/JUS.CLI" -dotnet build -cd "./bin/Debug/net6.0/" - -# ./JUS.CLI jus texts export --bin 04-textos/jp/ability_t.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/bgm.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/clearlst.bin --output 04-textos/jp/po -# ./JUS.CLI jus texts export --bin 04-textos/jp/commwin.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/chr_b_t.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/chr_s_t.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/demo.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/infoname.bin --output 04-textos/jp/po -# ./JUS.CLI jus texts export --bin 04-textos/jp/komatxt.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/location.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/piece.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/pname.bin --output 04-textos/jp/po -# ./JUS.CLI jus texts export --bin 04-textos/jp/rulemess.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/stage.bin --output 04-textos/jp/po -./JUS.CLI jus texts export --bin 04-textos/jp/title.bin --output 04-textos/jp/po \ No newline at end of file diff --git a/src/JUS.CLI/JUS/CommandLine.cs b/src/JUS.CLI/JUS/CommandLine.cs index 57507ad7..b2df3083 100644 --- a/src/JUS.CLI/JUS/CommandLine.cs +++ b/src/JUS.CLI/JUS/CommandLine.cs @@ -256,30 +256,6 @@ private static Command CreateContainerCommand() parseResult.GetValue(exportOutput)!); }); - var exportAlar3Container = new Option("--container") { Description = "the input alar3 container" }; - var exportAlar3Output = new Option("--output") { Description = "the output folder" }; - var exportAlar3 = new Command("export-alar3", "Export alar3") { - exportAlar3Container, - exportAlar3Output, - }; - exportAlar3.SetAction(parseResult => { - ContainerCommands.ExportAlar3( - parseResult.GetValue(exportAlar3Container)!, - parseResult.GetValue(exportAlar3Output)!); - }); - - var exportAlar2Container = new Option("--container") { Description = "the input alar2 container" }; - var exportAlar2Output = new Option("--output") { Description = "the output folder" }; - var exportAlar2 = new Command("export-alar2", "Export alar2") { - exportAlar2Container, - exportAlar2Output, - }; - exportAlar2.SetAction(parseResult => { - ContainerCommands.ExportAlar2( - parseResult.GetValue(exportAlar2Container)!, - parseResult.GetValue(exportAlar2Output)!); - }); - var importContainer = new Option("--container") { Description = "the input alar container" }; var importInput = new Option("--input") { Description = "the input directory to insert" }; var importOutput = new Option("--output") { Description = "the output folder" }; @@ -295,43 +271,9 @@ private static Command CreateContainerCommand() parseResult.GetValue(importOutput)!); }); - var importAlar2Container = new Option("--container") { Description = "the input alar2 container" }; - var importAlar2Input = new Option("--input") { Description = "the input directory to insert" }; - var importAlar2Output = new Option("--output") { Description = "the output folder" }; - var importAlar2 = new Command("import-alar2", "import alar2") { - importAlar2Container, - importAlar2Input, - importAlar2Output, - }; - importAlar2.SetAction(parseResult => { - ContainerCommands.ImportAlar2( - parseResult.GetValue(importAlar2Container)!, - parseResult.GetValue(importAlar2Input)!, - parseResult.GetValue(importAlar2Output)!); - }); - - var importAlar3Container = new Option("--container") { Description = "the input alar3 container" }; - var importAlar3Input = new Option("--input") { Description = "the input directory to insert" }; - var importAlar3Output = new Option("--output") { Description = "the output folder" }; - var importAlar3 = new Command("import-alar3", "import alar3") { - importAlar3Container, - importAlar3Input, - importAlar3Output, - }; - importAlar3.SetAction(parseResult => { - ContainerCommands.ImportAlar3( - parseResult.GetValue(importAlar3Container)!, - parseResult.GetValue(importAlar3Input)!, - parseResult.GetValue(importAlar3Output)!); - }); - return new Command("containers", "Unpack/Repack container files") { export, - exportAlar3, - exportAlar2, import, - importAlar2, - importAlar3, }; } diff --git a/src/JUS.CLI/JUS/ContainerCommands.cs b/src/JUS.CLI/JUS/ContainerCommands.cs index 5bd6a418..133ba2e6 100644 --- a/src/JUS.CLI/JUS/ContainerCommands.cs +++ b/src/JUS.CLI/JUS/ContainerCommands.cs @@ -68,62 +68,6 @@ public static void Export(string container, string output) Console.WriteLine("Done!"); } - /// - /// Export all the files from the Alar3 container. - /// - /// The path to the alar3 file. - /// The output directory. - public static void ExportAlar3(string container, string output) - { - Console.WriteLine("Exporting Alar3"); - Console.WriteLine("Container: " + container); - - PathValidator.ValidateFile(container); - - using Node files = NodeFactory.FromFile(container) - .TransformWith() - .TransformWith() ?? throw new FormatException("Invalid container file"); - - foreach (Node node in Navigator.IterateNodes(files)) { - if (!node.IsContainer) { - // Path.Combine ignores the relative path if there is an absolute path - // so we remove the first slash of the node.Path - string outputFile = Path.Combine(output, node.Path[1..]); - node.Stream!.WriteTo(outputFile); - } - } - - Console.WriteLine("Done!"); - } - - /// - /// Export all the files from the Alar2 container. - /// - /// The path to the alar2 file. - /// The output directory. - public static void ExportAlar2(string container, string output) - { - Console.WriteLine("Exporting Alar2"); - Console.WriteLine("Container: " + container); - - PathValidator.ValidateFile(container); - - using Node files = NodeFactory.FromFile(container) - .TransformWith() - .TransformWith() ?? throw new FormatException("Invalid container file"); - - foreach (Node node in Navigator.IterateNodes(files)) { - if (!node.IsContainer) { - // Path.Combine ignores the relative path if there is an absolute path - // so we remove the first slash of the node.Path - string outputFile = Path.Combine(output, node.Path[1..]); - node.Stream!.WriteTo(outputFile); - } - } - - Console.WriteLine("Done!"); - } - /// /// Import files into an Alar container. /// @@ -179,69 +123,5 @@ public static void Import(string container, string input, string output) Console.WriteLine("Done!"); } - - /// - /// Import files into an Alar3 container. - /// - /// The path to the original alar3 file. - /// The path to the directory of the files we want to add. - /// The output directory. - public static void ImportAlar3(string container, string input, string output) - { - Console.WriteLine("Importing Alar3"); - Console.WriteLine("Container: " + container); - Console.WriteLine("Input files from: " + input); - - PathValidator.ValidateFile(container); - PathValidator.ValidateDirectory(input); - - using Node containerNode = NodeFactory.FromFile(container); - Alar3 alar = containerNode - .TransformWith() - .GetFormatAs() ?? throw new FormatException("Invalid container file"); - - using var filesToInsert = new NodeContainerFormat(); - using Node factory = NodeFactory.FromDirectory(input); - filesToInsert.Root.Add(factory); - - alar.InsertModification(filesToInsert); - - using BinaryFormat binary = alar.ConvertWith(new Alar3ToBinary()); - binary.Stream.WriteTo(Path.Combine(output, Path.GetFileName(container))); - - Console.WriteLine("Done!"); - } - - /// - /// Import files into an Alar2 container. - /// - /// The path to the original alar2 file. - /// The path to the directory of the files we want to add. - /// The output directory. - public static void ImportAlar2(string container, string input, string output) - { - Console.WriteLine("Importing Alar2"); - Console.WriteLine("Container: " + container); - Console.WriteLine("Input files from: " + input); - - PathValidator.ValidateFile(container); - PathValidator.ValidateDirectory(input); - - using Node containerNode = NodeFactory.FromFile(container); - Alar2 alar = containerNode - .TransformWith() - .GetFormatAs() ?? throw new FormatException("Invalid container file"); - - using var filesToInsert = new NodeContainerFormat(); - using Node factory = NodeFactory.FromDirectory(input); - filesToInsert.Root.Add(factory); - - alar.InsertModification(filesToInsert); - - using BinaryFormat binary = alar.ConvertWith(new Alar2ToBinary()); - binary.Stream.WriteTo(Path.Combine(output, Path.GetFileName(container))); - - Console.WriteLine("Done!"); - } } }