A miracle when it works first time!

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
Cosmium
Berk
Posts: 28
Joined: Tue Dec 04, 2018 10:20 pm
Location: USA

Re: A miracle when it works first time!

Post by Cosmium » Thu Aug 29, 2019 10:40 pm

Turtle_Quality wrote:
Thu Aug 29, 2019 8:06 pm
For vertical clipping , if you use a lookup table to get the address of each row, you point rows 192-255 to somewhere harmless, ROM for instance. That way there is no loss of speed. I assume you hold the y address in a single byte so -1 would be 255.
Hey, that's an elegant solution!

Though I think it's handy to calculate ahead of time how many lines of the clipped sprite to draw. That way you can avoid drawing more than necessary as you would if you "blindly" wrote data into ROM over the course of the full sprite height.
0 x

User avatar
Cosmium
Berk
Posts: 28
Joined: Tue Dec 04, 2018 10:20 pm
Location: USA

Re: A miracle when it works first time!

Post by Cosmium » Fri Aug 30, 2019 6:32 pm

So I finished writing the part where the sprite should gracefully exit the bottom of the screen. Gave it a test and sure enough there were no "it works first time" miracles on display here either. Just an encore fireworks display! :)

Image

Luckily it was an easy fix and a silly mistake (aren't they always?!). I'd incorrectly assumed a register had a certain value in it after copying and pasting code. Ugh :roll:

I wonder what percentage of programming bugs are due to unfounded assumptions..
0 x

User avatar
R-Tape
Site Admin
Posts: 2357
Joined: Thu Nov 09, 2017 11:46 am

Re: A miracle when it works first time!

Post by R-Tape » Sat Aug 31, 2019 5:58 am

Ast A. Moore wrote:
Thu Aug 29, 2019 9:20 pm
Yup, even the release version of Exolon has a similar bug.
And so does Rallybug, or at least the paid-for version does. There's very few opportunities to actually reach the outer limits, but it's happen to me.
0 x

User avatar
Ast A. Moore
Dynamite Dan
Posts: 1134
Joined: Mon Nov 13, 2017 3:16 pm

Re: A miracle when it works first time!

Post by Ast A. Moore » Sat Aug 31, 2019 11:34 am

R-Tape wrote:
Sat Aug 31, 2019 5:58 am
Ast A. Moore wrote:
Thu Aug 29, 2019 9:20 pm
Yup, even the release version of Exolon has a similar bug.
And so does Rallybug, or at least the paid-for version does. There's very few opportunities to actually reach the outer limits, but it's happen to me.
What’s that, you say? A bug in Rallybug? Figures. :lol:
0 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

User avatar
Cosmium
Berk
Posts: 28
Joined: Tue Dec 04, 2018 10:20 pm
Location: USA

Re: A miracle when it works first time!

Post by Cosmium » Wed Sep 11, 2019 3:42 am

Capture of the latest amusing bug while optimising my sprite routine. Think it needs a bit more of work. ;)

Funny how tiny and seemingly innocuous changes in the code can lead to such graphic disaster!

Image
0 x

Post Reply