home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 #11 / q11.d81 / t.screensketch < prev    next >
Encoding:
Text File  |  1990-01-01  |  13.4 KB  |  293 lines

  1.                         S C R E E N S K E T C H    8 0
  2.  
  3.                                 by Jon Mattson
  4.  
  5.  
  6.       If you're anything like me, you find yourself designing custom screens
  7. for programs all the time.   Title screens, help screens, background
  8. screens...  the list is endless.  And the work can seem pretty endless, too,
  9. sometimes.  If you have ever designed a nifty screen and then hit RETURN -
  10. or, worse yet, CLR - and screwed up the whole thing, you know the true
  11. meaning of frustration.
  12.  
  13.     Fortunately, a number of useful utilities exist to make the task of
  14. creating 40-column screens much easier.  Unfortunately, few, if any, such
  15. routines exist for the 80-column screen - pretty unfair, considering that
  16. you have twice as much area to fill!  This is not surprising when you
  17. consider how tricky it can be to manipulate VDC data with machine language. 
  18. Saving the result from BASIC is impossible.
  19.  
  20.     Enter SCREENSKETCH 80.  It uses the power of the CONTROL80 language
  21. extension to make screen design not only possible, but easy.  For those
  22. interested in CONTROL80, it is also a good demonstration of how best to use
  23. that utility.  Of course, you don't need to have CONTROL80 to use
  24. SCREENSKETCH - a version of it is already built into the program in the
  25. guise of the ML file "SS.C80".
  26.  
  27.     SCREENSKETCH is totally menu-driven, so you will be using it like a pro
  28. in no time.  Plug your joystick into Port 2 or use the CRSR keys (RETURN =
  29. FIRE).  Since the CRSR keys do not allow diagonal movement, I have also
  30. included an extra method of keyboard control:
  31.  
  32.                                        I
  33.                                      U   O
  34.                                    J       K
  35.                                      N   ,
  36.                                        M
  37.  
  38.     You can freely switch between input methods at any time, since the
  39. program continually scans both the joystick port and the keyboard.  For
  40. purposes of brevity, the rest of this article will refer to the joystick and
  41. FIRE button, but the keyboard methods are always allowed, as well.
  42.  
  43.     There is only one other key you need to remember: ESC.  The ESCape key
  44. is used to switch between the Command and Drawing Modes, and also allows you
  45. to exit a menu without making any choices.
  46.  
  47.     When you first run the program, you will be in Command Mode.  A blue
  48. menu bar will be at the top of the screen, with four choices: Character,
  49. Screen, Files and Command.  The Character choice will be highlighted, and
  50. moving the joystick will allow you to select from the four menus.  Pressing
  51. FIRE will open the appropriate menu, allowing you to make specific choices
  52. as noted below.  Pressing ESC will switch to Drawing Mode.
  53.  
  54.     In Drawing Mode, the menu bar disappears, allowing you access to the
  55. whole screen.  The joystick moves a flashing cursor, and the FIRE button
  56. draws the currently selected Character and Attribute (see below) at that
  57. location.  By pressing the button and moving the stick simultaneously, you
  58. can draw lines of characters.  Note that this particular trick will not work
  59. for the keyboard, since several keys cannot be scanned simultaneously. 
  60. Pressing ESC takes you back to Command Mode, causing the menu bar to
  61. reappear over top of your work of art - don't worry, it was saved to memory
  62. first.
  63.  
  64.     There is also one shortcut in the Drawing Mode that allows you to erase
  65. characters without going back to Command Mode.  Just press the DEL key, and
  66. the currently selected Character will automatically become a space, although
  67. the current Attribute will be unchanged.
  68.  
  69.     Now let's take a closer look at the Command Mode.  When you press the
  70. FIRE button, the menu of your choice will pop open, giving you a more
  71. specific list of options.  Move the joystick up and down to choose a
  72. function, then press FIRE to activate it.  The sub-menu window will then
  73. close automatically.  The ESC key can be used to close a window at any time
  74. without making a choice.
  75.  
  76.     There is one exception to this standard procedure: since the Character
  77. window often requires several selections, the FIRE button will NOT
  78. automatically close that window when a choice is made.  You must use ESC to
  79. exit the Character sub-menu.
  80.  
  81.     All of the sub-menu selections are listed below with brief explanations.
  82. Most of them are actually self-explanatory, so you will probably never have
  83. to refer to this article again.
  84.  
  85.  
  86.  CHARACTER
  87.  ---------
  88.  
  89.     Before describing this sub-menu, I should probably do a quick
  90. explanation of how the 80-column screen uses characters.  This must, per
  91. force, be a brief explanation, but what you don't understand will quickly
  92. become clear through experimentation.
  93.  
  94.     If you have tinkered with POKEs to the regular 40-column VIC screen, you
  95. will know that each "square" is made up of two pieces of data: the actual
  96. character code and the color.  You must POKE to two different locations to
  97. alter both the character and the color, starting at 1024 (any bank) and
  98. 55296 (bank 15) respectively.
  99.  
  100.     On the 80-column VDC screen, the character code concept is unchanged. 
  101. However, color must be extended to include other video effects, such as
  102. reverse, flash and underline.  Furthermore, since the VDC can display two
  103. different character sets simultaneously (termed "normal" and "alternate"
  104. herein), there must be some way to tell which set any given character should
  105. be taken from.  Collectively, these effects are called Attributes.
  106.  
  107.     Like the VIC, the VDC has two separate sections of memory: one for
  108. character codes (pictures) and one for attributes (color and other video
  109. effects).  You don't need to worry about this memory management:
  110. SCREENSKETCH does that for you.  When you SAVE a picture, all of its
  111. necessary components will automatically be saved with it - even flashing
  112. areas!  All you need to remember while designing a screen is that each
  113. "paint brush" or "stamp" that you pick to draw with will be composed of a
  114. Character and an Attribute grouping.
  115.  
  116.  
  117. CHARACTER: While this selection is highlighted, moving the joystick left and
  118. right will allow you to view all of the characters and pick one to draw with
  119. - the "currently selected Character" previously mentioned.  Note that the
  120. sample character shows only the current choice - not its color or other
  121. attributes.  Watch the "Attributes" line to see what you will actually be
  122. drawing.
  123.  
  124. ATTRIBUTES: You cannot actually highlight this selection; instead, you will
  125. be able to highlight each of the items which compose it (see below). 
  126. However, the Attribute line shows you a picture of what the currently
  127. selected Character will look like with the currently selected Attributes -
  128. in other words, this picture shows what you will actually be drawing.
  129.  
  130.     The following 8 sub-choices are all portions of the total Attribute
  131. code.  In each case, moving the joystick or pressing FIRE will simply toggle
  132. the attribute between off (-) and on (X).  Watch the sample character on the
  133. attributes line to see what effects each change has.
  134.  
  135. ALTERNATE: Chooses between each of the two character sets available - normal
  136. (off) and alternate (on).
  137.  
  138. REVERSE: Reverses the foreground and background colors of the corresponding
  139. character.  This is similar to toggling the RVS ON and RVS OFF keys.
  140.  
  141. UNDERLINE: This simply causes the character to be underlined.
  142.  
  143. FLASH (or Blink): Causes the character to flash on and off automatically. 
  144. This is independent from program control, being a function of the VDC.
  145.  
  146. RED, GREEN, BLUE, INTENSITY: These four attributes set the color of the
  147. character.  By mixing them, you can get different colors, as noted on the
  148. table below.  For those who are interested, the appropriate code numbers
  149. have also been included (equivalent to the codes used for POKEing to color
  150. memory on the 40-column screen).  They can be used with the POST command in
  151. CONTROL80.
  152.  
  153.      CODE   COLOR         R G B I      CODE   COLOR         R G B I
  154.        0    Black         - - - -        8    Dark Red      X - - -
  155.        1    Dark Grey     - - - X        9    Light Red     X - - X
  156.        2    Dark Blue     - - X -       10    Dark Purple   X - X -
  157.        3    Light Blue    - - X X       11    Light Purple  X - X X
  158.        4    Dark Green    - X - -       12    Brown         X X - -
  159.        5    Light Green   - X - X       13    Yellow        X X - X
  160.        6    Dark Cyan     - X X -       14    Light Grey    X X X -
  161.        7    Light Cyan    - X X X       15    White         X X X X
  162.  
  163.     Those who own a C-128 Programmer's Reference Guide take note: the table
  164. therein (page 302 and elsewhere) is incorrect.  Use the table above.
  165.  
  166.  
  167.  SCREEN
  168.  ------
  169.  
  170. CLEAR: This erases the whole screen.  You will be asked to confirm your
  171. selection.
  172.  
  173. FILL: This fills the entire screen with the selected Character and
  174. Attributes as shown by the sample picture on the FILL line.  You will be
  175. asked to confirm your selection.
  176.  
  177. CHANGE COLOR: This allows you to change the background color.  Just move the
  178. joystick left or right to change the color, and press FIRE to make your
  179. choice.
  180.  
  181.  
  182.  FILES
  183.  -----
  184.  
  185. DIRECTORY: Calls up the directory of the disk currently in the drive.
  186.  
  187. LOAD VDC SCREEN: This will load a screen previously saved to disk in VDC
  188. format (see below).
  189.  
  190. LOAD RAM SCREEN: This will load a screen previously saved to disk in RAM
  191. format (see below).
  192.  
  193. SAVE VDC SCREEN: This saves your current work of art in standard VDC format
  194. (see below).
  195.  
  196. SAVE RAM SCREEN: This saves your current work of art in a special RAM
  197. format, which may or may not include resident fonts, at your option (see
  198. below).
  199.  
  200. LOAD NORMAL FONT: This option allows you to load in a normal 40-column font
  201. and use it on the 80-column screen.  SCREENSKETCH automatically converts it
  202. into 80-column format.  Remember that the VDC allows two fonts to be used
  203. simultaneously: in this case, the font is loaded into the "normal" slot.
  204.  
  205. LOAD ALTERNATE FONT: As above, but the font is loaded into the "alternate"
  206. slot.  Be selective with this command: the menu bar uses the alternate font
  207. and could become illegible if you load inappropriate data.  Generally,
  208. custom fonts should only be used with the normal slot, unless you are sure
  209. they contain at least the bare bones upper and lower case alphabet.
  210.  
  211.  
  212.  COMMAND
  213.  -------
  214.  
  215. ABOUT SCREENSKETCH: This simply opens a window giving information on the
  216. program, its version number and so on.
  217.  
  218. EXIT: You will be asked to confirm this choice - make sure that you have
  219. saved your work first!  If your LOADSTAR disk is in the drive, it will
  220. automatically be booted.
  221.  
  222.  
  223.  FILE TYPES
  224.  ---- -----
  225.  
  226.     As previously noted, SCREENSKETCH can load and save your screens in two
  227. different formats.  The normal VDC-format is a direct data save: its
  228. 40-column equivalent would be a BSAVE of screen and character memory,
  229. 1024-2023 and 55296-56295.  Of the two formats, it is the shortest and,
  230. thus, is recommended.
  231.  
  232.     Unfortunately, BASIC does not allow you to access the 80-column screen
  233. directly: to load a VDC-format file outside of SCREENSKETCH, you will
  234. require some form of machine language loader.  If you are using CONTROL80,
  235. you don't have a problem: just VLOAD"filename" and your screen will be
  236. retrieved, complete with attributes.  If you aren't using CONTROL80 and
  237. aren't an ML programmer, you would probably be out of luck; however...
  238.  
  239.     The RAM-format offers an elegant solution to this problem.  It transfers
  240. your screen to RAM, then BSAVEs the whole thing, along with a small ML
  241. run-time module.  To view a RAM-format file without CONTROL80 or a similar
  242. extension, just perform three simple steps:
  243.  
  244. 1) GRAPHIC 1,1:GRAPHIC 5,1 - This sets aside an area of RAM to work with and
  245. switches to the 80-column screen.
  246.  
  247. 2) BLOAD"filename",B0,P8072 - This loads the file into the reserved RAM
  248. area.
  249.  
  250. 3) SYS 8072 - This calls up the screen.  Note that it can be used
  251. repeatedly, anywhere within your program, as long as you don't over-write
  252. the ML or the screen's RAM location (8072-12287).
  253.  
  254.     Since the appearance of your screen may depend on the fonts you used to
  255. design it, the SAVE RAM SCREEN option allows you to save the current fonts
  256. as part of the file.  Thereafter, when you BLOAD the file, you can call up
  257. the normal font with SYS 8114,0 and the alternate font with SYS 8114,1. 
  258. Note that this option will cause the file to take up almost the entire RAM
  259. graphics area (8072-16383); however, once the fonts are resident in VDC
  260. memory (using the aforementioned SYS), the area from 12288-16383 can be
  261. over-written.
  262.  
  263.  SAMPLES
  264.  -------
  265.  
  266.     Three different fonts have been included with the program.  The first
  267. two "SS.FN0" and "SS.FN1" are the default fonts for the normal and alternate
  268. slots, respectively.  They are loaded automatically when the program is
  269. first booted, but are also handy to have around when you want to "undo" any
  270. experimentation you've been doing with your own fonts.  The third, "SS.FN2",
  271. has been designed for the normal slot.  It is a "dingbats" font, which
  272. includes several different alphabets and a number of graphics symbols.  It
  273. is a good font to begin "sketching" with.
  274.  
  275.     A sample screen has also been included that uses "SS.FN2".  To view it,
  276. simply follow this procedure:
  277.  
  278. 1) Under the FILES menu, select LOAD NORMAL FONT, then answer the filename
  279. prompt with SS.FN2.
  280.  
  281. 2) Again under the FILES menu, select LOAD VDC SCREEN, then answer the
  282. filename prompt with SS.SAMPLE.
  283.  
  284.     Of course, your LOADSTAR 128 disk must be in the drive so that the
  285. appropriate files can be retrieved.
  286.  
  287.     Give SCREENSKETCH a try, and you will probably find yourself on much
  288. better terms with the 80-column screen.  It will put an end to those "CLRed
  289. screen blues" and turn a chore into a creative experience.
  290.  
  291. JM
  292.                              **** End of Text ****
  293.