Difference between revisions of "SCI Specifications: Chapter 1 - Introduction"

From SCI Wiki
Jump to navigationJump to search
(Replaced content with "== Introduction ==   === The basics === <!-- ;Notes <references /> -->   <!-- <span style="float: left">Sierra_Creative_Interpreter_Specifications|< P...")
Line 4: Line 4:
 
=== The basics ===
 
=== The basics ===
  
 +
The Sierra Creative Interpreter is a stack-based virtual machine ("P-Machine"). In addition to its roughly 125 basic opcodes, it provides a set of extended functions for displaying graphics, playing sound, receiving input, writing and reading data to and from the hard disk, and handling complex arithmetical and logical functions. In version 0.xxx of the interpreter, Sierra split the game data into nine different types of information:
  
 +
script data: SCI scripts and local data<br />
 +
vocab data: Parser data and debug information<br />
 +
patch data: Information pertaining to specific audio output devices<br />
 +
sound data: MIDI music tracks<br />
 +
cursor data: Mouse pointer shapes<br />
 +
view data: Sets of sets of image and hotspot information<br />
 +
pic data: Background images and metadata<br />
 +
font data: Bitmap fonts<br />
 +
text data: Plain text information
  
<!-- ;Notes
+
Each game may contain up to 1000 different elements of each data type; these elements are referred to as "resources". The index numbers of the various resources need not be in sequence; they are usually assigned arbitrarily. <ref>With several notable exceptions, such as script 0 and most vocab resources.</ref>
<references /> -->
 
  
 
&nbsp;
 
&nbsp;
 +
=== Resource Storage ===
  
<!-- <span style="float: left">[[Sierra_Creative_Interpreter_Specifications|&lt; Previous: Sierra Creative Interpreter Specifications Preface]]</span><span style="float: right">[[SCI Specifications: Chapter_2_-_Resource_files|Next: Chapter 2 - Resource files &gt;]]</span>
+
Individual resources can be stored in one of two ways: Either in resource files (which, surprisingly, are called something like "RESOURCE.000" or "RESOURCE.001"), or in external patch files (not to be confused with "patch" resources). The external files are called something like "PIC.100" or "script.000", and they take precedence over data from resource files.
&nbsp; -->
 
  
[[Category:SCI Resources]]
+
There is also a file called "RESOURCE.MAP", which contains a lookup table for the individual resources, and another file, "RESOURCE.CFG", which contains configuration information.
[[Category:Sierra Creative Interpreter Specifications]]
+
 
 +
Resource information stored in external patch files is not compressed and therefore easily readable. It is, however, preceded by two bytes: The first byte contains the resource type ORed with 0x80, the purpose of the second byte is unknown (but it appears to be ignored by the original SCI version 0 engine).
 +
 
 +
As stated before, external patch files take precedence over resource resource files. Applying those external files as patches is an option since FreeSCI version 0.2.2.
 +
 
 +
The resource files, however, are more complicated. Each of them contains a sequence of resources preceded by a header; these resources may be compressed. It is, also, quite common to find resources shared by several resource files. The reason for this appears to be that that, back when hard disks were rare and hard to come by, the games had to be playable from floppy disks. To prevent unnecessary disk-jockeying, common stuff was placed in several resource files, each of which was then stored on one disk.
 +
 
 +
&nbsp;
 +
=== The individual resources: A summary ===
 +
 
 +
The resource types of SCI0 can be roughly grouped into four sets:
 +
 
 +
*[[#Graphical resources summarized|Graphics (pic, view, font, cursor)]]
 +
*[[#Sound resources summarized|Sound (patch, sound)]]
 +
*[[#Logic resources summarized|Logic (script, vocab)]]
 +
*Text (Text resources are nothing more than a series of ASCIIZ strings)
 +
<!--; but the other resources deserve further discussion.-->

Revision as of 16:56, 5 September 2013

Introduction

 

The basics

The Sierra Creative Interpreter is a stack-based virtual machine ("P-Machine"). In addition to its roughly 125 basic opcodes, it provides a set of extended functions for displaying graphics, playing sound, receiving input, writing and reading data to and from the hard disk, and handling complex arithmetical and logical functions. In version 0.xxx of the interpreter, Sierra split the game data into nine different types of information:

script data: SCI scripts and local data
vocab data: Parser data and debug information
patch data: Information pertaining to specific audio output devices
sound data: MIDI music tracks
cursor data: Mouse pointer shapes
view data: Sets of sets of image and hotspot information
pic data: Background images and metadata
font data: Bitmap fonts
text data: Plain text information

Each game may contain up to 1000 different elements of each data type; these elements are referred to as "resources". The index numbers of the various resources need not be in sequence; they are usually assigned arbitrarily. [1]

 

Resource Storage

Individual resources can be stored in one of two ways: Either in resource files (which, surprisingly, are called something like "RESOURCE.000" or "RESOURCE.001"), or in external patch files (not to be confused with "patch" resources). The external files are called something like "PIC.100" or "script.000", and they take precedence over data from resource files.

There is also a file called "RESOURCE.MAP", which contains a lookup table for the individual resources, and another file, "RESOURCE.CFG", which contains configuration information.

Resource information stored in external patch files is not compressed and therefore easily readable. It is, however, preceded by two bytes: The first byte contains the resource type ORed with 0x80, the purpose of the second byte is unknown (but it appears to be ignored by the original SCI version 0 engine).

As stated before, external patch files take precedence over resource resource files. Applying those external files as patches is an option since FreeSCI version 0.2.2.

The resource files, however, are more complicated. Each of them contains a sequence of resources preceded by a header; these resources may be compressed. It is, also, quite common to find resources shared by several resource files. The reason for this appears to be that that, back when hard disks were rare and hard to come by, the games had to be playable from floppy disks. To prevent unnecessary disk-jockeying, common stuff was placed in several resource files, each of which was then stored on one disk.

 

The individual resources: A summary

The resource types of SCI0 can be roughly grouped into four sets:

  1. With several notable exceptions, such as script 0 and most vocab resources.