As of recently, I have been working on an extremely cut down and simplistic VT52 terminal emulator for my OS project. I have it all currently running on a TI-83+. For the sake of a very small program (These routines optimuall will fit in less than 256 bytes of memory), I have using _VPutMap for putting text on the screen. While not the optimal or cleanest way to do it, it is relatively small and already built into TIOS. My question is what is a good assembly routine that will scroll the screen up 1 (or preferably 7) pixels up. I saw a small hex routine to do this on this page, but it does not seem to work when I disassemble it and add it to my project.

Any suggestions? Thank you.
Provided you're working on the graph buffer and not directly on the LCD (the textWrite flag is set), this isn't particularly hard. If not using the buffer, you'd have more work to do.

    ld hl, plotSScreen + (12 * 7)
    ld de, plotSScreen
    ld bc, 768 - (12 * 7)

This won't clear the bottom of the screen so you'd have to do that as well if it matters.
Alright, that makes sense. I assume that the flag is not set by default, as from looking in the debugger the graphics buffer space is empty.

On a related note, how does one actually set a system flag. I haven't found any information online for the routines to actually preform this operation.
You can use something like the following:


 set flag,(iy+group)
 res flag,(iy+group)
 bit flag,(iy+group)

Those instructions will set a flag, reset it, or read it. That isn't always the best way, but it is a way to do it (in your specific case, this is the better way).

Other ways that you might see this done in assembly is ORing to set a bit or bits, ANDing to reset a bit or bits, or to read bits, and XORing to toggle bits.
If you want really fast scrolling, you might want to take a look at the LCD's Z-addressing feature. (http://wikiti.brandonw.net/index.php?title=83Plus:Ports:10 values 40~7F) To scroll down, just do:
 ld a,(zaddress)
 add 7
 and $3f
 ld (zaddress),a
 or $40
 out ($10),a

... where zaddress is one byte in memory initialized to 0. To scroll up, replace the add with a sub. Beware that you will need to clear out the rows that get wrapped to the other side of the screen. Also, when you want to set a row address, you first have to subtract (zaddress) from it. But this means that you can scroll the entire screen in just 10 microseconds (the time the LCD needs to respond to a command). Another issue is that the OS routines won't let you put text across the screen border, which might be necessary in this situation, so if you want the fastest scrolling possible, you will need your own text routine.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum