home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_03 / JAGDOX.ZIP / COLOR.TXT next >
Text File  |  1995-12-10  |  5KB  |  146 lines

  1. # -------------------------------------------------------------------
  2. # COLOR SCHEMES                     (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. Since we are not under NDA or anything from
  6. # Atari we feel free to give this to you for educational purposes
  7. # only.
  8. #
  9. # Please note, that this is not official documentation from Atari
  10. # or derived work thereof (both of us have never seen the Atari docs)
  11. # and Atari isn't connected with this in any way.
  12. #
  13. # Please use this informationphile as a starting point for your own
  14. # exploration and not as a reference. If you find anything innacurate,
  15. # missing, needing more explanation etc. by all means please write
  16. # to us:
  17. #     nat@zumdick.rhein-main.de
  18. # or
  19. #     kkp@gamma.dou.dk
  20. #
  21. # If you could do us a small favor, don't use this information for
  22. # those lame flamewars on r.g.v.a or the mailing list.
  23. #
  24. # HTML soon ?
  25. # -------------------------------------------------------------------
  26. # $Id: jag_col.txt,v 1.2 1995/12/08 18:48:09 nat Exp $
  27. # -------------------------------------------------------------------
  28. # Note: This is definetely the weakest doc so far. High bull content!
  29. # --------------------------------------------------------------------
  30. 1 Quest For Color
  31.  
  32.  
  33. The Jaguar has a great number of color modes that all can be mixed on
  34. screen at any time thanks for the Object processor.
  35. There are 3 major color modes called CRY (chroma-intensity), TC (TrueColor)
  36. and Palette.
  37.  
  38.  
  39. 1.1 Palette Color Image (1,2,4,8 bits/pixel)
  40.  
  41. [ Nat! I think the following is only valid for TrueColor Videomode.
  42.        If the videmode is 16bit RGB or CrY, then the pallete entries
  43.        are also Cry/RGB 16 bit words (and indexed that way)
  44. ]
  45.  
  46. Objects using Palette colors can have 1, 2, 4 or 8 bits per pixel.
  47. There are 256 entrys in the Clut (0xF00400). Each color in the Clut is
  48. defined by the 4 byte structure:
  49.  
  50.          +-------+-------+-------+-------+
  51.          | Green |  Red  |  nc   | Blue  |
  52.          +-------+-------+-------+-------+
  53.  
  54. The actuel color displayed on the screen depends on a lot of things, fx the
  55. O_INDEX value in the Object Processor.
  56.  
  57. In 8 bits/Pixel the pixel value is used directly as a index into the Clut.
  58.  
  59. In 1, 2 and 4 bits/pixel modes the Clut-Index for the displayed color is
  60. calculated as Clut-Index = 2*O_INDEX + Pixel-Value.
  61.  
  62.  
  63. 1.2 CrY Color Image (16 bit/pixel)
  64.  
  65.  
  66. Objects using CrY colors always uses 16 bits per pixel. Each pixel is
  67. defined by this 2 byte structure:
  68.  
  69.          +-------+-------+-------+-------+
  70.          |    Chroma     |       Y       |
  71.          +-------+-------+-------+-------+
  72.  
  73. The Chroma and Y channel are 8 bits each. Y has nothing to do with
  74. Yellow, but is the Luminence of the color choosen by Chroma!
  75. The Color on the screen are calculated by the formular:
  76.  
  77.                 color-Trans[ Cr ]
  78.      color   =  ----------------- * Y,  Color = {Red, Green, Blue}
  79.                        255
  80.  
  81.  
  82.  
  83. 1.3.1 True Color Image (16 bits/pixel)
  84.  
  85.  
  86. The other 16 bit/pixel mode uses a normal packed RGB format like
  87. on the Falcon and some VGA cards to get 5 bit worth of Red and Blue
  88. and 6 bits worth of Green information. The format used is
  89.  
  90.          +-------+-------+-------+-------+
  91.          |   Red   |  Blue   |   Green   |
  92.          +-------+-------+-------+-------+
  93.          15......11 10......6 5..........0
  94.  
  95. To convert use something along the lines of:
  96.  
  97. ; Input:
  98. ;   d5.5        : red
  99. ;   d6.6        : green
  100. ;   d7.5        : blue
  101. ; Output
  102. ;  d0.16    : packed TrueColor pixel
  103. shiftcolor:
  104.     move.w  d5,d0   ; d0 = red, now have [0]-[0]-[0]-[red]
  105.     asl #5,d0   ; shift red up, now have [0]-[0]-[red]-[0]
  106.     or.w    d7,d0   ; add in blue, now have [0]-[0]-[red]-[blue]
  107.     asl #6,d0   ; shift red & blue up, now have [0]-[red]-[blue]-[0]
  108.     or.w    d6,d0   ; add in green, now have [0]-[red]-[blue]-[green]
  109.     rts
  110.  
  111.  
  112. 1.3.2 True Color Image (24/32 bits/pixel)
  113.  
  114.  
  115. Objects using the TrueColor model always uses 4 bytes per pixel???? Each
  116. pixel is defined by the structure:
  117.  
  118.          +-------+-------+-------+-------+
  119.          | Green |  Red  |  nc   | Blue  |
  120.          +-------+-------+-------+-------+
  121.  
  122. 1.5 Default Colors
  123.  
  124.     move.w  #$0000,BG           ;default background color (16 bit RGB or CRY
  125. color)
  126.     move.l  #$00000000,BORD1    ;default border color (green,red,unused,blue)
  127.  
  128.  
  129. 1.4 Video Modes
  130.  
  131. The VMODE register can switch between some modes of operation in
  132. the Graphics chip.
  133.  
  134. It is possible to switch between 24 bit RGB values and 16 bit CrY
  135. in the Clut.
  136.  
  137. It is possible to switch between 16 bit RGB mode and 16 bit CrY mode.
  138. If VMODE is set to CrY mode, then a 16 bit/pixel object is
  139. interpreted as a CrY Object otherwise as a 16 bit/pixel RGB Object.
  140.  
  141.  
  142.  
  143.  
  144. --- uugate 0.40 (SunOS 4.1.3)
  145.  * Origin: Internet gateway [cindy] (2:200/427.1)
  146.