Skip to content

The first KiSS Specification

Libby edited this page Feb 21, 2022 · 3 revisions

This is an edited (for formatting and clarity) version of the original KiSS specification by K.O.S. The references to "new" and "old" are relative to 1991. :) The "old" version referenced here had no specification at all apparently.

Introduction

KISS - a paper doll program has been developped for computers based on NEC PC-9801VM2 architecture since March 1991. Many people have enjoyed and implemented KISS for other computers. Now KISS is running on many platforms.

Now we make a reference manual about new KISS data format, that is, KISS General Specification : KISS/GS and release this.

Abstract of new specification

New style KISS data is upper compatible with the old style.

  • color (cel) 16 colors -> 16 or 256 colors
  • color (palette) 4096 colors -> 4096 or 16,777,216 colors
  • screen size 640 x 400 -> 768 x 480 or more
  • cel and object max 128 -> 256 or more

Multiple palette files available. (-> 4-1 multipalette)

A header is added to cel/palette files to store additional information. At implemention some limitations may exist about hardware and software resources. So implementation level is indicated in the following form:

KISS/GSn ( n = 1,2,3,... )_(-> 7 KISS/GS Ranks)

Basic Concepts

KISS Functions

KISS is a image viewer program with transparency processing. It is able to display overlapped pictures and allow the user to manipulate them with real-time mouse operation.

Files

KISS needs the following files.

  • Cel file -- Image data to be moved. An array of pixels. Pixel code 0 the is transparent pixel.
  • Palette file -- Defines actual colors of pixels.
  • Configuration file -- Describes the overlapping order and positions of cels, etc. KISS reads this first and refers it to read other files. This file is a text file created with a text editor. Some parts of it may be changed by KISS program's save function.

Technical terms

  • Cel -- The basic image element.
  • Object -- A unit of pictures to move or display; composed of one or more cels.
  • Palette group -- Color information for one set.
  • Set -- A palette group and object positions to be displayed.

KISS/GS New Feature

Multipalette

Before KISS/GS, all cels are drawn according to a single palette table in the palette file. Now, cels can be drawn with individual palette tables. The total number of colors must be less than or equal to 256. Each cel requires information about which palette it uses.

The configuration file

Each line must be shorter than 256 bytes.

Palette/cel filenames are composed of the basename (max 8 bytes) + the suffix (max 3 bytes). Upper and lower cases are identical. The character set used in filenames is [_0-9a-z].

The character at the top of each line is one of the following:

Memory size

Description: =_memory_K

For KISS v1.0 compatibility. KISS v2.0 or later ignores it. Its use is discouraged.

Example:

    =260K

Screen size

Description: (horizontal size, vertical size)

Defines the screen size. If omitted, (448,320) is assumed for KISS v2.18 compatibility. Maximum size of screen is (640,400) on KISS/GS2. (-> 7 KISS/GS Ranks)

Example:

     (640,400)

Palette file

Description: %Palette filename

Describes a palette file. Palette files are numbered as 0,1,2... in the order of appearance.

All colors in the palette file #0 are used. But the first (transparent) color in the other palette files is ignored. Total number of colors must be less than or equal to 256.

All palette files must be described before description about cel files.

Example:

    %COL.KCF
    %COL2.KCF

Border color

