There’s also its sequel Crosswize, with great animation and effects:Freespirit wrote: ↑Thu Jul 16, 2020 10:09 amI'd not heard of this one, had to look it up. Looks good. A standard to aim for.
https://spectrumcomputing.co.uk/entry/1 ... /Crosswize
There’s also its sequel Crosswize, with great animation and effects:Freespirit wrote: ↑Thu Jul 16, 2020 10:09 amI'd not heard of this one, had to look it up. Looks good. A standard to aim for.
Thanks for this, I didn’t know about IXL and IXH. Yes, I’m using it for a table exactly as you say for x,y etc. Strangely I used IX+1 a few days ago just to see if it would work and I’m now using it with the table.Joefish wrote: ↑Thu Jul 16, 2020 11:08 amYep, IX and IY are interesting. Their operations run a bit slower than the HL equivalents so most people start to use them when they run out of other registers. It's kind of a hidden feature of the Z80 but most compilers will let you use instructions that address 8-bit halves of IX and IY. So most things you can do with H and L separately, you can also do with IXH, IXL, IYH and IYL, e.g. LD IXL,1Freespirit wrote: ↑Thu Jul 16, 2020 9:47 am Thanks Joefish, i just started using IX a few days ago, very handy. I didn't know about the ld a,-1 i just tried it and it compiles fine. Interesting. I will have to go through some examples and your explanation to get my head around the calculations. Its amazing all the little tricks you can do.
They're also good for looking things up in a table. Like in my Pac-Man maze generator I can point IY at a cell in the table, then use LD A,(IY+1) to read the cell to the right, or (IY-32) to read the cell above.
And for structured data; for example, if your sprite data is always "1 byte for sprite ID, 1 for X, 1 for Y, 1 for Vx, 1 for Vy and 1 for HP remaining" then you can point IX at the first byte, then read (for example) the hit-points remaining on your sprite with LD A,(IX+5). That way all your functions that deal with sprites just need to be given that root IX value and they all know how to fetch the relevant data to do anything with any sprite.
They really improved their game for the sequel it looks a lot better. Very impressive.Pegaz wrote: ↑Thu Jul 16, 2020 11:49 am There’s also its sequel Crosswize, with great animation and effects:
https://spectrumcomputing.co.uk/entry/1 ... /Crosswize
An extra point for the name, I think.
Thanks!Freespirit wrote: ↑Tue Jul 21, 2020 5:54 pm Here is the tzx version:
https://1drv.ms/u/s!At9gHWg9x_GpjguV18a ... b?e=APX6w4
Code: Select all
1$ call $28e ;poll keyboard upon entry
inc e ;if E=FFh (no key is pressed), INC E will result in 0
jr nz,1$ ;and we can go on; else, we wait until no key is pressed