Difference between revisions of "AGI Specifications: Chapter 10 - Savegame Files"
Lance Ewing (talk | contribs) |
Lance Ewing (talk | contribs) |
||
| Line 85: | Line 85: | ||
|- | |- | ||
|align="center"|<code>1489-1490</code>||<code>Text Attribute value (a combined foreground/background value)</code> | |align="center"|<code>1489-1490</code>||<code>Text Attribute value (a combined foreground/background value)</code> | ||
| + | |- | ||
| + | |align="center"|<code>1491-1492</code>||<code>Accept input = 1, Prevent input = 0</code> | ||
| + | |- | ||
| + | |align="center"|<code>1493-1494</code>||<code>User input row number on the screen</code> | ||
| + | |- | ||
| + | |align="center"|<code>1495-1496</code>||<code>Cursor character</code> | ||
| + | |- | ||
| + | |align="center"|<code>1497-1498</code>||<code>Show status line = 1, Don't show status line = 0</code> | ||
| + | |- | ||
| + | |align="center"|<code>1499-1500</code>||<code>Status line row number on the screen</code> | ||
|- | |- | ||
|align="center"|<code>WIP</code>||<code>WORK IN PROGRESS</code> | |align="center"|<code>WIP</code>||<code>WORK IN PROGRESS</code> | ||
Revision as of 17:18, 8 March 2017
10.1 Introduction
AGI saved game files are named as follows:
<gameId>SG.<num>
where <gameId> is the ID of the game, e.g. KQ1, SQ2, etc., and where <num> is a number starting at 1. The format of the saved game file was relatively consistent between versions 2.4XX and 2.9XX apart from one minor addition. The specification below currently focuses on the format used by that version range. The format of AGI v3 saved games has not yet been explored, but it is known that AGI v2.272 differs somewhat in format and almost certainly those versions prior to 2.272 will therefore be different as well.
The saved game file consists of six sections. The first section contains only the description of the saved game. We'll call this the header. The other five sections follow a high level format where the first two bytes give the length of the section and the remainder is the data for that section.
Note that the byte offsets for each section are specified as being from the start of that section and not the start of the file.
Where a numeric value is specified over multiple bytes, it is always little-endian, unless otherwise noted.
10.2 Saved Game Format
Header
Byte Meaning 0-30Savegame description. This can be up to 30 printable characters, and is padded out with NUL (\0) bytes to a total of 31 bytes.
General State
Byte Meaning 0-1Length of general state section2-8Game ID("SQ2", "KQ3", "LLLLL", etc.), NUL padded9-264Variables, 1 variable per byte265-296Flags, 8 flags per byte, starting with highest bit first297-300Clock ticks since game started. 1 clock tick == 50ms301-302Horizon303-304Key Dir305-306Upper left X position for active block307-308Upper Left Y position for active block309-310Lower Right X position for active block311-312Lower Right Y position for active block313-314Player control (1) / Program control (0)315-316Current picture number317-318Blocking flag (1 = true, 0 = false)319-320Max drawn. Always set to 15. Maximum number of animated objects that can be drawn at a time.321-322Script size. Set by script.size. Max number of script event entries. Default is 50.323-324Current number of script event entries.325-524Key to controller map (4 bytes each). First 2 bytes keycode, second 2 bytes controller num.525-148424 strings, each 40 bytes long (note that some AGI versions had 12 strings)1485-1486Text foreground colour1487-1488Text background colour1489-1490Text Attribute value (a combined foreground/background value)1491-1492Accept input = 1, Prevent input = 01493-1494User input row number on the screen1495-1496Cursor character1497-1498Show status line = 1, Don't show status line = 01499-1500Status line row number on the screenWIPWORK IN PROGRESS
Animated Objects
Byte Meaning 0-1Length of animated objects section.WIPWORK IN PROGRESS
Inventory Objects
Byte Meaning 0-1Length of inventory objects section.WIPWORK IN PROGRESS
Script Events
Byte Meaning 0-1Length of script events section.WIPWORK IN PROGRESS
Scan Offsets
Byte Meaning 0-1Length of scan offsets section.WIPWORK IN PROGRESS
< Previous: Chapter 9 - Sound ResourcesNext: Chapter 11 - Other Game Data >