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

  1. *******************************************************************************
  2. * simple double buffering example
  3. *******************************************************************************
  4. * INFO    shows how to work with a HalfRes double buffered display
  5. * NOTE    - experiment with the display definition parameters
  6. *    - LMB to exit anytime
  7. *******************************************************************************
  8.  
  9.     machine    68020
  10.  
  11.     include    INCLUDES:libraries/tcs.i
  12.     include    INCLUDES:libraries/tcs_lib.i
  13.     include    /inc/macros.i
  14.  
  15.  
  16.  
  17. *******************************************************************************
  18. * custom display definitions
  19. *******************************************************************************
  20.  
  21. DSPLWD    =    320    ;our TCS display width and
  22. DSPLHT    =    256    ;height (LORES pixels)
  23. SCRWD    =    160    ;TCS screen width and
  24. SCRHT    =    256    ;height (HalfRes pixels)
  25. DSPLX0    =    $81*4    ;display start
  26. DSPLY0    =    $2c    ;position (SHRES pixels)
  27. DSPLX1    =    DSPLX0+DSPLWD*4    ;display end
  28. DSPLY1    =    DSPLY0+DSPLHT    ;position (SHRES pixels)
  29. DSPLBRTNS    =    256    ;max brightness
  30. GFXCTXT    =    0    ;graphic context
  31. CWBTM    =    0    ;clipping
  32. CWTOP    =    0    ;window
  33. CWRT    =    0    ;borders
  34. CWLF    =    0    ;coordinates
  35. VDOMODE    set    TCS_VM_RGBW | TCS_VMf_chqr | TCS_VMf_MskPln
  36. VDOMODE    set    VDOMODE | TCS_VMf_DubBuf    ;display video mode
  37.  
  38.  
  39.  
  40. *******************************************************************************
  41. * code start
  42. *******************************************************************************
  43.  
  44.     include    /inc/shl_strtup.i
  45.  
  46.  
  47.  
  48. *******************************************************************************
  49. * init
  50. *******************************************************************************
  51.  
  52. _PrgInit    move.w    #0,ccr    ;OK!
  53.     rts
  54.  
  55.  
  56.  
  57. *******************************************************************************
  58. * main
  59. *******************************************************************************
  60.  
  61. _PrgMain    movea.l    DIAdr,a0    ;our display
  62.     moveq.l    #0,d0    ;x0
  63.     moveq.l    #0,d1    ;y0
  64.     move.w    #SCRWD-1,d2    ;x1
  65.     move.w    #SCRHT-1,d3    ;y1
  66.     move.b    #255,d4    ;color
  67.     CALLTCS    DrwFrm0    ;mark screen with a rectangle
  68.  
  69.     btst.b    #5,$dff01f
  70.     beq.s    _PrgMain    ;if not VERTB...
  71.     move.w    #$20,$dff09c    ;clr VERTB
  72.  
  73.     CALLTCS    DubSwp    ;swap screen buffers
  74.  
  75.     btst.b    #6,$bfe001
  76.     bne.s    _PrgMain    ;if not LMB...
  77.     rts
  78.  
  79.  
  80.  
  81. *******************************************************************************
  82. * cleanup
  83. *******************************************************************************
  84.  
  85. _PrgClnUp    rts
  86.  
  87.  
  88.  
  89. *******************************************************************************
  90. * data
  91. *******************************************************************************
  92.  
  93.     include    /inc/dat.i
  94.