Ejemplo n.º 1
0
 def __init__(self, story, ui, debugmode=False):
     zlogging.set_debug(debugmode)
     self._pristine_mem = ZMemory(story)  # the original memory image
     self._mem = ZMemory(
         story)  # the memory image which changes during play
     self._stringfactory = ZStringFactory(self._mem)
     self._objectparser = ZObjectParser(self._mem)
     self._stackmanager = ZStackManager(self._mem)
     self._opdecoder = ZOpDecoder(self._mem, self._stackmanager)
     self._opdecoder.program_counter = self._mem.read_word(0x06)
     self._ui = ui
     self._stream_manager = ZStreamManager(self._mem, self._ui)
     self._cpu = ZCpu(self._mem, self._opdecoder, self._stackmanager,
                      self._objectparser, self._stringfactory,
                      self._stream_manager, self._ui)
Ejemplo n.º 2
0
class ZMachine(object):
    """The Z-Machine black box."""

    def __init__(self, story, ui, debugmode=False):
        zlogging.set_debug(debugmode)
        self._pristine_mem = ZMemory(story)  # the original memory image
        self._mem = ZMemory(story)  # the memory image which changes during play
        self._stringfactory = ZStringFactory(self._mem)
        self._objectparser = ZObjectParser(self._mem)
        self._stackmanager = ZStackManager(self._mem)
        self._opdecoder = ZOpDecoder(self._mem, self._stackmanager)
        self._opdecoder.program_counter = self._mem.read_word(0x06)
        self._ui = ui
        self._stream_manager = ZStreamManager(self._mem, self._ui)
        self._cpu = ZCpu(
            self._mem,
            self._opdecoder,
            self._stackmanager,
            self._objectparser,
            self._stringfactory,
            self._stream_manager,
            self._ui,
        )

    # --------- Public APIs -----------

    def run(self):
        return self._cpu.run()
Ejemplo n.º 3
0
 def __init__(self, story, ui, debugmode=False):
   zlogging.set_debug(debugmode)
   self._pristine_mem = ZMemory(story) # the original memory image
   self._mem = ZMemory(story) # the memory image which changes during play
   self._stringfactory = ZStringFactory(self._mem)
   self._objectparser = ZObjectParser(self._mem)
   self._stackmanager = ZStackManager(self._mem)
   self._opdecoder = ZOpDecoder(self._mem, self._stackmanager)
   self._opdecoder.program_counter = self._mem.read_word(0x06)
   self._ui = ui
   self._cpu = ZCpu(self._mem, self._opdecoder, self._stackmanager,\
                    self._objectparser, self._stringfactory, self._ui)
Ejemplo n.º 4
0
class ZMachine(object):
    """The Z-Machine black box."""
    def __init__(self, story, ui, debugmode=False):
        zlogging.set_debug(debugmode)
        self._pristine_mem = ZMemory(story)  # the original memory image
        self._mem = ZMemory(
            story)  # the memory image which changes during play
        self._stringfactory = ZStringFactory(self._mem)
        self._objectparser = ZObjectParser(self._mem)
        self._stackmanager = ZStackManager(self._mem)
        self._opdecoder = ZOpDecoder(self._mem, self._stackmanager)
        self._opdecoder.program_counter = self._mem.read_word(0x06)
        self._ui = ui
        self._stream_manager = ZStreamManager(self._mem, self._ui)
        self._cpu = ZCpu(self._mem, self._opdecoder, self._stackmanager,
                         self._objectparser, self._stringfactory,
                         self._stream_manager, self._ui)

    #--------- Public APIs -----------

    def run(self):
        return self._cpu.run()