Nice one! I loved hand rolling rasterisers, clippers, 8 bit maths routines. Such a nice time.
Nice one! I loved hand rolling rasterisers, clippers, 8 bit maths routines. Such a nice time.
Yeah, it's all coming back to me, with the adding luxury of 30-odd years experience. I've more or less caught up with where I was back in the day now.
It all comes flooding back doesn’t it? It’s so much easier the second time around - experience is a wonderful thing! Looking good!
The one thing you know, when you finish a project, is how you *should* have done it...
Do you write the assembler from scratch, "hand compile" into assembler, or get the C compiler to output assembler and optimise that?
I usually write the assembler from scratch, once the basic principles have been proved in C.
I'm also very impressed by z88dk - I never thought I'd be happy using a C compiler for Z80. Maybe developing the original Agon MOS changed my opinion. Yes, I know the Agon is running on an eZ80, yet the CPU is only slightly more optimised for C.
I wish I'd gone completely over to C programming during the early 16 / 32 bit era. I might have got some finished projects to my name, admittedly at the expense of (quite a lot of) performance.
I often hit roadblocks when developing assembly language code trying to optimising it as I go. C breaks that habit. I just write working code, optimise it, then fine tune in assembler.
I consciously summarized that (even if only working in 'C') as: "It's easier to make working code fast than to make fast code work"
I only really started using C whilst developing on the first PlayStation. We also had Borland C for PC so it kind of made sense to write our tooling in C too.
Righto, all the tricky bits in the clipping routine are now in Z80 assembler. The only thing left is the loop and some conditional branching. Should be easy converting that to Z80. Must admit this workflow of write it quick, optimise later is working really well. It's how I coded on the Playstation.
The Cohen-Sutherland clipping algorithm uses a function to quickly determine if a line can be drawn as-is, can be ignored, and if it needs to be clipped, the point of interest. This is it in C, compared to the rewrite in Z80. It should run quicker.
I didn't know it had a posh name. We always called it "outcoding"
I may have picked up that terminology from this book.
That book lived on my desk...I guess I hadn't ever put two and two together. (It also started a lifelong fascination with Vermeer)
My code clearly has ideas above its station.
Oh lol not at all! Any amount of junk learned by word of mouth at Argonaut in 1996 is probably not canonical hahah
Hahaha! I think Argonaut have earned their 3D stripes, so they can pretty much call it what they want.
I guess? Lol. I learned from some super smart people anyway. Lucky me 😊
That’s cool! I never did any 3D stuff at all, never mind on 8-bit. Is that running on a Next at 3.5Mhz?
No it’s running flat out. 28Mhz? There’s plenty of scope for increasing the speed yet. The trig functions for example.
Well if you ever release the C or asm it'd be interesting to poke at.
I'll have to see what I can do. I was only really intending on using the C as a scratchpad as I moved it all to assembler. It will probably still be a library that's callable from C.
heh, NP. Maybe I should just do my own, for make great learnings :)
Noice 😎👍🏻
While there, what about Elite natively compiled for the Psion 3a...? 😉