6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 4:57 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Jun 27, 2021 8:58 am 
Offline
User avatar

Joined: Wed Jul 01, 2020 6:15 pm
Posts: 79
Location: Germany
I thought I'd try a fractal plotting program as a demo for the 100 MHz 65F02 in my Apple II. A reasonably efficient implementation (fixed point? assembly core routines?) would be great as a starting point.

Bob Bishop's article in Call A.P.P.L.E. seems to have just what I am looking for (https://web.archive.org/web/20120307183 ... index.html). Is anyone aware of a machine-readable version of Bob's code, either as a "modern" text file or maybe as an Apple II disk image? I am ready to type in the code from the article if I have to -- vintage style ;-) -- but would not mind a shortcut.

Thanks!
Juergen


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 27, 2021 12:11 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
Not able to help with the machine code version, sorry, but some time back I did a simple BASIC one that I could use to check different BASICs - EhBASIC, CBM BASIC2 and BBC Basic. I think it might run on an Apple II under Applesoft unchanged, although the output would need an 80 column card to look good.

The output it produces is:

https://unicorn.drogon.net/mandel.txt

and that number; 48.21 is seconds that it took on my Ruby system running BBC Basic at 16Mhz. (A BBC Micro normally runs at 2Mhz). The run for EhBASIC and CBM Basic on the same hardware at 16Mhz is nearly double that at 78 seconds.

The source code is here:

https://unicorn.drogon.net/mandel.bas

So hoping it might run in about 12 seconds or so on your 100Mhz system which would be nice to see. (although IIRC Applesoft uses 5 byte FP while EhBASIC uses 4-byte, so possible a shade slower)

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 28, 2021 12:31 am 
Offline
User avatar

Joined: Thu Mar 11, 2004 7:42 am
Posts: 362
This post discusses an adaptation of Bishop's routines for the 65C816. Everything's in assembly, and there are some optimizations, though it's not a big deal if X0, DX, DY, and YY are calculated once at the beginning in BASIC.

viewtopic.php?f=2&t=2243

Code and documentation can be found here:

http://biged.github.io/6502-website-arc ... mandel.htm


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 28, 2021 6:10 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Oh, I'm glad I didn't dive in to say I couldn't find a trace of Bishop's code! Thanks Bruce.

(I did feed the posted link into the Wayback Machine to get a free OCR, but as is often the case, the OCR failed pretty miserably on the code sections. There might be a way to pre-process the images to get a better result.)

For a couple of different approaches, search for David Given's Bogomandel. The crux of Mandelbrot is the squaring of a complex value - table-driven multiplication can be very fast, but there are many ways to tackle the problem. Two things worth noting, one is that Mandelbrot, despite appearances, is very much a fixed-point application and not a floating-point one. The other is that squaring is inherently a bit simpler and can be made a bit faster than multiplication. But the linked thread and article go into this.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 28, 2021 6:32 am 
Offline

Joined: Tue Apr 20, 2010 4:02 pm
Posts: 34
A friend of mine recently programmed nice Mandelbrot fractal generator in assembler for Atari 8bit.
You can download it for testing here:

http://flop.atariportal.cz/frames.htm

The software name is FRACTARI.COM. There is an english manual too.

I may be able to get you source codes for this.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 28, 2021 6:40 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
(Source code would always be very welcome!)


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 28, 2021 8:51 am 
Offline
User avatar

Joined: Wed Jul 01, 2020 6:15 pm
Posts: 79
Location: Germany
Thank you all! Those are some great leads.

I just realized that I will need to take a slight detour, unfortunately: They keyboard of my old Apple II has began to really act up. This seems to be beyond the level of flaky key contacts (of which it has a few), but rather encoder-related -- various keys stop and restart working over the course of minutes or hours. So some hardware debugging is in order before any meaningful typing can happen...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: