A miracle when it works first time!
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: A miracle when it works first time!
Lovely.
Waiter! I’ll have what the gentleman’s having.
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.
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.
Re: A miracle when it works first time!
Of course sir. And perhaps for dessert..
I had a little chuckle when a few straightforward (or so I thought) optimisations to sprite rendering resulted in this OTT crash! Still working on finding the bug
Cosmium
https://cosmium.itch.io/
https://cosmium.itch.io/
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: A miracle when it works first time!
Oh, yeah . . . That hit the spot.
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.
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.
Re: A miracle when it works first time!
Think I'd better beef up the safeguards for sprites writing outside of screen memory...
as appears to have happened here. Man, what a show
as appears to have happened here. Man, what a show
Cosmium
https://cosmium.itch.io/
https://cosmium.itch.io/
Re: A miracle when it works first time!
Haha brill. How on earth did you get it to do that?!
Never used to do safeguards, but a while back, I started checking that D was below 88 before any pixel draw subroutine, and if so doing a JP NC, safety, that sets DE to draw safely in ROM.
Re: A miracle when it works first time!
I know, it's a ridiculous display isn't it?! I'd been tinkering with adding a write address offset as sprite data was written to the screen. I already had a check to make sure y <= 191 but hadn't figured on encountering larger x offsets pushing the write address outside of screen memory.
I probably could've zeroed in on the source of the bug sooner using ZX SPIN disassembler's conditional breakpoints, but I haven't yet figured out the syntax to check for a write to an addresses range..
That's a good plan too. It's always a toss up between speed and safety eh? Guess I've been leaning towards speed but it's catching me out occasionally when values go outside the range of initial expectations.
Probably a better approach is to add conditional assembly based on an EQU for a special "debug" build with these safeguards in place, which can be easily removed for performance in "release" code. Note to self: actually do this rather than talk about it as a theory!
Cosmium
https://cosmium.itch.io/
https://cosmium.itch.io/
Re: A miracle when it works first time!
One of my more unusual crashes:
I think it was the speccy rebelling against Dave Spicer's cruelty to Z80 registers.
I think it was the speccy rebelling against Dave Spicer's cruelty to Z80 registers.