 C                                                                                p. 
 
Comes to A.N.N. by way of VISA who obtained it from Ron Mitchell of AUFG. 
 
The following is the fifth in a six-part series of articles on SmartBASIC written bEXPLORING SMARTBASIC.  
      BY GUY COUSINEAU 
of the Adam User Friendly Group. 
 
Comes to A.N.N. by way of VISA who obtained it from Ron Mitchell of AUFG. 
 
The following is the fifth in a six-part series of articles on SmartBASIC written by Guy Cousineau of the ADAM User Friendly Group. The article was made available to us by Ron Mitchell, President of AUFG.\\ 
\\ 
SCREEN FORMAT COMMANDS\\ 
\\ 
The HOME command is used to clear the text window (even the 4 lines in GR and HGR mode).  It also places the cursor at the top of the screen.  If you want to home the cursor without clearing the screen, just PRINT CHR$(128).\\ 
\\ 
SPEED controls the delay between each character sent to the screen.  It can be useful for special effects but should generally be avoided as it infuriates some experienced programmers, fast readers, or anxious game players.  Don't try to guess how fast someone can read, fill up a screen and GET a keypress to move to the next screen.  You can totally disable SPEED with:\\
- poke 12043,195:poke 12044,15:poke 12045,76 \\ 
Note that these 3 POKEs must appear on the same line or BASIC will crash.\\ 
\\ 
Before discussing INVERSE video, let's look at the way that BASIC handles the screen.  There are 2 tables in VIDEO RAM which control characters.  BASIC routinely alternates between these 2 tables regardless of the FLASH INVERSE and NORMAL settings.  Normally, these 2 tables contain exactly the same thing ie. the characters to be displayed on the screen.  If INVERSE is on, both tables are set to the inverse of the character being printed.  When FLASH is on, one page has normal text, and the other page has reverse text.  For those of you who may have experimented with direct writes to VRAM to place the characters on the screen, you may have already figured out that you must write the character in 2 places if you don't want to get funny results.\\ 
\\ 
INVERSE and NORMAL complement each other.  They affect the way that characters are represented on the screen.  INVERSE can be handy for printing TITLES at the top of the screen.  Note that INVERSE will print regular characters in inverse video and inverse characters in normal video:\\ 
\\ 
10 REM inverse demo\\ 
20 PRINT CHR$(65):REM this is an A\\ 
30 PRINT CHR$(65+128):rem this is an inverse A\\ 
40 INVERSE\\ 
50 PRINT CHR$(65):REM this is an A\\ 
60 PRINT CHR$(65+128):rem this is an inverse A\\ 
70 NORMAL\\ 
The foregoing program prints an A and an inverse A. It then calls the INVERSE command and does the same thing again.  Note the difference.\\ 
\\ 
FLASH is used for emphasis.  Depending on the colour selection, it can be very hard on the eyes.  For this reason, it should be used sparingly and for short periods.  The following program illustrates a good combination of FLASH and INVERSE for emphasis:\L\\ 
10 a$=" HEADLINE ":REM your message here\\ 
20 HOME: FLASH: PRINT a$\\ 
30 FOR w= 1 TO 1000: NEXT: REM wait a bit\\ 
40 HOME: INVERSE: PRINT a$\\ 
50 NORMAL: PRINT "continue"\A\\ 
There is one strange thing you can do with FLASH.  Try POKEing powers of 2 in address 17006 (16,32,64) or any other number for that matter.\\ 
\\ 
TEXT is a powerful command.  Besides being used to exit graphics modes, it can be used to clear or set certain other screen parameters.  The routine jumps around a bit but essentially starts at 18453 (4815H) where it resets the cursor value and the BLANK SPACE value, sets the cursor to FLASH mode, and clears FLASH/INVERSE.  It then jumps to 17406 (4296H) where the VPD is initialized.  You can patch in your default TEXT attributes as follows:\L\\ 
17054 492E border colour\\ 
17060 42A4 background colour\\ 
17115 42DB normal character colour\\ 
17126 42E6 inverse colour\\ 
17164 430C character to fill the screen with\\ 
17175 4317 character to fill alternate screen with\\ 
17198 432E number of lines\\ 
17199 432F number of columns\\ 
17201 4331 home line number\\ 
17202 4332 home column number\A\\ 
Every time you give a TEXT command, it is reset to the values in the addresses shown above.  Be sure these values are the ones you want to live with.  To temporarily reset the margins, POKE the values you want in the following addresses; you can then reset using TEXT.\L\\ 
16993 4261 number of lines\\ 
16994 4262 number of columns\\ 
16995 4263 home line\\ 
16996 4264 home column\\ 
16956 423C left margin\\ 
16957 423D right margin\\ 
16958 423E top margin\\ 
16959 423F bottom margin\\ 
\r~45,80\\ 
\K\Q\A\\ 
\\ 
\\ 
\\ 
\\ 
There are a few other interesting routines that you may like to experiment with:\\ 
\\ 
17275 (437BH) is the start of the GET CHARACTER sequence which flashes the cursor while waiting for a keypress.  Address 17291 (438BH) contains the wait value between flashes.\\ 
\\ 
18112 (46C0H) scrolls the screen up one line.  You may call this routine directly to push text off the top of the screen.\\ 
\\ 
7884 (1ECCH) contains the ASCII value of the character printed between COMMAS in PRINT statements.\\ 
\\ 
Next time out, positioning the cursor on the screen.\\ 
\\ 
Guy Cousineau 1059 Hindley Street OTTAWA Canada K2B 5L9\\ 
\\
        
set the margins, POKE the values you want in the f
