On the 64, you use the cursor keys to move the cursor. For example,
suppose you want to move the cursor 5 lines down and 5 columns across:
10 PRINT "{CLR}":REM HIT THE CLEAR KEY, AN INVERSE HEART WILL SHOW UP
BETWEEN THE QUOTES.
20 PRINT "{5 CRSR-DOWN}{5 CRSR-RIGHT}THIS IS 5 DOWN AND 5 ACROSS.":REM
HIT THE CURSOR DOWN KEY 5 TIMES AND THE CURSOR RIGHT KEY FIVE TIMES.
10 inverse characters will appear in the quotes next to the text. When
you run the program, the cursor will move as desired and the text will
show up in the correct position.
--
Casey Vanlandingham (cvan...@iastate.edu)
Welch 1258 Ayres
Ames, IA 50013-0018 515-294-7770
: I'm helping a friend port a basic program to his C64, and we need to be able
Hey, hey, hey!! Look what I found in the June 1992 issue of COMPUTE
Magazine, Gazette edition! (page G-24, "Programmer's Page" column)
POKE 211,C (moves cursor to specified Column, 0-79)
POKE 214,R (moves cursor to specified Row, 0-24)
Nhat-Viet Phi
nhat...@nucleus.com
Calgary, Alberta, Canada
Nhat-Viet> Hey, hey, hey!! Look what I found in the June 1992 issue of
Nhat-Viet> COMPUTE Magazine, Gazette edition! (page G-24,
Nhat-Viet> "Programmer's Page" column)
Nhat-Viet> POKE 211,C (moves cursor to specified Column, 0-79)
Nhat-Viet> POKE 214,R (moves cursor to specified Row, 0-24)
Yes, but you must PRINT a carriage return after that, or the ($D1) and
($F3) pointers won't be changed. So, that's why you must make
POKE 214,(R-1)AND255:PRINT:POKE 211,C instead, as I suggested before.
Marko
Wonderbar> In <380t0p$14...@msuinfo.cl.msu.edu> t...@pilot.msu.edu (Tim
Wonderbar> D. Childs) writes:
>> I'm helping a friend port a basic program to his C64, and we need
>> to be able to position the cursor (same as LOCATE in MS-Basic or
>> HTAB and VTAB on the Apple][). C64 basic doesn't seem to have any
>> such command built in. I'm sure there must be a technique to do
>> that. Can anyone help? Thanks in advance.
Wonderbar> On the 64, you use the cursor keys to move the cursor. For
Wonderbar> example, suppose you want to move the cursor 5 lines down
Wonderbar> and 5 columns across:
But this method does not work if you want to use variables, like
"locate x,y". Of course you could define X$ a string of 39 crsr-rights
and Y$ a string of 24 crsr-downs and then do
print"{home}"left$(x$,x)left$(y$,y);
to get to the correct position (the top left corner is x=y=0), but
this is slow, as we all know how the Microsoft-programmed C= basic
handles strings.
The best way is to use the machine language, the PLOT function.
Load the Y coordinate to the X register and the X coordinate to
the Y register (again the top left corner is x=y=0), and clear the
Carry flag before calling $FFF0. Well, actually you can do this
even faster by pokeing the values to $d3 and $d6, like this:
poke214,(y-1)and255:print:poke211,x
But I just found out that this only works on the c64 (and the vic-20),
not in the c128 mode. Anyway, on the C128 you can do
bank15:sys65520,dummy,y,x,0
to do the same thing.
Marko