Example #1
0
import os

import bt.extract.btfile as btfile
import bt.extract.btimage as btimage

res_path = os.path.join("..", "res")
amiga_bt1_path = os.path.join(res_path, "amiga", "bt1", "bards_data")


# levels
#btfile.show_indexed_file_info("levs", amiga_bt1_path)
data = btfile.load_indexed_file("levs", amiga_bt1_path)


btfile.show_compressed_file_info("CITY/bi1", amiga_bt1_path)
data1 = btfile.load_compressed_file("CITY/bi1", amiga_bt1_path)
btfile.show_compressed_file_info("CITY/bi2", amiga_bt1_path)
data2 = btfile.load_compressed_file("CITY/bi2", amiga_bt1_path)
btfile.show_compressed_file_info("CITY/BI3", amiga_bt1_path)
data3 = btfile.load_compressed_file("CITY/BI3", amiga_bt1_path)

btfile.show_indexed_file_info("pics", amiga_bt1_path)
data = btfile.load_indexed_file("pics", amiga_bt1_path, index=2)

ind = 0
# skip load addr
ind += 2
# 
time = data[ind]
ind += 1
Example #2
0
        print hex(c),
        # if i > 256: break
    print
    # btimage.save_4bit_image(data, (w, h), pal16, "bigpic0-foo.png")
    # btimage.save_8bit_image(data, (w, h), pal64, "bigpic0-foo.png")


if True:
    # works
    show = lambda im: btimage.show(im)

    # house fronts "b?.huf"
    for i in xrange(4):
        infilename = "b%d.huf" % i
        outfilename = "b%d.png" % i
        btfile.show_compressed_file_info(infilename, msdos_bt1_path)
        data = btfile.load_compressed_file(infilename, msdos_bt1_path)
        im = btimage.save_4bit_image(data, vsize, pal16, outfilename)
        show(im)

    # game screen "bardscr", title screen "bardtit"
    for basename in ["bardscr", "bardtit"]:
        btfile.show_compressed_file_info(basename, msdos_bt1_path)
        data = btfile.load_compressed_file(basename, msdos_bt1_path)
        im = btimage.save_4bit_separated_image(data, (320, 200), basename + ".png")
        show(im)

    # game screen "cga_scr", title screen "rgb_tit"
    for basename in ["cga_scr", "rgb_tit"]:
        btfile.show_compressed_file_info(basename, msdos_bt1_path)
        data = btfile.load_compressed_file(basename, msdos_bt1_path)