Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
13f501e
🚀 Version v0.9.5
dimspell Nov 25, 2026
459f37b
docs: rewrite seven documents in plain English with observable facts
dimspell Nov 25, 2026
cf17570
docs: rewrite hexedit README in plain English and fix version
dimspell Nov 25, 2026
958cf52
docs: rewrite nine format documents in plain English
dimspell Nov 25, 2026
a98ad5a
docs: rewrite fourteen format documents in plain English
dimspell Nov 25, 2026
a9b493c
docs: rewrite fourteen map and entity format documents
dimspell Nov 25, 2026
348da02
docs: rewrite AGENTS.md in plain English
dimspell Nov 25, 2026
dae2c4a
docs: align agent guide version and sound example
dimspell Nov 25, 2026
404c11e
docs: keep the shared notice unique in the root readme
dimspell Nov 25, 2026
95a8df8
docs: correct file cross references from code
dimspell Nov 25, 2026
0a539df
docs: fix five cross reference details
dimspell Nov 25, 2026
129ca2a
refactor(gui): combine composite item selects with search
dimspell Nov 25, 2026
06bf6db
feat(gui): keep composite item search per field
dimspell Nov 25, 2026
4b697d4
refactor(gui): use iced combo box for composite items
dimspell Nov 26, 2026
b67b08b
test(gui): verify composite combo box behaviour
dimspell Nov 26, 2026
d146a1b
fix(gui): disambiguate duplicate item labels and cover update hook
dimspell Nov 26, 2026
4799519
fix(gui): clear editor state when entering a new game
dimspell Nov 28, 2026
3b8aca3
fix(gui): stop recording when the game path changes
dimspell Nov 28, 2026
74ec281
fix(gui): route completion messages to their tab
dimspell Nov 28, 2026
edb7a60
fix(hexedit): apply persisted settings to every opened file
dimspell Nov 28, 2026
5849fa8
fix(hexedit): remove unsupported UTF-16 write modes
dimspell Nov 28, 2026
e4892f2
fix(gui): target the right frame in sprite context actions
dimspell Nov 28, 2026
6728c1d
fix(gui): deduplicate tabs by path and editor type
dimspell Nov 28, 2026
ceabe68
fix(gui): keep active tab correct after closing another tab
dimspell Nov 28, 2026
651719a
fix(gui): mark structural edits as unsaved
dimspell Nov 28, 2026
5df65d0
fix(gui): discard stale scan results from another game
dimspell Nov 28, 2026
c19f1ba
fix(gui): truncate mod preview on character boundaries
dimspell Nov 28, 2026
66fb36a
fix(gui): clamp localization page after rescan
dimspell Nov 28, 2026
9ee1554
fix(core): reject out-of-range map sprite ids
dimspell Nov 28, 2026
6903f23
fix(core): reject malformed dialogue script ids
dimspell Nov 28, 2026
4d1e0f6
fix(core): reject malformed draw item columns
dimspell Nov 28, 2026
8bfdb55
fix(hexedit): ignore unsupported persisted encodings
dimspell Nov 28, 2026
0c31560
fix(hexedit): remap write mode after multiple removals
dimspell Nov 28, 2026
6b92b8d
fix(core): preserve store products with lodging cost
dimspell Nov 28, 2026
59a450e
fix(core): rename terminal frame flag to reset
dimspell Nov 28, 2026
cdb451e
fix(core): rename weapon durability to modification budget
dimspell Nov 28, 2026
c2add44
fix(core): rename magic targeting mode to animation cycles
dimspell Nov 28, 2026
531ad1b
docs(gui): describe magic range as target power cap
dimspell Nov 28, 2026
c779da2
fix(core): rename monster walk speed to attack cooldown
dimspell Nov 28, 2026
0b1c844
fix(core): rename magic enabled to requires target
dimspell Nov 28, 2026
21b70e3
fix(core): rename mana drain to health leech
dimspell Nov 28, 2026
0e13889
fix(core): rename cures petrification to cures paralysis
dimspell Nov 28, 2026
1f7d307
fix(core): relabel monster ini sound fields
dimspell Nov 28, 2026
55f73ac
fix(core): rename payload counts to journal strides
dimspell Nov 28, 2026
72d11cc
fix(core): rename modification resistance to cost
dimspell Nov 28, 2026
1f9cbe6
docs(gui): clarify magic type proficiency
dimspell Nov 28, 2026
507a75f
docs: describe shipped sprites as RGB565
dimspell Nov 28, 2026
06f0f9f
docs(save): describe walk records as countdowns
dimspell Nov 28, 2026
e32c885
fix(core): rename next dialog to fallback
dimspell Nov 28, 2026
12b7bd4
fix(core): rename dialogue param1 to next page id
dimspell Nov 28, 2026
fd5e3a3
fix(core): rename overlay mode fields
dimspell Nov 28, 2026
907e277
fix(core): rename save runtime state fields
dimspell Nov 28, 2026
b440543
fix(core): accept renamed dialogue keys in patchers
dimspell Nov 28, 2026
54fba64
fix(core): swap chdata archer seed labels
dimspell Nov 28, 2026
01f75a8
fix(core): remove SmallRange0to3 enum
dimspell Nov 29, 2026
2dd6009
fix(core): Remove alias in EditItem.db
dimspell Nov 29, 2026
3c50f56
fix(core): Remove more aliases
dimspell Nov 29, 2026
22ee06e
fix(core): fix compilation error
dimspell Nov 29, 2026
5ccb110
fix(core): Use in-memory or /tmp for saving any files within tests
dimspell Nov 29, 2026
98a11e7
fix(core): Remove more aliases
dimspell Nov 29, 2026
162452f
refactor: remove legacy field and name aliases
dimspell Nov 29, 2026
db17e55
docs: drop conflicting save version values
dimspell Nov 30, 2026
fea53b2
fix(core): read full sprite frame header into named fields
dimspell Nov 30, 2026
3d90fe3
fix(items): name weapon proc and item mod budget fields
dimspell Nov 30, 2026
e52d15c
fix(core): preserve WAVEFORMATEX in snf files
dimspell Nov 30, 2026
660a177
refactor: prepare stable keys and strict validation
dimspell Nov 30, 2026
dbdbb88
fix(core): split misc rune words and merge wave index
dimspell Nov 30, 2026
a5a7c47
refactor(core): name character field renames
dimspell Nov 30, 2026
9ca42a2
refactor(core): name monster data fields from saves
dimspell Nov 30, 2026
bd0e516
feat(gui): add runtime, snapshot and session views from saves
dimspell Nov 30, 2026
fe1b3ca
fix(gui): remove unused imports
dimspell Nov 30, 2026
48e0f20
fix(map): name roof overlay byte 1 as draw-enable
dimspell Nov 30, 2026
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
230 changes: 114 additions & 116 deletions AGENTS.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ path = "src/lib.rs"

