home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / gms_dev.lha / GMS / Source / Asm / Fading / AGAGreenFade.s next >
Encoding:
Text File  |  1997-02-16  |  3.4 KB  |  137 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;AGA Fade
  3. ;--------
  4. ;Fades in a 32 colour AGA picture (24 bit colour).  Then up to a specified
  5. ;colour (greenish yellow), and then out to black.
  6. ;
  7. ;Press left mouse button to exit.
  8.  
  9.     INCDIR    "INCLUDES:"
  10.     INCLUDE    "exec/exec_lib.i"
  11.     INCLUDE    "games/games_lib.i"
  12.     INCLUDE    "games/games.i
  13. CALL    MACRO
  14.     jsr    _LVO\1(a6)
  15.     ENDM
  16.  
  17.     SECTION    "AGAFade",CODE
  18.  
  19. ;===========================================================================;
  20. ;                             INITIALISE DEMO
  21. ;===========================================================================;
  22.  
  23. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  24.     move.l    ($4).w,a6
  25.     lea    GMS_Name(pc),a1
  26.     moveq    #$00,d0
  27.     CALL    OpenLibrary
  28.     move.l    d0,GMS_Base
  29.     beq.s    .Error_GMS
  30.  
  31.     move.l    GMS_Base(pc),a6
  32.     sub.l    a0,a0
  33.     CALL    SetUserPrefs
  34.  
  35.     lea    Screen(pc),a0   
  36.     CALL    AddScreen
  37.     tst.l    d0
  38.     bne.s    .Error_Screen
  39.  
  40.     lea    Picture(pc),a1
  41.     move.l    GS_MemPtr1(a0),PIC_Data(a1)
  42.     CALL    LoadPic
  43.     tst.w    d0
  44.     bne.s    .Error_Picture
  45.  
  46.     CALL    ShowScreen
  47.  
  48.     bsr.s    Main
  49.  
  50. .ReturnToDOS
  51.     move.l    GMS_Base(pc),a6
  52.     lea    Picture(pc),a1
  53.     CALL    FreePic
  54. .Error_Picture
  55.     lea    Screen(pc),a0
  56.     CALL    DeleteScreen
  57. .Error_Screen
  58.     move.l    ($4).w,a6
  59.     move.l    GMS_Base(pc),a1
  60.     CALL    CloseLibrary
  61. .Error_GMS
  62.     MOVEM.L    (SP)+,A0-A6/D1-D7
  63.     moveq    #$00,d0
  64.     rts
  65.  
  66. ;===========================================================================;
  67. ;                                MAIN CODE
  68. ;===========================================================================;
  69.  
  70. Main:    moveq    #$00,d0    ;d0 = FadeState
  71.     moveq    #5,d1    ;d1 = Speed of fade.
  72.     move.l    Picture+PIC_Palette(pc),a1    ;a1 = Palette to fade to.
  73.     moveq    #$000000,d2    ;d2 = Fading from black.
  74.     moveq    #00,d3    ;d3 = Start colour.
  75.     moveq    #32,d4    ;d4 = Amount of colours.
  76. .f_in    CALL    WaitSVBL
  77.     CALL    ColourToPalette    ;Do the fade routine.
  78.     tst.w    d0    ;Has the fade finished yet?
  79.     bne.s    .f_in    ;If not, keep doing it.
  80.  
  81.     moveq    #2,d1    ;d1 = Speed of fade.
  82.     move.l    Picture+PIC_Palette(pc),a1    ;a1 = Palette we are fading from.
  83.     move.l    #$75F343,d2    ;d2 = Colour we are fading to.
  84. .f_mid    CALL    WaitSVBL
  85.     CALL    PaletteToColour    ;Do the fade routine.
  86.     tst.w    d0    ;Has the fade finished yet?
  87.     bne.s    .f_mid    ;If not, keep doing it.
  88.  
  89.     moveq    #2,d1    ;d1 = Speed of fade.
  90.     move.l    #$a5F343,d2    ;d2 = Colour.
  91.     moveq    #$000000,d5    ;d5 = Colour.
  92. .f_out    CALL    WaitSVBL
  93.     CALL    ColourMorph    ;Do the fade routine.
  94.     tst.w    d0    ;Has the fade finished yet?
  95.     bne.s    .f_out    ;If not, keep doing it.
  96.     rts
  97.  
  98. ;===========================================================================;
  99. ;                                  DATA
  100. ;===========================================================================;
  101.  
  102. GMS_Name:
  103.     dc.b    "games.library",0
  104.     even
  105. GMS_Base:
  106.     dc.l    0
  107.  
  108. AMT_PLANES =    5
  109.  
  110. Screen:    dc.l    GSV1,0    ;Version header.
  111.     dc.l    0,0,0    ;Screen memory 1/2/3.
  112.     dc.l    0    ;Screen link.
  113.     dc.l    0    ;Address of palette.
  114.     dc.l    0    ;Address of rasterlist.
  115.     dc.l    32    ;Amount of colours in palette.
  116.     dc.w    320,256    ;Screen Width and Height.
  117.     dc.w    0,0,0    ;Picture Width, ByteWidth, Height.
  118.     dc.w    AMT_PLANES    ;Amount of planes.
  119.     dc.w    0,0    ;X/Y screen offsets.
  120.     dc.w    0,0    ;X/Y picture offsets.
  121.     dc.l    0    ;Special attributes.
  122.     dc.w    LORES|COL24BIT    ;Screen mode.
  123.     dc.w    ILBM    ;Screen type
  124.  
  125. Picture    dc.l    PCV1,0    ;Version header.
  126.     dc.l    0    ;Source data.
  127.     dc.w    320,0,256    ;Width, Height.
  128.     dc.w    AMT_PLANES    ;Amount of Planes.
  129.     dc.l    32    ;Amount of colours.
  130.     dc.l    0    ;Source palette (remap).
  131.     dc.w    LORES|COL24BIT    ;Screen mode.
  132.     dc.w    ILBM    ;Destination
  133.     dc.l    GETPALETTE    ;Parameters.
  134.     dc.l    .File
  135. .File    dc.b    "GAMESLIB:data/IFF.Loading",0
  136.     even
  137.