コード例 #1
0
banks = get_banks(rom_contents, rom_offsets)

tilesets = set()
offsets = {}

# Loop over all maps and add their tileset offsets
for bank_n in range(len(banks)):
    map_headers = get_map_headers(rom_contents, bank_n, banks)
    
    for map_n, map_header_address in enumerate(map_headers):
        # Last map, I haven't found a better way to handle this
        if bank_n >= 42 and map_n > 0:
            break

        map_header = parse_map_header(rom_contents, map_header_address)
        map_data_header = mapped.parse_map_data(
            rom_contents, map_header['map_data_ptr'], game_id)
        tilesets.add((
            map_data_header['global_tileset_ptr'], 
            map_data_header['local_tileset_ptr']))

global_blocks = {}
local_blocks = {}
global_behavior = {}
local_behavior = {}

for tileset1, tileset2 in list(tilesets):
    t1_header = mapped.parse_tileset_header(rom_contents, tileset1, game_id)
    t2_header = mapped.parse_tileset_header(rom_contents, tileset2, game_id)
    
    pals1_ptr = mapped.get_rom_addr(t1_header["palettes_ptr"])
    pals2_ptr = mapped.get_rom_addr(t2_header["palettes_ptr"])
コード例 #2
0
ファイル: speedtest.py プロジェクト: cosarara97/blue-spider
app = QtWidgets.QApplication(sys.argv)
print("created stupid app")
window = mapped_gui.Window(no_argv=True)
print("created stupid window")
window.load_rom(sys.argv[1])
print("loaded stupid rom")
print(window.game.name)
bank_n = int(sys.argv[2])
map_n = int(sys.argv[3])
rom_contents = window.game.rom_contents
rom_data = window.game.rom_data
banks = mapped.get_banks(rom_contents, rom_data)
map_header_ptr = mapped.get_map_headers(rom_contents, bank_n, banks)[map_n]
map = mapped.parse_map_header(rom_contents, map_header_ptr)
h = mapped.parse_map_data(rom_contents, map['map_data_ptr'])
t1_header = mapped.parse_tileset_header(
        rom_contents,
        h['global_tileset_ptr'],
        #int(sys.argv[2], 16),
        window.game.name
        )
t2_header = mapped.parse_tileset_header(
        rom_contents,
        #int(sys.argv[3], 16),
        h['local_tileset_ptr'],
        window.game.name
        )
print("parsed stupid headers")
print("running real test now")
x = time.time()
コード例 #3
0
app = QtWidgets.QApplication(sys.argv)
print("created stupid app")
window = mapped_gui.Window(no_argv=True)
print("created stupid window")
window.load_rom(sys.argv[1])
print("loaded stupid rom")
print(window.game.name)
bank_n = int(sys.argv[2])
map_n = int(sys.argv[3])
rom_contents = window.game.rom_contents
rom_data = window.game.rom_data
banks = mapped.get_banks(rom_contents, rom_data)
map_header_ptr = mapped.get_map_headers(rom_contents, bank_n, banks)[map_n]
map = mapped.parse_map_header(rom_contents, map_header_ptr)
h = mapped.parse_map_data(rom_contents, map['map_data_ptr'])
t1_header = mapped.parse_tileset_header(
    rom_contents,
    h['global_tileset_ptr'],
    #int(sys.argv[2], 16),
    window.game.name)
t2_header = mapped.parse_tileset_header(
    rom_contents,
    #int(sys.argv[3], 16),
    h['local_tileset_ptr'],
    window.game.name)
print("parsed stupid headers")
print("running real test now")
x = time.time()
#window.load_tilesets(t1_header, t1_header, t1_imgs=None)
if PROFILE: