home *** CD-ROM | disk | FTP | other *** search
- S C R E E N S K E T C H 8 0
-
- by Jon Mattson
-
-
- If you're anything like me, you find yourself designing custom screens
- for programs all the time. Title screens, help screens, background
- screens... the list is endless. And the work can seem pretty endless, too,
- sometimes. If you have ever designed a nifty screen and then hit RETURN -
- or, worse yet, CLR - and screwed up the whole thing, you know the true
- meaning of frustration.
-
- Fortunately, a number of useful utilities exist to make the task of
- creating 40-column screens much easier. Unfortunately, few, if any, such
- routines exist for the 80-column screen - pretty unfair, considering that
- you have twice as much area to fill! This is not surprising when you
- consider how tricky it can be to manipulate VDC data with machine language.
- Saving the result from BASIC is impossible.
-
- Enter SCREENSKETCH 80. It uses the power of the CONTROL80 language
- extension to make screen design not only possible, but easy. For those
- interested in CONTROL80, it is also a good demonstration of how best to use
- that utility. Of course, you don't need to have CONTROL80 to use
- SCREENSKETCH - a version of it is already built into the program in the
- guise of the ML file "SS.C80".
-
- SCREENSKETCH is totally menu-driven, so you will be using it like a pro
- in no time. Plug your joystick into Port 2 or use the CRSR keys (RETURN =
- FIRE). Since the CRSR keys do not allow diagonal movement, I have also
- included an extra method of keyboard control:
-
- I
- U O
- J K
- N ,
- M
-
- You can freely switch between input methods at any time, since the
- program continually scans both the joystick port and the keyboard. For
- purposes of brevity, the rest of this article will refer to the joystick and
- FIRE button, but the keyboard methods are always allowed, as well.
-
- There is only one other key you need to remember: ESC. The ESCape key
- is used to switch between the Command and Drawing Modes, and also allows you
- to exit a menu without making any choices.
-
- When you first run the program, you will be in Command Mode. A blue
- menu bar will be at the top of the screen, with four choices: Character,
- Screen, Files and Command. The Character choice will be highlighted, and
- moving the joystick will allow you to select from the four menus. Pressing
- FIRE will open the appropriate menu, allowing you to make specific choices
- as noted below. Pressing ESC will switch to Drawing Mode.
-
- In Drawing Mode, the menu bar disappears, allowing you access to the
- whole screen. The joystick moves a flashing cursor, and the FIRE button
- draws the currently selected Character and Attribute (see below) at that
- location. By pressing the button and moving the stick simultaneously, you
- can draw lines of characters. Note that this particular trick will not work
- for the keyboard, since several keys cannot be scanned simultaneously.
- Pressing ESC takes you back to Command Mode, causing the menu bar to
- reappear over top of your work of art - don't worry, it was saved to memory
- first.
-
- There is also one shortcut in the Drawing Mode that allows you to erase
- characters without going back to Command Mode. Just press the DEL key, and
- the currently selected Character will automatically become a space, although
- the current Attribute will be unchanged.
-
- Now let's take a closer look at the Command Mode. When you press the
- FIRE button, the menu of your choice will pop open, giving you a more
- specific list of options. Move the joystick up and down to choose a
- function, then press FIRE to activate it. The sub-menu window will then
- close automatically. The ESC key can be used to close a window at any time
- without making a choice.
-
- There is one exception to this standard procedure: since the Character
- window often requires several selections, the FIRE button will NOT
- automatically close that window when a choice is made. You must use ESC to
- exit the Character sub-menu.
-
- All of the sub-menu selections are listed below with brief explanations.
- Most of them are actually self-explanatory, so you will probably never have
- to refer to this article again.
-
-
- CHARACTER
- ---------
-
- Before describing this sub-menu, I should probably do a quick
- explanation of how the 80-column screen uses characters. This must, per
- force, be a brief explanation, but what you don't understand will quickly
- become clear through experimentation.
-
- If you have tinkered with POKEs to the regular 40-column VIC screen, you
- will know that each "square" is made up of two pieces of data: the actual
- character code and the color. You must POKE to two different locations to
- alter both the character and the color, starting at 1024 (any bank) and
- 55296 (bank 15) respectively.
-
- On the 80-column VDC screen, the character code concept is unchanged.
- However, color must be extended to include other video effects, such as
- reverse, flash and underline. Furthermore, since the VDC can display two
- different character sets simultaneously (termed "normal" and "alternate"
- herein), there must be some way to tell which set any given character should
- be taken from. Collectively, these effects are called Attributes.
-
- Like the VIC, the VDC has two separate sections of memory: one for
- character codes (pictures) and one for attributes (color and other video
- effects). You don't need to worry about this memory management:
- SCREENSKETCH does that for you. When you SAVE a picture, all of its
- necessary components will automatically be saved with it - even flashing
- areas! All you need to remember while designing a screen is that each
- "paint brush" or "stamp" that you pick to draw with will be composed of a
- Character and an Attribute grouping.
-
-
- CHARACTER: While this selection is highlighted, moving the joystick left and
- right will allow you to view all of the characters and pick one to draw with
- - the "currently selected Character" previously mentioned. Note that the
- sample character shows only the current choice - not its color or other
- attributes. Watch the "Attributes" line to see what you will actually be
- drawing.
-
- ATTRIBUTES: You cannot actually highlight this selection; instead, you will
- be able to highlight each of the items which compose it (see below).
- However, the Attribute line shows you a picture of what the currently
- selected Character will look like with the currently selected Attributes -
- in other words, this picture shows what you will actually be drawing.
-
- The following 8 sub-choices are all portions of the total Attribute
- code. In each case, moving the joystick or pressing FIRE will simply toggle
- the attribute between off (-) and on (X). Watch the sample character on the
- attributes line to see what effects each change has.
-
- ALTERNATE: Chooses between each of the two character sets available - normal
- (off) and alternate (on).
-
- REVERSE: Reverses the foreground and background colors of the corresponding
- character. This is similar to toggling the RVS ON and RVS OFF keys.
-
- UNDERLINE: This simply causes the character to be underlined.
-
- FLASH (or Blink): Causes the character to flash on and off automatically.
- This is independent from program control, being a function of the VDC.
-
- RED, GREEN, BLUE, INTENSITY: These four attributes set the color of the
- character. By mixing them, you can get different colors, as noted on the
- table below. For those who are interested, the appropriate code numbers
- have also been included (equivalent to the codes used for POKEing to color
- memory on the 40-column screen). They can be used with the POST command in
- CONTROL80.
-
- CODE COLOR R G B I CODE COLOR R G B I
- 0 Black - - - - 8 Dark Red X - - -
- 1 Dark Grey - - - X 9 Light Red X - - X
- 2 Dark Blue - - X - 10 Dark Purple X - X -
- 3 Light Blue - - X X 11 Light Purple X - X X
- 4 Dark Green - X - - 12 Brown X X - -
- 5 Light Green - X - X 13 Yellow X X - X
- 6 Dark Cyan - X X - 14 Light Grey X X X -
- 7 Light Cyan - X X X 15 White X X X X
-
- Those who own a C-128 Programmer's Reference Guide take note: the table
- therein (page 302 and elsewhere) is incorrect. Use the table above.
-
-
- SCREEN
- ------
-
- CLEAR: This erases the whole screen. You will be asked to confirm your
- selection.
-
- FILL: This fills the entire screen with the selected Character and
- Attributes as shown by the sample picture on the FILL line. You will be
- asked to confirm your selection.
-
- CHANGE COLOR: This allows you to change the background color. Just move the
- joystick left or right to change the color, and press FIRE to make your
- choice.
-
-
- FILES
- -----
-
- DIRECTORY: Calls up the directory of the disk currently in the drive.
-
- LOAD VDC SCREEN: This will load a screen previously saved to disk in VDC
- format (see below).
-
- LOAD RAM SCREEN: This will load a screen previously saved to disk in RAM
- format (see below).
-
- SAVE VDC SCREEN: This saves your current work of art in standard VDC format
- (see below).
-
- SAVE RAM SCREEN: This saves your current work of art in a special RAM
- format, which may or may not include resident fonts, at your option (see
- below).
-
- LOAD NORMAL FONT: This option allows you to load in a normal 40-column font
- and use it on the 80-column screen. SCREENSKETCH automatically converts it
- into 80-column format. Remember that the VDC allows two fonts to be used
- simultaneously: in this case, the font is loaded into the "normal" slot.
-
- LOAD ALTERNATE FONT: As above, but the font is loaded into the "alternate"
- slot. Be selective with this command: the menu bar uses the alternate font
- and could become illegible if you load inappropriate data. Generally,
- custom fonts should only be used with the normal slot, unless you are sure
- they contain at least the bare bones upper and lower case alphabet.
-
-
- COMMAND
- -------
-
- ABOUT SCREENSKETCH: This simply opens a window giving information on the
- program, its version number and so on.
-
- EXIT: You will be asked to confirm this choice - make sure that you have
- saved your work first! If your LOADSTAR disk is in the drive, it will
- automatically be booted.
-
-
- FILE TYPES
- ---- -----
-
- As previously noted, SCREENSKETCH can load and save your screens in two
- different formats. The normal VDC-format is a direct data save: its
- 40-column equivalent would be a BSAVE of screen and character memory,
- 1024-2023 and 55296-56295. Of the two formats, it is the shortest and,
- thus, is recommended.
-
- Unfortunately, BASIC does not allow you to access the 80-column screen
- directly: to load a VDC-format file outside of SCREENSKETCH, you will
- require some form of machine language loader. If you are using CONTROL80,
- you don't have a problem: just VLOAD"filename" and your screen will be
- retrieved, complete with attributes. If you aren't using CONTROL80 and
- aren't an ML programmer, you would probably be out of luck; however...
-
- The RAM-format offers an elegant solution to this problem. It transfers
- your screen to RAM, then BSAVEs the whole thing, along with a small ML
- run-time module. To view a RAM-format file without CONTROL80 or a similar
- extension, just perform three simple steps:
-
- 1) GRAPHIC 1,1:GRAPHIC 5,1 - This sets aside an area of RAM to work with and
- switches to the 80-column screen.
-
- 2) BLOAD"filename",B0,P8072 - This loads the file into the reserved RAM
- area.
-
- 3) SYS 8072 - This calls up the screen. Note that it can be used
- repeatedly, anywhere within your program, as long as you don't over-write
- the ML or the screen's RAM location (8072-12287).
-
- Since the appearance of your screen may depend on the fonts you used to
- design it, the SAVE RAM SCREEN option allows you to save the current fonts
- as part of the file. Thereafter, when you BLOAD the file, you can call up
- the normal font with SYS 8114,0 and the alternate font with SYS 8114,1.
- Note that this option will cause the file to take up almost the entire RAM
- graphics area (8072-16383); however, once the fonts are resident in VDC
- memory (using the aforementioned SYS), the area from 12288-16383 can be
- over-written.
-
- SAMPLES
- -------
-
- Three different fonts have been included with the program. The first
- two "SS.FN0" and "SS.FN1" are the default fonts for the normal and alternate
- slots, respectively. They are loaded automatically when the program is
- first booted, but are also handy to have around when you want to "undo" any
- experimentation you've been doing with your own fonts. The third, "SS.FN2",
- has been designed for the normal slot. It is a "dingbats" font, which
- includes several different alphabets and a number of graphics symbols. It
- is a good font to begin "sketching" with.
-
- A sample screen has also been included that uses "SS.FN2". To view it,
- simply follow this procedure:
-
- 1) Under the FILES menu, select LOAD NORMAL FONT, then answer the filename
- prompt with SS.FN2.
-
- 2) Again under the FILES menu, select LOAD VDC SCREEN, then answer the
- filename prompt with SS.SAMPLE.
-
- Of course, your LOADSTAR 128 disk must be in the drive so that the
- appropriate files can be retrieved.
-
- Give SCREENSKETCH a try, and you will probably find yourself on much
- better terms with the 80-column screen. It will put an end to those "CLRed
- screen blues" and turn a chore into a creative experience.
-
- JM
- **** End of Text ****
-