Example #1
0
def compose_file(input, output=None, path=None, asm=False):
    from os.path import dirname, realpath

    f = open(input)
    code = f.read()
    f.close()

    if path == None:
        path = dirname(realpath(input)) + '/'
    elif path[-1] != '/':
        path += '/'

    if output == None:
        output = 'output.nes'

    game = compose(code)
    asmcode = game.to_asm()
    if asm:
        asmfile = open('output.asm', 'w')
        asmfile.write(asmcode)
        asmfile.close()
    opcodes = compile(asmcode, path)
    pynes.write_bin_code(opcodes, output)
Example #2
0
def compose_file(input, output=None, path=None, asm=False):
    from os.path import dirname, realpath

    f = open(input)
    code = f.read()
    f.close()

    if path == None:
        path = dirname(realpath(input)) + '/'
    elif path[-1] != '/':
        path += '/'

    if output == None:
        output = 'output.nes'


    game = compose(code)
    asmcode = game.to_asm()
    if asm:
        asmfile = open('output.asm', 'w')
        asmfile.write(asmcode)
        asmfile.close()
    opcodes = compile(asmcode, path)
    pynes.write_bin_code(opcodes, output)
Example #3
0
 def assert_asm_without_ines_from(self, code):
     self.code = code
     self.game = compose(code)
     self.asm = self.game.to_asm()
     compile(self.asm, self.path)
     return WhatElse(self)
Example #4
0
 def assert_asm_without_ines_from(self, code):
     self.code = code
     self.game = compose(code)
     self.asm = self.game.to_asm()
     compile(self.asm, self.path)
     return WhatElse(self)