RC2014 basic mandelbrot set and simulator

268 views
Skip to first unread message

n.a.m...@gmail.com

unread,
Jul 3, 2016, 2:35:39 PM7/3/16
to rc201...@googlegroups.com
Hi all,

I've been testing my RC2014 using a small basic program that displays
the mandelbrot set.
Perhaps others will find it fun too.

I've also been working on a simulator/debugger for windows which I will
release shortly!
Preview here: https://www.youtube.com/watch?v=JRQ-znMCTGc

Regards,
Niels.

10 MAXITER=20
20 LET C$=" .,'~!^:;[/<&?oxOX# "
30 FOR Y=-39 TO 39
40 FOR X=-39 TO 39
50 CREAL=X/20
70 CIMAG=Y/20
80 ZREAL = CREAL
90 ZIMAG = CIMAG
95 COUNT = 1
100 ZM = ZREAL*ZREAL
105 ZN = ZIMAG*ZIMAG
107 ZL = ZM+ZN
110 IF ZL>4 THEN GOTO 170
120 ZR2=ZM-ZN+CREAL
130 ZIMAG=ZREAL*ZIMAG*2+CIMAG
140 ZREAL=ZR2
150 COUNT=COUNT+1
160 IF COUNT<MAXITER THEN GOTO 100
170 PRINT MID$(C$,1+COUNT,1);
180 NEXT X
185 PRINT ""
190 NEXT Y
200 END

n.a.m...@gmail.com

unread,
Jul 3, 2016, 2:48:00 PM7/3/16
to rc201...@googlegroups.com

Funny thing is, my simulator produces the wrong output :)
There must still be something wrong with the Z80 library.
I tried two, one is libz80, the other is z80ex. The first won't even
produce any output,
the latter produces the output seen in the video. Oh well..

/Niels.

Spencer Owen

unread,
Jul 3, 2016, 2:55:17 PM7/3/16
to rc201...@googlegroups.com
That code runs the same on Scotts RC2014sim (At least, it produces same output as the video).  I will give it a go on the real hardware shortly.

Spencer

--
You received this message because you are subscribed to the Google Groups "RC2014-Z80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rc2014-z80+...@googlegroups.com.
To post to this group, send an email to rc201...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rc2014-z80/8c0462ef-4077-d256-e490-ceb9773538de%40gmail.com.

For more options, visit https://groups.google.com/d/optout.

n.a.m...@gmail.com

unread,
Jul 3, 2016, 2:56:13 PM7/3/16
to rc201...@googlegroups.com

Strange, might it be a bug in Basic then?

n.a.m...@gmail.com

unread,
Jul 3, 2016, 3:04:54 PM7/3/16
to rc201...@googlegroups.com
Hi Spencer,

Thanks for checking!

There is certainly something strange going on. I think the floating point precision of the basic interpreter is too low for this kind of work. The other problem is a small bug in my basic program; maxiter should be 19.

A C version running on the PC produces this:

