tag:blogger.com,1999:blog-5343147845038027993.post2070889226620571992..comments2023-10-18T02:41:39.785-06:00Comments on Semi-Original Thought: How to simply create the Mandelbrot set on the Commodore 64Joseph Deweyhttp://www.blogger.com/profile/07043299863249381802noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5343147845038027993.post-86567845794949941052017-04-06T10:12:06.896-06:002017-04-06T10:12:06.896-06:00Wow! EgonOlsen, your project is really cool!Wow! EgonOlsen, your project is really cool!Joseph Deweyhttps://www.blogger.com/profile/07043299863249381802noreply@blogger.comtag:blogger.com,1999:blog-5343147845038027993.post-9336090367117296052016-12-16T00:26:04.444-07:002016-12-16T00:26:04.444-07:00Nice little program. I added as a test case to my ...Nice little program. I added as a test case to my BASIC V2-compiler-for-Java-project (which can be found here: https://github.com/EgonOlsen71/basicv2 )<br />Albeit that thing isn't an emulator, i.e. it doesn't actually display graphics and such, I added the option to save the rendered image to disk.<br />It runs approx. 60.000 times faster than an actual C64 on a 4Ghz machine and still approx. 4000 times faster than VICE in warp mode on the same machine.EgonOlsenhttps://www.blogger.com/profile/00302208575520268640noreply@blogger.comtag:blogger.com,1999:blog-5343147845038027993.post-15350294018963243152014-06-20T15:27:49.595-06:002014-06-20T15:27:49.595-06:00This is so amazingly cool! Thank you so much for a...This is so amazingly cool! Thank you so much for adding to my code, and making this so awesome!!!Joseph Deweyhttps://www.blogger.com/profile/07043299863249381802noreply@blogger.comtag:blogger.com,1999:blog-5343147845038027993.post-10156007446177429662013-11-28T23:32:04.131-07:002013-11-28T23:32:04.131-07:00I improved my color code, and creating a post: htt...I improved my color code, and creating a post: http://grahamsneurons.blogspot.com/2013/11/commodore-64-mandelbrot-in-color.htmlAnonymoushttps://www.blogger.com/profile/05186281020775460099noreply@blogger.comtag:blogger.com,1999:blog-5343147845038027993.post-60317410154117383942013-11-28T22:07:57.988-07:002013-11-28T22:07:57.988-07:00I added multicolor hi-res support, in 4-color glor...I added multicolor hi-res support, in 4-color glory! Also, some machine code to erase the hi-res screen, which saves a lot of time before anything interesting happens.<br /><br /> 100 xl =-2.000:xu =0.500<br /> 110 yl =-1.100:yu=1.100<br /> 115 reps =20<br /> 120 width =160:height =200<br /> 130 xinc =(xu -xl)/width<br /> 140 yinc =(yu-yl)/height<br /> 200 rem main routine<br /> 205 print "{clr}"<br /> 207 gosub 500<br /> 210 for j = 0 to height - 1<br /> 220 : for i = 0 to width -1<br /> 230 gosub 300<br /> 231 gosub 600<br /> 240 next i<br /> 250 next j<br /> 290 get a$: if a$ = ""then 290<br /> 299 goto 700<br /> 300 rem calculate mandelbrot<br /> 310 ismnd =-1<br /> 312 nreal = xl + i * xinc<br /> 313 nimg = yl + j * yinc<br /> 315 rz = 0:iz = 0<br /> 316 r2z = 0:i2z = 0<br /> 320 for k = 1 to reps<br /> 330 r2z=rz*rz-iz*iz<br /> 340 i2z=2*rz*iz<br /> 350 rz=r2z+nreal<br /> 360 iz=i2z+nimg<br /> 370 if(rz*rz+iz*iz)>4 then ismnd=0:goto395<br /> 390 next<br /> 395 if k<8 then c=3:return<br /> 396 if k<12then c=2:return<br /> 397 if k<16then c=1:return<br /> 398 c=0<br /> 400 return<br /> 500 rem clear screen<br /> 530 poke 53272, 29:poke 53265, 59<br /> 531 poke53270,peek(53270)or16<br /> 532 poke 53280, 0<br /> 541 gosub 800<br /> 549 rem set screen colors to grays<br /> 550 for r=1024 to 2023:poke r,207:next<br /> 560 for r=55296to56295:poke r,1:next<br /> 599 return<br /> 600 rem draw hires<br /> 610 p =8192 + int(j/8)*320 +int(i/4)*8+(j and7)<br /> 625 lb=2^(7-(1+2*(iand3)))<br /> 626 hb=2^(7-(2*(iand3)))<br /> 630 if c=1 then pokep,peek(p)or lb<br /> 640 if c=3 then pokep,peek(p)or lb<br /> 650 if c=2 then pokep,peek(p)or hb<br /> 699 return<br /> 700 rem return to normal<br /> 705 poke 53280, 14<br /> 740 poke 53272,21:poke 53265,27<br /> 750 poke 53270,peek(53270)and239<br /> 760 end<br /> 799 rem some machine code to erase the hires screen<br /> 800 for i= 0to 20:read a:poke 49152+i, a:next<br /> 810 data 169,0,162,32,160,0,132,33,134,34,145,33,200,208,251,232,224,64,208,244<br /> 815 data 96<br /> 820 sys49152<br /> 830 return<br />Anonymoushttps://www.blogger.com/profile/05186281020775460099noreply@blogger.com