Open Sarah-C opened 2 years ago
The code from Stack Overflow expects x
coordinate in the range of characters (0 - 31) so B
should be divided by 8 for using with that routine which is at least three slow shift operations more.
The whole routine could be improved by using registers instead of memory locations for the coordinates, by avoiding pushing so many registers on the stack (which is not easy to do) and by replacing:
scf
ccf
with
or a
https://retrocomputing.stackexchange.com/questions/20425/zx-spectrum-coordinates-to-bitmap-conversion-subroutine-acting-strange
Looking at the Y calculation code, I think it's a few bytes less/quicker than the look up algorithm you're using? I don't know how many T-States it is though.
Vs