home *** CD-ROM | disk | FTP | other *** search
- /* Horizontal Scroll 640
- ** ---------------------
- ** This opens an extra wide screen of 640x256 pixels, and hardware scrolls
- ** left and right. This is *totally* inadequate for platformers, shoot'em-ups
- ** etc because the picture size takes up huge amounts of memory. However for
- ** games like Skidmarks, Lemmings, Monkey Island, etc, such large screens can
- ** be a necessity.
- */
-
- MODULE 'games','games/games','exec/memory'
-
- PROC main()
- DEF screen:PTR TO gamescreen, palette:PTR TO INT, direction=1:LONG,
- sparkie:PTR TO sprite, zbxy:LONG, timer:LONG, loadpic:PTR TO picture
-
- palette := [
- $000,$400,$501,$501,$601,$701,$701,$801,
- $901,$A01,$B02,$432,$CC0,$F00,$211,$880,
- $1C2,$050,$B0B,$606,$F20,$910,$BBB,$FFF,
- $0BF,$068,$568,$9BF,$FF0,$EE0,$BA0,$540
- ]:INT;
-
- sparkie := [
- SPV1,0, -> Version number
- 0, -> Bank Number 0
- 0, -> Ptr to graphic
- 150,150, -> Beginning X/Y positions
- 0, -> Current frame
- 16,21, -> Width, Height
- 16, -> Amt of colours
- 16, -> Colour start in palette
- 2, -> Amt of planes
- LORES, -> Resolution attributes
- 0, -> Position in relation to playfields
- XLONG -> Special attributes.
- ]:sprite;
-
- loadpic := [
- PCV1,0, -> Version header.
- 0, -> Destination.
- 640,0,256, -> Width, Height.
- 4, -> Amount of Planes.
- 0, -> Amount of colours.
- 0, -> Palette (remap).
- LORES OR COL12BIT, -> Screen mode.
- ILBM, -> Destination.
- 0, -> Parameters.
- 'GAMESLIB:data/IFF.Pic640x256'
- ]:picture;
-
- IF gmsbase := OpenLibrary('games.library',0)
- SetUserPrefs(0)
- IF (screen := AddScreen([TAGS,0,
- GSA_PALETTE,palette,
- GSA_SCRWIDTH,320,
- GSA_SCRHEIGHT,256,
- GSA_PICWIDTH,640,
- GSA_AMTCOLOURS,32,
- GSA_PLANES,4,
- GSA_SCRATTRIB,HSCROLL OR SPRITES OR NOSCRBDR,
- GSA_SCRMODE,LORES OR COL12BIT,
- GSA_SCRTYPE,ILBM,
- TAGEND]))
-
- loadpic.data := screen.memptr1;
- IF (LoadPic(loadpic) = ERR_OK)
- sparkie.data := SmartLoad('GAMESLIB:data/sparkie.raw',0,MEMF_CHIP)
- IF (sparkie.data)
- ShowScreen(screen)
- InitSprite(screen,sparkie)
- UpdateSprite(screen,sparkie)
- zbxy := ReadMouse(JPORT1)
-
- REPEAT
- zbxy := ReadMouse(JPORT1)
- IF (timer++ AND $1)
- IF (sparkie.frame = 5) THEN sparkie.frame := 0 ELSE sparkie.frame := sparkie.frame+1
- ENDIF
- sparkie.xpos := sparkie.xpos+getZBXYx(zbxy)
- sparkie.ypos := sparkie.ypos+getZBXYy(zbxy)
- IF (screen.picxoffset = 320) THEN direction := -2
- IF (screen.picxoffset = 0) THEN direction := 2
- screen.picxoffset := screen.picxoffset+direction
- MovePicture(screen)
- WaitSVBL()
- UpdateSprite(screen,sparkie)
- UNTIL !(zbxy AND MB_LMB)
-
- FreeMemBlock(sparkie.data);
- ENDIF
- ENDIF
- DeleteScreen(screen)
- ENDIF
- CloseLibrary(gmsbase)
- ENDIF
- ENDPROC
-
-