4 ms·
Ah 6502 arithmetic... Back in 1984 I wrote a 3D graphics toolkit for the VIC20 in 6502 assembler. Starting with fixed point multiply, then my own floating point
by stevesimmons 8y ago
Ah 6502 arithmetic... Back in 1984 I wrote a 3D graphics toolkit for the VIC20 in 6502 assembler. Starting with fixed point multiply, then my own floating point format, then floating point arithmetic functions, including transcendentals. From there I added 3D to 2D perspective and orientation transforms. And finally Bressingham's line drawing algorithm, clipping, etc.
I was 14 at the time. Wrote the code in exercise books on a Christmas camping holiday and then typed it in when I got home. After a couple of weeks' debugging during the January summer school holidays, it all worked.
Kids nowadays don't know how easy they have it. Clone a Github repo... Pfffff !
- ashleyn 8y agoYeah but that was very rewarding in its own way. Every line of code you wrote was your own and you really learned more that way. I'm currently going through the theory on Scratchapixel to see how OpenGL actually works.
- stevesimmons 8y agoYup. And once it was finished, I never used it, but moved on to my next challenge. That was robotics, using car windscreen wiper motors, which had incredible amounts of torque :)
- scotty79 8y agoHow did it go? I had idea to use two wiper motors connected to arm through springs for each join to get variable stiffness joints. Wiper motors are especially good for that because they have worm gear so thry don't have to use energy to keep springs tensioned.
- fallat 8y agoSo obviously this is impressive for a 14 year old in 1984. What were your sources of information? What was your line of learning? It's very interesting not only that you were able to do this, but the path that led you to being able to do it. 14 year olds don't just re-discover years of work in their heads. Thank you!!
- stevesimmons 8y agoGood questions! I had two starting points: a) I won the VIC20 as a prize in a science competition age 13. I started with BASIC, discovered PEEK and POKE, and then saved up my pocketmoney for the Assembly Language cartridge. I was intrigued by the ROM and copied the entire disassembly into exercise books to figure out how it worked (printers were too expensive back then!). I reverse engineered the arithmetic routines, from which I discovered floating point representation's mantissas and exponents. b) I expect the graphics transformations came from Mathematical Elements for Computer Graphics, by David Rogers and James Adams (McGraw-Hill, 1976), which I would have found in the library at my mum's work. Her work was opposite my school and I often killed an hour or two in the computer section reading back issues of Byte magazine waiting for her to drive me home. I think that was the book because prompted by your question, I just found Rogers' 1988 update Procedural Elements for Computer Graphics in my bookshelf. The price sticker inside the cover says '1/89 $41.99'. That shows I bought it with the money earned from my first university holiday job in Dec 1988/Jan 1989. That was at the research labs of BHP Billiton, the Australian mining company, where I designed and built the electronics for a 32-channel channel data logger for a steel rolling mill, and taught myself C and wrote the data acquisition and display software.