3D Chess 2K18
Re: 3D Chess 2K18
The epic program I've just compiled:
DI
EXX
EI
RET
causes a hang on return to basic.
If that helps at all.
Edit:
DI
EXX
Ld hl, bc, de, a with some arbitrary numbers
EXX
EI
RET
Gave me a "c nonsense in basic" but did return
DI
EXX
EI
RET
causes a hang on return to basic.
If that helps at all.
Edit:
DI
EXX
Ld hl, bc, de, a with some arbitrary numbers
EXX
EI
RET
Gave me a "c nonsense in basic" but did return
CLEAR 23855
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: 3D Chess 2K18
Yes. You need to save HL’ and restore it before returning to BASIC.
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.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Just HL’ ?
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: 3D Chess 2K18
Well, IY, too, obviously, since it holds the base address for all the system variables. But as far as prime registers are concerned, yes, just HL’.
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.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
No need to worry about iy. But being able to use one of the alternative register pairs for addressing instead of Ix may give the possibility of saving a few bytes.
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: 3D Chess 2K18
I only learned about it by accident (just like you did) when I was perfecting my QuickPrint routine. I even investigated why HL′ in particular was important. I just looked at my source and found this informative snippet:
Code: Select all
exx ;\
ld (saveHL+1),hl ; needed only for the BASIC interpreter (routine at $32d7)
exx ;/
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.
-
- Manic Miner
- Posts: 401
- Joined: Fri Jan 03, 2020 10:00 am
Re: 3D Chess 2K18
You may write ld hl,10072:exx:ret, this number doesn't change.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Christmas cheer to all!
After almost an entire year of faffing around trying desperately to save an odd byte here and there and failing, I woke up yesterday morning and came up with a Solution to save 4 bytes!!
..so now my little chess thing has now broken the 500 byte milestone.
499 bytes!
I’ll post some .asm soon, as although the bytes saved are actually only in the part that sets the board initially, there have been performance improvements elsewhere over the past year.
After almost an entire year of faffing around trying desperately to save an odd byte here and there and failing, I woke up yesterday morning and came up with a Solution to save 4 bytes!!
..so now my little chess thing has now broken the 500 byte milestone.
499 bytes!
I’ll post some .asm soon, as although the bytes saved are actually only in the part that sets the board initially, there have been performance improvements elsewhere over the past year.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Oh dear!! I always seem to have a habit of premature posting when I think I’ve done something good!
Well, actually I’ve saved more than I thought!
Now
497 bytes!
Now I really didn’t expect to save a whopping 6 bytes!!
Well, actually I’ve saved more than I thought!
Now
497 bytes!
Now I really didn’t expect to save a whopping 6 bytes!!
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
The board initialise routine is now 26 bytes with 6 bytes of data
Re: 3D Chess 2K18
Like I said, you're a wizard and this is witchcraft.arkannoyed wrote: ↑Mon Dec 21, 2020 7:00 pm Oh dear!! I always seem to have a habit of premature posting when I think I’ve done something good!
Well, actually I’ve saved more than I thought!
Now
497 bytes!
Now I really didn’t expect to save a whopping 6 bytes!!
Is there a chance for some compact chess engine in the near future ?
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Yes! Development has definitely slowed, but it has continued.
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
This is the new routine to set the board;
Code: Select all
init_board:
ld de,data20
ld hl,0ffc0h
ib1:
ld bc,0602h
ld a,(de)
ld (hl),a
inc e
ib2:
inc l
ld (hl),c
ld c,00h
djnz ib2
ib3:
ld (hl),03h
inc l
inc a
ld (hl),a
inc l
jr nz,ib1
- Einar Saukas
- Bugaboo
- Posts: 3094
- Joined: Wed Nov 15, 2017 2:48 pm
Re: 3D Chess 2K18
You are now storing the board sideways! That's clever!
- arkannoyed
- Manic Miner
- Posts: 436
- Joined: Mon Feb 05, 2018 9:56 am
- Location: Northamptonshire
Re: 3D Chess 2K18
Yes, it suddenly occurred to me that it was so much smaller to code, and there is only 8 bytes of date, two of which are an 06, 04 (ld b,04) at the start of a routine, so technically 6 bytes only.
-
- Manic Miner
- Posts: 401
- Joined: Fri Jan 03, 2020 10:00 am
Re: 3D Chess 2K18
Does anybody know, what is the smallest chess program that thinks deeply for any number of moves?