home *** CD-ROM | disk | FTP | other *** search
- ;Clip Picture
- ;------------
- ;This demo demonstrates the clipping of LoadPic(). You can load in any
- ;IFF picture and it will be clipped to fit the specified screen size
- ;(in this case, 320x256).
-
- INCDIR "INCLUDES:"
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "ClipPicture",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 Picture(pc),a1 ;Load background picture.
- CALL LoadPic
- tst.w d0
- bne.s .Error_Picture
-
- lea Screen(pc),a0
- move.l PIC_Data(a1),GS_MemPtr1(a0)
- move.l PIC_Palette(a1),GS_Palette(a0)
- move.w PIC_Planes(a1),GS_Planes(a0)
- move.l PIC_AmtColours(a1),GS_AmtColours(a0)
- move.w PIC_ScrType(a1),GS_ScrType(a0)
- move.w PIC_ScrMode(a1),GS_ScrMode(a0)
-
- CALL AddScreen
- tst.l d0
- bne.s .Error_Screen
-
- CALL ShowScreen
-
- CALL WaitLMB
-
- .ReturnToDOS
- move.l GMS_Base(pc),a6
- lea Screen(pc),a0
- CALL DeleteScreen
- .Error_Screen
- move.l GMS_Base(pc),a6
- lea Picture(pc),a1
- CALL FreePic
- .Error_Picture
- move.l ($4).w,a6
- move.l GMS_Base(pc),a1
- CALL CloseLibrary
- .Error_GMS
- MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #$00,d0
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- Screen: dc.l GSV1,0 ;Version header.
- dc.l 0,0,0 ;Screen memory 1/2/3.
- dc.l 0 ;Screen link.
- dc.l 0 ;Address of 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 0,0,0 ;Picture Width and Height.
- dc.w 0 ;Amount of planes
- dc.w 0,0 ;X/Y screen offsets.
- dc.w 0,0 ;X/Y picture offsets.
- dc.l 0 ;Special attributes.
- dc.w 0 ;Screen mode.
- dc.w 0 ;Screen type
-
- Picture dc.l PCV1,0 ;Version header.
- dc.l 0 ;Source data.
- dc.w 320,320/8,256 ;Width/8, Height.
- dc.w 0 ;Amount of Planes.
- dc.l 0 ;Amount of colours.
- dc.l 0 ;Palette.
- dc.w LORES|COL12BIT ;Screen mode.
- dc.w 0 ;Screen type.
- dc.l VIDEOMEM|GETPALETTE
- dc.l .File
- .File dc.b "GAMESLIB:data/IFF.Pic640x256",0
- even
-