home *** CD-ROM | disk | FTP | other *** search
- -> This is a Mandel generator from the Amiga E archive (which was converted
- -> from Oberon) and is now converted to work with GMS.
-
- MODULE 'games','games/games'
-
- CONST ITERDEPTH=50 ->This constant defines the detail of the mandel.
-
- /*=========================================================================*/
-
- PROC main()
-
- DEF screen:PTR TO gamescreen,zr,zi,ar,ai,dr,di,sr,si,st,x,y,i
-
- IF gmsbase := OpenLibrary('games.library',0)
- SetUserPrefs('Mandel Generator v1.0')
- IF (screen := AddScreen([TAGS,0,
- GSA_SCRWIDTH,640,
- GSA_SCRHEIGHT,512,
- GSA_AMTCOLOURS,16,
- GSA_SCRMODE,HIRES OR COL12BIT OR LACED,
- TAGEND]))
-
- x:=256/screen.amtcolours*2
- FOR i:=0 TO screen.amtcolours-1 DO UpdateRGB12(screen,i,(Shr(i*x,4) OR (i*x)))
-
- sr := $400000/screen.scrwidth -> shrink horiz
- si := $300000/screen.scrheight -> shrink vert
- st := $140000*-2 -> move side
- zi := $160000 -> move up
-
- ShowScreen(screen)
-
- FOR y:=screen.scrheight-1 TO 0 STEP -1
- IF (ReadMouse(JPORT1) AND MB_LMB) THEN JUMP end
- zi := zi-si
- zr := st
- FOR x:=0 TO screen.scrwidth-1
- i := 0
- ar := zr
- ai := zi
- REPEAT
- dr := Shr(ar,10)
- di := Shr(ai,10)
- ai := dr*2*di+zi
- dr := dr*dr
- di := di*di
- ar := dr-di+zr
- i++
- UNTIL (i>ITERDEPTH) OR (dr+di>$400000)
- DrawPixel(screen,BUFFER1,x,y,Mod(i,screen.amtcolours))
- zr:=zr+sr
- ENDFOR
- AutoSwitch()
- ENDFOR
- WaitLMB()
-
- end:
- DeleteScreen(screen)
- ENDIF
- CloseLibrary(gmsbase)
- ENDIF
- ENDPROC
-
-