Page 2 of 2

Re: print at x,y equivalent

Posted: Wed May 07, 2014 12:48 pm
by satpro
Shaun_B wrote:Hi Bert, you say we drink too much but then I hear that you can't have too much of a good thing... so who is right?

AJordison, I'll do some testing later. Unfortunately I was woken up early this morning by my daughter so I'm not braining very well at the moment.

Regards,

Shaun.
Who is right? I would say whoever you get your information from. ;) I have this picture in my head of you in a big fur going beyond the 'Great Wall' looking for action!

Re: print at x,y equivalent

Posted: Wed May 07, 2014 12:52 pm
by Shaun_B
satpro wrote:Who is right? I would say whoever you get your information from. ;) I have this picture in my head of you in a big fur going beyond the 'Great Wall' looking for action!
Not today - way too tired for anything like that.

Regards,

Shaun.

Re: print at x,y equivalent

Posted: Wed May 07, 2014 1:47 pm
by satpro
Yeah, it seemed like both of you guys were up late last night. Hey, I didn't mean to snag this topic. Arthur makes a good point. Timing it is the way to go. I know you can use VICE to do that, but maybe one of us can come up with something in 65x code, perhaps a CIA timing or something like that.

Re: print at x,y equivalent

Posted: Wed May 07, 2014 2:11 pm
by Shaun_B
Hmm... you'd know better than I would on the 65x side of things. I'll see if the test I have in mind is reliable enough tonight.

Regards,

Shaun.

Re: print at x,y equivalent

Posted: Wed May 07, 2014 2:13 pm
by metalfoot
Isn't there a slightly quicker one again using zero-page locations 209-214 to force the location of the cursor? I'll look it up and see if I can remember that trick

Re: print at x,y equivalent

Posted: Fri May 16, 2014 2:36 pm
by buzbard
If you're looking for a way to "print" to the last screen position without "poking", try printing your last character to the space just before the last followed by a cursor-left and an insert.

Re: print at x,y equivalent

Posted: Fri May 16, 2014 2:52 pm
by Shaun_B
buzbard wrote:If you're looking for a way to "print" to the last screen position without "poking", try printing your last character to the space just before the last followed by a cursor-left and an insert.
Top tip - I'll give it a try thanks.

Regards,

Shaun.

Re: print at x,y equivalent

Posted: Mon Feb 08, 2016 1:16 pm
by ibitato
Shaun_B wrote:Here's a quick example of how to do print to position x, y in basic:

Code: Select all

0 x$="{home}{right*39}":y$="{down*24}"
10 x=10:y=7: rem x is across and y is down
20 print left$(x$,x)right$(y$,y)"hello";
Please note that you are not able to print to the last character of the screen without forcing a new line. If you want a character to be written to the last screen position, you'll need to poke it there, like poke 2023,81 - I don't know if there's an advanced trick in basic that will stop a new line when printing to the last character position. Someone here may be able to answer that.

Regards,

Shaun.

Code: Select all

10 PRINT CHR$(147)
20 SP = 20: ZE = 3: A$ = "Good Morning!": GOSUB 1000: GOSUB 2000
30 SP = 10: ZE = 3: A$ = "I'm the Commodore 64": GOSUB 1000: GOSUB 2000
40 SP = 12: ZE = 6: A$ = "And what is your name ?": GOSUB 1000
100 END
1000 REM cursor positioning and printing
1010 POKE 211,SP :POKE 214, ZE: SYS 58640 : PRINT A$
1020 RETURN
2000 REM delay-loop
2010 FOR X=0 TO 3000: NEXT X
2020 RETURN

Re: print at x,y equivalent

Posted: Sun Oct 30, 2016 3:59 pm
by Gyro Gearloose
What's wrong with using the SPC command?