home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / TCS / demos / cod / TriBuf&BltFRP.s < prev    next >
Encoding:
Text File  |  2000-09-26  |  3.4 KB  |  120 lines

  1. *******************************************************************************
  2. * Blitter-assisted FullRes conversion and triple buffering example
  3. *******************************************************************************
  4. * INFO    shows how to work with a Blitter-assisted FullRes triple
  5. *    buffered display
  6. * NOTE    - experiment with the display definition parameters
  7. *    - LMB to exit anytime
  8. *******************************************************************************
  9.  
  10.     machine    68020
  11.  
  12.     include    INCLUDES:libraries/tcs.i
  13.     include    INCLUDES:libraries/tcs_lib.i
  14.     include    /inc/macros.i
  15.  
  16.  
  17.  
  18. *******************************************************************************
  19. * custom display definitions
  20. *******************************************************************************
  21.  
  22. DSPLWD    =    320    ;our TCS display width and
  23. DSPLHT    =    256    ;height (LORES pixels)
  24. SCRWD    =    320    ;TCS screen width and
  25. SCRHT    =    256    ;height (FullRes pixels)
  26. DSPLX0    =    $81*4    ;display start
  27. DSPLY0    =    $2c    ;position (SHRES pixels)
  28. DSPLX1    =    DSPLX0+DSPLWD*4    ;display end
  29. DSPLY1    =    DSPLY0+DSPLHT    ;position (SHRES pixels)
  30. DSPLBRTNS    =    256    ;max brightness
  31. GFXCTXT    =    0    ;graphic context
  32. CWBTM    =    0    ;clipping
  33. CWTOP    =    0    ;window
  34. CWRT    =    0    ;borders
  35. CWLF    =    0    ;coordinates
  36. VDOMODE    set    TCS_VM_RGBW | TCS_VMf_FullRes ;display video mode
  37. VDOMODE    set    VDOMODE | TCS_VMf_TriBuf | TCS_VMf_BltFRP
  38.  
  39.  
  40.  
  41. *******************************************************************************
  42. * code start
  43. *******************************************************************************
  44.  
  45.     include    /inc/shl_strtup.i
  46.  
  47.  
  48.  
  49. *******************************************************************************
  50. * init
  51. *******************************************************************************
  52.  
  53. _PrgInit    move.w    #0,ccr    ;OK!
  54.     rts
  55.  
  56.  
  57.  
  58. *******************************************************************************
  59. * main
  60. *******************************************************************************
  61.  
  62. _PrgMain    move.l    #Lev3Hndlr,([_VBR.l],$6c.w) ;set level3 autovector
  63.     move.w    #$c020,$dff09a    ;set INTENA.INTEN/VERTB
  64.  
  65. .lp    movea.l    DIAdr,a0    ;our display
  66.     move.w    #SCRWD/2,d0    ;centre x coordinate
  67.     move.w    #SCRHT/2,d1    ;centre y coordinate
  68.     move.w    #50,d2    ;radius
  69.     move.b    #255,d3    ;color
  70.     CALLTCS    DrwCrcl2    ;mark screen with a rectangle
  71.  
  72.     movea.l    DIAdr,a0    ;render FullRes screen
  73.     CALLTCS    BltFRPass0    ;to make changes visible
  74.  
  75.     movea.l    DIAdr,a0    ;acknowledge screen
  76.     CALLTCS    TriUpd    ;rendering completion
  77.  
  78.     btst.b    #6,$bfe001
  79.     bne.s    .lp    ;if not LMB...
  80.     rts
  81.  
  82.  
  83.  
  84. *******************************************************************************
  85. * cleanup
  86. *******************************************************************************
  87.  
  88. _PrgClnUp    rts
  89.  
  90.  
  91.  
  92. *******************************************************************************
  93. * Blitter-assisted FullRes & triple buffer handler (level 3 interrupt handler)
  94. *******************************************************************************
  95.  
  96. Lev3Hndlr    movem.l    d0-d1/d7/a0-a1/a5-a6,-(sp)
  97.     move.w       $dff01e,d7    ;get INTREQR
  98.  
  99.     btst.l    #6,d7
  100.     beq.s    .ChkVERTB    ;if not BLIT...
  101.     CALLTCS    BltFRPassHndlr    ;perform FullRes conversion
  102.  
  103. .ChkVERTB    btst.l    #5,d7
  104.     beq.s    .exit    ;if not VERTB...
  105.  
  106.     movea.l    DIAdr,a0    ;perform screen
  107.     CALLTCS      TriSwp    ;swapping
  108.  
  109. .exit    movem.l    (sp)+,d0-d1/d7/a0-a1/a5-a6
  110.     move.w    #$70,$dff09c    ;clr INTREQ.BLIT/VERTB/COPER
  111.     rte
  112.  
  113.  
  114.  
  115. *******************************************************************************
  116. * data
  117. *******************************************************************************
  118.  
  119.     include    /inc/dat.i
  120.