Code Monkey home page Code Monkey logo

dcnick3 / shindatautil Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 3.0 349 KB

This is an utility for working with game files of Higurashi no Naku Koro ni and Kono Subarashii Sekai ni Shukufuku wo! Kibou no Meikyuu to Tsudoishi Boukenshata Plus (see branch konosuba) visual novels released for Nintendo Switch.

License: GNU General Public License v2.0

C# 99.90% Shell 0.10%
visual-novel reverse-engineered game-tool higurashi konosuba reverse-engineering

shindatautil's Introduction

Overview

This is an utility for working with game files of Higurashi no Naku Koro ni visual novel released for Nintendo Switch.

There's also a konosuba branch with support for konosuba's flavour of scenario and some more texture formats

Usage

dotnet run subcommand subcommand-args

Subcommands:

  • rom-list romname - list files in a rom

  • rom-extract-all [--regex=filename_regex] romname destination-directory - extract raw files (optionally filtered by regex) from rom

  • rom-extract-all-with-decode [--regex=filename_regex] romname destination-directory - extract files (optionally filtered by regex) from rom, decoding known formats

  • [rom-]pic-decode [romname] picname outname - decode a PIC file (optionally from rom) to png

  • [rom-]sound-remux [romname] nxaname outname - remux a NXA file (optionally from rom)to opus

  • [rom-]font-extract [romname] fntname outname - extract an FNT file (optionally from rom) to a bunch of png files

  • [rom-]txa-extract {--ignore-file-size} [romname] txaname outname - extract an TXA file (optionally from rom) to a bunch of png files. ignore-file-size makes the tool ignore the file size specified in txa header

  • [rom-]sysse-extract [romname] syssename outname - extract a sysse.bin file (optionally from rom) to a bunch of wav files

  • [rom-]bustup-extract [romname] bustupname outname - extract a BUP file (optionally from rom) to a bunch of png files

  • [rom-]mask-extract [romname] mskname outname - extract a MSK file (optionally from rom) to a png file

  • [rom-]scenario-decompile [romname] snrname outname - disassemble an SNR file (optionally from rom) to a listing, a json file containg head data and raw dump of code section

  • scenario-build asmdir outname - build an SNR file from a listing and json file containing head data (same structure as decompiler)

  • rom-replace-file origrom srcfile targetname outrom - quickly replace a file in ROM by another one. Does not remove previous file contents, so avoid using this repeatedly

  • rom-build outrom [infile targetname]... - build a ROM from scratch from specified pairs of source files and their target names

  • rom-build-from-dir outrom indir - build a ROM from scratch from specified root directory. All files in the directory will be put to the rom with the same name

  • txa-encode srcdir outtxa - build a TXA from the specified directory (needs an index.txt file to function)

  • scenario-layout [--ignore-logset] fntfile asmfile outasmfile - transform the specified scenario asm file, doing word wrapping according to mixed English/Japanese rules. Specify --ignore-logset to make the layouter not modify messages of LOGSET. Useful, as the original game script has a typo there (r@ vs @r).

  • pic-encode {--origin origin} {--quantize} {--dither} {--lossless-alpha} inpng outpic - encode a png file into PIC, setting the origin as specified by --origin (default - Bottom). Optionally --quantize the colors to 256 using Wu's algorithm to allow to use more effective dict encoding. Add --dither to also apply dithering, improving the overall resulting look, but increasing the file size slightly. You can also specify --lossless-alpha not to apply dithering to alpha channel. This will reduce the stress on ditherer and will increase the overall number of colors, but, obviously, will increase file size.

  • pic-encode-roundtrip {--quantize} {--dither} {--lossless-alpha} inpng outpng - encode a png file into PIC and decode it back. Allows to test the results of lossy compression. Also prints encoded size and Mean Square Error between the original and encoded image.

Tests

Tests require the game data (most notably - data.rom and patch.rom).

$ sha1sum data.rom patch.rom
66ce63758e955eed385f8d5c9d90698d5428e369  data.rom
3dc7e123e23fcbe2058b25ca011849e4aef252c5  patch.rom

