tag:blogger.com,1999:blog-4757118446768919900.post5038202603764732761..comments2023-03-30T01:53:44.203-07:00Comments on Retro Programming: Divide and Conquer Line Algorithm for the ZX SpectrumJohn Metcalfhttp://www.blogger.com/profile/09108374348083307900noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-4757118446768919900.post-80437399152423039812016-09-22T00:38:39.675-07:002016-09-22T00:38:39.675-07:00Ah, I've just worked out that setting the last...Ah, I've just worked out that setting the last 3 bits and adding one is probably like rounding the X co-ordinate up to the next multiple of 8. Maybe that's something to do with the X axis having 8 pixels to each screen byte? Am I getting warmer?<br /><br />Though if you're trying to use as few bytes as possible (to pack as much game as possible into a 16K Spectrum?) a simple CALL to ROM would only be 3 bytes. That's a lot less than all this "Round up and divide by the number you first thought of" stuff.<br />solar penguinhttps://www.blogger.com/profile/00728740139045059913noreply@blogger.comtag:blogger.com,1999:blog-4757118446768919900.post-85284007540181481172016-09-21T06:55:46.629-07:002016-09-21T06:55:46.629-07:00That PLOT: routine pretty much sums up why I never...That PLOT: routine pretty much sums up why I never managed to learn machine code. It's easy to learn what all the instructions do on their own, but when they get put together, they just become a jumble.<br /><br />You set the last three bits of the X co-ordinate and add one to it, for some reason. And then it gets really weird when you move on to the Y coordinate. I think "rra, scf, rra, or a, rra" might mean something like "divide by 8 then add 64" but when you Xor it with the number you first thought of, then And it with something else, and Xor it with the number you first thought of once again, my brain just turns to mush.<br /><br />How does anyone follow all that, let alone understand it enough to write it?<br />solar penguinhttps://www.blogger.com/profile/00728740139045059913noreply@blogger.comtag:blogger.com,1999:blog-4757118446768919900.post-52333378273156385882016-08-29T09:11:23.511-07:002016-08-29T09:11:23.511-07:00Hi John,
Do you know where I can find an implemen...Hi John,<br /><br />Do you know where I can find an implementation of the Bresenham line drawing in Z80? I'm not too bothered about the size of the code, I'm just trying to understand how to do it correctly, :)Polominthttps://www.blogger.com/profile/02965216664073695801noreply@blogger.comtag:blogger.com,1999:blog-4757118446768919900.post-48056251708546627302016-05-29T13:27:08.556-07:002016-05-29T13:27:08.556-07:00Fantastic work! Thanks for sharing, if I had a ZX ...Fantastic work! Thanks for sharing, if I had a ZX Spectrum, I'd definitely try this out. :)Leland Greenhttps://www.blogger.com/profile/13478516804501370814noreply@blogger.com