home *** CD-ROM | disk | FTP | other *** search
- ;-------T-------T------------------------T----------------------------------;
- ;Fade Demo
- ;---------
- ;ECS Fading demo.
-
- INCDIR "INCLUDES:"
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "FadingDemo",CODE
-
- ;===========================================================================;
- ; INITIALISE DEMO
- ;===========================================================================;
-
- Start: MOVEM.L A0-A6/D1-D7,-(SP)
- move.l ($4).w,a6
- lea GMS_Name(pc),a1
- moveq #$00,d0
- CALL OpenLibrary
- move.l d0,GMS_Base
- beq.s .Error_GMS
-
- move.l GMS_Base(pc),a6
- sub.l a0,a0
- CALL SetUserPrefs
-
- lea Screen(pc),a0
- CALL AddScreen
- tst.l d0
- bne.s .Error_Screen
-
- lea Picture(pc),a1
- move.l GS_MemPtr1(a0),PIC_Data(a1)
- CALL LoadPic
- tst.w d0
- bne.s .Error_Picture
-
- CALL ShowScreen
-
- bsr.s Main
-
- .ReturnToDOS
- .Error_Picture
- move.l GMS_Base(pc),a6
- lea Screen(pc),a0
- CALL DeleteScreen
- .Error_Screen
- move.l GMS_Base(pc),a1
- move.l ($4).w,a6
- CALL CloseLibrary
- .Error_GMS
- MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #$00,d0
- rts
-
- ;===========================================================================;
- ; MAIN CODE
- ;===========================================================================;
-
- Main: moveq #30,d0
- CALL WaitTime
-
- moveq #00,d0 ;d0 = FadeState
- moveq #1,d1 ;d1 = Speed
- moveq #$000,d2 ;d2 = Colour (Black)
- moveq #00,d3 ;d3 = Start at colour zero.
- moveq #16,d4 ;d4 = Amount of colours (32)
- lea Palette(pc),a1 ;a1 = Palette to fade to.
- .Fade CALL WaitVBL
- CALL WaitVBL
- CALL WaitSVBL
- CALL ColourToPalette
- tst.w d0
- bne.s .Fade
-
- CALL WaitLMB
-
- moveq #00,d0
- moveq #1,d1
- lea Palette(pc),a1
- lea Palette2(pc),a2
- .Fade1 CALL WaitSVBL
- CALL PaletteMorph
- tst.w d0
- bne.s .Fade1
-
- moveq #25,d0
- CALL WaitTime
-
- moveq #00,d0
- moveq #1,d1
- moveq #$000,d2
- lea Palette(pc),a1
- .Fade2 CALL WaitSVBL
- CALL PaletteToColour
- tst.w d0
- bne.s .Fade2
-
- moveq #50,d0
- CALL WaitTime
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- AMT_PLANES = 4
-
- Screen: dc.l GSV1,0
- dc.l 0,0,0 ;Screen memory pointers 1/2/3
- dc.l 0 ;Screen link.
- dc.l 0 ;Address of screen palette.
- dc.l 0 ;Address of rasterlist.
- dc.l 0 ;Amount of colours in palette.
- dc.w 320,256 ;Screen Width and Height.
- dc.w 640,640/8,256 ;Picture Width and Height.
- dc.w AMT_PLANES ;Amount of planes.
- dc.w 0,0 ;X/Y screen offset.
- dc.w 0,0 ;X/Y picture offset.
- dc.l 0 ;Special attributes.
- dc.w LORES|COL12BIT ;Screen mode.
- dc.w ILBM ;Screen type
-
- Palette dc.w $000,$400,$501,$501,$601,$701,$701,$801
- dc.w $901,$A01,$B02,$432,$CC0,$F00,$211,$880
-
- Palette2:
- dc.w $000,$004,$105,$105,$106,$107,$107,$108
- dc.w $109,$10A,$20B,$234,$0CC,$00F,$112,$088
-
- Picture dc.l PCV1,0 ;Version header.
- dc.l 0 ;Source data.
- dc.w 640,0,256 ;Width, Height.
- dc.w AMT_PLANES ;Amount of Planes.
- dc.l 32 ;Amount of colours.
- dc.l Palette ;Source palette (remap).
- dc.w LORES|COL12BIT ;Screen mode.
- dc.w ILBM ;Destination
- dc.l 0 ;Parameters.
- dc.l .File
- .File dc.b "GAMESLIB:data/IFF.Pic640x256",0
- even
-
-