예제 #1
0
def t_rom_data(w, fn):
    w.load_rom(fn)
    rom = w.rom_contents
    rom_code = mapped.get_rom_code(rom)
    rom_data, game = mapped.get_rom_data(rom_code)
    if "RUBY" in fn.upper():
        assert w.rom_code == rom_code == b"AXVE"
    if "FR" in fn.upper():
        assert w.rom_code == rom_code == b"BPRE"
예제 #2
0
                    mask.putdata(mask_data)
                    block_img.paste(part_img, (x, y, x+8, y+8), mask)
                else:
                    block_img.paste(part_img, (x, y, x+8, y+8))

            if (beh_mem & 0x20) and layer == 1:
                layer_imgs.append(base_block_img.copy())
            else:
                layer_imgs.append(block_img)
        block_imgs.append(layer_imgs)
    return block_imgs

with open(ROMPATH, "rb") as rom_file:
    rom_contents = rom_file.read()

rom_code = get_rom_code(rom_contents)
rom_offsets, game_id = get_rom_data(rom_code)
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