home *** CD-ROM | disk | FTP | other *** search
-
- PEEKs, POKEs, & SYSes -- Part 30
-
- Written by Alan Gardner
-
-
-
- This month we would like to turn
-
- your attention to us. For one year
-
- we have been publishing some very
-
- useful routines that have received
-
- little attention. They form a major
-
- portion of LOADSTAR's operating
-
- system. A great deal of what you see
-
- in LOADSTAR is possible because of
-
- some machine-language routines that
-
- are contained in a ML program called
-
- ROUTINES V4.
-
- ROUTINES V4 can be found on both
-
- sides of this issue as well as many of
-
- the past issues. Very early issues
-
- used an earlier version of ROUTINES.
-
- ROUTINES V4 is chock full of very
-
- useful ML subroutines. These include
-
- routines for handling text windows,
-
- 80 character input, modified listings,
-
- and a user peek. All of these will be
-
- discussed in this article along with
-
- examples of how to use each.
-
-
- TEXT WINDOWS
-
- A text window is a portion of the
-
- screen in which text can be read and
-
- scrolled, either up or down. All of
-
- the text in Paperless Pages, Influx,
-
- Payload (in the files that describe
-
- the programs) and Contents Map is
-
- viewed via a text window.
-
- A text window should be able to
-
- scroll either up or down, providing
-
- easy access to the reader.
-
- You will note that while you are
-
- reading this article, you have the
-
- capability of scrolling either up or
-
- down using the function keys, cursor
-
- keys, or joystick. You will also
-
- notice that the whole screen does NOT
-
- scroll, only the text inside of the
-
- window. To keep things outside of the
-
- window from scrolling, the window
-
- handling routine must use boundaries.
-
- In ROUTINES V4, these boundaries are
-
- contained in memory locations 1020-
-
- 1023. The boundaries are defined as
-
- follows:
-
- Top Boundary -- 1020
- Bottom Boundary -- 1021
- Left Boundary -- 1022
- Right Boundary -- 1023
-
- The top and bottom boundaries can
-
- range from 0 to 24. The left and
-
- right boundaries can range from 0 to
-
- 39. The left boundary MUST be less
-
- than the right and the top boundary
-
- MUST be less than the bottom. To set
-
- the boundaries of your text window,
-
- simply POKE the values you want for
-
- each boundary into the appropriate
-
- memory location. For example:
-
-
- 10 POKE 1020,5 :REM _ top
- 20 POKE 1021,20 :REM _ bottom
- 30 POKE 1022,10 :REM _ left
- 40 POKE 1023,20 :REM _ right
-
-
- Once the boundaries have been
-
- established, you can begin displaying
-
- text in the window.
-
- Now, you can start scrolling your
-
- text. Believe it or not, this is the
-
- easy part because ROUTINES V4 does all
-
- the work for you.
-
-
- To scroll up -- SYS 51206
- To scroll down -- SYS 51209
-
-
- In addition to this, we must tell
-
- ROUTINES what color to make the text.
-
- This is done with a POKE 646, X (where
-
- X ranges between 0 and 15). After
-
- setting the color, a SYS 51203 will
-
- set the color in the window.
-
- While displaying your text, you may
-
- need to clear the entire window very
-
- quickly without clearing the whole
-
- screen. No need to worry! ROUTINES
-
- V4 has a built-in 'clear window'
-
- routine.
-
-
- To clear a window -- SYS 51200
-
-
- =======< continued in Part 31 >=======
-