org.zmpp.vm
Class PortableGameState

java.lang.Object
  extended by org.zmpp.vm.PortableGameState

public class PortableGameState
extends Object

This class represents the state of the Z machine in an external format, so it can be exchanged using the Quetzal IFF format.

Version:
1.0
Author:
Wei-ju Wu

Nested Class Summary
static class PortableGameState.StackFrame
          This class represents a stack frame in the portable game state model.
 
Constructor Summary
PortableGameState()
          Constructor.
 
Method Summary
 void captureMachineState(Machine machine, int savePc)
          Makes a snapshot of the current machine state.
 int getChecksum()
          Returns the game checksum.
 byte[] getDeltaBytes()
          Returns the delta bytes.
 byte[] getDynamicMemoryDump()
          Returns the current dump of dynamic memory captured from a Machine object.
 int getProgramCounter()
          Returns the program counter.
 int getRelease()
          Returns the game release number.
 String getSerialNumber()
          Returns the game serial number.
 List<PortableGameState.StackFrame> getStackFrames()
          Returns the list of stack frames.
 boolean readSaveGame(FormChunk formChunk)
          Initialize the state from an IFF form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortableGameState

public PortableGameState()
Constructor.

Method Detail

getRelease

public int getRelease()
Returns the game release number.

Returns:
the release number

getChecksum

public int getChecksum()
Returns the game checksum.

Returns:
the checksum

getSerialNumber

public String getSerialNumber()
Returns the game serial number.

Returns:
the serial number

getProgramCounter

public int getProgramCounter()
Returns the program counter.

Returns:
the program counter

getStackFrames

public List<PortableGameState.StackFrame> getStackFrames()
Returns the list of stack frames.

Returns:
the stack frames

getDeltaBytes

public byte[] getDeltaBytes()
Returns the delta bytes. This is the changes in dynamic memory, where 0 represents no change.

Returns:
the delta bytes

getDynamicMemoryDump

public byte[] getDynamicMemoryDump()
Returns the current dump of dynamic memory captured from a Machine object.

Returns:
the dynamic memory dump

readSaveGame

public boolean readSaveGame(FormChunk formChunk)
Initialize the state from an IFF form.

Parameters:
formChunk - the IFF form
Returns:
false if there was a consistency problem during the read

captureMachineState

public void captureMachineState(Machine machine,
                                int savePc)
Makes a snapshot of the current machine state. The savePc argument is taken as the restore program counter.

Parameters:
machine - a Machine
savePc - the program counter restore value


Copyright © 2005 . All Rights Reserved.