View Javadoc

1   /*
2    * $Id: StoryFileHeader.java,v 1.4 2005/11/03 19:04:34 weiju Exp $
3    * 
4    * Created on 2005/09/23
5    * Copyright 2005 by Wei-ju Wu
6    *
7    * This file is part of The Z-machine Preservation Project (ZMPP).
8    *
9    * ZMPP is free software; you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as published by
11   * the Free Software Foundation; either version 2 of the License, or
12   * (at your option) any later version.
13   *
14   * ZMPP is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   *
19   * You should have received a copy of the GNU General Public License
20   * along with ZMPP; if not, write to the Free Software
21   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22   */
23  package org.zmpp.vm;
24  
25  
26  
27  /***
28   * This interface defines the structure of a story file header in the Z-machine.
29   * It is designed as a read only view to the byte array containing the
30   * story file data.
31   * By this means, changes in the memory map will be implicitly change
32   * the header structure.
33   * 
34   * @author Wei-ju Wu
35   * @version 1.0
36   */
37  public interface StoryFileHeader {
38  
39    /***
40     * Returns the story file version.
41     * 
42     * @return the story file version
43     */
44    int getVersion();
45    
46    /***
47     * Returns the flags1 field.
48     * 
49     * @return the flags1 field
50     */
51    int getFlags1();
52    
53    /***
54     * Returns the release number.
55     * 
56     * @return the release number
57     */
58    int getRelease();
59    
60    /***
61     * Returns the high memory start address.
62     * 
63     * @return the start of the high memory
64     */
65    int getHighMemAddress();
66    
67    /***
68     * Returns the program counter start address.
69     * 
70     * @return the PC start address
71     */
72    int getProgramStart();
73    
74    /***
75     * Returns the dictionary's start address.
76     * 
77     * @return the dictionary start address
78     */  
79    int getDictionaryAddress();
80    
81    /***
82     * Returns the object table's start address.
83     * 
84     * @return the object table's start address
85     */
86    int getObjectTableAddress();
87    
88    /***
89     * Returns the address of the global variables.
90     * 
91     * @return the global variables section
92     */
93    int getGlobalsAddress();
94    
95    /***
96     * Returns the static memory start address.
97     * 
98     * @return the start address of the static memory
99     */
100   int getStaticsAddress();
101   
102   /***
103    * Returns the flags2 field.
104    * 
105    * @return the flags2 field
106    */
107   int getFlags2();
108   
109   /***
110    * Returns this game's serial number.
111    * 
112    * @return the serial number
113    */
114   String getSerialNumber();
115   
116   /***
117    * Returns the start address of the abbreviations section.
118    * 
119    * @return the abbreviations start address
120    */
121   int getAbbreviationsAddress();
122   
123   /***
124    * Returns this story file's length.
125    * 
126    * @return the file length
127    */
128   int getFileLength();
129   
130   /***
131    * Returns the checksum for the story file.
132    * 
133    * @return the checksum
134    */
135   int getChecksum();
136   
137   /***
138    * Returns the interpreter number.
139    * 
140    * @return the interpreter number
141    */
142   int getInterpreter();
143   
144   /***
145    * Returns the interpreter version.
146    * 
147    * @return the interpreter version
148    */
149   int getInterpreterVersion();
150   
151   /***
152    * Returns the revision number.
153    * 
154    * @return the revision number
155    */
156   int getRevision();  
157 }