3D Chess 2K18

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
ZXDunny
Microbot
Posts: 166
Joined: Tue Nov 14, 2017 3:45 pm

Re: 3D Chess 2K18

Post by ZXDunny » Fri May 10, 2019 6:44 pm

Actually, that doesn't look half bad.
1 x

User avatar
arkannoyed
Manic Miner
Posts: 360
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Fri May 10, 2019 7:29 pm

I know right?! Maybe he’s onto something! Option maybe?
Shouldn’t be too hard to implement, as it’s only masking and can be swapped by changing 1 byte.
0 x

User avatar
arkannoyed
Manic Miner
Posts: 360
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Mon May 13, 2019 2:54 pm

As far as general use is concerned, is it safe to use the R register? i.e. if I'm utilising it to store BIT 7, which in R remains unchanged as far as I can see, would that interfere with anything like attached peripherals that I'm not aware of?
0 x

User avatar
Metalbrain
Dizzy
Posts: 64
Joined: Thu Feb 15, 2018 2:14 pm

Re: 3D Chess 2K18

Post by Metalbrain » Mon May 13, 2019 2:59 pm

AFAIK bit 7 of register R is perfectly safe to be used. Jonathan Smith (aka Joffa) did use it as a flag in several of his games.
1 x

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

Re: 3D Chess 2K18

Post by Ast A. Moore » Mon May 13, 2019 3:04 pm

arkannoyed wrote:
Mon May 13, 2019 2:54 pm
As far as general use is concerned, is it safe to use the R register? i.e. if I'm utilising it to store BIT 7, which in R remains unchanged as far as I can see, would that interfere with anything like attached peripherals that I'm not aware of?
Perfectly safe. Go ahead.
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
arkannoyed
Manic Miner
Posts: 360
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Mon May 13, 2019 3:09 pm

Good, shame its a 2 byte instruction though! :x

I've utilised it to hold the status of the current square being printed to set the mask that shades it or leaves Black etc. The whole process has added 21 bytes to the routine, however it works nicely and with no messy writes to memory addresses as was the case in the earlier attempts.

Now to make a final decision as to whether the piece selected to move will raise up or have a great big arrow pointing at it. Not really much in it in terms of size to graft into the routine, probably slightly less for making the piece float in the air.
0 x

User avatar
arkannoyed
Manic Miner
Posts: 360
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Mon May 13, 2019 4:01 pm

Amazing how quickly all this extra stuff eats into the spare bytes. Whereas there was 520 available, thats already dropped to 434 now that all of the visual extras are in. That might improve a little once I've tweeked a few things though.
0 x

User avatar
djnzx48
Manic Miner
Posts: 463
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: 3D Chess 2K18

Post by djnzx48 » Mon May 13, 2019 9:28 pm

arkannoyed wrote:
Mon May 13, 2019 2:54 pm
As far as general use is concerned, is it safe to use the R register? i.e. if I'm utilising it to store BIT 7, which in R remains unchanged as far as I can see, would that interfere with anything like attached peripherals that I'm not aware of?
There's nothing wrong with using the full register either (if you don't write to it too much). If there are no interrupt routines running and you've run out of registers, it's sometimes possible to use R as an automatically incrementing loop counter.
0 x

User avatar
arkannoyed
Manic Miner
Posts: 360
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Tue May 14, 2019 8:59 am

I have experimented in the past using it as a counter, but I've no need to use it for anything cleaver in this production at the moment.

I could perhaps use the EXX set for something, but to save them all (or whichever I need to use) would be a bigger overhead.
0 x

User avatar
arkannoyed
Manic Miner
Posts: 360
Joined: Mon Feb 05, 2018 9:56 am

Re: 3D Chess 2K18

Post by arkannoyed » Wed May 15, 2019 9:00 am

Isn't it great when you change something that you think will have the desired effect, but then it turns out to achieve something quite different and unexpected. I added 3 bytes to try and alternate the squares select bit so that they showed grey, however this happened, which looks amazingly effective!

Image
2 x

Post Reply