/* 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, sparkmem:LONG palette := [ $000000,$400000,$500010,$500010,$600010,$700010,$700010,$800010, $900010,$A00010,$B00020,$403020,$C0C000,$F00000,$201010,$808000, $10C020,$005000,$B000B0,$600060,$F02000,$901000,$B0B0B0,$F0F0F0, $00B0F0,$006080,$506080,$90B0F0,$F0F000,$E0E000,$B0A000,$504000 ]:LONG; IF gmsbase := OpenLibrary('GMS:GPI/Master.GPI',0) SetUserPrefs(0) IF (screen := AddScreen([TAGS_GAMESCREEN,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, GSA_SCRTYPE,ILBM, TAGEND])) IF (loadpic := LoadPic([TAGS_PICTURE,0, PCA_DATA,screen.memptr1, PCA_WIDTH,640, PCA_HEIGHT,256, PCA_PLANES,4, PCA_FILE,'GMS:demos/data/PIC.Pic640x256', TAGEND])) IF (sparkmem := SmartLoad('GMS:demos/data/RAW.Sparkie',0,MEMF_CHIP)) IF (sparkie := InitSprite(screen,[TAGS_SPRITE,0, SPA_DATA,sparkmem, SPA_XCOORD,150, SPA_YCOORD,150, SPA_WIDTH,16, SPA_HEIGHT,21, SPA_AMTCOLOURS,16, SPA_COLSTART,16, SPA_PLANES,2, SPA_SCRMODE,LORES, SPA_ATTRIB,XLONG, TAGEND])) ShowScreen(screen) UpdateSprite(screen,sparkie) InitJoyPorts() 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) WaitVBL() UpdateSprite(screen,sparkie) UNTIL !(zbxy AND MB_LMB) FrSprite(sparkie) ENDIF FreeMemBlock(sparkmem) ENDIF FreePic(loadpic) ENDIF DeleteScreen(screen) ENDIF CloseGMS() ENDIF ENDPROC