home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4649 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  7.1 KB

  1. From: magicsn@birdland.es.bawue.de (Steffen Haeuser)
  2. Path: eisbaer.bb.bawue.de!birdland.es.bawue.de
  3. Newsgroups: comp.sys.amiga.programmer
  4. Message-ID: <72000405732631910000@BIRDLAND>
  5. X-Mailer: fastnet2rfc V2.0 - (tse) Lunqual%MAB@wsb.freinet.de / Tachy@wsb.freinet.de
  6. Organization: Birdland BBS, Dettingen/Teck, South Germany, +49-7021-862428
  7. Content-Type: text/plain; charset=ISO-8859-1
  8. Subject: rtgmaster c2p rework [2/2]
  9. Date: 01 Mar 1996 23:46:31
  10.  
  11. 2. As soon as an application opens a RtgScreen, the c2p algorithm is loaded to memory,
  12.    using LoadSeg() of dos.library, and the default c2p is stored in the RtgScreen
  13.    structure. After that, a possibly existing initilaization function of the c2p will
  14.    be called and the data it returns will be saved in the RtgScreen structure. Some
  15.    error checks will be done (see below)
  16. 3. As you call CallRtgC2P, the c2p will be performed, with some error checks (see below).
  17.    If it returns 0, everything worked, else an error happened. Some of the error checks
  18.    will be done in CallRtgC2P, some will have to be done in your c2p code (see below).
  19. 4. The application waits with exec.library Wait() for the c2p to be finished, even if
  20.    it is synchrone c2p. The application should not leave out this Wait().
  21. 5. If CloseRtgScreen is called, the Expunge function will be called (if it exists),
  22.    and after that, UnloadSeg() of dos.library will be called.
  23.  
  24. Certainly, Rtgmaster c2p is usable without having to use rtgmaster.library, too,
  25. but this is recommended. Both rtgmaster.library and the rtgmaster c2p format
  26. are freeware. Up to what c2p functions are, copyright is up to those who wrote
  27. the functions. But most of them should probably be freeware, too.
  28.  
  29. ----------------------------------------------------------------------------------------------
  30.  
  31. 6. Error Handling
  32. =================
  33.  
  34. The Rtgmaster c2p format knows the following error messages. They will be
  35. returned by CallRtgC2P.
  36.  
  37. I.    c2p_err_Wrong_C2P
  38. II.   c2p_err_Wrong_Depth
  39. III.  c2p_warn_Wrong_Pixelmode
  40. IV.   c2p_err_Wrong_Windowsize
  41. V.    c2p_warn_divisible
  42. VI.   c2p_err_hardware
  43. VII.  c2p_err_memory
  44. VIII. c2p_err_internal
  45. IX.   c2p_warn_internal
  46.  
  47.  
  48.  
  49.  
  50.  
  51. I.        will come up, if you, for example, try to do an interleaved-only c2p
  52.           with a interleaved Bitmap. This will be checked by CallRtgC2P itself.
  53.  
  54. II.       will come up, if the Display has a depth, that is not supported
  55.           by the c2p code. This will be checked by CallRtgC2P itself.
  56.  
  57. III.      will come up, if you tried to use a Pixelmode, that is not available
  58.           for this c2p. It is only a warn, and your c2p code should use a mode, that
  59.           finds to be a appropriate replacement. It will still do c2p, but it
  60.           should return this warning. The c2p code should check for this, as it
  61.           knows its possibilities and features best.
  62.  
  63. IV.       will come up, if you tried to do a "smaller than Fullscreen" c2p with
  64.           a c2p that only can do Fullscreen c2p. This will be checked by CallRtgC2P
  65.           itself. This will be done first, so a
  66.  
  67.           1. Try to do "smaller than Fullscreen"
  68.           2. Did not work => Recalculate and do Fullscreen c2p
  69.  
  70.           should be optimal.
  71.  
  72. V.        will come up, if you tried to use illegal widths/heights for this c2p.
  73.           You might configure the Rtgmaster Screenmode Requester c2p choosing
  74.           utility to filter out such modes, though, so this warn will only appear,
  75.           if you do not filter out. It will then try to do the c2p, anyways and
  76.           wish you good luck :)
  77.  
  78. VI.       will be given from CallRtgC2P, if you tried to do a c2p that is not
  79.           compatible with the given Display hardware. Processor hardware won't
  80.           be checked, but this might be implemented in the Rtgmaster Screenmode
  81.           Requester c2p choosing utility later.
  82.  
  83. VII.      is the error that you should return, if your initialization/expunge code
  84.           fails, due to the system being low on memory.
  85.  
  86. VIII./IX. is the error you should return, if something happens that is nothing
  87.           of the other stuff. It exists as warn and as error.
  88.  
  89. ---------------------------------------------------------------------------------------------
  90.  
  91. 7. Includes
  92. ===========
  93.  
  94. You probably should get :
  95.  
  96. - Standard AmigaDOS Includes for OS2.0 or higher
  97. - rtgmaster.library includes (available from me, MagicSN@birdland.es.bawue.de)
  98.  
  99. I am listing the RtgScreenAMI structure out of rtgAMI.i here for better understanding
  100. (note : in the docs of rtgmaster.library it is stated, that this structure would be
  101. private to rtgmaster.library. It is private to rtgmaster.library *and* rtgmaster c2p
  102. now...)
  103.  
  104. STRUCTURE RtgScreenAMI,0
  105.   STRUCT rsAMI_Header,rs_SIZEOF
  106.   UWORD rsAMI_Locks
  107.   ALIGNLONG
  108.   ULONG rsAMI_ScreenHandle
  109.   ULONG rsAMI_PlaneSize
  110.   ULONG rsAMI_DispBuf      ;Buffer currently displayed
  111.   ULONG rsAMI_ChipMem1
  112.   ULONG rsAMI_ChipMem2
  113.   ULONG rsAMI_ChipMem3
  114.   STRUCT rsAMI_Bitmap1,40
  115.   STRUCT rsAMI_Bitmap2,40
  116.   STRUCT rsAMI_Bitmap3,40
  117.   LABEL rsAMI_SIZEOF
  118.  
  119. Now i am listing include:rtgmaster/rtgc2p.i :
  120.  
  121. STRUCTURE c2p_Info,0
  122.      WORD    CI_ColorDepth           ;CI_256, CI_128, CI_64, CI_EHB, CI_32..
  123.      WORD    CI_CPU                  ;CI_68060, CI_68040, CI_68030....
  124.      WORD    CI_Needs                ;CI_Aikiko, CI_MMU, CI_FPU...
  125.      UBYTE   CI_PixelSize            ;CI_1x1, CI_1x2, CI_2x1, CI_2x2...
  126.      BOOL    CI_Dirty                ;TRUE/FALSE
  127.      BOOL    CI_Hack                 ;TRUE/FALSE
  128.      BOOL    CI_Asynchrone           ;TRUE/FALSE
  129.      WORD    CI_WidthAlign           ;Width has to be divisible by <number>
  130.      WORD    CI_HeightAlign          ;Height has to be divisible by <number>
  131.      WORD    CI_Misc                 ;Different stuff...
  132.      ULONG   CI_AmiCompatible        ;Is this compatible to RtgScreenAMI ?
  133.      APTR    CI_Description          ;Pointer to a string
  134.      APTR    CI_Initialization       ;Pointer to Initialization code
  135.      APTR    CI_Expunge              ;Pointer to Expunge code
  136.      APTR    CI_Normal_c2p           ;Pointer to c2p code
  137.      APTR    CI_Normal_c2p_InterL    ;Pointer to Interleaved c2p
  138.      APTR    CI_Scrambled_c2p        ;Pointer to Scrambled c2p
  139.      APTR    CI_Scrambled_c2p_InterL ;Pointer to Scrambled Interleaved c2p
  140.      LABEL   CI_SIZEOF
  141.  
  142.  
  143. ; CI_ColorDepth
  144.  
  145. CI_256 EQU 256
  146. CI_128 EQU 128
  147. CI_64  EQU 64
  148. CI_EHB EQU 32
  149. CI_32  EQU 16
  150. CI_16  EQU 8
  151. CI_8   EQU 4
  152. CI_4   EQU 2
  153. CI_2   EQU 1
  154.  
  155. ; CI_CPU
  156.  
  157. CI_68060 EQU 1
  158. CI_68040 EQU 2
  159. CI_68030 EQU 4
  160. CI_68020 EQU 8
  161. CI_68060D EQU 16
  162. CI_68040D EQU 32
  163. CI_68030D EQU 64
  164. CI_68020D EQU 128
  165.  
  166. ; CI_Needs
  167.  
  168. CI_68060N EQU 1
  169. CI_68040N EQU 2
  170. CI_68030N EQU 4
  171. CI_Aikiko EQU 8
  172. CI_MMU    EQU 16
  173. CI_FPU    EQU 32
  174.  
  175. ; CI_Misc
  176.  
  177. CI_Smaller EQU 1
  178.  
  179. ----------------------------------------------------------------------------------------------
  180.  
  181. 8. A word from the Authors
  182. ==========================
  183.  
  184. This rtgmaster c2p format was mainly done by me, Steffen Haeuser,
  185. with the help of Ludvig Pedersen and Peter McGavin. rtgmaster.library
  186. was/is done by me, John Hendrikx, Wolfram Schenk and Hans-Joerg Frieden.
  187. CallRtgC2P is supported by rtgmaster sublibraries starting with version
  188. number 2.0. Up to now no c2p functions are finished, so send me some :)
  189.  
  190.  
  191.  
  192.