Open main menu

Difference between revisions of "Cine/Specifications"

6,033 bytes added ,  17:39, 5 May 2018
Added more detail to chapter title "Compression format" with "Compression format (Bytekiller 1.3)".
m (.H32 files in Operation Stealth are probably used for Roland MT-32 music.)
(Added more detail to chapter title "Compression format" with "Compression format (Bytekiller 1.3)".)
 
(7 intermediate revisions by 2 users not shown)
Line 10: Line 10:
===.ADL files===
===.ADL files===


Adlib music.
AdLib music.


===.AMI files===
===.AMI files===
Line 106: Line 106:
* CELLO2, CELLOSEC, ETOMSIMO, FUZZGUIT, PRO1002, PRO11, PRO1120, PRO13, PRO3, PRO300, PRO69, PRO700, PRO800, PRO9874
* CELLO2, CELLOSEC, ETOMSIMO, FUZZGUIT, PRO1002, PRO11, PRO1120, PRO13, PRO3, PRO300, PRO69, PRO700, PRO800, PRO9874
** These seem to be sample files (Possibly identical in format to the [[Cine/Specifications#.AMI_files | .AMI files]])
** These seem to be sample files (Possibly identical in format to the [[Cine/Specifications#.AMI_files | .AMI files]])
===Savegames===
NOTE: This is specific to Operation Stealth's PC version's savegame format at the moment.
* 0x0000: Current disk (Uint16BE)
* A chunk of current string variables:
** 0x0002: Current part name (String, 13 bytes)
** 0x000F: Current procedure name (String, 13 bytes)
** 0x001C: Current relation name (String, 13 bytes)
** 0x0029: Current message name (String, 13 bytes)
** 0x0036: Current background names (8 strings, 13 bytes each)
** 0x009E: Current Ct name (String, 13 bytes)
* Object structs:
** 0x00AB: Entry count (Uint16BE), value discarded on load and assumed to be 255 in the PC version of Operation Stealth
** 0x00AD: Entry size (Uint16BE), 32 in the PC version of Operation Stealth
** 0x00AF: Object structs (Entry count structs, entry size bytes each):
** struct objectStruct:
*** x (Int16BE)
*** y (Int16BE)
*** mask (Uint16BE), seems to be a priority or a Z-buffer value this one
*** frame (Int16BE), indexes the animDataTable
*** costume (Int16BE), maybe this should be named room number instead?
*** name (String, 20 bytes)
*** part (Uint16BE)
* Palettes:
** 0x208F: Temporary color palette (256 colors, 3 bytes per color, 768 bytes total)
*** TODO: Make sure whether this is the backup color palette or the active one
** 0x238F: Color palette (256 colors, 3 bytes per color, 768 bytes total)
*** TODO: Make sure whether this is the active color palette or the backup one
* 0x268F: Global variables (255 Uint16BE values, 510 bytes total)
* 0x288D: Zone data table (16 Uint16BE values, 32 bytes total)
* 0x28AD: Command variables (4 Uint16BE values, 8 bytes total)
* 0x28B5: Command buffer (String, 80 bytes)
* 0x2905: Zone query table (16 Uint16BE values, 32 bytes total)
* 0x2925: Current music name (String, 13 bytes)
* A chunk of Uint16BE variables:
** 0x2932: Is music loaded? (Uint16BE, Boolean)
** 0x2934: Is music playing? (Uint16BE, Boolean)
** 0x2936: Player's command string's vertical position on-screen (Uint16BE)
** 0x2938: Some unknown zero value (Uint16BE)
** 0x293A: Allow player input? (Uint16BE, Boolean)
** 0x293C: Player command (Uint16BE)
** 0x293E: commandVar1 (Uint16BE)
** 0x2940: Is draw command enabled? (Uint16BE, Boolean)
** 0x2942: var5 (Uint16BE)
** 0x2944: var4 (Uint16BE)
** 0x2946: var3 (Uint16BE)
** 0x2948: var2 (Uint16BE)
** 0x294A: commandVar2 (Uint16BE)
** 0x294C: Default menu background color (Uint16BE)
** 0x295E: adBgVar1 (Uint16BE)
** 0x2950: currentAdditionalBgIdx (Uint16BE)
** 0x2952: currentAdditionalBgIdx2 (Uint16BE)
** 0x2954: additionalBgVScroll (Uint16BE)
** 0x2956: adBgVar0 (Uint16BE)
** 0x2958: Is system menu disabled? (Uint16BE, Boolean)
* Animation data structs:
** 0x295A: Entry count (Uint16BE), value discarded on load and assumed to be 255 in the PC version of Operation Stealth
** 0x295C: Entry size (Uint16BE), 36 in the PC version of Operation Stealth
** 0x295E: Animation data structs (Entry count structs, entry size bytes each):
** struct animData:
*** Width (Uint16BE)
*** Var1 (Uint16BE)
*** Bits per pixel (Uint16BE), or maybe type?
*** Height (Uint16BE)
*** Data pointer (Uint32LE, Real mode far pointer, only test for equality or inequality with zero!)
*** File index (Int16BE)
*** Frame index (Int16BE)
*** Name (String, 20 bytes)
* 0x4D3A: Unknown screen parameters (6 parameters, Uint16BE each, 12 bytes total)
* Global scripts:
** 0x4D46: Entry count (Uint16BE)
** 0x4D48: Global script structs (Entry count structs, entry size undetermined)
*** TODO: Determine the entry size used by a global script
* Object scripts:
** Entry count (Uint16BE)
** Object script structs (Entry count structs, entry size undetermined)
*** TODO: Determine the entry size used by an object script
* seqList elements:
** Entry count (Uint16BE)
** seqList element structs (Entry count structs, 32 bytes each)
* Overlays:
** Entry count (Uint16BE)
** Overlay structs (Entry count structs, 22 bytes each)
* Background incrusts
** Entry count (Uint16BE)
** Background incrust structs (Entry count structs, 22 bytes each)
And there the savegame file ends.


===Part file format===
===Part file format===
Line 209: Line 305:
</pre>
</pre>


===Compression format===
===Compression format (Bytekiller 1.3) ===


The compression algorithm used by all Delphine's adventure games uses
The compression algorithm used by all Delphine's adventure games uses
sliding window compression (Quite like [http://en.wikipedia.org/wiki/LZ77 LZ77])
sliding window compression (Quite like [http://en.wikipedia.org/wiki/LZ77 LZ77])
combined with a fixed non-adaptive [http://en.wikipedia.org/wiki/Entropy_coding entropy coding] scheme (Not of any type I could recognize).
combined with a fixed non-adaptive [http://en.wikipedia.org/wiki/Entropy_coding entropy coding]
scheme. It seems that the algorithm is [http://www.pouet.net/prod.php?which=47994 Bytekiller 1.3].
This is based on comparing the reverse engineered
[https://github.com/scummvm/scummvm/blob/branch-2-0-0/engines/cine/unpack.cpp#L92 decompression routine]
in ScummVM with the
[https://github.com/aperture-software/colditz-escape/blob/v1.2/low-level.c#L150 uncompress]-function
from [https://github.com/aperture-software/colditz-escape Colditz Escape]'s source code.


The compressed data is in big endian 32-bit chunks, working backwards from the buffer's end.
The compressed data is in big endian 32-bit chunks, working backwards from the buffer's end.
Line 309: Line 411:
error detection method, it lets errors through relatively easily if compared to other more robust
error detection method, it lets errors through relatively easily if compared to other more robust
error detection methods like [http://en.wikipedia.org/wiki/SHA-1 SHA-1] or even [http://en.wikipedia.org/wiki/Cyclic_redundancy_check CRC]).
error detection methods like [http://en.wikipedia.org/wiki/SHA-1 SHA-1] or even [http://en.wikipedia.org/wiki/Cyclic_redundancy_check CRC]).
===Fonts===
Fonts are loaded from file "TEXTE.DAT".
====TEXTE.DAT file's format====
<pre>
    Byte  Meaning
    ------ ------------------------------------------------------------
    0-1  Entry size (16-bit big endian integer)
    2-3  Entry count (16-bit big endian integer)
    4-end Font data (4-bit bitplaned data in 16-bit big endian chunks)
    ------ ------------------------------------------------------------
</pre>
* Characters are 16x8 in size
* Entry size has been 8 in all observed data
* Entry count divided by entry size gives the number of characters in the font
* Take a look at [http://scummvm.svn.sourceforge.net/viewvc/scummvm/scummvm/trunk/engines/cine/gfx.cpp?revision=33976&view=markup#l_1669 gfxConvertSpriteToRaw] to see how the font data can be unpacked
====Known different font versions====
There are 4 known different font versions:
=====78 characters version=====
* Used by most PC, Amiga and Atari ST versions of Future Wars, but also by Operation Stealth's Amiga demo
* [[Image:Cinematique-78_characters_font.png]]
=====85 characters version=====
* Used by all observed versions of German Future Wars (Amiga and PC), possibly by Spanish Future Wars too
* [[Image:Cinematique-85_characters_font.png]]
=====90 characters version=====
* Used by most PC, Amiga and Atari ST versions of Operation Stealth
* [[Image:Cinematique-90_characters_font.png]]
=====93 characters version=====
* Used by all observed versions of German Operation Stealth (Amiga and PC)
* [[Image:Cinematique-93_characters_font.png]]
417

edits