Actually, my native language
is Dutch - imagine the odds
I don't have a lot of time right now and I will have a closer look at it later, one thing I can say already though is that you can replace something like
Code: Select all
cp 0
jr z, somewhere
cp 1
jr z, somewhere else
etc
With
Code: Select all
or a
jr z, somewhere ; a|a==a so "or a" tests for "a==0"
dec a
jr z, somewhere else ; if a-1 is 0, than a was 1
dec a etc
Which not only saves a couple of clock cycles, it saves bytes (which is especially important in asm problems, not so much in applications until you run out of space)
And of course the jp's you put there can easily be jr's, the speed difference is not going matter since they are not in a loop (and even a "do nothing" bcall would totally dominate the execution time) - saves some more bytes
jp stop can be replaces by ret, saves 2 bytes every time
ShiftAlockOff doesn't have to be closed with a jp stop/ret, it falls through to a ret anyway
IY doesn't have to be loaded with flags, it always points to the flags (if it doesn't, the TIOS will likely crash, so you can assume that if your program is running IY is pointing to the flags)
The reason your draw square isn't working is that RclVarSym kills most registers, you have to save them somewhere (I'd just push them on the stack)
edit: a second reason is that you're not getting the actual value, but only the first byte (which means close to nothing), you should use ConvOP1 or something similar