mirror of
https://github.com/snesrev/zelda3.git
synced 2025-12-19 18:05:55 -05:00
First extract the german dialogue: python restool.py --extract-dialogue -r german.sfc Then extract resources / build the assert file: python restool.py --extract-from-rom --languages=de
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
import argparse
|
|
import util
|
|
import sys
|
|
|
|
parser = argparse.ArgumentParser(description='Resource tool used to build zelda3_assets.dat', allow_abbrev=False)
|
|
parser.add_argument('-r', '--rom', nargs='?', metavar='ROM')
|
|
parser.add_argument('--extract-from-rom', '-e', action='store_true', help='Extract/overwrite things from the ROM')
|
|
|
|
optional = parser.add_argument_group('Language settings')
|
|
optional.add_argument('--extract-dialogue', action='store_true', help = 'Extract dialogue from the german ROM')
|
|
optional.add_argument('--languages', action='store', metavar='L1,L2', help = 'Comma separated list of additional languages to build (de).')
|
|
|
|
optional = parser.add_argument_group('Debug things')
|
|
optional.add_argument('--no-build', action='store_true', help="Don't actually build zelda3_assets.dat")
|
|
optional.add_argument('--print-strings', action='store_true', help="Print all dialogue strings")
|
|
optional.add_argument('--print-assets-header', action='store_true')
|
|
|
|
optional = parser.add_argument_group('Image handling')
|
|
optional.add_argument('--sprites-from-png', action='store_true', help="When compiling, load sprites from png instead of from ROM")
|
|
|
|
args = parser.parse_args()
|
|
|
|
if args.extract_dialogue:
|
|
ROM = util.load_rom(args.rom, True)
|
|
import extract_resources, sprite_sheets
|
|
extract_resources.print_dialogue()
|
|
sprite_sheets.decode_font()
|
|
sys.exit(0)
|
|
|
|
ROM = util.load_rom(args.rom)
|
|
|
|
want_compile = True
|
|
|
|
if args.extract_from_rom:
|
|
import extract_resources
|
|
extract_resources.main()
|
|
|
|
if args.print_strings:
|
|
import text_compression
|
|
text_compression.print_strings(ROM)
|
|
want_compile = False
|
|
|
|
if want_compile and not args.no_build:
|
|
import compile_resources
|
|
compile_resources.main(args)
|
|
|
|
|
|
|