13 ms·
First program I ever wrote on a Sinclair Spectrum was to spin a disk on the screen. I was disappointed with the performance, so for the second program I precal
by speakeron 7y ago
First program I ever wrote on a Sinclair Spectrum was to spin a disk on the screen.
I was disappointed with the performance, so for the second program I precalculated the sin/cos values and stored them in an array (and learnt that all programming is an exercise in caching).
I was still disappointed with the performance, so the third program I wrote was a hex loader so I could poke machine code straight into it (had to run down to the local electronics store to pick up copy of the Z80 assembler manual). I then was happy with the speed.
That kickstarted a career in software development which I still derive immense enjoyment from.
- alok-g 7y agoOh my! Your story is a very significant overlap with mine! I started programming at an age of 11 years, when I did not even know the meaning of sin and cos. The spinning 3D ring I had created was slow like yours, speeded up by caching sin and cos values like yours. The final one had entire frames precomputed in memory and cycled by hand-written machine code into the video memory space. That last one was when I was when 14 years of age.