Login
Back to forumReply to this topicGo to last reply

Posted By

Andras
on 2025-01-28
10:17:45
 Basic question

Hello!
Is there any Poke instruction that can be used to scroll the screen in a BASIC program? Either horizontally or vertically.

Posted By

Csabo
on 2025-01-28
11:09:30
 Re: Basic question

Within one character, yes. That's a range of 8 pixels. There are two TED registers that do this, you can use $FF06 for vertical and $FF07 for horizontal scrolling.

To scroll all the characters on the screen up/down/left/right, you need a bit of code, that cannot be done with a single POKE by default. Scrolling the entire screen up/down from BASIC is the easiest, you can do something like ESC+I or ESC+D.

Posted By

Andras
on 2025-01-28
11:39:02
 Re: Basic question

Thank you @Csabo. I can see the allocation of registers. Can I find an example of how to do this somewhere?

Posted By

gerliczer
on 2025-01-28
13:26:01
 Re: Basic question

I did a little test to make sure my idea is right. You can move a character row one character left or right by printing the DEL character (20) into the second column or the INSERT character (148) into the first one with the CHAR instruction (e.g. CHAR1,1,1,CHR$(20) or CHAR1,0,1,CHR$(148)). Obviously, you will have to fill the newly created "space" on the side opposite to the movement in the row.

Posted By

Andras
on 2025-01-28
13:40:41
 Re: Basic question

@gerliczer left$ is also suitable for this.

Posted By

Csabo
on 2025-01-28
13:49:43
 Re: Basic question

Something like this will work, simply change the X and Y shift values in line 1 to any number from 0 to 7:

0 T=DEC("FF00"):REM TED ADDRESS
1 X=4:Y=4
2 POKET+6,(PEEK(T+6)AND240)+Y
3 POKET+7,(PEEK(T+7)AND240)+X


Posted By

gerliczer
on 2025-01-29
00:41:25
 Re: Basic question

@Andras: If you say so. Nevertheless, it would be interesting to know which is faster, or under what circumstances is faster one or the other.

Posted By

Andras
on 2025-01-29
01:09:02
 Re: Basic question

@Csabo thanks
@gerliczer I'll try it this weekend.



Back to topReply to this topic


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