Including Home as the first row character is the correct way to do it. If Y=1, then the cursor lands on the top row of the screen, and you don't need to do any math.Ser Olmy wrote: ↑Tue Feb 06, 2024 6:05 amMy only real criticism is that he chose to include the "home" character in the Y position string, which does confuse matters somewhat, and his use of a three-letter variable name: "VTB$" could cause issues, as it will be interpreted as just "VT$" and would clash with any other string variable name starting with "VT".
This way, you don't need to do any math: you can just
PRINT LEFT$(YY$,Y);TAB(X);
Which gives you the fastest, simplest expression possible.
Of course, looking at the Galaxy! code, it looks like SP$ is being used to clear lines of text, rather than just positioning.
Honestly, if I was converting this game, I'd probably leave all the PETSCII stuff just like it is. It works, and it's kind of fun seeing how people got around the lack of absolute cursor positioning using things like this.