[package]
name = "dispel-extractor"
version = "0.9.4"
version = "0.9.5"
edition = "2024"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
87 changes: 35 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# DISPEL® Game File Extractor

A modding toolkit for the **DISPEL®** RPG game. Reads and writes game files in native binary, INI, and DB formats. Includes a CLI, a desktop GUI with 46 editor types, a hex editor, and a full mod packaging pipeline. All edits are persisted directly to game files — no intermediate database.
This toolkit reads and writes DISPEL® game files in binary, INI and DB formats. It includes a CLI, a desktop GUI with 46 editor types, a hex editor and a mod packaging pipeline. The tools write each edit into the game file. They do not keep a separate database.

**Not affiliated with, endorsed by, or sponsored by the trademark owner.**
## Scope and notice

---
This project reads and writes data files for DISPEL®. It ships no game content. You choose the files you edit.

DISPEL® is a registered trademark. This project is not affiliated with, endorsed by, or sponsored by the trademark owner.

The MIT License (LICENSE) covers the source code. It does not cover game content.

## What's in this repository

This is a 6-crate Cargo workspace (Rust 2024, version `0.9.3`):
This Cargo workspace has six crates. The workspace uses Rust 2024 and version `0.9.5`.

| Crate | Type | Role |
| ------------------------- | ---------- | --------------------------------------------------------------- |
Expand All @@ -23,18 +27,16 @@ This is a 6-crate Cargo workspace (Rust 2024, version `0.9.3`):

| Directory | Contents |
| --------------------- | ------------------------------------------------------------------- |
| `src/references/` | 30+ parsers for `.db`, `.ini`, `.ref` game data files |
| `src/references/` | 51 source files with parsers for `.db`, `.ini` and `.ref` files |
| `src/map/` | `.map` parser + isometric tile/sprite/event renderer |
| `src/sprite.rs` | `.spr` sprite and animation parser (RGB 565) |
| `src/snf.rs` | `.snf` audio parser (PCM → WAV conversion) |
| `src/snf.rs` | `.snf` audio parser (PCM to WAV conversion) |
| `src/modding/` | Mod authoring pipeline (apply, patch, package, conflict resolution) |
| `src/commands/` | CLI command implementations (11 subcommands) |
| `src/queries/` | 118 SQL files (59 schema DDL + 59 parameterized INSERTs) |
| `src/localization.rs` | Text export/import for translations |
| `src/localization.rs` | Text export and import for translations |
| `src/database.rs` | SQLite schema bootstrap |

---

## Supported file formats

### Binary DB files (`.db`)
Expand All @@ -53,7 +55,7 @@ This is a 6-crate Cargo workspace (Rust 2024, version `0.9.3`):
| `DrawItem.db` | Draw items |
| `PartyLevelNpc.db` | Party level NPC data |

### INI / text files
### INI and text files

| File | Description |
| ------------- | -------------------------- |
Expand All @@ -79,15 +81,13 @@ This is a 6-crate Cargo workspace (Rust 2024, version `0.9.3`):
| Extension | Description |
| --------------- | ---------------------------------------------- |
| `.map` | Map geometry (tiles, sprites, events) |
| `.gtl` / `.btl` | Tilesets (ground / roof, RGB 565, 32×32 tiles) |
| `.gtl` / `.btl` | Tilesets (ground / roof, RGB 565, 32x32 tiles) |
| `.spr` | Character sprites and animations (RGB 565) |
| `.snf` | Sound effects (custom PCM → WAV) |
| `.snf` | Sound effects (custom PCM to WAV) |
| `.dlg` / `.pgp` | Dialogue scripts and text (EUC-KR / 1250) |
| `.scr` | Event scripts (1250) |

Full format specs are in `docs/files/` (36 per-format documents plus `CROSS_REFERENCES.md`).

---
Format specifications are in `docs/files/`. That directory holds 36 per-format documents and `CROSS_REFERENCES.md`.

## CLI usage

Expand Down Expand Up @@ -131,17 +131,18 @@ cargo run -- schema --type weapons
cargo run -- template --type weapons --pretty
```

### Sprite and animation extraction
### Extract sprites and animations

```bash
cargo run -- sprite fixtures/Dispel/CharacterInGame/M_BODY1.SPR --mode sprite
cargo run -- sprite fixtures/Dispel/CharacterInGame/M_BODY1.SPR --mode animation
```

### Sound conversion
### Convert sound files

```bash
cargo run -- sound --input fixtures/Dispel/Sound/sample.snf --output output.wav
cargo run -- sound to-wav fixtures/Dispel/Sound/sample.snf output.wav
cargo run -- sound from-wav output.wav sample.snf
```

### Map operations
Expand Down Expand Up @@ -171,6 +172,8 @@ cargo run -- database import fixtures/Dispel/ db.sqlite

### Mod packaging

The CLI `mod-pack` command reads `Event*.scr` files from the game `Ref/` folder and writes JSON.

```bash
cargo run -- mod-pack --help
```
Expand All @@ -181,8 +184,6 @@ cargo run -- mod-pack --help
cargo run -- --help
```

---

## GUI

Launch the desktop editor:
Expand All @@ -191,28 +192,26 @@ Launch the desktop editor:
cargo run -p dispel-gui
```

The GUI provides:

- **46 editor types** — spreadsheet views for every supported game data format
- **3-pane layout** — sidebar (file tree), main content (editors), history panel (undo/redo)
- **Undo/redo** with full edit history per editor
- **Mod recording** — tracks every field change for mod changelog generation
- **Full-text search** — nucleo-matcher fuzzy search across all loaded files
- **Hex editor** — built-in hex editor (from `hexedit` crate)
- **Map viewer** — isometric rendering with viewport + LRU cache
- **SNF audio playback** — rodio-based sound preview
- **Audio viewer** — read-only OGG/WAV playback with timeline and volume
- **BMP viewer** — read-only image preview with zoom and fit-to-viewport
- **Mod packager** — package changes into `dispel-mod` archives
The GUI has these features:

---
- 46 editor types with spreadsheet views for supported game data formats
- A three-pane layout with a sidebar for the file tree, main content for editors and a history panel for undo and redo
- Undo and redo with an edit history for each editor
- Mod recording that tracks every field change for the mod changelog
- Full-text search with nucleo-matcher fuzzy search across loaded files
- A hex editor from the `hexedit` crate
- A map viewer with isometric rendering, a viewport and an LRU cache
- SNF audio playback with rodio
- An audio viewer for read-only OGG and WAV playback with timeline and volume
- A BMP viewer for read-only image preview with zoom and fit to viewport
- A mod packager that stores work in `.dispel-mods`. It writes a zip with `manifest.json`, `changes.json`, `patches/` and `files/`.

## Project structure

```
dispel-extractor/
├── src/ # dispel-core library + CLI binary
│ ├── references/ # 30+ game data file parsers
│ ├── references/ # 51 game data file parsers
│ ├── map/ # .map parser + isometric renderer
│ ├── modding/ # Mod authoring pipeline
│ ├── commands/ # CLI command implementations
Expand All @@ -236,13 +235,9 @@ dispel-extractor/
└── release.sh # Automated release script
```

---

## Development

The canonical build, format, lint and test commands live in
`scripts/ci-commands.sh` (11 commands). CI and the Makefile delegate to that
script, so use it or the matching `make` target rather than an inline command:
The canonical build, format, lint and test commands live in `scripts/ci-commands.sh`. The script has 11 commands. CI and the Makefile call that script. Use the script or the matching `make` target.

```bash
bash scripts/ci-commands.sh --list # show all canonical commands
Expand Down Expand Up @@ -282,15 +277,3 @@ cargo run -p dispel-gui
| `make sprite-animation` | Extract animations |
| `make mod-pack` | Package a mod |
| `make help` | Show all Makefile targets |

