a thing that puzzles me is how https://bbcmic.ro/?t=9ctpk is only 4× faster in emulation (about 30 seconds per scan line and so on the order of 2 hours for the whole image) i'm running this on a ryzen 5 3500u at 2400 megahertz. the acorn electron which supposedly takes 8 hours and 40 minutes is a 1 megahertz 6502 when running from ram, roughly, 262144 instructions per second. at 2 ipc one core of the ryzen should be…
The rocket ship icon seems to have disappeared. Maybe I used it too much, or maybe the site owner removed it? (was it serverside and overloaded?)
BBC BASIC raytracer in 432 characters
71–80 of 96 posts
Re: BBC BASIC raytracer in 432 characters
#72Earlier quoted context omitted.
that's astounding; i would have guessed months or years
I recreated a mandlebrot zoom I saw in a library book in bbc basic and the last image took two weeks. I had 8 of them saved on a floppy and that would slideshow them for a 2fps "movie"
Re: BBC BASIC raytracer in 432 characters
#73In the replies underneath, someone ran it on a real Acorn Electron computer (6502 at 1 MHz), where it completed in 8 hours and 40 minutes. Not too bad really.
I wonder how much of that it spent just computing those square roots.
Intel's optimization manual has suggestions for fast versions at 15.12.3 (recommended by @James https://stackoverflow.com/a/2637823/10981777) Don't look especially long to implement for 22-bit approximation.
https://software.intel.com/content/www/us/en/develop/downloa...
Also, what's the SQRD? Not finding that referred to anywhere.
Re: BBC BASIC raytracer in 432 characters
#74Earlier quoted context omitted.
I wonder how much of that it spent just computing those square roots.
Does anybody happen to know what SQR algorithm BBC Basic uses? http://www.bbcbasic.co.uk/bbcwin/manual/bbcwin7.html#printha... does not seem to have the actual algorithm. Intel's optimization manual has suggestions for fast versions at 15.12.3 (recommended by @James https://stackoverflow.com/a/2637823/10981777 ) Don't look especially long to implement for 22-bit approximation. https://software.intel.com/content/www/u…
Re: BBC BASIC raytracer in 432 characters
#75In 398 characters, I can give it error diffusion dithering capabilities, which makes the code smaller and the output quality a bit better: https://bbcmic.ro/#%7B%22v%22%3A1%2C%22program%22%3A%22MODE1... It would look even better with bidirectional error diffusion, but that requires reading back memory which I don't know how to do.
Re: BBC BASIC raytracer in 432 characters
#76In 398 characters, I can give it error diffusion dithering capabilities, which makes the code smaller and the output quality a bit better: https://bbcmic.ro/#%7B%22v%22%3A1%2C%22program%22%3A%22MODE1... It would look even better with bidirectional error diffusion, but that requires reading back memory which I don't know how to do.
Thanks for sharing. I asked ChatGPT to analyze your code, while telling it what it does. How well do you think it did? Did it make any mistakes? https://chat.openai.com/share/6e754fa1-531d-432e-a767-8c8132...
Re: BBC BASIC raytracer in 432 characters
#77Earlier quoted context omitted.
all the basics i used on processors that slow were surprisingly inefficient, even for an interpreted languages i thought they had to be, running on processors with that little memory. though later on i learned about forth, which is surprisingly efficient for an interpreted language a more likely explanation is that sophie wilson was just a better hacker than bill gates and paul allen
Yeah, BBC BASIC is really good. Both the language design and the implementation. I loved it at the time, and the more I think back on it the more impressed I am. Like it had a very decent suite of floating-point routines, which if I remember right were very performant. In a 32KB ROM!
Re: BBC BASIC raytracer in 432 characters
#78Earlier quoted context omitted.
Does anybody happen to know what SQR algorithm BBC Basic uses? http://www.bbcbasic.co.uk/bbcwin/manual/bbcwin7.html#printha... does not seem to have the actual algorithm. Intel's optimization manual has suggestions for fast versions at 15.12.3 (recommended by @James https://stackoverflow.com/a/2637823/10981777 ) Don't look especially long to implement for 22-bit approximation. https://software.intel.com/content/www/u…
SQRD is just SQR D :)
What a nightmare to read though if you don't know what it's supposed to be written like. Is it a: "FORM=" or a "FOR M=" ? Is it: "S GNU:G", "SG NU:G", "SGN U:G"? SQRD totally looks like some special kind of square root implementation.
Re: BBC BASIC raytracer in 432 characters
#79In 398 characters, I can give it error diffusion dithering capabilities, which makes the code smaller and the output quality a bit better: https://bbcmic.ro/#%7B%22v%22%3A1%2C%22program%22%3A%22MODE1... It would look even better with bidirectional error diffusion, but that requires reading back memory which I don't know how to do.
Re: BBC BASIC raytracer in 432 characters
#80Earlier quoted context omitted.
SQRD is just SQR D :)
Thanks. So much more of that code makes sense now. IFD, SGNU, FORN, FORM. FORM especially. So many codes now have the word FORM as a special word. What a nightmare to read though if you don't know what it's supposed to be written like. Is it a: "FORM=" or a "FOR M=" ? Is it: "S GNU:G", "SG NU:G", "SGN U:G"? SQRD totally looks like some special kind of square root implementation.