home *** CD-ROM | disk | FTP | other *** search
/ Chip Hitware 3 (Alt) / Chip_Hitware_Vol_03.iso / chiphit3 / lernen / wkiss / kissgs18.txt < prev    next >
Encoding:
Text File  |  1995-11-29  |  14.7 KB  |  447 lines

  1. KISS/GS        ( KISS General Specification ) Manual        by K.O.S.
  2.  
  3.  
  4.  
  5. <<<<<<<<    KISS/GS (v1.80) $Date: 1994/09/23 23:30:37 $    >>>>>>>>
  6.  
  7.                 revised:1995/10/18
  8.  
  9.           by:             yav <UHD98984@pcvan.or.jp>
  10.  
  11.           translated by: ITO Takayuki <yuki@is.s.u-tokyo.ac.jp>
  12.  
  13.                   Edited by:     Hitoshi Ozawa <h_ozawa@bekkoame.or.jp>
  14.  
  15.  
  16.  
  17. DISCLAIMER
  18.  
  19. KISS General Specification is public domain and is provided free of
  20.  
  21. charge to all users on an AS IS basis without warranty of any kind,
  22.  
  23. including without limitations the fitness of this specification to your
  24.  
  25. needs. The entire risk of using and developing software based on this
  26.  
  27. specification is borne to you. IN NO WAYS WILL DEVELOPERS AND AUTHORS
  28.  
  29. OF THIS SPECIFICATION BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
  30.  
  31. DAMAGE OR LOSS FROM CONTENT OF THIS SPECIFICATION.
  32.  
  33.  
  34.  
  35.     Content of this document is subject to change without notice.
  36.  
  37.     Furthermore, there are topics that are not still not fully
  38.  
  39.     defined in the KISS specification. They will be covered as
  40.  
  41.     they are defined.
  42.  
  43.  
  44.  
  45.     ***********************************************************
  46.  
  47.  
  48.  
  49. 1.    Introduction
  50.  
  51.  
  52.  
  53.     KISS is a paper doll program came to existence on March 1991 when
  54.  
  55.     it was initially developed to run on Japanese NEC PC-9801VM2 computer.
  56.  
  57.     The initial program was dependent on the NEC computer architecture
  58.  
  59.     but due to its popularity, it was soon appearing on other platforms.
  60.  
  61.  
  62.  
  63.     To help further spread KISS, this KISS data format reference manual,
  64.  
  65.         KISS General Specification : KISS/GS
  66.  
  67.     containing the most recent specification, was written as a PUBLIC
  68.  
  69.     DOMAIN document.
  70.  
  71.  
  72.  
  73.     This new specification was developed to be independent of NEC
  74.  
  75.     computers and portable across all computers platforms.
  76.  
  77.  
  78.  
  79. 2.    Changes in Specification
  80.  
  81.  
  82.  
  83.     New specification is fully upward compatible with the old specification.
  84.  
  85.     However, following limitations have been changed:
  86.  
  87.  
  88.  
  89.                 OLD        NEW
  90.  
  91.     * color (cel)        16 colors   ->    16 or 256 colors
  92.  
  93.     * color (palette)    4096 colors ->    4096 or 16,777,216 colors
  94.  
  95.     * screen size        640 x 400   ->    768 x 480 or more
  96.  
  97.     * maximum number of    128         ->  256 or more
  98.  
  99.       cels and objects
  100.  
  101.  
  102.  
  103.     Furthermore, the multiple color palette files are now supported.
  104.  
  105.     (Refer to section -> 4-1 Multi-Palette)
  106.  
  107.  
  108.  
  109.     With this change, a header containing necessary information are now
  110.  
  111.     inserted in cel and color palette files.
  112.  
  113.  
  114.  
  115.     All these changes, nevertheless, may actually be limited
  116.  
  117.     during implementation by hardware and software specifications.
  118.  
  119.     To distinguish these levels, KISS/GS specifies the following levels:
  120.  
  121.         KISS/GSn (where n = 1,2,3,... )
  122.  
  123.     (Refer to section -> 7 KISS/GS Levels)
  124.  
  125.  
  126.  
  127. 3.    Basic Concepts
  128.  
  129.  
  130.  
  131.     3-1    KISS functions
  132.  
  133.  
  134.  
  135.     KISS is an image viewer program supporting transparency processing and
  136.  
  137.     display object layering. To enable it to be used as a doll clothing
  138.  
  139.     changing program, these objects are made to be moveable in real-time
  140.  
  141.     using a mouse.
  142.  
  143.  
  144.  
  145.     3-2    Files
  146.  
  147.  
  148.  
  149.     KISS uses the following files:
  150.  
  151.  
  152.  
  153.     * Cel file
  154.  
  155.         Cel files (files ending with CEL extensions) contain images of
  156.  
  157.         individual pictures. 
  158.  
  159.         It consists of array defining each color of a pixel (color code)
  160.  
  161.         with the first pixel (0th pixel code) defining the transparent
  162.  
  163.         color.
  164.  
  165.  
  166.  
  167.     * Palette file
  168.  
  169.         Defines relationship between the color code used in the CEL
  170.  
  171.         file with the actual screen color code that is used to display
  172.  
  173.         them. Maximum of color palettes for 10 settings may be defined.
  174.  
  175.  
  176.  
  177.     * Configuration file
  178.  
  179.         Defines the cel layer ordering and coordinates.
  180.  
  181.         This is the first file KISS opens to find what other files
  182.  
  183.         need to be opened.
  184.  
  185.         Configuration files, also, are ordinary text files that may be
  186.  
  187.         created with a text editor.
  188.  
  189.         Some KISS program may update some definitions when [Save]
  190.  
  191.         is selected.
  192.  
  193.  
  194.  
  195.     3-3    Glossary of Technical Terms
  196.  
  197.  
  198.  
  199.     * Cel        Minimal picture element manageable by KISS
  200.  
  201.     * Object    Unit of moveable pictures.
  202.  
  203.             Composed of one or more cels.
  204.  
  205.     * Palette group    Color information pertaining to a screen.
  206.  
  207.     * Set        Group of palette group and object coordinates.
  208.  
  209.  
  210.  
  211. 4.    GS-KISS Special Feature
  212.  
  213.  
  214.  
  215.     4-1    Multi-palette
  216.  
  217.         Standard computer system only support one color palette.
  218.  
  219.         KISS, by supporting several colors palette files, lessens
  220.  
  221.         picture elements dependencies. Thus, parts like clothes
  222.  
  223.         and accessories may exist individually as a separate file
  224.  
  225.         (cel file). These parts may be paired with a background
  226.  
  227.         to create a complete picture. Furthermore, because each
  228.  
  229.         piece of a picture may have independent color palette,
  230.  
  231.         they may be created by different developers.
  232.  
  233.  
  234.  
  235.         However, each cell must specify which color palette to use.
  236.  
  237.  
  238.  
  239.         The only limitation that exists now is that the total
  240.  
  241.         number of color must be less than or equal to 256 colors.
  242.  
  243.  
  244.  
  245. 5.    Configuration File
  246.  
  247.  
  248.  
  249.     Each line in a configuration file must be shorter than 256 bytes.
  250.  
  251.  
  252.  
  253.     Furthermore, cel and palette filenames must be composed of basename
  254.  
  255.     (max 8 bytes) + extension (max 3 bytes) with upper and lower cases
  256.  
  257.     characters treated identically (MS-DOS limitations).
  258.  
  259.     Characters that may be used in filenames are [_0-9a-z].
  260.  
  261.  
  262.  
  263.     The first character of each line specifies the content of the line.
  264.  
  265.  
  266.  
  267.       Character    Content
  268.  
  269.     *   '='    Data memory size in kilobytes
  270.  
  271.             Format:     =<memory size>K
  272.  
  273.  
  274.  
  275.             Specifies how much memory to allocate for KISS data.
  276.  
  277.             Is used in KISS v1.0 for compatibility but is ignored
  278.  
  279.             by KISS v2.0 or later.
  280.  
  281.             Usage is discouraged.
  282.  
  283.  
  284.  
  285.             Example:
  286.  
  287.             |
  288.  
  289.             |=260K
  290.  
  291.             |
  292.  
  293.  
  294.  
  295.     *   '('    Screen size
  296.  
  297.             Format: (<horizontal size>,<vertical size>)
  298.  
  299.  
  300.  
  301.             Defines screen size.
  302.  
  303.             When omitted, KISS v2.18 compatible size of
  304.  
  305.             (448,320) is assumes.
  306.  
  307.             Maximum screen size supported by KISS/GS2 is (640,400).
  308.  
  309.             (Refer to section-> 7 KISS/GS Ranks)
  310.  
  311.  
  312.  
  313.             Example:
  314.  
  315.             |
  316.  
  317.             |(640,400)
  318.  
  319.             |
  320.  
  321.  
  322.  
  323.     *   '%'    Palette filename
  324.  
  325.             Format: %<Palette filename>
  326.  
  327.  
  328.  
  329.             Defines palette files to open.
  330.  
  331.             Several palette files may be defines. When they
  332.  
  333.             are, they numbered 0,1,2... in order of usage. 
  334.  
  335.  
  336.  
  337.             All colors defined in the first palette file are
  338.  
  339.             used, but the first color (transparent) color in
  340.  
  341.             the remaining files are ignored and palette are
  342.  
  343.             shifted left one place.
  344.  
  345.             Additionally, the total number colors defined by all
  346.  
  347.             file palettes must be less than 256 colors.
  348.  
  349.     
  350.  
  351.             Furthermore, all color palette files must be defined
  352.  
  353.             prior to cel file definition.
  354.  
  355.  
  356.  
  357.             Example:
  358.  
  359.             |
  360.  
  361.             |%COL.KCF
  362.  
  363.             |%COL2.KCF
  364.  
  365.             |
  366.  
  367.  
  368.  
  369.     *   '['    Border color
  370.  
  371.             Format: [<Border color's pixel code>
  372.  
  373.  
  374.  
  375.             Defines the color of screen where color is
  376.  
  377.             not explicitly defined by the cel data.
  378.  
  379.             Pixel code is the color code defined in the
  380.  
  381.             cel file.
  382.  
  383.  
  384.  
  385.             Example:
  386.  
  387.             |
  388.  
  389.             |[12
  390.  
  391.             |
  392.  
  393.  
  394.  
  395.  
  396.  
  397.     *   '#'    Cel file
  398.  
  399.             Format: #<Mark>[.<Fix>] <Cel filename>
  400.  
  401.                 [*<Palette number>] [:<Set number>...]
  402.  
  403.  
  404.  
  405.             where
  406.  
  407.                <Mark> : Unique ID number to specify an object.
  408.  
  409.                     Cels with a same Mark are combined as
  410.  
  411.                     an object.
  412.  
  413.                     KISS/GS2 supports Marks between 0 to 255.
  414.  
  415.                     (refer to section -> 7 KISS/GS Ranks)
  416.  
  417.                <Fix> :  A number indicating object movement
  418.  
  419.                     fluidity. Usually used to fix an object
  420.  
  421.                     to a location. A number from 0 to 32767
  422.  
  423.                     may be specified with larger number
  424.  
  425.                     requiring more operations to move an 
  426.  
  427.                     object.
  428.  
  429.                     When omitted, an object is assigned a
  430.  
  431.                     value of 0 (ie. totally mobile).
  432.  
  433.                <Cel filename> :
  434.  
  435.                     Specifies the cel file name to assign
  436.  
  437.                     to the Mark.
  438.  
  439.                <Palette number> :
  440.  
  441.                     Specifies palette file corresponding to
  442.  
  443.                     the cel file when multiple palette files
  444.  
  445.                     are defined.
  446.  
  447.                     When omitted, palette file 0 is assigned.
  448.  
  449.                <Set number> :
  450.  
  451.                     Assign an object to a particular set.
  452.  
  453.                     There may be 10 sets which are numbered
  454.  
  455.                     from 0 to 9.
  456.  
  457.                     When omitted, an object will become available
  458.  
  459.                     in all sets.
  460.  
  461.         Cels are layered in order of definition with first definition being
  462.  
  463.         the top layered cel and last being the bottom layered cel.
  464.  
  465.         Up to 256 cels may be defined in KISS/GS2.
  466.  
  467.         (refer to section -> 7 KISS/GS Ranks)
  468.  
  469.  
  470.  
  471.  
  472.  
  473.         Example:
  474.  
  475.         |
  476.  
  477.         |#2    data1.cel            ; top (shown in front of other cells)
  478.  
  479.          |#3    data2.cel    :2 3 4        ; available only in sets 2,3,4
  480.  
  481.         |#4.255    data3.cel            ; fix object location
  482.  
  483.         |#5    data4.cel  *1   :5        ; use palette 1. only in set 5
  484.  
  485.         |#2    data1_.cel            ; bottom (shown behind other cels)
  486.  
  487.         |
  488.  
  489.  
  490.  
  491.         In the following example, data1.cel and data1_.cel are combined as an
  492.  
  493.         object.
  494.  
  495.  
  496.  
  497.  
  498.  
  499.     * '$' Set Information
  500.  
  501.             Format: $<Palette group> [<xpos,ypos> ...]
  502.  
  503.  
  504.  
  505.             Defines palette group and position of objects in each set.
  506.  
  507.             Up to 10 sets, numbered from 0 to 9, may be defined.
  508.  
  509.             Set Information section are usually automatically
  510.  
  511.             generated when [Save] is selected from KISS so there
  512.  
  513.             probably isn't any need to directly modify them.
  514.  
  515.  
  516.  
  517.             When definition extends through multiple lines, continued
  518.  
  519.             rows start with a space.
  520.  
  521.  
  522.  
  523.         <Palette group>    : Palette group number. 0 - 9.
  524.  
  525.         <xpos,ypos>    : Position of object (ordered in accordance
  526.  
  527.                               with Mark definition).
  528.  
  529.                   KISS/GS2 supports up to 256 positions definitions.
  530.  
  531.                   (see also section -> 7 KISS/GS Ranks)
  532.  
  533.                   Undefined objects are denoted by an asterisk (*).
  534.  
  535.  
  536.  
  537.         Example:
  538.  
  539.         |
  540.  
  541.         |$2 192,11 * 56,176 55,21 259,62 15,24 375,63
  542.  
  543.         |$3 43,115 154,62 372,108 253,156 * * * 165,207
  544.  
  545.         | * 162,198 * 119,56 152,44 * * *
  546.  
  547.         | 16,355 394,362 108,355 * * * 125,261
  548.  
  549.         |$0 192,11 * 56,176 55,21 259,62 15,24 375,63
  550.  
  551.         |
  552.  
  553.  
  554.  
  555.  
  556.  
  557.     * ';' Comment
  558.  
  559.             Format: ;<Comment>
  560.  
  561.  
  562.  
  563.             Igonores content of this line.
  564.  
  565.             Future KISS/GS versions may specify to enable some
  566.  
  567.             information such as title and author names in comments
  568.  
  569.             lines to be a read into a program.
  570.  
  571.  
  572.  
  573.     * Others
  574.  
  575.         Reserved for future extensions
  576.  
  577.  
  578.  
  579. 5.    Cel File Layout
  580.  
  581.  
  582.  
  583.     In new KISS/GS, cel files each contain a 32-byte header.
  584.  
  585.  
  586.  
  587.     offset    size    contents
  588.  
  589.     +0    4B    KiSS data Identifier ( 4Bh 69h 53h 53h )
  590.  
  591.     +4    B    cel file Mark ( 20h )
  592.  
  593.     +5    B    number of bits to represent a pixel (either 4 or 8 )
  594.  
  595.     +6    W    Reserved
  596.  
  597.     +8    W(L,H)    Width ( 1 ... XMAX )
  598.  
  599.     +10    W(L,H)    Height ( 1 ... YMAX )
  600.  
  601.     +12    W(L,H)    x-offset ( 0 ... XMAX-1 )
  602.  
  603.     +14    W(L,H)    y-offset ( 0 ... YMAX-1 )
  604.  
  605.     +16    16B    Reserved
  606.  
  607.  
  608.  
  609.         WARNING: All reserved fields must be filled with 0.
  610.  
  611.  
  612.  
  613.     Cels defined in the same object are aligned by their top left corners.
  614.  
  615.     When offsets are defined, a cel are moved to coordinate    (x,y) from this
  616.  
  617.     top left corner.
  618.  
  619.  
  620.  
  621.     +32...    Pixel data
  622.  
  623.  
  624.  
  625.  
  626.  
  627.     * Data Layout of 4 bits per pixel data (16 colors) 
  628.  
  629.       -when bit 5 in the header is 4
  630.  
  631.  
  632.  
  633.     One raster layout:
  634.  
  635.  
  636.  
  637.     |<-  byte   ->|  |<-  byte   ->|  |<-  byte   ->|
  638.  
  639.     MSB         LSB  MSB         LSB  MSB         LSB
  640.  
  641.  
  642.  
  643.     | pix0 | pix1 |  | pix2 | pix3 |  | pix4 | pix5 |  ......... |
  644.  
  645. pixN |
  646.  
  647.  
  648.  
  649.     When there are only odd number of pixels in a line, the end pixel is
  650.  
  651.     padded with a '0'.
  652.  
  653.  
  654.  
  655.     Pixel data consists of concatenation of these arrays defining each line
  656.  
  657.     in a cel.
  658.  
  659.  
  660.  
  661.     * Data Layout of 8 bits per pixel data (256 colors) 
  662.  
  663.       -when bit 5 in the header is 8
  664.  
  665.  
  666.  
  667.     One raster layout:
  668.  
  669.  
  670.  
  671.     |<-  byte   ->|  |<-  byte   ->|  |<-  byte   ->|
  672.  
  673.     MSB         LSB  MSB         LSB  MSB         LSB
  674.  
  675.  
  676.  
  677.     |     pix0    |  |     pix1    |  |     pix2    | ...  |
  678.  
  679. pixN    |
  680.  
  681.  
  682.  
  683.     Pixel data consists of concatenation of these arrays defining each line
  684.  
  685.     in a cel.
  686.  
  687.  
  688.  
  689.     An old KISS format may not have 'KiSS' in the first 4-byte identification
  690.  
  691.     field. In such a case, the file layout is as follows:
  692.  
  693.  
  694.  
  695.     offset    size    contents
  696.  
  697.     +0    W(L,H)    Width
  698.  
  699.     +2    W(L,H)    Height
  700.  
  701.  
  702.  
  703.     +4...    Pixel data
  704.  
  705.  
  706.  
  707.     Pixel data are in the 4 bits per pixel data (16 colors) format which
  708.  
  709.     is the same as those defined above. Furthermore, x and y offsets should
  710.  
  711.     both be treated as 0 (ie. no offset).
  712.  
  713.  
  714.  
  715. 6.    Palette File Layout
  716.  
  717.  
  718.  
  719.     Palette files have a 32-byte header.
  720.  
  721.  
  722.  
  723.     offset    size    contents
  724.  
  725.     +0    4B    KiSS data Identifier ( 4Bh 69h 53h 53h )
  726.  
  727.     +4    B    Palette file mark ( 10h )
  728.  
  729.     +5    B    number of bits per color ( 12 or 24 )
  730.  
  731.     +6    W    Reserved
  732.  
  733.     +8    W(L,H)    number of colors in one palette group ( 1 ... 256 )
  734.  
  735.     +10    W(L,H)    number of palette groups ( 1 ... 10 )
  736.  
  737.     +12    W    Reserved
  738.  
  739.     +14    W    Reserved
  740.  
  741.     +16    16B    Reserved
  742.  
  743.  
  744.  
  745.         WARNING: All reserved fields must be filled with 0.
  746.  
  747.  
  748.  
  749.     +32...    Palette data
  750.  
  751.  
  752.  
  753.  
  754.  
  755.     * Palette Data Layout (12 bits = 4096 colors)
  756.  
  757.        -when bit 5 in the header is 12
  758.  
  759.  
  760.  
  761.     Each color is defined by 4 bit primary colors - red, green, and blue - 
  762.  
  763.     in the following 2 byte layout:
  764.  
  765.  
  766.  
  767.     |<-  byte   ->|  |<-  byte   ->|
  768.  
  769.     MSB         LSB  MSB         LSB
  770.  
  771.  
  772.  
  773.     | rrrr | bbbb |  | 0000 | gggg | ....
  774.  
  775.  
  776.  
  777.     When there are less than 10 palette groups, group 0 data are replicated
  778.  
  779.     to fill to form 10 groups.
  780.  
  781.  
  782.  
  783.     * Palette Data Layout (24 bit = 16,777,216 colors)
  784.  
  785.        -when bit 5 in the header is 24
  786.  
  787.  
  788.  
  789.     Each color is defined by 1 byte primary colors - red, green, and blue - 
  790.  
  791.     in the following 3 byte layout:
  792.  
  793.  
  794.  
  795.     |<-  byte   ->|  |<-  byte   ->|  |<-  byte   ->|
  796.  
  797.     MSB         LSB  MSB         LSB  MSB         LSB
  798.  
  799.  
  800.  
  801.     |  rrrrrrrr   |  |  gggggggg   |  |  bbbbbbbb   | ...
  802.  
  803.  
  804.  
  805.     When there are less than 10 palette groups, group 0 data are replicated
  806.  
  807.     to fill to form 10 groups.
  808.  
  809.  
  810.  
  811.     An old KISS format may not have 'KiSS' in the first 4-byte identification
  812.  
  813.     field. In such a case, the file layout is as follows:
  814.  
  815.  
  816.  
  817.     +0...    palette data
  818.  
  819.  
  820.  
  821.     Palette data are in the 12 bits per each color with 16 colors in a palette
  822.  
  823.     groups with 10 groups. Refer to Palette Data Layout above for palette data
  824.  
  825.     layout.
  826.  
  827.  
  828.  
  829.     NOTE: KISS data identification purposely consists of lower case 'i' to
  830.  
  831.          reduce possibility of conflicting with other file formats.
  832.  
  833.  
  834.  
  835. 7.    KISS/GS Levels
  836.  
  837.  
  838.  
  839.     Rank        size      colors max cels      Status
  840.  
  841.     --------------- ---------- ---- ----------
  842.  
  843.       KISS/GS1    640 x 400   16     128        ;      KISS v2.24c
  844.  
  845.       KISS/GS2    640 x 400   256    256        ;      KISS v2.37
  846.  
  847.       KISS/GS3    768 x 480   256    256        ; draft
  848.  
  849.       KISS/GS4    768 x 480   256    512        ; draft
  850.  
  851.     --------------- ---------- ---- ----------
  852.  
  853.     Degree of data portability was increased with generalization of
  854.  
  855.     specification. Nevertheless, differences in hardwares still limits
  856.  
  857.     some computers from running KISS programs and displaying KISS data.
  858.  
  859.     Above ranks are specified as a guideline to allow developers to
  860.  
  861.     write programs and for users to display data on their platforms.
  862.  
  863.     We encourage programmers to implement the highest KISS rank capable
  864.  
  865.     on their system and for users to use highest ranks program to view
  866.  
  867.     them while keeping in mind that the lower ranks have more users
  868.  
  869.     base.
  870.  
  871.  
  872.  
  873. *    Miscellaneous
  874.  
  875.  
  876.  
  877.     This document is in public domain.
  878.  
  879.     Please send bug reports, questions, comments and problems to
  880.  
  881.  
  882.  
  883.         UHD98984@pcvan.or.jp
  884.  
  885.                 yav
  886.  
  887.  
  888.  
  889.     Thank you.
  890.  
  891.  
  892.  
  893.