home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / gms_dev.lha / GMS / Source / Asm / RasterEffects / AGAMirror.s < prev    next >
Encoding:
Text File  |  1997-02-16  |  4.0 KB  |  172 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;AGA Mirror Demo
  3. ;---------------
  4. ;Demo of the mirroring effect.  When this effect is combined with a
  5. ;decrease in palette values at the same line, you can create the illusion of
  6. ;water.
  7. ;
  8. ;Use  the  mouse  to  move  the mirror up and down.  LMB exits.
  9.  
  10.     INCDIR    "INCLUDES:"
  11.     INCLUDE    "exec/exec_lib.i"
  12.     INCLUDE    "games/games_lib.i"
  13.     INCLUDE    "games/games.i"
  14.  
  15. CALL    MACRO
  16.     jsr    _LVO\1(a6)
  17.     ENDM
  18.  
  19.     SECTION    "MirrorDemo",CODE
  20.  
  21. ;===========================================================================;
  22. ;                             INITIALISE DEMO
  23. ;===========================================================================;
  24.  
  25. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  26.     move.l    ($4).w,a6
  27.     lea    GMS_Name(pc),a1
  28.     moveq    #$00,d0
  29.     CALL    OpenLibrary
  30.     move.l    d0,GMS_Base
  31.     beq.s    .Error_GMS
  32.  
  33.     move.l    GMS_Base(pc),a6
  34.     sub.l    a0,a0
  35.     CALL    SetUserPrefs
  36.  
  37.     lea    Screen(pc),a0
  38.     CALL    AddScreen
  39.     tst.l    d0
  40.     bne.s    .Error_Screen
  41.  
  42.     move.l    GS_MemPtr1(a0),a1    ;a1 = Destination.
  43.     lea    PackedPicFile(pc),a0    ;a0 = File Name.
  44.     CALL    SmartLoad
  45.     tst.l    d0
  46.     beq.s    .ReturnToDOS
  47.  
  48.     lea    Screen(pc),a0
  49.     CALL    ShowScreen
  50.  
  51.     CALL    InitJoyPorts
  52.  
  53.     bsr.s    Loop
  54.  
  55. .ReturnToDOS
  56.     move.l    GMS_Base(pc),a6
  57.     lea    Screen(pc),a0
  58.     CALL    DeleteScreen
  59. .Error_Screen
  60.     move.l    GMS_Base(pc),a1
  61.     move.l    ($4).w,a6
  62.     CALL    CloseLibrary
  63. .Error_GMS
  64.     MOVEM.L    (SP)+,A0-A6/D1-D7
  65.     moveq    #$00,d0
  66.     rts
  67.  
  68. ;===========================================================================;
  69. ;                                MAIN CODE
  70. ;===========================================================================;
  71.  
  72. Loop:    CALL    WaitSVBL
  73.     CALL    UpdateRasterLines
  74.  
  75.     moveq    #JPORT1,d0
  76.     CALL    ReadMouse
  77.     ext.w    d0
  78.     add.w    d0,RasterList+2
  79.  
  80. .chk129    cmp.w    #129,RasterList+2
  81.     bgt.s    .chk256
  82.     move.w    #129,RasterList+2
  83.  
  84. .chk256    cmp.w    #255,RasterList+2
  85.     blt.s    .chklmb
  86.     move.w    #255,RasterList+2
  87.  
  88. .chklmb    btst    #MB_LMB,d0
  89.     beq.s    Loop
  90.  
  91.     moveq    #0,d0    ;Fade to black.
  92.     moveq    #1,d1
  93.     lea    Palette(pc),a1
  94.     moveq    #$000000,d2
  95.     moveq    #00,d3
  96.     move.l    #128,d4
  97. .Fade    CALL    WaitSVBL
  98.     CALL    PaletteToColour
  99.     tst.w    d0
  100.     bne.s    .Fade
  101.     rts
  102.  
  103. ;===========================================================================;
  104. ;                                  DATA
  105. ;===========================================================================;
  106.  
  107. GMS_Name:
  108.     dc.b    "games.library",0
  109.     even
  110. GMS_Base:
  111.     dc.l    0
  112.  
  113. AMT_PLANES =    7
  114.  
  115. Screen:    dc.l    GSV1,0
  116.     dc.l    0,0,0    ;Screen memory 1/2/3.
  117.     dc.l    0    ;Screen link.
  118.     dc.l    Palette    ;Address of screen palette.
  119.     dc.l    RasterList    ;Address of rasterlist.
  120.     dc.l    0    ;Amt of colours in palette.
  121.     dc.w    320,256    ;Screen Width and Height.
  122.     dc.w    0,0,0    ;Picture Width, ByteWidth, Height.
  123.     dc.w    AMT_PLANES    ;Amount of planes.
  124.     dc.w    0,0    ;X/Y screen offset.
  125.     dc.w    0,0    ;X/Y picture offset.
  126.     dc.l    0    ;Special attributes.
  127.     dc.w    LORES|COL24BIT    ;Screen mode.
  128.     dc.w    ILBM    ;Screen type
  129.  
  130. RasterList:
  131.     WAITLINE 164
  132.     MIRROR
  133.     RASTEND
  134.  
  135. Palette    dc.l    $000000,$FFFFFF,$FAF5F2,$FAE8E7
  136.     dc.l    $EEDED5,$E8D4C8,$DDC0AF,$D7B5A2
  137.     dc.l    $D1AC96,$DCA491,$CBA38B,$C5997E
  138.     dc.l    $BD8E74,$B5846A,$AD7A5F,$A57056
  139.     dc.l    $9D674D,$955D44,$8C533B,$844B34
  140.     dc.l    $7C432D,$743B26,$6C3320,$642D1B
  141.     dc.l    $5C2616,$532010,$4A1D0C,$411A09
  142.     dc.l    $381606,$2F1204,$260F02,$1D0C00
  143.     dc.l    $AC783A,$A67139,$A06C39,$986638
  144.     dc.l    $995F36,$906037,$8C5C36,$945733
  145.     dc.l    $865735,$905030,$7E5133,$8D4B2E
  146.     dc.l    $764B31,$6E4630,$8A462D,$64412B
  147.     dc.l    $5D3D27,$593A24,$543822,$50351F
  148.     dc.l    $4B341D,$47301A,$592218,$402D17
  149.     dc.l    $382813,$3B2007,$302310,$2B200D
  150.     dc.l    $331100,$430907,$3C0504,$2E0202
  151.     dc.l    $B48038,$B7743D,$AE6350,$A85D4A
  152.     dc.l    $A35644,$9E503E,$994A39,$944534
  153.     dc.l    $9F4336,$8E3F30,$87412B,$87382A
  154.     dc.l    $823628,$803226,$792C21,$72251C
  155.     dc.l    $E1AB98,$DBA28C,$D79C89,$D29582
  156.     dc.l    $CD8D7A,$C88672,$C27E6B,$BD7764
  157.     dc.l    $B8705D,$B36A57,$BB5244,$AD4A3D
  158.     dc.l    $C8594A,$7F7444,$847D49,$67271E
  159.     dc.l    $6C2219,$651D15,$5E1711,$57130E
  160.     dc.l    $500F0B,$4A0C09,$350303,$270000
  161.     dc.l    $89874E,$8C8E53,$8C9358,$8E9D62
  162.     dc.l    $C6904A,$9AA467,$CD9E51,$AFAE6F
  163.     dc.l    $E3D765,$D5AE58,$BCAD78,$C1AC7C
  164.     dc.l    $CBAA82,$D5A588,$EAA09B,$ECA7A2
  165.     dc.l    $EDADA9,$EFB5B1,$F0BBB8,$F2C2BF
  166.     dc.l    $F4CBC8,$F5D1CF,$F7D9D7,$FDF7F7
  167.  
  168. PackedPicFile:
  169.     dc.b    "GAMESLIB:data/Yattering128.pak",0
  170.     even
  171.  
  172.