home *** CD-ROM | disk | FTP | other *** search
- ;-------T-------T------------------------T----------------------------------;
- ;Scroll Memory
- ;-------------
- ;This demo shows you the power of the scrolling features by allowing you
- ;to scroll all over your chip ram :-). Usually you would set limits to stop
- ;you from going over the boundaries, but that's up to you.
- ;
- ;Use mouse to move around, 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 "ScrollMemory",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
- CALL InitJoyPorts
- bsr.s Main
-
- .ReturnToDOS
- move.l GMS_Base(pc),a6
- lea Picture(pc),a1
- CALL FreePic
- .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 LOOP
- ;===========================================================================;
-
- Main:
- .loop moveq #JPORT1,d0
- moveq #JT_ZBXY,d1
- CALL ReadJoyPort
- btst #MB_RMB,d0
- bne.s .done
- move.w d0,d1
- asr.w #8,d0 ;d0 = X Change
- ext.w d1
-
- ;btst #MB_LMB,d0
- ;bne.s .MoveScreen
- .MovePicture
- add.w d0,GS_PicXOffset(a0)
- add.w d1,GS_PicYOffset(a0)
- CALL RemakeScreen
- CALL MovePicture
- CALL WaitSVBL
- bra.s .loop
-
- .MoveScreen
- add.w d0,GS_ScrXOffset(a0)
- add.w d1,GS_ScrYOffset(a0)
- CALL RemakeScreen
- CALL MovePicture
- CALL WaitSVBL
- bra.s .loop
- .done rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- AMT_PLANES = 5
-
- 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 palette.
- dc.l 0 ;Address of rasterlist.
- dc.l 0 ;Amount of colours in palette.
- dc.w 320,256 ;Screen Width, Height.
- dc.w 0,0,0 ;Picture Width/8, Height.
- dc.w AMT_PLANES ;Amount of planes
- dc.w 0,0 ;X/Y screen offsets.
- dc.w 0,0 ;X/Y picture offsets.
- dc.l HSCROLL|VSCROLL|SBUFFER ;|CENTRE ;Special attributes.
- dc.w COL12BIT|LORES ;Screen mode.
- dc.w ILBM ;Screen type
-
- Palette dc.w $000,$130,$FCB,$FA9,$D88,$965,$644,$211
- dc.w $400,$444,$FF0,$432,$CC0,$150,$501,$880
- dc.w $261,$271,$382,$492,$5A3,$5B4,$677,$6C4
- dc.w $788,$9AA,$BCC,$801,$901,$A02,$701,$601
-
- Picture dc.l PCV1,0 ;Version header.
- dc.l 0 ;Source data.
- dc.w 320,320/8,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|LACED ;Screen mode.
- dc.w ILBM ;Destination
- dc.l 0 ;Parameters.
- dc.l .File
- .File dc.b "GAMESLIB:data/IFF.Pic320",0
- even
-
-