Crates.io | glulxtoc |
lib.rs | glulxtoc |
version | 0.1.0 |
source | src |
created_at | 2021-07-10 00:56:23.621253 |
updated_at | 2021-07-10 00:56:23.621253 |
description | Decompile Glulx storyfiles into C code |
homepage | https://github.com/curiousdannii/if-decompiler |
repository | https://github.com/curiousdannii/if-decompiler |
max_upload_size | |
id | 420949 |
size | 571,000 |
Glulxtoc will decompile your Glulx storyfile into C code which you can then compile against any Glk library.
To get it, first install Rust and then install glulxtoc with cargo:
cargo install glulxtoc
glulxtoc <path> [FLAGS] [OPTIONS]
Required option:
Flags:
-d
, --disassemble
: Disassembler mode - only disassemble, do not optimise or generate structured codeOptions:
--debug-file
: path to an Inform debug file for the storyfile--out-dir
: Output folder. If not given will make a folder based on the storyfile's name with .decompiled
added to the end--stack-size
: Stack size in MB (default 8), for the glulxtoc app (not the stack of the Glulx file being decompiled.) Very large storyfiles may cause the glulxtoc app to have a stack overflow, in which case pass this option.--safe-function-overrides
: An array of function addresses to forcibly set as safe, overriding the decompiler's heuristics. Example, --safe-function-overrides=1234,5678
--unsafe-function-overrides
: An array of function addresses to forcibly set as unsafe, overriding the decompiler's heuristics.Glulxtoc produces several C files and provides a CMake CMakeLists.txt. You must pass in the Glk library's path to CMake. For example:
glulxtoc advent.ulx
cd advent.ulx.decompiled
mkdir remglk
cmake -DGlkLibPath=../../remglk . -B remglk
cd remglk
make
In general Glulxtoc is likely to have problems with any Glulx files that weren't compiled with Inform.
make
stage of compilation is very slow, try Clang. GCC has a bug which makes Glulxtoc's output compile very slowly.-d
) fixes things. If it does then that indicates a bug in Glulxtoc's decompilation optimisation code.If you do get an error, please post a bug report with as much detail as you can provide, and ideally with your storyfile.