home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_03 / JAG_DOX.ZIP / jag_col.txt < prev    next >
Text File  |  1996-01-28  |  6KB  |  173 lines

  1. # -------------------------------------------------------------------
  2. # VIDEO AND COLOR                        (c) Copyright 1995 KKP & Nat!
  3. # -------------------------------------------------------------------
  4. # These are some of the results/guesses that Klaus and I Nat! found
  5. # out about the Jaguar with a few helpful hints by other people, 
  6. # who'd prefer to remain anonymous.
  7. #
  8. # Since we are not under NDA or anything from
  9. # Atari we feel free to give this to you for educational purposes
  10. # only.
  11. #
  12. # Please note, that this is not official documentation from Atari
  13. # or derived work thereof (both of us have never seen the Atari docs)
  14. # and Atari isn't connected with this in any way.
  15. #
  16. # Please use this informationphile as a starting point for your own
  17. # exploration and not as a reference. If you find anything innacurate,
  18. # missing, needing more explanation etc. by all means please write
  19. # to us:
  20. #      nat@zumdick.rhein-main.de
  21. # or
  22. #      kkp@gamma.dou.dk
  23. #
  24. # If you could do us a small favor, don't use this information for
  25. # those lame flamewars on r.g.v.a or the mailing list.
  26. #
  27. # HTML soon ?
  28. # -------------------------------------------------------------------
  29. # $Id: jag_col.txt,v 1.7 1996/01/28 20:51:32 nat Exp $                 
  30. # -------------------------------------------------------------------
  31. # Note: This is definetely the weakest doc so far. High bull content!
  32. # --------------------------------------------------------------------
  33. 1 Quest For Color
  34.  
  35.  
  36. The Jaguar has a great number of color modes that all can be mixed on
  37. screen at any time thanks for the Object processor.
  38. There are 3 major color modes called CRY (chroma-intensity), TC (TrueColor)
  39. and Palette.
  40.  
  41.  
  42. 1.1 Palette Color Image (1,2,4,8 bits/pixel)
  43.  
  44. [ Nat! I think the following is only valid for TrueColor Videomode.
  45.        If the videmode is 16bit RGB or CrY, then the pallete entries
  46.        are also Cry/RGB 16 bit words (and indexed that way)
  47. ]
  48.  
  49. Objects using Palette colors can have 1, 2, 4 or 8 bits per pixel.
  50. There are 256 entrys in the Clut (0xF00400). Each color in the Clut is
  51. defined by the 4 byte structure:
  52.  
  53.          +-------+-------+-------+-------+
  54.          | Green |  Red  |  nc   | Blue  |
  55.          +-------+-------+-------+-------+
  56.  
  57. The actual color displayed on the screen depends on a lot of things, f.e. 
  58. the O_INDEX value in the Object Processor.
  59.  
  60. In 8 bits/Pixel the pixel value is used directly as a index into the Clut.
  61.  
  62. In 1, 2 and 4 bits/pixel modes the Clut-Index for the displayed color is
  63. calculated as Clut-Index = 2*O_INDEX + Pixel-Value.
  64.  
  65.  
  66. 1.2 CrY Color Image (16 bit/pixel)
  67.  
  68.  
  69. Objects using CrY colors always uses 16 bits per pixel. Each pixel is
  70. defined by this 2 byte structure:
  71.  
  72.          +-------^-------+-------^-------+
  73.          |    Chroma     |       Y       |
  74.          +---------------+---------------+
  75.  
  76. The Chroma and Y channel are 8 bits each. Y has nothing to do with
  77. Yellow, but is the Luminence of the color choosen by Chroma! 
  78. The Color on the screen are calculated by the formular:
  79.  
  80.                 color-Trans[ Cr ]
  81.      color   =  ----------------- * Y,  Color = {Red, Green, Blue}
  82.                        255
  83.  
  84.  
  85.  
  86. 1.3.1 True Color Image (16 bits/pixel)
  87.  
  88.  
  89. The other 16 bit/pixel mode uses a normal packed RGB format like
  90. on the Falcon and some VGA cards to get 5 bit worth of Red and Blue
  91. and 6 bits worth of Green information. The format used is 
  92.  
  93.          +-------^-+-----^---+---^-------+
  94.          |   Red   |  Blue   |   Green   |
  95.          +---------+---------+-----------+
  96.          15......11 10......6 5..........0
  97.  
  98. To convert use something along the lines of:
  99.  
  100. ; Input:
  101. ;    d5.5        : red
  102. ;    d6.6        : green
  103. ;    d7.5        : blue
  104. ; Output
  105. ;  d0.16    : packed TrueColor pixel
  106. shiftcolor:
  107.     move.w    d5,d0    ; d0 = red, now have [0]-[0]-[0]-[red]
  108.     asl    #5,d0    ; shift red up, now have [0]-[0]-[red]-[0]
  109.     or.w    d7,d0    ; add in blue, now have [0]-[0]-[red]-[blue]
  110.     asl    #6,d0    ; shift red & blue up, now have [0]-[red]-[blue]-[0]
  111.     or.w    d6,d0    ; add in green, now have [0]-[red]-[blue]-[green]
  112.     rts
  113.  
  114.  
  115. 1.3.2 True Color Image (24/32 bits/pixel)
  116.  
  117.  
  118. Objects using the TrueColor model always uses 4 bytes per pixel???? Each
  119. pixel is defined by the structure:
  120.  
  121.          +-------+-------+-------+-------+
  122.          | Green |  Red  |  nc   | Blue  |
  123.          +-------+-------+-------+-------+
  124.  
  125. 1.5 Default Colors
  126.  
  127.     move.w    #$0000,BG           ;default background color (16 bit RGB or CRY color)
  128.     move.l    #$00000000,BORD1    ;default border color (green,red,unused,blue)
  129.  
  130.  
  131. 1.4 Video Modes
  132.  
  133. The VMODE register can switch between some modes of operation in
  134. the Graphics chip.
  135.  
  136. It is possible to switch between 24 bit RGB values and 16 bit CrY
  137. in the Clut.
  138.  
  139. It is possible to switch between 16 bit RGB mode and 16 bit CrY mode.
  140. If VMODE is set to CrY mode, then a 16 bit/pixel object is 
  141. interpreted as a CrY Object otherwise as a 16 bit/pixel RGB Object.
  142.  
  143. bit 0    VIDEN   enable time base generator
  144. 1,2      mode    line-buffer mode
  145.           0      16-bit CRY
  146.           1      24-bit rgb
  147.           2      16-bit direct "each 32 bit entry is put in two-16bit words
  148.                                 which are output to red and green on alt 
  149.                                 phases of video clock...  
  150.                                 it is assumed further processing will occur
  151.                                 outside the chip..." (spooky possums!)
  152.           3      16-bit RGB
  153.  
  154. bit 3    Genlock
  155.  
  156. bit 4    Incen   (more genlock stuff..)
  157. bit 5    BINC    (more genlock)
  158. bit 6    CSYNC   composite sync(genlock?)
  159. bit 7    BGEN    clears the line buffer to the colour in the background reg
  160.                  (only has effect in CRP and RGB16..)
  161.                  
  162. bit 8    VarMOd  LSB of colour in line buffer set   = CRY
  163.                  LSB of colour in line buffer clear = RGB16..
  164.  9..11  Pwidth   "pixelwidth in video clock cycles"-1
  165.                  "the display width should be set to an integer multiple
  166.                   of the pixel width here"
  167.  
  168.  
  169. Use:  6C1   for 320x200 overscan 16bit Crymode
  170.       2C1   for 640x200 overscan 16bit Crymode
  171.  
  172.  
  173.