Esempio 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)
Esempio 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()
Esempio 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)
Esempio 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()