home *** CD-ROM | disk | FTP | other *** search
- ;-------T-------T------------------------T----------------------------------;
- ;AGA Mirror Demo
- ;---------------
- ;Demo of the mirroring effect. When this effect is combined with a
- ;decrease in palette values at the same line, you can create the illusion of
- ;water.
- ;
- ;Use the mouse to move the mirror up and down. LMB exits.
-
- INCDIR "INCLUDES:"
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "MirrorDemo",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
-
- move.l GS_MemPtr1(a0),a1 ;a1 = Destination.
- lea PackedPicFile(pc),a0 ;a0 = File Name.
- CALL SmartLoad
- tst.l d0
- beq.s .ReturnToDOS
-
- lea Screen(pc),a0
- CALL ShowScreen
-
- CALL InitJoyPorts
-
- bsr.s Loop
-
- .ReturnToDOS
- 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
- ;===========================================================================;
-
- Loop: CALL WaitSVBL
- CALL UpdateRasterLines
-
- moveq #JPORT1,d0
- CALL ReadMouse
- ext.w d0
- add.w d0,RasterList+2
-
- .chk129 cmp.w #129,RasterList+2
- bgt.s .chk256
- move.w #129,RasterList+2
-
- .chk256 cmp.w #255,RasterList+2
- blt.s .chklmb
- move.w #255,RasterList+2
-
- .chklmb btst #MB_LMB,d0
- beq.s Loop
-
- moveq #0,d0 ;Fade to black.
- moveq #1,d1
- lea Palette(pc),a1
- moveq #$000000,d2
- moveq #00,d3
- move.l #128,d4
- .Fade CALL WaitSVBL
- CALL PaletteToColour
- tst.w d0
- bne.s .Fade
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- AMT_PLANES = 7
-
- Screen: dc.l GSV1,0
- dc.l 0,0,0 ;Screen memory 1/2/3.
- dc.l 0 ;Screen link.
- dc.l Palette ;Address of screen palette.
- dc.l RasterList ;Address of rasterlist.
- dc.l 0 ;Amt of colours in palette.
- dc.w 320,256 ;Screen Width and Height.
- dc.w 0,0,0 ;Picture Width, ByteWidth, 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|COL24BIT ;Screen mode.
- dc.w ILBM ;Screen type
-
- RasterList:
- WAITLINE 164
- MIRROR
- RASTEND
-
- Palette dc.l $000000,$FFFFFF,$FAF5F2,$FAE8E7
- dc.l $EEDED5,$E8D4C8,$DDC0AF,$D7B5A2
- dc.l $D1AC96,$DCA491,$CBA38B,$C5997E
- dc.l $BD8E74,$B5846A,$AD7A5F,$A57056
- dc.l $9D674D,$955D44,$8C533B,$844B34
- dc.l $7C432D,$743B26,$6C3320,$642D1B
- dc.l $5C2616,$532010,$4A1D0C,$411A09
- dc.l $381606,$2F1204,$260F02,$1D0C00
- dc.l $AC783A,$A67139,$A06C39,$986638
- dc.l $995F36,$906037,$8C5C36,$945733
- dc.l $865735,$905030,$7E5133,$8D4B2E
- dc.l $764B31,$6E4630,$8A462D,$64412B
- dc.l $5D3D27,$593A24,$543822,$50351F
- dc.l $4B341D,$47301A,$592218,$402D17
- dc.l $382813,$3B2007,$302310,$2B200D
- dc.l $331100,$430907,$3C0504,$2E0202
- dc.l $B48038,$B7743D,$AE6350,$A85D4A
- dc.l $A35644,$9E503E,$994A39,$944534
- dc.l $9F4336,$8E3F30,$87412B,$87382A
- dc.l $823628,$803226,$792C21,$72251C
- dc.l $E1AB98,$DBA28C,$D79C89,$D29582
- dc.l $CD8D7A,$C88672,$C27E6B,$BD7764
- dc.l $B8705D,$B36A57,$BB5244,$AD4A3D
- dc.l $C8594A,$7F7444,$847D49,$67271E
- dc.l $6C2219,$651D15,$5E1711,$57130E
- dc.l $500F0B,$4A0C09,$350303,$270000
- dc.l $89874E,$8C8E53,$8C9358,$8E9D62
- dc.l $C6904A,$9AA467,$CD9E51,$AFAE6F
- dc.l $E3D765,$D5AE58,$BCAD78,$C1AC7C
- dc.l $CBAA82,$D5A588,$EAA09B,$ECA7A2
- dc.l $EDADA9,$EFB5B1,$F0BBB8,$F2C2BF
- dc.l $F4CBC8,$F5D1CF,$F7D9D7,$FDF7F7
-
- PackedPicFile:
- dc.b "GAMESLIB:data/Yattering128.pak",0
- even
-
-