Esempio n. 1
0
 def test_op_print_num(self):
     op = opcodes.op_print_num()
     op.operands = [0x01]
     op.optypes = [opcodes.TYPE_SMALL]
     self.cpu.print_line(ztext.from_zscii("1"))
     self.mymox.ReplayAll()
     op.execute(self.cpu)
     self.mymox.VerifyAll()
Esempio n. 2
0
    def test_op_print(self):
        op = opcodes.op_print()
        op.text = ztext.to_bytes(ztext.from_zscii("This is a test"))

        self.cpu.print_line(op.text)

        self.mymox.ReplayAll()
        op.execute(self.cpu)
        self.mymox.VerifyAll()
Esempio n. 3
0
 def quit(self):
     self.print_line(ztext.from_zscii("END OF EXECUTION"))
     self.state = STOPPED
Esempio n. 4
0
 def testCanEncodeZTextToMemory(self):
     self.assertEquals([0x98, 0xE8],ztext.to_bytes(ztext.from_zscii("abc")))
     self.assertEquals([0x90, 0x84], ztext.to_bytes(ztext.from_zscii("")))
     self.assertEquals([0x10, 0xC7, 0xA0, 0x84],ztext.to_bytes(ztext.from_zscii("Abc")))
Esempio n. 5
0
 def testCanGetZtextFromZcii(self):
     self.assertEquals([6,7,8],ztext.from_zscii("abc"))
     self.assertEquals([4,4,4], ztext.from_zscii(""))
     self.assertEquals([4,6,7,8,4,4],ztext.from_zscii("Abc"))
     self.assertEquals([5,15,5,20,4,4],ztext.from_zscii("7!"))
Esempio n. 6
0
 def execute(self, cpu):
     cpu.print_line(ztext.from_zscii("%d" % get_arg_value(self, cpu, 0)._signed_value()))