home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Demo Collection / TheAmigaDemoCollectionCDCUE.img / S / showtime05 / Bonus / BScreen.lha / Blitterscreen / main.asm < prev    next >
Assembly Source File  |  1992-12-20  |  8KB  |  205 lines

  1.     opt    d-,l-,c+    ;remove this if tou don't use Devpac
  2.  
  3.  
  4.     include    'general.i'        ;my set of macros
  5.     include    'startup2.i'        ;the startup code
  6. START
  7.     lea.l    $dff000,a6        ;I use this here ever
  8.  
  9. *---
  10. * Do your personal modify to coplist BEFORE call BScreenInit,
  11. * cause this is not the real coplist but just an header that will
  12. * be copied in chip mem and modified.
  13.  
  14.     lea.l    Palette,a0        ;just set the palette in coplist
  15.     lea.l    BScreenCoplist_color,a1
  16.     move.l    #256,d0
  17.     bsr    SetPalette
  18. *---
  19. *Remember to activate at least all this DMAs
  20.     move.w    #$83e0,$096(a6)        ;mast,bpl,cop,blit,spr
  21.  
  22.  
  23.     move.w    #$7fff,$09a(a6)        ;deactivate interrupts
  24.     move.w    #$7fff,$09c(a6)        ;kill survivors
  25.  
  26. *---
  27. *Call to Inizialization Routine
  28.     bsr    BScreenInit        ;create coplist
  29.  
  30. *---
  31. * VERY IMPORTANT Set the screen to be used by the interrupt lev 3 routine
  32. * By changing this you can perform double buffering.
  33.     move.l    #MyScreen,BScreenCurrentScreen
  34.  
  35. *---
  36. * The coplist will be started by the Interrupt routine
  37. * V.I. set Interrupt vector and activate bits
  38.     move.l    BaseVBR,a0
  39.     move.l    #BScreenInt3,$06c(a0)    ;interrupt routine in 'BScreenInt3.i'
  40.     move.w    #$c060,$09a(a6)        ;activate Blitter e VB intreq
  41.  
  42. *---
  43. *Convert my image
  44.     lea.l    Chunky,a0        ;Chunky image to convert
  45.     lea.l    MyScreen,a1        ;Destination screen
  46.     bsr    BScreenConvert        ;Conversion
  47.     
  48. *---
  49. *Here we wait for BScreen to finish
  50.     bsr    BScreenWait
  51.  
  52. *OK, now you can call BScreenReStart to convert again the same Chunky screen
  53. *in the same planar screen, but isn't good for double buffering.
  54. *Remember in any case to use BScreenWait first.
  55.  
  56.  
  57.     LMB        ;just wait for LeftMouse Button
  58. END
  59.     rts
  60. *********End Main*********************
  61.  
  62.  
  63.  
  64. *********************************
  65. * Some datas in fast mem
  66.  
  67.     include    'BScreen.i'        ;<----include these to use BScreen
  68.     include    'BScreenInt3.i'        ;<---/
  69.  
  70.     include    'SetPalette.i'        ;my proc to set the palette in coplist
  71.     WaitLine_def            ;macro to define WaitLine function
  72. Palette    include    'lakestar.pal'        ;Palette of the picture
  73.  
  74.  
  75.  
  76. *******************************
  77.     SECTION    BSSFast,BSS
  78. BScreenList    ds.b    40*1024        ;buffer for Blitter programmation
  79.  
  80.  
  81.  
  82. *******************************
  83.     SECTION    BSSChip,BSS_C
  84.     cnop    0,8
  85. MyScreen        ds.b    BScreenPlaneSize*4
  86. BScreenBuffer        ds.b    BScreenChunkySize/2
  87. BScreenScrambleBuffer    ds.b    BScreenChunkySize
  88. BScreenSpriteBuffer0    ds.b    (312*8*2)*8
  89. BScreenSpriteBuffer1    ds.b    (312*8*2)*8
  90. BScreenCoplist0        ds.b    8096
  91. BScreenCoplist1        ds.b    8096
  92.  
  93.  
  94.  
  95.  
  96.  
  97. *******************************
  98.     SECTION    DatiChip,DATA_C
  99.                     ;IMAGE TO CONVERT
  100.                     ;MUST be in chip mem
  101. Chunky    incbin    'LakeStar160x128.raw'    ;in 8 bit Chunky Mode
  102.  
  103. ******                ;THE COPPERLIST
  104. BScreenCoplist
  105.      dc.l $01fc400f ;fmode=3  ;SPRfmode=3 ; 2x2: SCANDOUBLE planes
  106.      dc.l $00968100           ;plane dma on line 0
  107.      dc.l $01000211,$01020000 ;LORES 8 planes, ECS on for bblank
  108.      dc.l $0104003f           ;$104 sprite priority!
  109.      dc.l $01060020           ;$1060020: bblank
  110.      dc.l $010c00ff           ;$10c:<--- SELECT HERE THE SPRITE COLORBANK!!!
  111.      dc.l $0108ffd8,$010a0000 ;2x2: modulo -40=$ffd8
  112.      dc.l $008e2881,$009028c1 ;display window
  113.      dc.l $00920038,$009400a0 ;ddfstrt/stp values for 320pix-width-plane
  114.  
  115. ;*** Bpl pointers refreshed in VB-Int3
  116. ;*** Color Section
  117.     dc.w    $106,$c00
  118. BScreenCoplist_color
  119.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  120.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  121.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  122.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  123.     DC.W    $106,$e00
  124.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  125.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  126.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  127.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  128.     DC.W    $106,$2C00
  129.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  130.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  131.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  132.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  133.     DC.W    $106,$2E00
  134.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  135.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  136.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  137.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  138.     DC.W    $106,$4C00
  139.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  140.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  141.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  142.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  143.     DC.W    $106,$4E00
  144.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  145.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  146.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  147.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  148.     DC.W    $106,$6C00
  149.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  150.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  151.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  152.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  153.     DC.W    $106,$6E00
  154.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  155.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  156.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  157.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  158.     DC.W    $106,$8C00
  159.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  160.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  161.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  162.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  163.     DC.W    $106,$8E00
  164.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  165.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  166.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  167.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  168.     DC.W    $106,$AC00
  169.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  170.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  171.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  172.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  173.     DC.W    $106,$AE00
  174.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  175.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  176.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  177.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  178.     DC.W    $106,$CC00
  179.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  180.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  181.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  182.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  183.     DC.W    $106,$CE00
  184.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  185.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  186.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  187.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  188.     DC.W    $106,$EC00
  189.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  190.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  191.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  192.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  193.     DC.W    $106,$EE00
  194.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  195.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  196.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  197.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  198.  
  199.     dc.l $01060c20
  200. BScreenCoplist_End    ;$fffffffe will be added by BScreenInit
  201.  
  202.  
  203.  
  204.     end
  205.