home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / JAGDEV_1.LZH / DEVELOP.JAG / VECTRONI.X! / JAGPEG / DEJAG / DEJAG.TXT < prev    next >
Text File  |  1994-02-19  |  8KB  |  194 lines

  1. ---------
  2. DEJAG 1.6
  3. ---------
  4.  
  5. Copyright 1993 Atari Corp. All Rights Reserved.
  6. Author: Mike Pooler, Atari Corp.
  7. Update: Mike Fulton, Atari Corp.
  8. Release Date: 2/18/94
  9.  
  10. CONFIDENTIAL.
  11.  
  12. --------------------------------------------------------------------------
  13.  
  14. DEJAG uncompresses a JagPeg graphic file. It a routine that runs in the 
  15. Jaguar's GPU.  There are two versions of the DEJAG program, DEJAG16.BIN and 
  16. DEJAG24.BIN.  They work the same way except:
  17.  
  18. DEJAG16.BIN:  Produces 16 bit-per-pixel output
  19.  
  20. DEJAG24.BIN:  Produces 24 bit-per-pixel output (32-bit format GxRB).
  21.  
  22. Use the one that corresponds to the video mode you are working in.
  23.  
  24. Note that the input to JagPeg (the .JAG file) itself is THE SAME whether it is 
  25. being uncompressed and/or viewed at 16 or 24 bits.
  26.  
  27. --------------------------------------------------------------------------
  28.  
  29. To use DEJAG: (These steps are described in detail below.)
  30.  
  31. 1. Put DEJAG16.BIN or DEJAG24.BIN (the GPU program) into GPU RAM
  32.  
  33. 2. Have the DEHUFF.DAT table in memory
  34.  
  35. 3. Have a DQ??.DAT table in GPU ram at DQ_Adr
  36.  
  37. 4. Have the JagPeg picture data in memory
  38.  
  39. 5. Pass the appropriate parameters to DEJAG via the variables in GPU RAM
  40.    described below and in DEJAG.INC
  41.  
  42. 6. Set the GPU instruction pointer to the top of GPU RAM, start the GPU
  43.  
  44. 7. Optionally wait for the GPU to finish (Obviously an important step if
  45.    you're going to use it for something else after showing the picture).
  46.  
  47. Note: The order of steps 1 to 5 is not important, but they all must
  48. preceed step 6.
  49.  
  50. There is a sample program included that demonstrates how to decompress and 
  51. display a picture file using the DEJAG routines.  It essentially illustrates 
  52. the steps detailed below:
  53.  
  54. --------------------------------------------------------------------------
  55. Details:
  56. --------------------------------------------------------------------------
  57.  
  58. 1. Load DEJAG16.BIN or DEJAG24.BIN (the GPU program) into GPU RAM. You should 
  59. know how to do this.  You can also examine the sample program source code.
  60.  
  61. --------------------------------------------------------------------------
  62.  
  63. 2. Prepare the DEHUFF.DAT file, have its contents in memory
  64.  
  65. Preparing DEHUFF.DAT with LOCATE.TTP
  66. ------------------------------------
  67.  
  68. DEHUFF.DAT is a data table that DEJAG uses during decompression. The table must 
  69. be somewhere in memory (it won't fit in GPU RAM).  You cannot use the 
  70. DEHUFF.DAT as it is provided to you. You must first alter it with the LOCATE 
  71. program (LOCATE.EXE for the PC, or LOCATE.TTP for the Atari).
  72.  
  73. DEHUFF.DAT has absolute pointers to itself. Therefore, it has to be altered to 
  74. work at any specific memory location.  You must decide in advance where 
  75. DEHUFF.DAT will reside, and then run LOCATE with that address.  For example:
  76.  
  77. LOCATE 50000
  78.  
  79. This will alter DEHUFF.DAT so that it works when loaded starting at memory 
  80. location $00050000. Note that (DEHUFF.DAT should be in the same directory as 
  81. LOCATE when you run it).
  82.  
  83. You can run LOCATE again at any time if you need to change the address again.  
  84. Note that the address parameter is taken to be in HEX, even if you don't 
  85. preceed it with 0x (which works) or $ (which doesn't work anyway).
  86.  
  87. DEJAG also needs to know where to find DEHUFF.DAT. You pass the address as a 
  88. parameter, described in step 5.
  89.  
  90. --------------------------------------------------------------------------
  91.  
  92. 3. Have a DQ??.DAT table in GPU RAM at DQ_Adr.
  93.  
  94. Each picture is compressed at a certain "quality" setting (as decribed in 
  95. TGAJAG.DOC). For every quality setting, there is a corresponding DQ??.DAT file, 
  96. where "??" is a number cooresponding to this setting. For example, when you 
  97. create a JagPeg file with quality 75 (the default) DQ75.DAT is created along 
  98. with the *.JAG file.
  99.  
  100. When you decompress the image, DEJAG needs the corresponding DQ??.DAT file. To 
  101. decompress any JagPeg that was compressed with quality 75, use DQ75.DAT.  For 
  102. JagPegs created with quality 60, use DQ60.DAT.  And so on.
  103.  
  104. The DQ??.DAT file must be loaded at address the DQ_Adr, which is a constant 
  105. defined in DEJAG.INC (it is a memory location within GPU RAM).
  106.  
  107. Note that if you are decompressing a number of pictures that were all 
  108. compressed at the same quality, you only need to load the DQ??.DAT into GPU RAM 
  109. once.  If each picture has a different quality setting, you have to load a 
  110. different DQ??.DAT before decompressing each picture.
  111.  
  112. If you make a mistake, the resulting picture will be either too bright or too 
  113. dark. (For example, if DQ60.DAT is at DQ_Adr when you decompress a picture 
  114. compressed at quality 75).
  115.  
  116. --------------------------------------------------------------------------
  117.  
  118. 4. Have the JagPeg data in memory
  119.  
  120. TGAJAG produces the JagPeg file (with a .JAG extension). The contents of the 
  121. JagPeg file must be in memory.
  122.  
  123. --------------------------------------------------------------------------
  124.  
  125. 5. Pass parameters to the DEJAG routine via GPU RAM
  126.  
  127. Parameters to DEJAG
  128. -------------------
  129.  
  130. Include DEJAG.INC to load these equates:
  131.  
  132. In_Adr       EQU ????      ; Pointer to start of the JagPeg (input)
  133. Out_Adr      EQU ????      ; Pointer to start of output area
  134. Dehuff_Adr   EQU ????      ; Pointer to start of DEHUFF.DAT
  135.                            ; (Be sure you have used LOCATE on DEHUFF.DAT)
  136. Out_Width    EQU ????      ; Width of the output space in blocks
  137.                            ; (A block is 8 pixels)
  138. Out_E_Width  EQU ????      ; Encloded pixel output width as defined in
  139.                            ; BLIT.INC (#WID320 for example)
  140.  
  141. ; Then set the DEJAG parameters as in this example:
  142. ;
  143.    move.l   #$70000,In_Adr         ; JagPeg data starts at $70000
  144.    move.l   #$20000,Out_Adr        ; Write output starting at $20000
  145.    move.l   #$60000,Dehuff_Adr     ; DEHUFF.DAT starts at $60000
  146.    move.l   #40,Out_Width          ; Output screen is 40 blocks wide
  147.    move.l   #WID320,Out_E_Width    ; Output screen is 320 pixels wide
  148.  
  149. Note: A block is 8 pixels wide.
  150.  
  151. DEJAG will create output within a memory map that is considered to be Out_Width 
  152. blocks wide. This example is for a picture being uncompressed to the screen, 
  153. which is 320 pixels wide.  The width and height of the output itself is the 
  154. size of the picture.
  155.  
  156. --------------------------------------------------------------------------
  157.  
  158. 6. Set the GPU instruction pointer to the top of GPU ram, start the GPU
  159.  
  160. --------------------------------------------------------------------------
  161.  
  162. 7. If you need to wait for the GPU to finish its decompression, you can watch 
  163. the memory address All_Done, a variable located in GPU RAM. DEJAG moves 
  164. $12345678 into it when it's finished.
  165.  
  166. --------------------------------------------------------------------------
  167.  
  168. To run DEJAG a second (and subsequent) times, 
  169.  
  170. A. Wait until it's finished with the current picture (step 7)
  171. B. Set In_Adr and Out_Adr again (as in step 5)
  172. C. Repeat step 3 if a new DQ??.DAT is needed
  173. D. Restart the GPU (step 7)
  174. E. All_Done gets loaded with 1 when DEJAG starts- look for the 1 first
  175.    before you start looking for $12345678 (or clear All_Done yourself)
  176.  
  177.  
  178.  
  179. --------------------------------------------------------------------------
  180. --------------------------------------------------------------------------
  181. --------------------------------------------------------------------------
  182.  
  183. Version 1.6 Release Notes
  184. -------------------------
  185. In earlier versions, the DEHUFF.DAT file was named DEHUFF.ABS and the DQ??.DAT 
  186. files were named DQ??.ABS.  This has been changed so these files use an 
  187. extension of .DAT, in order to avoid confusion with the .ABS files created by 
  188. the ALN linker.  Only the filenames have been changed, they are otherwise the 
  189. same.
  190.  
  191. The earlier release of the PC verison of LOCATE utilty did not function 
  192. correctly.  This has been fixed.
  193.  
  194.