Classic Computer Magazine Archive COMPUTE! ISSUE 73 / JUNE 1986 / PAGE 78

Looking Glass:
Windows For The 64


James E. Hosek

This interesting program adds two new commands to Commodore 64 BASIC which let you create text windows and pull-down menus similar to those on Commodore 128, Atari ST, Amiga, and Macintosh computers. You can also add four text screens of information, including help screens.


"Looking Glass" is an all machine language utility that brings advanced windowing capabilities to the Commodore 64. Since it works as an extension to BASIC, you can use this program without understanding machine language at all.
    To get started, type in the data from Program 1 using the "MLX" machine language entry program published elsewhere in this issue. Here are the starting and ending addresses you need for MLX:

Starting address: C000
Ending address: C62F

    When you're finished entering all the data, be sure to use the MLX Save option to save at least one copy. If you want to try out the examples detailed below, be sure to save the data with the filename LG.
    To use Looking Glass, load it with LOAD"LG",8,1 for disk or LOAD"LG",1,1 for tape. Activate it by typing SYS 49152 and pressing RETURN.
    You now have two new BASIC statements for creating windows and menus. The OPENW (Open Window) statement opens a window on the text screen from any of five different sources (see below). The SAVEW (Save Window) statement saves the contents of an existing window into one of the four available workspaces which Looking Glass uses.
    The new BASIC statements work either in immediate mode (when you're not running a program) or in program mode. Just like normal BASIC keywords, they can be abbreviated if you wish. The abbreviation for OPENW is O SHIFT-P W. The abbreviation for SAVEW is S SHIFT-A W.
    To use Looking Glass in a program of your own, include these lines:

10 IF PEEK(49152)<>169 THEN LOAD
   "LG",8,1
20 SYS 49152

If you're using tape instead of disk, change the ,8,1 to ,1,1.

OPENW Opens Windows
Here is the general format for the OPENW statement:

OPENW s,x,y,w,h,f

OPENW can use from one to six parameters (values). The first parameter (s in this example) can range from 0 to 9 and must always be present. This value tells Looking Glass the source of the text which will appear in the new window. A source value of 0 designates the normal text screen (memory locations 1024-2023) as the source for the window. Opening a window from source 0 does not change what's currently displayed, since it merely copies the current contents of screen memory into the same locations.
    Source values 1-4 designate one of the four workspaces which Looking Glass allocates underneath the 64's Kernal ROM. As you'll learn below, these areas initially contain garbage; the SAVEW command can be used to store meaningful information there.
    Source values 5-9 have a special function. They automatically create a window the same size as the entire screen, using one of the four workspaces as a source of information. When you specify a source from 5 to 9, only the first parameter is relevant; Looking Glass ignores all additional parameters (see below).

Window Coordinates
The second and third parameters in an OPENW command (indicated by x and y in the previous example) locate the upper-left corner of the window you want to open. Specifying this corner's location effectively determines the screen position for the entire window. The horizontal (x) coordinate can range from 0 to 39, and the vertical (y) coordinate can range from 0 to 24.
    The next two parameters (w and h in the previous example) represent the width and height of the window, respectively. The width value can range from 1 to 40, while the height value can range from 1 to 25. Note, however, that the maximum width and height for a given window depends on where its upper-left corner is located. For instance, if you locate the upper-left corner 10 columns from the left edge of the screen, you won't have room for a window that's 40 columns wide. To keep everything on the screen, you must make sure that a window's horizontal coordinate plus its width doesn't exceed 40, and that its vertical coordinate plus its height doesn't exceed 25.
    The last parameter (f in the previous example) specifies the type of frame the window will have, and whether the window's contents will be normal or reverse video. A frame value of 0 creates a frameless window. A value of 2 selects a normal frame, and 4 creates a reversed frame. To make the window appear in reverse video, add 1 to any of the previous three values. The table below outlines the options for the frame parameter.

Table: Frame Parameter

0    No frame, normal window
1    No frame, reverse window
2    Normal frame, normal window
3    Normal frame, reverse window
4    Reverse frame, normal window
5    Reverse frame, reverse window

    Any of the parameters for OPENW can be specified as a constant, variable, or arithmetic expression. For example, if S=1, then the statement OPENW S has the same effect as OPENW 1. If you omit a parameter, it defaults to the most recently used value (if any). To allow room for the frame, framed windows must have a width and height of at least three. Here are a few examples of legal OPENW commands:

OPENW 1,10,10,20,5
OPENW 4,,,25,10
OPENW 2,X,Y,10+X*2,5+Y*3,F

Saving With SAVEW
The SAVEW command saves the contents of a window in one of the special Looking Glass workspaces. This is useful when you need to save the contents of a window for further use and for certain other purposes which we'll explain below. Here is the general format for SAVEW, which takes only one parameter:

SAVEW w

In this example w stands for workspace, and corresponds to the values used for the source in an OPENW command. Legal workspace values can range from 0 to 9. If you SAVEW with a value from 1 to 4, Looking Glass saves the contents of the current window in one of the four workspaces located under ROM. If you SAVEW with a value from 6 to 9, Looking Glass saves the entire display screen (which may be bigger than the current window) in the designated workspace.
    Thus, after deciding which workspace to use, you have a basic choice between saving an entire screenful of information or saving only the contents of a window. Note that SAVEW stores the contents of a window or screen without disturbing what's already there. Values of 0 and 5 are legal for SAVEW but have no visible effect since they simply store the contents of the current window or screen back into their present locations.

Working Inside Windows
After you open a window with a screen number of 0 to 4, certain restrictions apply. All text and output go only into the defined window area. Windows scroll separately from the rest of the screen, and a screen clear operation clears only the window. In immediate mode, commands can occupy only one physical line, without any wraparound at the window's edge. (If you wish to edit a program after creating a window, either press RUN/STOP-RESTORE or execute an OPENW command with a source value of 5 to 9.)
    Windows also affect the behavior of the INST/DEL key and certain control codes for printing. When you type inside a window, either in direct mode or in response to an INPUT statement, the INST key (SHIFT-INST/DEL) always inserts a space at the cursor until the current line is full. DEL always deletes the character to the left of the cursor. If the cursor is at the beginning of a line, it wraps back to the end of the previous line, but does not pull any text with it. Looking Glass ignores CHR$(20) and CHR$(148) when they are printed to screens 0-4.

advanced windowing
"Looking Glass" adds advanced win-
dowing capabilities to Commodore 64
BASIC, making it easy to create and
manipulate windows like this.

    When you type inside a reversed window in immediate mode, control characters do not work when embedded in quotation marks. For example, typing PRINT "{HOME}" prints the letter S instead of homing the cursor as usual. To circumvent this problem, either type PRINT CHR$(147) or specify a nonreversed window. However, the control keys (RVS ON, CLR, BLK, and so on) work normally in every window.
    When PRINTing inside a window, the SPC function works normally, since it refers to the current cursor position. The TAB function, however, refers to the left edge of the screen, not the left edge of the window, and may cause unexpected results unless the two edges coincide. Avoid using commas to separate items for printing (for instance, as in the statement PRINT X,Y,Z). When you separate printed items with commas, the computer arranges them into columns that are multiples of ten spaces-which may or may not fall inside the current window.
    You will probably find the string functions (LEFT$, RIGHT$, MID$) and the semicolon (;) most useful for formatting text inside a window. If you exit a window by pressing RUN/STOP-RESTORE, don't forget to reactivate Looking Glass with SYS 49152 before trying to use OPENW or SAVEW again.

A Graphic Demonstration
Let's try some experiments to become familiar with windowing. First, activate Looking Glass as described above. Then clear the screen and enter the following statement in immediate mode (without a line number):

OPENW 1,5,5,30,15,2

    A large boxful of random characters appears in the middle of the screen. Press SHIFT-CLR/HOME to get rid of the garbage characters. If you move around the window with the cursor keys, you'll notice that the window is actually only 28 X 15; the rest of the space is taken up by the frame. Enter a few direct commands to get a feel for how the window works. For instance, you may want to load a BASIC program, LIST it in the window, change the character colors, and so on.
    Now type SAVEW 2 and press RETURN. This command stores the contents of the window in work space 2. (Notice that you don't have to SAVEW a window to the same workspace that was used when you opened it.) Press SHIFT-CLR/ HOME again, then enter OPENW 2. This retrieves the stored information from workspace 2. The frame color is the last color that you specified; all other window parameters default to their previous values.
    To open a reversed window, enter this command:

OPENW 1,,,,,1:PRINT CHR$(147)

    Note that the window is now a full 30 X 15. PRINTing CHR$(147) clears the window immediately so that no garbage appears. If you still have a program in memory, LIST it to confirm that the text indeed PRINTS in reverse video. To change the text color, press CTRL and any color key, then press SHIFT-CLR/ HOME. The entire window changes to the selected color.
    Press CTRL-RVS ON and type a few characters. Characters that are actually normal now appear in reverse mode. Next, enter OPENW 5 to leave the window and enter full screen mode. If you press SHIFTCLR/HOME at this point, the whole screen is cleared. Enter OPENW 7. The previously stored text is now instantly recalled, along with the garbage that was not previously overwritten.

More Hints
The following line can be used to clear all four workspaces at the beginning of a program:

30 PRINT CHR$(147):SAVEW 6:SAVEW
   7:SAVEW 8:SAVEW 9

    In some cases, you'll want two windows to overlap, but also be able to restore either window at any time. To accomplish this, save each window to a different workspace as soon as it is complete (that is, as soon as you're done printing in it). To restore the window, open it again with OPENW using the same workspace number used when you saved it.
    Sometimes it may be desirable to put a header or title in the frame of a window. The following ex ample opens a 15 X 15 window with a normal frame and the header DIRECTORY:

100 OPENW 1,10,5,15,15,2: PRINT
    CHR$(147)
110 OPENW 0,10,5,15,1,0: PRINT
    "[RIGHT]DIRECTORY";
120 OPENW 0,11,6,13,13

    Notice that line 120 opens from window 0 and that x and y are incremented by one, and w and h are decremented by two. In this case the f parameter defaults to zero, preventing Looking Glass from redrawing the frame and erasing the header.
    While Looking Glass does not use any of the 64's BASIC programming space, it does use virtually all the RAM underneath the Kernal ROM, as well as RAM from locations 49152-50728 ($C000-$C628). The 64's BASIC ROM is also copied to underlying RAM and modified.
    The more you learn about how Looking Glass works, the more uses you'll find for it. A pull-down menu, for instance, is simply a window located on the top edge of the screen. Program 2 demonstrates how to create nondestructive pulldown menus as well as many other unique effects. Once you master the techniques involved, you'll probably think of even more applications.


Program 1: Looking Glass
For instructions on entering this listing, please
refer to the "MLX" article published in this
issue Of COMPUTE!.


C000:A9 51 8D 08 03 A9 C3 8D B0
C008:26 03 A9 E6 8D 02 03 A9 25
C010:DD 8D 04 AC A9 F6 8D 18 8B
C018:03 A9 C5 8D 19 03 A9 C0 FF
C020:8D 09 03 A9 C3 8D 27 03 4B
C028:A9 C4 8D 03 03 A9 C5 8D 69
C030:05 AC A9 00 85 FB A9 A0 A4
C038:85 FC A0 00 B1 FB 91 FB 6C
C040:E6 FB D0 FB E6 FC A5 FC 51
C048:C9 C0 D0 F0 A9 76 85 01 3B
C050:60 20 73 00 8D 16 C6 C9 94
C058:9F D0 0E A0 01 B1 7A C9 37
C060:57 D0 18 A9 06 85 FB D0 6E
C068:18 C9 94 D0 0E A0 01 B1 AE
C070:7A C9 57 D0 06 A9 01 85 F7
C078:FB D0 06 20 79 00 4C E7 3B
C080:A7 20 73 00 20 73 00 88 A3
C088:98 48 20 9E AD A9 00 2A 94
C090:20 90 AD 20 1B BC 20 BF C9
C098:B1 68 AB A5 65 99 01 C6 D6
C0A0:20 79 00 C9 2C D0 1C 20 2A
C0A8:73 00 C8 C9 2C D0 02 F0 33
C0B0:F6 C4 FB F0 0E D0 Dl AC 71
C0B8:09 C6 20 CA F1 88 C0 02 56
C0C0:D0 F8 60 AD 01 C6 30 0E 61
C0C8:C9 0A 10 0A AE 16 C6 E0 90
C0D0:94 D0 0D 4C 2A C3 A9 00 EA
C0D8:8D 19 C6 A2 0E 6C 00 03 8F
C0E0:AD 01 C6 C9 05 30 07 18 FD
C0E8:6E 19 C6 4C DE C2 38 6E 66
C0F0:19 C6 A0 04 B9 01 C6 99 FD
C0F8:06 C6 88 D0 F7 AD 07 C6 98
C100:18 6D 09 C6 C9 29 10 CE 5A
C108:AD 08 C6 18 6D 0A C6 C9 A9
C110:1A 10 C3 A9 00 8D 17 C6 E2
C118:AD 06 C6 4A 8D 18 C6 6E 3A
C120:17 C6 C9 03 10 B0 C9 00 21
C128:F0 02 A9 02 CD 09 C6 10 2A
C130:A5 CD 0A C6 10 A0 AD 18 1E
C138:C6 C9 00 D0 03 4C F6 C1 97
C140:AD 18 C6 C9 01 F0 04 A9 93
C148:12 D0 02 A9 92 20 CA F1 80
C150:AE 08 C6 AC 07 C6 18 86 DA
C158:02 20 F0 FF E6 02 A9 B0 46
C160:20 CA F1 A9 60 20 B7 C0 33
C168:A9 AE 20 CA F1 AD 0A C6 3E
C170:38 E9 02 85 FB A6 02 AC 4E
C178:07 C6 18 20 F0 FF A9 7D 8E
C180:20 CA F1 A5 D3 18 6D 09 42
C188:C6 A8 88 88 84 D3 A9 7D 77
C190:20 CA F1 E6 02 C6 FB D0 77
C198:DC A6 02 AC 07 C6 18 20 E2
C1A0:F0 FF A9 AD 20 CA F1 A9 66
ClA8:60 20 B7 C0 AD 08 C6 18 9A
C1B0:6D 0A C6 C9 19 D0 23 AD E2
CIB8:07 C6 18 6D 09 C6 C9 28 6A
ClC0:D0 18 AD 18 C6 C9 02 F0 3C
ClC8:04 A9 7D D0 02 A9 FD 8D B5
C1D0:E7 07 AD 86 02 8D E7 DB 1A
C1D8:D0 05 A9 BD 20 CA F1 EE 16
CIE0:07 C6 EE 08 C6 CE 09 C6 42
CIE8:CE 09 C6 CE 0A C6 CE 0A EE
CIF0:C6 A9 00 8D 18 C6 A9 00 4A
C1F8:8D 21 C6 AC 01 C6 A9 04 A9
C200:8D 1F C6 B9 0C C6 8D 22 41
C208:C6 20 61 C2 AC 01 C6 A9 F1
C210:D8 8D 1F C6 B9 11 C6 8D E2
C218:22 C6 20 61 C2 A9 92 4D A9
C220:17 C6 20 CA F1 AE 08 C6 B4
C228:AC 07 C6 18 20 F0 FF AD 92
C230:07 C6 18 6D 09 C6 A8 8C 06
C238:1B C6 88 8C IA C6 AD 08 26
C240:C6 18 6D 0A C6 A8 8C 1D 8C
C248:C6 88 8C 1C C6 AC 08 C6 66
C250:B9 D9 00 09 80 99 D9 00 D7
C258:C8 CC 1D C6 30 F2 4C DB 47
C260:C2 AC 0A C6 A9 00 85 FC 15
C268:AD 08 C6 0A 0A 18 6D 08 D3
C270:C6 0A 0A 26 FC 0A 26 FC D8
C278:18 6D 07 C6 85 FB 90 02 Fl
C280:E6 FC 18 A5 FB 6D 21 C6 B4
C288:85 FD AD 22 C6 65 PC 85 73
C290:FE 18 AD 1F C6 65 FC 85 8E
C298:FC 78 AS 01 48 A9 75 85 D8
C2A0:01 98 AA AC 09 C6 88 B1 13
C2A8:FD 2C lE C6 10 06 AD 23 7F
C280:C6 0D 17 C6 91 FE 88 10 C9
C288:EE 18 A9 28 65 FB 85 FB 95
C2C0:A9 00 65 FC 85 PC 18 A9 91
C2C8:28 65 FD 85 FD A9 00 65 CF
C2D0:FE 85 FE CA D0 CD 68 85 D7
C2DB:01 58 60 4C 7B C8 38 E9 FE
C2E0:05 8D 01 C6 A9 00 8D 19 5A
C2E8:C6 20 EF C2 4C F6 Cl A9 6F
C2F0:00 8D 07 C6 8D 08 C6 A9 EA
C2F8:28 8D 09 C6 A9 19 8D 0A 5A
C300:C6 60 A9 00 8D 21 C6 AC 63
C308:01 C6 A9 04 8D 22 C6 B9 73
C310:0C C6 8D 1F C6 20 61 C2 2F
C318:AC 01 C6 A9 DS 8D 22 C6 B1
C320:B9 11 C6 8D 1F C6 20 61 30
C328:C2 60 C9 05 10 06 20 02 8D
C330:C3 4C 7B C0 38 E9 05 8D 29
C338:01 C6 A2 03 BD 07 C6 48 56
C340:CA 10 F9 20 EF C2 20 02 3F
C348:C3 E8 68 9D 07 C6 E8 E0 D8
C350:05 D0 F7 4C 7B C8 8E 24 72
C358:C6 SC 25 C6 AC 0A C6 C0 53
C360:01 F0 25 A9 D8 8D 1F C6 E5
C368:8D 22 C6 A9 28 8D 21 C6 33
C370:88 20 64 C2 A9 04 8D 1F 94
C378:C6 BD 22 C6 A9 28 8D 21 Al
C380:C6 AC 8A C6 88 20 64 C2 94
C388:38 6E lE C6 A9 20 8D 23 04
C390:C6 A9 00 85 FC AD 1C C6 DB
C398:0A 0A 6D 1C C6 0A 26 FC BE
C3A0:0A 26 FC 0A 26 FC 18 6D B9
C3A8:07 C6 85 FB A9 00 69 04 F9
C3B0:65 FC 85 FC A0 01 20 99 8D
C3B8:C2 8E lE C6 AE 24 C6 AC 95
C3C0:25 C6 60 08 2C 19 C6 30 9C
C3C8:04 28 4C CA F1 85 02 8E CA
C3D0:26 C6 8C 27 C6 38 20 F0 69
C3D8:FF AS 02 C9 0D D0 20 A9 3C
C3E0:00 85 D4 2C 17 C6 10 02 1D
C3E8:A9 12 85 C7 EC 1C C6 30 8C
C3F0:08 20 56 C3 AE 1C C6 10 0F
C3F8:01 ES AC 07 C6 10 40 C9 02
C400:8D F0 DC 48 AS D4 F0 04 13
C408:68 4C B8 C4 68 C9 93 D0 9E
C410:24 38 6E lE C6 A9 20 8D 14
C418:23 C6 A9 04 8D 1F C6 20 F8
C420:61 C2 AD 86 02 8D 23 C6 7C
C428:A9 D8 8D 1F C6 20 61 C2 9C
C430:4E 1E C6 10 04 C9 13 D0 80
C438:16 AC 07 C6 AE 08 C6 18 80
C440:20 F0 FF AE 26 C6 AC 27 CD
C448:C6 AS 02 28 58 18 60 C9 0F
C450:91 D0 07 EC 08 C6 F0 EB AF
C458:D0 19 C9 11 D0 8C EC 1C 87
C460:C6 10 02 30 0E 20 56 C3 F5
C468:B0 D9 C9 1D D0 1F CC lA 82
C470:C6 10 0A 28 AE 26 C6 AC 6D
C478:27 C6 4C CA F1 EC 1C C6 BF
C480:30 05 20 56 C3 B0 01 E8 98
C488:AC 07 C6 10 B2 C9 9D D0 CC
C490:12 CC 07 C6 F0 02 D0 DB B0
C498:EC 08 C6 F0 A6 AC IA C6 65
C4A0:CA 10 9C C9 14 F0 9C C9 2B
C4AB:94 F0 98 C9 12 D0 05 4D 93
C480:17 C6 D0 BF C9 92 F0 F7 FF
C4B8:CC lA C6 F0 02 D0 B4 EC C0
C4C0:lC C6 F8 10 20 CA Fl ES 22
C4C8:B5 D9 09 80 95 D9 AC 07 41
C4D0:C6 4C 3F C4 EC 08 C6 F0 0B
C4D8:EF 20 56 C3 CA 18 20 F0 51
C4E0:FF A5 02 4C C4 C4 2C 19 83
C4E8:C6 30 03 4C 83 A4 20 F4 EA
C4F0:C4 4C 86 A4 A4 D3 Bl D1 B4
C4F8:85 FE A9 00 85 CC 20 E4 BE
C500:FF AA F0 F6 48 A9 01 85 34
C508:CC A5 FE A4 D3 91 D1 AD C3
C510:87 02 91 F3 68 C9 0D F0 C6
C518:11 C9 8D F0 0D C9 14 F0 08
C520:6F C9 94 F0 37 20 D2 FF 57
C528:90 CA AC 07 C6 AE 09 C6 7E
C530:A9 00 85 FB A9 02 85 FC 5E
C538:88 E8 Bl Dl 8C 27 C6 4D 71
C540:17 C6 A8 30 19 C9 20 10 61
C548:05 18 69 40 90 16 C9 40 3E
C550:10 02 30 10 C9 60 10 Fl 4D
C558:09 80 D0 08 F0 5D 29 7F F1
C560:C9 40 10 E5 A0 00 91 FB 65
C568:AC 27 C6 E6 FB C8 CA D0 C4
C570:C9 A0 00 98 91 FB C6 FB 98
C578:81 FB 29 3F C9 20 D0 06 6B
C580:A9 00 91 FB F0 F0 A9 0D 7E
C588:20 D2 FF A2 00 A0 02 60 E9
C590:A4 D3 CC 07 C6 F0 14 B1 41
C598:D1 88 91 D1 C8 C8 CC 1B 9C
C5A0:C6 D0 F4 88 A9 20 0D 17 E9
C5A8:C6 91 Dl A6 D4 A9 00 85 73
C5B0:D4 A9 9D 20 D2 FF 86 D4 3F
CSB8:4C F4 C4 AC IA C6 B1 D1 2C
C5C0:29 7F C9 20 D0 12 88 Bl 8D
C5C8:D1 C8 91 Dl 88 C4 D3 D0 8E
C5D0:F5 A9 20 20 D2 FF 90 D3 53
C5DB:A9 94 4C 25 CS 2C 19 C6 12
C5E0:30 03 4C 60 A5 38 20 F0 14
C5E8:FF 98 18 ED 07 C6 85 FA D5
C5F0:20 F4 C4 A6 FA 60 24 91 FF
C5F8:30 04 18 6E 19 C6 4C 47 4B
C600:FE 00 00 00 28 19 00 00 82
C608:00 00 00 00 04 E0 E8 F0 FB
C610:F8 D8 E4 EC F4 FC 00 00 57
C618:00 00 00 00 00 00 00 00 AS
C620:00 00 00 00 00 00 00 00 AD
C628:00 00 00 00 00 00 00 00 B5


Program 2: Window
Demonstration

For instructions on entering this listing, please
refer to "COMPUTEI's Guide to Typing in
Programs" published in this issue of COMPUTE!.

 
MC 10 IFPEEK(49152)<>169THENLO
      AD"LG",8,1
SQ 20 SYS49152
JK 30 POKE53280,11:POKE53281,1
      1:PRINT"[<8>]{CLR}";CHR$(1
      4)
QS 40 OPENW5:SAVEW6:SAVEW7:SAV
      EW8:SAVEW9
XP 50 PRINT"{CLR}{OFF}
      {5 SPACES}LOOKING
      {SHIFT-SPACE}GLASS IS A
      {SPACE}POWERFUL UTILITY"
FP 60 PRINT"THAT ALLOWS YOU TO
       CREATE WINDOWS IN":PRIN
      T
HB 70 PRINT"YOUR TEXT SCREEN.
      {SPACE}THESE WINDOWS ARE
      ":PRINT
JC 80 PRINT"SMALL TEXT SCREENS
       OF THEIR OWN.":GOSUB740
EX 90 PRINT"{WHT}";:OPENW1,10,
      15,19,7,0:PRINT"{CLR}";:
      FORX=1TO200:PRINTX;:NEXT
SB 100 SAVEWI: OPENW5:PRINT"
       {HOME}{CYN}{8 DOWN}
       {5 SPACES}WINDOWS CAN H
       AVE FRAMES:":GOSUB740
SC 110 PRINT"[<6>]";:OPENW2,1,12
       ,21,8,2:PRINT"{CLR}LIKE
       THIS..."
DK 120 PRINT"{DOWN}NORMAL FRAM
       ES{YEL}":SAVEW2:OPENW2,
       21,19,19,6,4
PP 130 PRINT"{CLR}{3 SPACES}OR
        REVERSED{3 SPACES}FRAM
       ES...":SAVEW2:GOSUB740:
       OPENW5
FH 140 PRINT"{WHT}{HOME}
       {8 DOWN}{5 SPACES}PLUS
       {SPACE}WINDOWS CAN BE R
       EVERSED:{CYN}":GOSUB740
MQ 150 OPENW3,5,11,15,14,5:PRI
       NT"{CLR}LIKE THIS...":G
       OSUB740
PD 160 FORX=1TO100:PRINTX;:NEX
       T:PRINT:SAVEW3:GOSUB748
       :OPENW4,0,0,40,10,0:PRI
       NT"{CLR}"
SF 170 PRINT"[<7>]{OFF}
       {5 SPACES}EVEN THOUGH T
       HE WINDOWS OVERLAP,":PR
       INT
KD 180 PRINT"THEY ARE NON DEST
       RUGTIVE*":GOSUB740
BD 190 OPENW1,10,15,19,7,0:GOS
       UB740:PRINT"[<6>]"
CR 200 OPENW2,1,12,21,8,2:GOSU
       B740:PRINT"{YEL}"
PG 210 OPENW2,21,19,19,6,4:GOS
       UB740:PRINT"{CYN}";:OPE
       NW3,5,11,15,14,5:GOSUB7
       40
QH 220 OPENW5:SAVEW5:OPENW1,0,
       0,40,25,5:PRINT"{CLR}"
EQ 230 PRINT"{DOWN}{5 RIGHT}ON
       E OF THE POSSIBLE USES
       {SPACE}OF{DOWN}"
EP 240 PRINT" LOOKING GLASS IS
        TO CREATE PULL DOWN
       {DOWN}"
HX 250 PRINT" MENUS:"
FR 260 PRINT"{DOWN}{3 SPACES}
       {DOWN}TYPE P, T, OR F T
       O PULL DOWN MENU"
BM 270 PRINT"{DOWN}{3 SPACES}P
       RESS {RVS}RETURN{OFF} T
       O GO ON:":FR=0:PR=0:TV=
       0
EG 280 OPENW0,0,0,40,1,1:PRINT
       "{2 RIGHT}PRESIDENTS
       {4 RIGHT}TV SHOWS
       {6 RIGHT}FRUITS";
CC 290 OPENW5:SAVEW7
XC 300 X=PEEK(203):IFX=64THEN3
       00
GS 310 IFX=1THEN560
BM 320 IFX=41THEN360
PE 330 IFX=22THEN430
FK 340 IFX=21THEN480
FH 350 GOTO300
HF 360 PRINT"{GRN}":OPENW4,1,0
       ,12,17,5:IFPRTHEN410
PK 370 PRINT"{CLR}PRESIDENTS"
BQ 380 PRINT"WASHIRGTONLINCOLN
       ":PRINT"ROOSEVELT":PRIN
       T"NIXON":PRINT"JOHNSON"
SH 390 PRINT"JEFFERSON":PRINT"
       FORD":PRINT"CARTER":PRI
       RT"REAGAN" _
GX 400 PRINT"ADAMS":PRINT"MADI
       SON": PRINT"GRANT"
JS 410 X-PEEK(203):IFX-41THEN4
       10
BK 420 PR=-1:SAVEW4:OPENW7:GOT
       O300
GK 430 PRINT"{YEL}":OPENW4,14,
       0,12,12,5:IFTVTHEN460
BA 440 PRINT"{CLR} TV
       {SHIFT-SPACE}SHOWS
       {DOWN}":PRINT"A TEAM":P
       RINT"COSBY SHOW",
GM 450 PRINT"NIGHT{DOWN}
       {3 LEFT}COURT":PRINT"FA
       MILY{DOWN}{4 LEFT}TIES"
       :PRINT"LATE NIGHT";
XF 460 X=PEEK(203):IFX=22THEN4
       60
GD 470 TV=-1:SAVEW4:OPENW7:GOT
       O300
KJ 480 PRINT"[<7>]":OPENW4,27,0,
       12,23,5:IFFRTHEN540
PH 490 PRINT"{CLR}{2 SPACES}FR
       UITS"
JD 500 PRINT"{DOWN}APPLES":PRI
       NT"ORANGES":PRINT"BANAN
       AS":PRINT"PEARS":PRINT"
       LEMONS"
HQ 510 PRINT"KUMQUATS":PRINT"K
       IWI FRUITWATERMELONGRAP
       EFRUITTANGERINE STRAWBE
       RRY";
CQ 520 PRINT"PLUM":PRINT"PEACH
       ":PRINT"BLUEBERRY":PRIN
       T"APRICOT":PRINT"RASPBE
       RRY"
KF 530 PRINT"PINEAPPLE CHERRY"
       ;
DD 540 X=PEEK(203):IFX=21THEN5
       40
HD 550 FR=-1:SAVEW4:OPENW7:GOT
       O300
KX 560 PRINT"{CLR}{10 DOWN}
       {3 RIGHT}{RVS}PLEASE PU
       T ON YOUR SAFETY GOGGLE
       S"
DG 570 PRINT"{DOWN}{3 RIGHT}
       {7 SPACES}THEN PRESS RE
       TURN:":POKE198,0
QG 580 GETA$:IFA$<>CHR$(13)THE
       N580
ES 590 POKE198,0:PRINT"{CLR}":
       C$(0)="{CYN}":C$(1)="
       {YEL}":C$(2)="{GRN}":C$
       (3)="{WHT}"
SE 600 FORX=0T070:PRINT"LOOKIN
       G GLASS "C$(XAND3j;:NEX
       T:SAVEW6
DR 610 PRINT"{CLR}{RVS}":FORX=
       1T023:PRINT"[<39 +>]":NEX
       T
JG 620 OPENW0,0,0,40,25,4
PP 630 OPENW0,6,5,29,15,0:PRIN
       T"{WHT}{CLR}":FORX=1TO1
       3:PRINT"[<28 *>]"
QX 640 NEXT:OPENW0,5,5,30,15,4
       :PRINT"{YEL}";:SAVEW7
GA 650 FORX=1TO10:OPENW1,19-X,
       12-X,2*X+2,2*X+2,4:GOSU
       B750:NEXT
XM 660 FORX=0T09:OPENW2,9+X,2,
       1,22,0:OPENW1,10+X,2,21
       -X,22,4:GOSUB750:NEXT
MG 670 FORX=0T09:OPENW2,18,2+X
       ,13,1,0:OPENW1,19,3+X,1
       2,21-X,4:GOSUB750:NEXT
PD 680 FORX=1TO10:OPENW2,20-X,
       24-X,12,1,0:OPENW2,31-X
       ,13-X,1,11,0
JM 690 OPENW1,19-X,12-X,12,12,
       4:GOSUB750:NEXT:SAVEW7
FM 700 FORX=1TO11:OPENW7:GOSUB
       750:GOSUB750:OPENW6:GOS
       UB750:GOSUB750:NEXT
BB 710 FORX=1TO50:PRINT"{DOWN}
       ";:NEXT
QJ 720 PRINT"PLEASE REMOVE YOU
       R SAFETY GOGGLES NOW.
       {10 DOWN}"
BD 730 END
QC 740 FORX=1T01500:NEXT:RETUR
       N
BR 750 FORZ=1T0100:NEXT:RETURN