Re: A92: About screen.


[Prev][Next][Index][Thread]

Re: A92: About screen.






VIVES Fabien schrieb:
> 
> Hello.
> Here's my question :
> I made a small prog, that allows you to display on the screen a string. It's
> a prog you can use in any Ti-Basic Prog.
> You pass parameters in a string this way :
> "2,30,30,1,1, hello"
> where :
> 2 is the second function of my prog.
> 30 the X coordinate.
> 30 the Y coordinate.
> 1 the color.
> 1 the font.
> hello the string to display.
> 
> But, it displays it, but the calc erase it as soon as the my prog ends. So
> my question is :
> How could I keep the string displayed on the screen ?
> 
> I understand that it disappears on the HomeScreen, but I don't see why it
> disappears on the GraphScreen.
> Is suppose that the Ti refreshes the screen, but it should exists a way to
> keep my string on it.
> 
> Thanks for the answers.
> 

Of course the screen is restored after your program exits. And even
if the screen wouldn't be restored you won't see the string since
the Graph Screen is restored from a memory buffer whenever you 
switch to the home screen (or any other application) and back to it.
To fix that problem you will have to modify that buffer rather than
the screen. The buffer is a block of memory in the TI-92's heap
that can be accessed by a special handle (look handles.txt, included
with the Fargo distribution for details). If you don't know how
to draw characters directly into the Graph Screen Buffer, you may
try to draw the string onto the screen by the TI-OS DrawStrXY
routine and copy the changed area into the buffer. Drawing strings
directly isn't so difficult after all. You will have to access the
rom font table (It can be referenced by one of the pointers of
the tios pseudo library, look tios.h for details) and copy the
characters into the buffer like you'd put a sprite into the
LCD memory.

I hope this will help you.

						David Kühling


References: