Patch:Data segment

From KeenWiki
Jump to navigation Jump to search

The 'data segment' is an executable segment that contains all of the data used by the rest of the game's code. It is the last and largest segment in the executable and stores all of the text and variables the game uses. The start of the data segment in various games is as follows:

Keen 1: $13050
Keen 2: $17780
Keen 3: $19820
Keen 4: $2EE70
Keen 5: $30340
Keen 6: $30D30
Keen D: $23A70

Data in the data segment is referenced by its location (or offset) from the start of the segment, as an example: Text located at $14051 in the Keen 1 data segment would have a reference (or 'pointer' to it) of $1001W ($14051 - $13050 = $1001). This includes game variables such as the number of lives Keen has, which are two-byte variables in the segment.