home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / gms_dev.lha / GMS / Source / Asm / Fading / ECSMorph.s < prev   
Encoding:
Text File  |  1997-02-16  |  3.2 KB  |  156 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;Fade Demo
  3. ;---------
  4. ;ECS Fading demo.
  5.  
  6.     INCDIR    "INCLUDES:"
  7.     INCLUDE    "exec/exec_lib.i"
  8.     INCLUDE    "games/games_lib.i"
  9.     INCLUDE    "games/games.i"
  10.  
  11. CALL    MACRO
  12.     jsr    _LVO\1(a6)
  13.     ENDM
  14.  
  15.     SECTION    "FadingDemo",CODE
  16.  
  17. ;===========================================================================;
  18. ;                             INITIALISE DEMO
  19. ;===========================================================================;
  20.  
  21. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  22.     move.l    ($4).w,a6
  23.     lea    GMS_Name(pc),a1
  24.     moveq    #$00,d0
  25.     CALL    OpenLibrary
  26.     move.l    d0,GMS_Base
  27.     beq.s    .Error_GMS
  28.  
  29.     move.l    GMS_Base(pc),a6
  30.     sub.l    a0,a0
  31.     CALL    SetUserPrefs
  32.  
  33.     lea    Screen(pc),a0
  34.     CALL    AddScreen
  35.     tst.l    d0
  36.     bne.s    .Error_Screen
  37.  
  38.     lea    Picture(pc),a1
  39.     move.l    GS_MemPtr1(a0),PIC_Data(a1)
  40.     CALL    LoadPic
  41.     tst.w    d0
  42.     bne.s    .Error_Picture
  43.  
  44.     CALL    ShowScreen
  45.  
  46.     bsr.s    Main
  47.  
  48. .ReturnToDOS
  49. .Error_Picture
  50.     move.l    GMS_Base(pc),a6
  51.     lea    Screen(pc),a0
  52.     CALL    DeleteScreen
  53. .Error_Screen
  54.     move.l    GMS_Base(pc),a1
  55.     move.l    ($4).w,a6
  56.     CALL    CloseLibrary
  57. .Error_GMS
  58.     MOVEM.L    (SP)+,A0-A6/D1-D7
  59.     moveq    #$00,d0
  60.     rts
  61.  
  62. ;===========================================================================;
  63. ;                                MAIN CODE
  64. ;===========================================================================;
  65.  
  66. Main:    moveq    #30,d0
  67.     CALL    WaitTime
  68.  
  69.     moveq    #00,d0    ;d0 = FadeState
  70.     moveq    #1,d1    ;d1 = Speed
  71.     moveq    #$000,d2    ;d2 = Colour (Black)
  72.     moveq    #00,d3    ;d3 = Start at colour zero.
  73.     moveq    #16,d4    ;d4 = Amount of colours (32)
  74.     lea    Palette(pc),a1    ;a1 = Palette to fade to.
  75. .Fade    CALL    WaitVBL
  76.     CALL    WaitVBL
  77.     CALL    WaitSVBL
  78.     CALL    ColourToPalette
  79.     tst.w    d0
  80.     bne.s    .Fade
  81.  
  82.     CALL    WaitLMB
  83.  
  84.     moveq    #00,d0
  85.     moveq    #1,d1
  86.     lea    Palette(pc),a1
  87.     lea    Palette2(pc),a2
  88. .Fade1    CALL    WaitSVBL
  89.     CALL    PaletteMorph
  90.     tst.w    d0
  91.     bne.s    .Fade1
  92.  
  93.     moveq    #25,d0
  94.     CALL    WaitTime
  95.  
  96.     moveq    #00,d0
  97.     moveq    #1,d1
  98.     moveq    #$000,d2
  99.     lea    Palette(pc),a1
  100. .Fade2    CALL    WaitSVBL
  101.     CALL    PaletteToColour
  102.     tst.w    d0
  103.     bne.s    .Fade2
  104.  
  105.     moveq    #50,d0
  106.     CALL    WaitTime
  107.     rts
  108.  
  109. ;===========================================================================;
  110. ;                                  DATA
  111. ;===========================================================================;
  112.  
  113. GMS_Name:
  114.     dc.b    "games.library",0
  115.     even
  116. GMS_Base:
  117.     dc.l    0
  118.  
  119. AMT_PLANES =    4
  120.  
  121. Screen:    dc.l    GSV1,0
  122.     dc.l    0,0,0    ;Screen memory pointers 1/2/3
  123.     dc.l    0    ;Screen link.
  124.     dc.l    0    ;Address of screen palette.
  125.     dc.l    0    ;Address of rasterlist.
  126.     dc.l    0    ;Amount of colours in palette.
  127.     dc.w    320,256    ;Screen Width and Height.
  128.     dc.w    640,640/8,256    ;Picture Width and Height.
  129.     dc.w    AMT_PLANES    ;Amount of planes.
  130.     dc.w    0,0    ;X/Y screen offset.
  131.     dc.w    0,0    ;X/Y picture offset.
  132.     dc.l    0    ;Special attributes.
  133.     dc.w    LORES|COL12BIT    ;Screen mode.
  134.     dc.w    ILBM    ;Screen type
  135.  
  136. Palette    dc.w    $000,$400,$501,$501,$601,$701,$701,$801
  137.     dc.w    $901,$A01,$B02,$432,$CC0,$F00,$211,$880
  138.  
  139. Palette2:
  140.     dc.w    $000,$004,$105,$105,$106,$107,$107,$108
  141.     dc.w    $109,$10A,$20B,$234,$0CC,$00F,$112,$088
  142.  
  143. Picture    dc.l    PCV1,0    ;Version header.
  144.     dc.l    0    ;Source data.
  145.     dc.w    640,0,256    ;Width, Height.
  146.     dc.w    AMT_PLANES    ;Amount of Planes.
  147.     dc.l    32    ;Amount of colours.
  148.     dc.l    Palette    ;Source palette (remap).
  149.     dc.w    LORES|COL12BIT    ;Screen mode.
  150.     dc.w    ILBM    ;Destination
  151.     dc.l    0    ;Parameters.
  152.     dc.l    .File
  153. .File    dc.b    "GAMESLIB:data/IFF.Pic640x256",0
  154.     even
  155.  
  156.