...............................,,,,,,,,,,,,,,,,,...............................
...........................,,,,,,,,,,,,,,,,,,,,,,,,,...........................
........................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,........................
......................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,......................
....................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....................
..................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..................
.................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.................
...............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...............
..............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..............
.............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.............
............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,............
...........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...........
..........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..........
.........,,,,,,,,,,,,,,,''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.........
........,,,,,,,,,,,,''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,........
.......,,,,,,,,,,''''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.......
.......,,,,,,,''''''''''''''''''~~~~!~~~''''',,,,,,,,,,,,,,,,,,,,,,,,,,,.......
......,,,,,,,''''''''''''''''~~~~~! ;!!~~~'''',,,,,,,,,,,,,,,,,,,,,,,,,,,......
.....,,,,,,''''''''''''''''~~~~~~!^;&^^!~~~~'''',,,,,,,,,,,,,,,,,,,,,,,,,,.....
.....,,,,,''''''''''''''''~~~~~~!!^:<[< !~~~~'''',,,,,,,,,,,,,,,,,,,,,,,,,.....
....,,,,''''''''''''''''~~~~~~~!!!:;/ /:^!~~~~''''',,,,,,,,,,,,,,,,,,,,,,,,....
....,,,''''''''''''''''~~~~~~~!!!^;[  <;^!!~~~~''''',,,,,,,,,,,,,,,,,,,,,,,....
...,,,''''''''''''''''~~~~~~~!!!^< x  #O:!!!~~~~''''',,,,,,,,,,,,,,,,,,,,,,,...
...,,''''''''''''''''~~~~~~~!!^^:;o    #;^!!!!~~'''''',,,,,,,,,,,,,,,,,,,,,,...
..,,,'''''''''''''''~~~~~~!!^^^::[      ;:^^!!!~~''''',,,,,,,,,,,,,,,,,,,,,,,..
..,,''''''''''''''~~~~~~!!^:;;;;[/o    ?/[;^^^#!~~''''',,,,,,,,,,,,,,,,,,,,,,..
..,''''''''''''''~~~~~!!!^:? &/          ? ;;;x:!~'''''',,,,,,,,,,,,,,,,,,,,,..
.,,'''''''''''''~~~~!!!!^^:&  O            &oxOx!~'''''',,,,,,,,,,,,,,,,,,,,,,.
.,'''''''''''''~~!!!!!!^^^;/                   [!!~'''''',,,,,,,,,,,,,,,,,,,,,.
.,'''''''''''~~!!!!!!!^^^;o&                   :^!~'''''',,,,,,,,,,,,,,,,,,,,,.
.''''''''''~~!^^^!!!^^^::                     &:^!~~'''''',,,,,,,,,,,,,,,,,,,,.
,'''''''~~~!!:&:::::::::;<                    X[ !~~'''''',,,,,,,,,,,,,,,,,,,,,
,''''~~~~~!!^:x[[;&/;;;;/                       #!~~'''''',,,,,,,,,,,,,,,,,,,,,
'''~~~~~~!!!^:/O &? ?<[[<                      x;^~~''''''',,,,,,,,,,,,,,,,,,,,
''~~~~~~!!!!::[x      ?<?                      o;!~~~'''''',,,,,,,,,,,,,,,,,,,,
'~~~~~~!!!!^:;<#       xO                       :!~~~'''''',,,,,,,,,,,,,,,,,,,,
~~~~~~!!!^:X[/                                  ^!~~~'''''',,,,,,,,,,,,,,,,,,,,
~~~~~^^^^:;&?o                                 ;^!~~~'''''',,,,,,,,,,,,,,,,,,,,
!!^:;:^:;;/o                                  /:^!~~~'''''',,,,,,,,,,,,,,,,,,,,
                                             &;:^!~~~''''''',,,,,,,,,,,,,,,,,,,
!!^:;:^:;;/o                                  /:^!~~~'''''',,,,,,,,,,,,,,,,,,,,
~~~~~^^^^:;&?o                                 ;^!~~~'''''',,,,,,,,,,,,,,,,,,,,
~~~~~~!!!^:X[/                                  ^!~~~'''''',,,,,,,,,,,,,,,,,,,,
'~~~~~~!!!!^:;<#       xO                       :!~~~'''''',,,,,,,,,,,,,,,,,,,,
''~~~~~~!!!!::[x      ?<?                      o;!~~~'''''',,,,,,,,,,,,,,,,,,,,
'''~~~~~~!!!^:/O &? ?<[[<                      x;^~~''''''',,,,,,,,,,,,,,,,,,,,
,''''~~~~~!!^:x[[;&/;;;;/                       #!~~'''''',,,,,,,,,,,,,,,,,,,,,
,'''''''~~~!!:&:::::::::;<                    X[ !~~'''''',,,,,,,,,,,,,,,,,,,,,
.''''''''''~~!^^^!!!^^^::                     &:^!~~'''''',,,,,,,,,,,,,,,,,,,,.
.,'''''''''''~~!!!!!!!^^^;o&                   :^!~'''''',,,,,,,,,,,,,,,,,,,,,.
.,'''''''''''''~~!!!!!!^^^;/                   [!!~'''''',,,,,,,,,,,,,,,,,,,,,.
.,,'''''''''''''~~~~!!!!^^:&  O            &oxOx!~'''''',,,,,,,,,,,,,,,,,,,,,,.
..,''''''''''''''~~~~~!!!^:? &/          ? ;;;x:!~'''''',,,,,,,,,,,,,,,,,,,,,..
..,,''''''''''''''~~~~~~!!^:;;;;[/o    ?/[;^^^#!~~''''',,,,,,,,,,,,,,,,,,,,,,..
..,,,'''''''''''''''~~~~~~!!^^^::[      ;:^^!!!~~''''',,,,,,,,,,,,,,,,,,,,,,,..
...,,''''''''''''''''~~~~~~~!!^^:;o    #;^!!!!~~'''''',,,,,,,,,,,,,,,,,,,,,,...
...,,,''''''''''''''''~~~~~~~!!!^< x  #O:!!!~~~~''''',,,,,,,,,,,,,,,,,,,,,,,...
....,,,''''''''''''''''~~~~~~~!!!^;[  <;^!!~~~~''''',,,,,,,,,,,,,,,,,,,,,,,....
....,,,,''''''''''''''''~~~~~~~!!!:;/ /:^!~~~~''''',,,,,,,,,,,,,,,,,,,,,,,,....
.....,,,,,''''''''''''''''~~~~~~!!^:<[< !~~~~'''',,,,,,,,,,,,,,,,,,,,,,,,,.....
.....,,,,,,''''''''''''''''~~~~~~!^;&^^!~~~~'''',,,,,,,,,,,,,,,,,,,,,,,,,,.....
......,,,,,,,''''''''''''''''~~~~~! ;!!~~~'''',,,,,,,,,,,,,,,,,,,,,,,,,,,......
.......,,,,,,,''''''''''''''''''~~~~!~~~''''',,,,,,,,,,,,,,,,,,,,,,,,,,,.......
.......,,,,,,,,,,''''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.......
........,,,,,,,,,,,,''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,........
.........,,,,,,,,,,,,,,,''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.........
..........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..........
...........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...........
............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,............
.............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.............
..............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..............
...............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...............
.................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.................
..................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..................
....................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....................
......................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,......................
........................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,........................
...........................,,,,,,,,,,,,,,,,,,,,,,,,,...........................
...............................,,,,,,,,,,,,,,,,,...............................

This is still quite different than the RC2014 basic output.

/N.

Spencer Owen

unread,
Jul 3, 2016, 3:24:08 PM7/3/16
to rc201...@googlegroups.com
Either changing line 10 to MAXITER=19 or adding an extra space before the final quote marks on line 20 fixes it.

Spencer

Reply all
Reply to author
Forward
0 new messages