-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.h
61 lines (53 loc) · 1.73 KB
/
header.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#define SWAP16(x) (x>>8) | (x<<8)
#ifndef HEADER_H
#define HEADER_H
#include "../foenixLibrary/mytypes.h"
struct header
{
byte version;
byte flags1;
unsigned short release;
unsigned short highMemoryStart;
unsigned short programCounterInitial;
unsigned short dictionaryLocation;
unsigned short objectTableLocation;
unsigned short globalVariableLocation;
unsigned short staticMemoryLocation;
unsigned short flags2; /* spec says byte but frotz has word, posibly for easier parsing, also need fille byte before serial */
byte serial[6];
unsigned short abbreviationsLocation;
unsigned short fileLength;
unsigned short fileChecksum;
byte interpreterNumber;
byte interpreterVersion;
byte screenHeightLines;
byte screenWidthChars;
unsigned short screenWidthUnits;
unsigned short screenheightUnits;
byte fontHeight;
byte fontWidth;
unsigned short routineOffset;
unsigned short stringOffset;
byte defaultBackgroundColor;
byte defaultForegroundColor;
unsigned short terminatingCharAddress;
unsigned short outputStream3pixelWidth;
unsigned short revisionNumber;
unsigned short alphabetTableAddress;
unsigned short headerExtensionTableAddress;
byte username[8];
};
//extern struct header *zorkHeader;
void header_initialise(char *filename);
ushort getRelease(void);
ushort getInitialProgramCounter(void);
ushort getDictionaryLocation(void);
ushort getObjectTableLocation(void);
ushort getGlobalVariableLocation(void);
ushort getStaticMemoryLocation(void);
ushort getHighMemoryStart(void);
ushort getAbbreviationsLocation(void);
ushort getAlphabetTableAddress(void);
ushort getRoutineOffset(void);
ushort getStringOffset(void);
#endif /* HEADER_H */