shindatautil's People

Contributors

dcnick3 avatar tellowkrinkle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

shindatautil's Issues

After last commit can't pack anything to new ROM

Even if it's just one file in root. Windows and Ubuntu are showing the same error.
Command:

dotnet shindatautil.dll rom-build ./patch.rom ./quiz.txa quiz.txa

Result

Process terminated. Assertion Failed
   at ShinDataUtil.Compression.ShinRomOperations.<BuildRom>g__AddEntry|1_0(IFileProvider source, String targetName, <>c__DisplayClass1_0& ) in C:\Users\Admin\Documents\Switch\Higurashi\ShinDataUtil2\ShinDataUtil\Compression\ShinRomOperations.cs:line 73
   at ShinDataUtil.Compression.ShinRomOperations.BuildRom(Stream outrom, IEnumerable`1 files) in C:\Users\Admin\Documents\Switch\Higurashi\ShinDataUtil2\ShinDataUtil\Compression\ShinRomOperations.cs:line 122
   at ShinDataUtil.Compression.ShinRomOperations.BuildRom(Stream outrom, IEnumerable`1 files) in C:\Users\Admin\Documents\Switch\Higurashi\ShinDataUtil2\ShinDataUtil\Compression\ShinRomOperations.cs:line 230
   at ShinDataUtil.Program.RomBuild(ReadOnlySpan`1 args) in C:\Users\Admin\Documents\Switch\Higurashi\ShinDataUtil2\ShinDataUtil\Program.cs:line 439
   at ShinDataUtil.Program.ActionList.Execute(String actionname, ReadOnlySpan`1 args) in C:\Users\Admin\Documents\Switch\Higurashi\ShinDataUtil2\ShinDataUtil\Program.cs:line 511
   at ShinDataUtil.Program.MainWrap(String[] args) in C:\Users\Admin\Documents\Switch\Higurashi\ShinDataUtil2\ShinDataUtil\Program.cs:line 542
   at ShinDataUtil.Program.Main(String[] args) in C:\Users\Admin\Documents\Switch\Higurashi\ShinDataUtil2\ShinDataUtil\Program.cs:line 549

Build with Visual Studio 2019 on Windows, dotnet 5.0.

Beside it's possible to write new function for packing that will just recursively scan folder we provide as argument and pack all of files inside? This way we can avoid Windows cmd limit that is 2048 characters per command (and will make life easier when putting new files regularly)

Can't decompress anything

Maybe I forgot to install something or not doing it right?

Here's log also:

PS G:\Translations\ShinDataUtil-master\bin\Debug\netcoreapp5.0> dotnet ShinDataUtil.dll txa-extract .\input\config.txa .\output
Process terminated. Assertion Failed
   at ShinDataUtil.Decompression.ShinTxaExtractor.Extract(ReadOnlySpan`1 data, String destinationDirectory, Boolean ignoreFileSize) in G:\Translations\ShinDataUtil-master\Decompression\ShinTxaExtractor.cs:line 24
   at ShinDataUtil.Program.TxaExtract(ReadOnlyMemory`1 txadata, String _, String outname, ImmutableArray`1 options) in G:\Translations\ShinDataUtil-master\Program.cs:line 518
   at ShinDataUtil.Program.ActionList.<>c__DisplayClass7_0.<AddSingleFileProcessingAction>b__0(ReadOnlySpan`1 args) in G:\Translations\ShinDataUtil-master\Program.cs:line 777
   at ShinDataUtil.Program.ActionList.Execute(String actionname, ReadOnlySpan`1 args) in G:\Translations\ShinDataUtil-master\Program.cs:line 813
   at ShinDataUtil.Program.MainWrap(String[] args) in G:\Translations\ShinDataUtil-master\Program.cs:line 850
   at ShinDataUtil.Program.Main(String[] args) in G:\Translations\ShinDataUtil-master\Program.cs:line 857

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.