Beispiel #1
0
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:
    import cProfile
    import re
            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"])
    pals = mapped.get_pals(rom_contents, game_id, pals1_ptr, pals2_ptr)
    imgs = mapped.load_tilesets(rom_contents, game_id, t1_header, t2_header, pals)
    
    # Check if the tileset has been rendered already
    if tileset1 not in global_blocks:
        print(hex(tileset1))
        behavior_data1 = get_behavior_data(rom_contents, t1_header, game_id)
        global_behavior[tileset1] = behavior_data1
        
        block_data_mem = mapped.get_block_data(rom_contents, t1_header, game_id)
        blocks_imgs = build_block_imgs(
Beispiel #3
0
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:
    import cProfile
    import re
    cProfile.run('window.get_tilesets(t1_header, t2_header, t1_imgs=None)')
Beispiel #4
0
from bluespider import mapped, mapped_gui
import sys
import time

PROFILE = False

print("imported things")

app = QtGui.QApplication(sys.argv)
print("created stupid app")
window = mapped_gui.Window()
print("created stupid window")
window.load_rom(sys.argv[1])
print("loaded stupid rom")
print(window.game)
t1_header = mapped.parse_tileset_header(window.rom_contents,
                                        int(sys.argv[2], 16), window.game)
t2_header = mapped.parse_tileset_header(window.rom_contents,
                                        int(sys.argv[3], 16), window.game)
print("parsed stupid headers")
print("running real test now")
x = time.time()
#window.load_tilesets(t1_header, t1_header, t1_imgs=None)
if PROFILE:
    import cProfile
    import re
    cProfile.run('window.get_tilesets(t1_header, t2_header, t1_imgs=None)')
else:
    window.get_tilesets(t1_header, t2_header, t1_imgs=None)
print(time.time() - x)
print("done")
Beispiel #5
0
import time

PROFILE = False

print("imported things")

app = QtGui.QApplication(sys.argv)
print("created stupid app")
window = mapped_gui.Window()
print("created stupid window")
window.load_rom(sys.argv[1])
print("loaded stupid rom")
print(window.game)
t1_header = mapped.parse_tileset_header(
        window.rom_contents,
        int(sys.argv[2], 16),
        window.game
        )
t2_header = mapped.parse_tileset_header(
        window.rom_contents,
        int(sys.argv[3], 16),
        window.game
        )
print("parsed stupid headers")
print("running real test now")
x = time.time()
#window.load_tilesets(t1_header, t1_header, t1_imgs=None)
if PROFILE:
   import cProfile
   import re
   cProfile.run('window.get_tilesets(t1_header, t2_header, t1_imgs=None)')