---

## Legal

This project is **not affiliated with, endorsed by, or sponsored by** the DISPEL® trademark owner.

This tool is for **independent file-format interoperability research based on observable program behavior** only. It does not redistribute copyrighted game files and does not circumvent technological protection measures.

### License

The source code is licensed under the **[MIT License](LICENSE)**. Game content, assets, and proprietary formats are not covered by this license.
2 changes: 1 addition & 1 deletion dispel-encodings/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dispel-encodings"
version = "0.9.4"
version = "0.9.5"
edition = "2024"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion dispel-gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dispel-gui"
version = "0.9.4"
version = "0.9.5"
edition = "2024"

[dependencies]
Expand Down
33 changes: 29 additions & 4 deletions dispel-gui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@ pub struct App {
pub start_page_input: String,
pub is_indexing: bool,
pub error_dialog: Option<String>,
#[cfg(test)]
_test_root: Option<tempfile::TempDir>,
}

impl App {
pub fn new() -> (Self, Task<Message>) {
let mut state = AppState::default();
Self::boot(AppState::default())
}

fn boot(mut state: AppState) -> (Self, Task<Message>) {
if let Err(e) = state.load_workspace() {
eprintln!("Failed to load workspace: {}", e);
}
Expand Down Expand Up @@ -83,9 +88,10 @@ impl App {
let init_task: Option<Task<Message>> =
if game_path.is_some() && search_index.file_mappings.is_empty() {
game_path.map(|gp| {
let gp_tag = gp.to_string_lossy().to_string();
Task::perform(
async move { crate::indexation::search_index::build_index(&gp).await },
|index| Message::System(SystemMessage::IndexLoaded(Ok(index))),
move |index| Message::System(SystemMessage::IndexLoaded(gp_tag, Ok(index))),
)
})
} else {
Expand Down Expand Up @@ -133,11 +139,25 @@ impl App {
start_page_input,
is_indexing,
error_dialog: None,
#[cfg(test)]
_test_root: None,
},
final_init_task,
)
}

#[cfg(test)]
pub fn test_app() -> Self {
let root = tempfile::tempdir().expect("temp dir");
let state = AppState {
paths: crate::paths::AppPaths::test_paths(root.path()),
..AppState::default()
};
let (mut app, _) = Self::boot(state);
app._test_root = Some(root);
app
}

pub(crate) fn set_title(&self) -> String {
let default_title: String = "Dispel Extractor".to_owned();

Expand All @@ -151,10 +171,12 @@ impl App {
pub fn test_new(workspace: crate::workspace::Workspace) -> Self {
use crate::state::AppState;

let state = AppState {
let root = tempfile::tempdir().expect("temp dir");
let mut state = AppState {
workspace,
..Default::default()
};
state.paths = crate::paths::AppPaths::test_paths(root.path());

Self {
state,
Expand All @@ -170,6 +192,7 @@ impl App {
start_page_input: String::new(),
is_indexing: false,
error_dialog: None,
_test_root: Some(root),
}
}

Expand Down Expand Up @@ -410,7 +433,9 @@ impl App {
},
move |result| {
crate::message::Message::save_file_viewer(
crate::editors::save_file_viewer::SaveFileViewerMessage::Loaded(result),
crate::editors::save_file_viewer::SaveFileViewerMessage::Loaded(
tab_id, result,
),
)
},
)
Expand Down
Loading
Loading