Description: [ Border color pixel code

Outside of the screen is filled with this pixel code.

Example:

    [12

Cell description

Description: #Object.Fix value Cel filename [* Palette number] [: Set number...]

Object number: Identification number to specify object. Cells of the same number are unified and make an object. Object number is from 0 to 255 on KISS/GS2. (->7 KISS/GS Ranks)

Fix value: Specify this for fixed objects such as the doll's body. An object with a big value is hard to move. Value is a number from 0 to 32767. If omitted, treated as 0 (not fixed).

Cell filename: Describes the filename with suffix.

Palette number: Indicates which palette file this cel uses. If omitted, treated as 0.

Set number: The cel is drawn only in the sets specified here. 0 - 9 is available. If omitted, this cel is drawn in all sets.

The order of cel file descriptions determines the priority in drawing cels. The number of cels is max 256. (- >7 KISS/GS Ranks)

Example:

    #2     extra.cel        :2 3 4 ; front (near)
    #4     dress-f.cel             ;
    #1.255 body.cel                ; fixed
    #4     dress-b.cel             ;
    #3     backgrnd.cel *1  :5     ; back (far)

dress-f.cel and dress-b.cel make one object, #4, that will move together.

Set information

Description: $Palette group [ xpos,ypos...]

Palette group and positions of object for each set. There are max 10 sets. This section can be overwritten by KISS save function.

A long description is wrapped, and the following lines start with a ' ' (blank) character to indicate that the lines are continued from the previous line.

Palette group: Palette group number. 0 ... 9.
xpos,ypos: Position of object (from object mark 0). Max 256 positions are described on KISS/GS2. (- >7 KISS/GS Ranks) '*' means a non-existent object.

Example:

    $2 192,11 * 56,176 55,21 259,62 15,24 375,63
    $3 43,115 154,62 372,108 253,156 * * * 165,207
        * 162,198 * 119,56 152,44 * * *
        16,355 394,362 108,355 * * * 125,261
    $0 192,11 * 56,176 55,21 259,62 15,24 375,63

Comments

Description: ;Comment

This line is ignored.

Future extension may determine how to include various information of the data (title, author etc.) as comments.

Others

Reserved for extention.

Details of cel file

Cel files have a 32-byte header.

offset size contents
+0 4B Identifier 'KiSS' ( 4Bh 69h 53h 53h )
+4 B Cel file mark ( 20h )
+5 B bits per pixel ( 4 or 8 )
+6 W Reserved
+8 W(L,H) Width ( 1 ... XMAX )
+10 W(L,H) Height ( 1 ... YMAX )
+12 W(L,H) x-offset ( 0 ... XMAX-1 )
+14 W(L,H) y-offset ( 0 ... YMAX-1 )
+16 16B Reserved

Caution: the reserved field must be filled with 0.

Cels of the same object are aligned at the top left corner. X,y-offsets are the offsets from this alignment point.

Pixel data

Pixel data order (4 bits/pixel)

One raster: || || || MSB LSB MSB LSB MSB LSB

| pix0 | pix1 | | pix2 | pix3 | | pix4 | pix5 | ......... | pixN |

If the width is odd, add a padding pixel of color 0. The number of rasters is indicated in the height field.

Pixel data order (8 bits/pixel)

One raster: || || || MSB LSB MSB LSB MSB LSB

| pix0 | | pix1 | | pix2 | ... | pixN |

The number of rasters is indicated in the height field.

If the top 4-byte identifier is not 'KiSS', the file format is as follows:

+0 W(L,H) Width +2 W(L,H) Height +4... Pixel data

4 bits/pixel. X and y-offset are 0. This is the conventional format.

Palette file detail

Palette files have a 32-byte header.

offset size contents
+0 4B Identifier 'KiSS' ( 4Bh 69h 53h 53h )
+4 B Palette file mark ( 10h )
+5 B bits per color ( 12 or 24 )
+6 W Reserved
+8 W(L,H) number of colors in one palette group ( 1 ... 256 )
+10 W(L,H) number of palette groups ( 1 ... 10 )
+12 W Reserved
+14 W Reserved
+16 16B Reserved

Caution: the reserved fields must be filled with 0.

Palette data

Palette data order (12 bits = 4096 colors)

A color consists of 2 bytes. 4 bits each for red, green, blue.

|| || MSB LSB MSB LSB

| rrrr | bbbb | | 0000 | gggg | ....

Palette data order (24 bit = 16,777,216 colors) A color consists of 3 bytes. 8 bits each for red, green, blue.

|| || || MSB LSB MSB LSB MSB LSB

| rrrrrrrr | | gggggggg | | bbbbbbbb | ...

If the number of palette groups is less than 10, colors of the remaining palette groups will be copied from Group 0.

If the top 4-byte identifier is not 'KiSS', the file format is as follows:

+0... palette data

12 bits/color, 16 colors in a palette group, 10 groups. This is the conventional format.

KISS/GS Ranks

Rank size colors max cels (comments)
KISS/GS1 640 x 400 16 128 KISS v2.24c
KISS/GS2 640 x 400 256 256 KISS v2.37
KISS/GS3 768 x 480 256 256 draft
KISS/GS4 768 x 480 256 512 draft

These are just standards. When you implement a KISS program on your system, you should support the maximum ability of the hardware. When you create KISS data you are encouraged to consider these ranks. The lower rank the data conforms to, the more users can play with it. However, you don't have to conform it to unnecessarily low ranks.

Appendix

The appendix originally said: This document is in public domain. Send bug reports, questions, comments and problems to [email protected] (yav). Thank you.

ITO Takayuki <[email protected] > Graduate student, Department of Information Science, Faculty of Science, University of Tokyo, Japan.

But yav is probably not involved in KiSS dolls anymore, so please feel free to just edit this wiki with corrections.