Scrolling UP

Started by xlar54, February 20, 2008, 09:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xlar54

Hey guys, working on my editor program, and Im having a hard time with upwards scrolling of the text window. What I imagine that I need to do, is (within the current window), copy line 22 to 23, then 21 to 22, then 20 to 21, etc.  Anyone know of a way to do this using the BASIC ROM?  I want to avoid trying to peek into VDC ram for this, and just let the ROM handle it.  Scrolling down is covered, but going up is apparently a problem. (obviously the screen editor doesnt do this, but im hoping there is a routine that copies a line to another line).

hydrophilic

I don't think there is any such routine in the BASIC ROM, but in the Editor ROM you should try the routine at $CACA which will scroll the current window down one line (so the user can scroll up).  The complement, at $CABC, will scroll the current window up one line (so the user can scroll down).  If you haven't defined a window, then this will naturally scroll the whole screen.

BigDumbDinosaur

Reverse scrolling (that is, moving the text lines lower on the screen—be careful with words like up and down, as forward scrolling moves the text lines higher on the screen) is a bit tricky with the VDC, as the block copy function sequentially goes from the starting_address to starting_address + Nbytes, which can trample on your display if you're not careful.  Easiest thing for now is to use screen kernel routines (e.g., $CACA as suggested by hydrophilic) to do this.  They're kind of slow, but will get you going until better code becomes available.

BTW, BASIC and screen ops have nothing to do with each other.  BASIC calls kernel subroutines to do such things as print to the screen.  It is the screen kernel ROM code (aka editor) that interprets escape sequence and such to manipulate the display.
x86?  We ain't got no x86.  We don't need no stinking x86!