BASIC problem?

Started by ComSoft6128, 12:20, 04 February 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ComSoft6128


This is a type-in from the December 1990 issue of Amstrad Action.

I've entered different values into this program a few times with the same result - flashing screens and bugger all else.

Now I think the program is fine but the problem is of the "Garbage In/Garbage Out" type - any idea what values I should input?



https://www.youtube.com/watch?v=YJSg0ESE6KE


SerErris

Can you please attach the code file here ? I can have a look into it.


I think there are bugs in the code. Unfortunately because of the transfer standards at that time that is pretty normal, that there are bugs in the code and you cannot actually run it.


Also do you know what CPC version it has been coded for?
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Okay I checked it. I think it is actually doing what it is supposed to do.


1st I would either turn color cycle of, or turn it to "aftter". That will remove the anoying flickering and you can actually see what the program is dooing.


This is either menu option 6 or 7.


2nd you need to enter values, where you actually can see something.


A good starting point is:


left -2.5
bottom -1.2
zoom 0.01 ..


The zoom is strange and I do not understand. smaller values = larger zoom ... pretty much unituitve if you ask me.


Also even if the Amstrad Arcade writes about it:
"Although it's certainly quicker than most, you'll still have time to take the dog for a three-mile walk while you leave the computer to it."

Actually that is by far the slowest implementation I have ever seen, and that is caused by the massive amount of ifs and gosubs inside of the main calculation loop. That does not make it fast.

I think, the idea the author had in duing a quick run with only each 4th pixel painted and even accellerate the other pixels is pretty brilliant, but he is wasting so much time in the code ... it hurts my eyes... and doing the color cycling in between each pixel makes it even worse (from a eye cancer and timing perspective).

Hope that helps.

A much better version can be found in another magazin (unfortunately german) here: http://www.homecomputerworld.at/magazine/cpc/CPCAI-86-07.pdf

However it is a mixture of machine code and basic ... not sure what they use the machine code for .. but not really for the rendering.

So the answer to your question is:
No you Basic is okay :-) The program with the weird color cycling is strange...
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Crazy what the outcome can be  8)

Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

eto

Quote from: SerErris on 23:35, 22 February 22Crazy what the outcome can be 

Wow... so this little BASIC program also enhances resolution and colour palette??? Nice!

;-)

SerErris

#5
Yes and it took me since 1986 to finally render it.


I used my 512k memory expansion, calculated it in 24bit color (in memory) and then dumped it to 4 disks in 128kb chunks and then continued with the next part of the image ...


It took only 39 disks to store the image ...


The even more problematic part was to calculate the jpg from it ...


I was shifting the disks in and out .. phew ... and I was lucky that over the total time of the calculation I did not got into any read error because of the aging of the disks ...
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

SerErris

Unfortunately due to the forum upgrade my last post vanished in between the upgrade (took me too long to write it).

In essence as this is getting addictive I did another one ... Waaa I cannot attach any pictures anymore ...  :o

Mandelbrot Image

Okay short version.

I did a new mandelbrot in a new tool call Quickman ... at the limit of precision (Double) I got the following parameters:
Real -0.7249875262958687
Imag 0.3575832669937741
Mag 3525843434384.286100

Size 3840x2160
Time 17.400s
Iters/s 2.426e+004M (218.30 GFlops)

So Zoom Factor is actually 3.5*10^12 ...

The number of iterations is 262144 (VGA colours by chance :-) ).

The image renter time took 17.4 seconds with a speed of 218.30 GFlops.

Lets set that into perspective with the CPC:

A CPC can calculate 375 48bit float multiplications in Basic. So that is 357 flops.

In relation that is then my CPU is 610.3 Million times faster. (12 Core AMD 5900x). Also it is a 64bit CPU and actually does double precision floats (64bit). The CPC is doing 48bit floats which is between single and double precision.

Let us assume that the CPC can do doubles with 357 flops.

It would take the CPC 10.625*10^10 seconds (10.6 billion seconds)  or 336 years.

So if you would get out your 336 CPCs you would actually be able to calculate this fantastic picture in all its glory within a year or two.

It is so funny to play with numbers ...

The power consumption for the CPC to render this would be:

5W*2.951.447h=14.757MWh ... 
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

Powered by SMFPacks Menu Editor Mod