home *** CD-ROM | disk | FTP | other *** search
- ;-------T-------T------------------------T----------------------------------;
- ;AGA FloodFill Demo
- ;------------------
- ;A demo of how you should use the FLOOD raster command.
- ;
- ;To exit the demo, press the left mouse button.
-
- INCDIR "INCLUDES:"
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "FloodFill",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
- lea PicFile(pc),a0
- moveq #$00,d0
- CALL SmartLoad
- tst.w d0
- beq.s .ReturnToDOS
-
- lea Screen(pc),a0
- CALL ShowScreen
-
- bsr.s Main
-
- .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
- ;===========================================================================;
-
- Main:
- .Flood CALL WaitSVBL
- bsr.s FloodFill
- tst.w d0
- beq.s .Flood
-
- CALL WaitLMB
-
- moveq #0,d0
- moveq #2,d1
- lea Palette(pc),a1
- moveq #$000000,d2
- moveq #00,d3
- move.l #128,d4
- .Fade move.l d0,-(sp) ;Run our own VBL wait code here
- moveq #$00,d0 ;for better fading.
- CALL WaitRastLine
- CALL AutoSwitch
- move.l (sp)+,d0
- CALL PaletteToColour
- tst.w d0
- bne.s .Fade
- rts
-
- ;===========================================================================;
- ; FLOOD FILL
- ;===========================================================================;
-
- FloodFill:
- lea Screen(pc),a0
- lea RasterList(pc),a2
- cmp.w #256,2(a2)
- bge.s .done
- addq.w #1,2(a2)
- CALL UpdateRasterLines
- moveq #$00,d0
- rts
-
- .done moveq #-1,d0
- 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 ;Amount of colours in palette.
- dc.w 320,256 ;Screen Width and Height.
- dc.w 0,0,0 ;Picture Width/8 and Height.
- dc.w AMT_PLANES ;Amount of planes.
- dc.w 160,128 ;X/Y screen offset.
- dc.w 0,0 ;X/Y picture offset.
- dc.l BLKBDR ;Special attributes.
- dc.w COL24BIT|HIRES|LACED ;Screen mode.
- dc.w ILBM ;Screen type
-
- 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
-
- RasterList:
- WAITLINE 000
- FLOOD
- RASTEND
-
- PicFile dc.b "GAMESLIB:data/Yattering128.pak",0
- even
-
-