Login
Back to forumReply to this topicGo to last reply

Posted By

Litwr
on 2014-07-07
00:58:19
 Is there a way to evade scrolling?

The printing a char to the 40 column forces scrolling. For example, char,39,0,"a" moves 24 low rows down. I tried to set $7e8 to 40 but the value of $7e8 is restored by a ROM routine. Is there any other known way?

Posted By

Csabo
on 2014-07-07
08:22:52
 Re: Is there a way to evade scrolling?

You're right, CHAR does seem to force scrolling in every case, if you're destination is the last column. Making the first line "long" (overflow into the next line, I forget what the official expression is for this) doesn't help, since CHAR removes this. Setting a user defined window also doesn't help as it's removed as well. (Both of these would help avoid scrolling if you were to use PRINT for example.)

So I guess you're stuck with either a POKE or writing a small custom machine language routine.

Posted By

Litwr
on 2014-07-07
08:47:06
 Re: Is there a way to evade scrolling?

I am trying to write several hundred lines of Basic codes. I have to say that Commodore Basic is very bad thing. It has no the normal IF statement, it doesn't allow to make GOTO inside or outside loop, ... I can only express my big respect to those men who could write several thousand lines in this so poor language! My respect is tripled for those who used only Basic editor...
Csabo, could you provide me any example with PRINT which outputs char at the 40th column without scrolling?

Posted By

Csabo
on 2014-07-07
12:02:40
 Re: Is there a way to evade scrolling?

Sure, here it is. It could be done better in many ways, but that depends on the end goal, so it's just a proof-of-concept. I made it this way so that it's easy to copy/paste into an emulator happy

The idea is to create a window which is one line tall, then turn off scrolling with the escape codes.

Change the values in the first line to specify row and the character to be printed.

0 Y=24:P$="!"
1 FORI=1TO39:R$=R$+CHR$(29):NEXTI
2 E$=CHR$(27):H$=CHR$(19)
3 CHAR,0,Y,""
4 PRINTE$"T"R$E$"B"E$"M"P$H$H$E$"L"


Posted By

Gaia
on 2014-07-07
16:48:01
 Re: Is there a way to evade scrolling?

Why not the easy way? happy There is an ESCAPE sequence that disables scrolling: ESC+M

Posted By

Csabo
on 2014-07-07
17:17:49
 Re: Is there a way to evade scrolling?

Not so fast, that doesn't work! We're talking about different scrolling. Try his Litwr's original line (CHAR,39,0,"a") in YAPE. In my code I did use ESC+M (the print statement has E$ which is ESC followed by "M").

Posted By

JamesC
on 2014-07-07
17:29:05
 Re: Is there a way to evade scrolling?

CHAR is for putting letters on a GRAPHIC screen.

The solution is to read the necessary letters into a SSHAPE varable, then GSHAPE them to the screen. wink

Posted By

Litwr
on 2014-07-08
00:27:58
 Re: Is there a way to evade scrolling?

Csabo, thank you very much for this piece of PETSCII art. However it is too slow for my needs. I've just found more crude but faster solution
char,39,0,"":poke2024,40:print"a";
BTW I use 'petcat -w3' from VICE package to transfer ASCII text to PRG format. PETCAT and PLUS4EMU convert uppercase letter to lowercase. So the examples in the lowercase letters are better. wink
JamesC, thank you for the joke. If I would write the world's slowest application then I use your advice. happy

Posted By

Csabo
on 2014-07-08
06:50:27
 Re: Is there a way to evade scrolling?

Like I said, what I wrote was just an example. The for loop at the beginning is slow, it would be much faster to create that string for positioning with just 39 "right" characters (but then the source is unreadable).

Anyway, your solution is very clever! Use CHAR to position only makes it quick, then use print and prevent the scrolling. It works perfectly, congratulations for figuring it out!



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon