import os import sys try: import png except ImportError: sys.exit("You need to have the PyPNG package installed in order to run this program.\n\ For more information, go to:\n\ http://pypi.python.org/pypi/pypng/0.0.13") import struct debug = False print "Telefang 1 Denjuu Sprite Importer v0.1" print "Enter the filename of your Telefang ROM or drag it here:" #Read ROM file rom = rom_utilities.open_file([".gbc"],"r+b") rom.seek(0x134) header = rom.read(16) #Read ROM header to detect correct game print 'ROM header: "{}"'.format(header.rstrip('\xC0\x80')) if not header.startswith(b"TELEFANG"): sys.exit("Invalid ROM. You must use a Telefang ROM.") print "Enter the number of the Denjuu that you want to import.\n\ Go to http://wikifang.meowcorp.us/wiki/List_of_Denjuu_in_Telefang_1 to see a list of Denjuu." denjuu_no = 0 while denjuu_no < 1 or denjuu_no > 174: denjuu_no = raw_input() try:
import os import struct import settings from level_info import level_ptrs, level_names, level_types import tiles import rom_utilities import game_map if sys.version >= '3': sys.exit("Python 3 is not supported at this time due to lack of backwards compatibility. You will have to use Python 2. Sorry!") print "DKL2/3 Map Dumper v1.0 beta" print "Enter the filename of your DKL2 or DKL3 ROM or drag it here:" #Read ROM file rom = rom_utilities.open_file([".gb",".sgb",".gbc"],"rb") rom.seek(0x134) header = rom.read(16) #Read ROM header to detect correct game print 'ROM header: "{}"'.format(header.rstrip('\xC0')) game = None region = None version = 0 if header == b"DONKEYKONGLAND95": game, region = "DKL", "U" elif header == b"SUPERDONKEYKONG ": game, region = "DKL", "J" elif header == b"DONKEYKONGLAND 2": game, region = "DKL2", "U"