A collection of utilities for extracting and modifying game files from Tomba! (Ore no Tomba) for PlayStation.
Currently supports WFM font files and GAM game data files with full extraction, modification, and recreation capabilities.
- WFM Font File Processing: Extract and modify font glyphs and dialogue text
- GAM File Processing: Extract and compress game data using custom LZ algorithm
- 4bpp PSX Graphics: Native support for PlayStation 4bpp linear little endian format
- YAML Export/Import: Human-readable dialogue editing
- PNG Glyph Export: Individual character extraction as PNG images
Download the latest release for your platform from the Releases page:
- Windows:
tombatools_windows_amd64.zip - Linux:
tombatools_linux_amd64.tar.gzortombatools_linux_arm64.tar.gz - macOS:
tombatools_darwin_amd64.tar.gz(Intel) ortombatools_darwin_arm64.tar.gz(Apple Silicon)
- Go 1.21 or later
git clone https://github.com/hansbonini/tombatools.git
cd tombatools
make build
# or
go build -o tombatools# Install development dependencies
make install
# Install linting and security tools
make toolsExtract glyphs and dialogues from a WFM file:
tombatools wfm decode CFNT999H.WFM ./output/This creates:
glyphs/- Individual PNG files for each characterdialogues.yaml- Editable dialogue text in YAML format
Create a new WFM file from edited dialogues:
tombatools wfm encode dialogues.yaml CFNT999H_modified.WFMUse -v flag for detailed processing information:
tombatools wfm decode -v CFNT999H.WFM ./output/
tombatools wfm encode -v dialogues.yaml output.WFMGAM files contain compressed game data using a custom LZ compression algorithm.
Extract and decompress data from a GAM file:
tombatools gam unpack GAME.GAM data.UNGAMThis creates a decompressed .UNGAM file containing the raw game data.
Compress data back into a GAM file:
tombatools gam pack data.UNGAM GAME_modified.GAMUse -v flag for detailed compression/decompression information:
tombatools gam unpack -v GAME.GAM data.UNGAM
tombatools gam pack -v data.UNGAM output.GAMmake help # Show available commands
make build # Build for current platform
make test # Run tests with coverage
make lint # Run code linters
make release # Build for all platforms
make security # Run security scans
make clean # Clean build artifacts# Run all tests
make test
# Run specific package tests
go test ./pkg/...
# Run with verbose output
go test -v ./...This project uses:
- golangci-lint for code linting
- gosec for security scanning
- GitHub Actions for CI/CD
- Dependabot for dependency updates
-
Extract original WFM file:
tombatools wfm decode CFNT999H.WFM ./extracted/
-
Edit dialogues:
- Open
extracted/dialogues.yamlin a text editor - Modify the
textfields under dialogue entries - Save the file
- Open
-
Create modified WFM:
tombatools wfm encode extracted/dialogues.yaml CFNT999H_translated.WFM
-
Extract original GAM file:
tombatools gam unpack GAME.GAM extracted_data.UNGAM
-
Modify data:
- Edit the extracted
.UNGAMfile with a hex editor or custom tools - Make your desired changes to the game data
- Edit the extracted
-
Create modified GAM:
tombatools gam pack extracted_data.UNGAM GAME_modified.GAM
WFM (WFM3) files contain:
- Font glyphs: 4bpp PSX format character graphics
- Dialogue data: Text with control codes for display
- Palettes: Color lookup tables (CLUT) for rendering
GAM files contain:
- 8-byte header: Magic "GAM" + padding + uncompressed size (little-endian)
- Compressed data: Game data compressed using custom LZ algorithm
- LZ compression: Bitmask-based algorithm with literal bytes and back-references
[INIT TEXT BOX]- Initialize dialogue box with dimensions[NEWLINE]- Line break[WAIT FOR INPUT]- Pause for user input[HALT]- End dialogue[CHANGE COLOR TO]- Change text color- And more...
- Native 4bpp linear little endian processing
- Automatic palette selection (Dialogue/Event CLUT)
- PSX 15-bit color format conversion
- 8px: Menu and UI text (DialogueClut)
- 16px: Standard dialogue text (DialogueClut)
- 24px: Event and emphasis text (EventClut)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Tomba! game by Whoopee Camp
- PlayStation technical documentation community
- Go image processing libraries
Note: This tool is for educational and preservation purposes. Respect copyright laws and game developer rights.