home *** CD-ROM | disk | FTP | other *** search
-
-
- DESIGNER.COM
-
- TURBO PASCAL SPRITE AND SPRITE TABLE
- EDITOR
-
- { Requires : IBM Compatible Computer, PC or MS.DOS 2.xx, 256 k, }
- { and a CGA compatible color card. }
-
- version 2.00 Feb 1986
-
- This disk contains procedures, functions and a utility that allow
- the use of sprites and animation in Turbo Pascal programs. I am re-
- leasing the disk to the Public Domain for distribution by User Groups
- or Bulletin Boards subject to the following stipulations:
-
- 1) Any person may obtain a copy of the BASE FILES on this disk either
- through their local User's Group or Bulletin Board, or by sending
- me a blank, double-sided, double-density 5 1/4 inch floppy diskette
- along with a PRE-PAID, SELF-ADDRESSED floppy diskette mailer.
-
- send to : Donald L. Pavia
- 1488 Lahti Dr.
- Bellingham, WA. 98226 USA
-
- Clubs may freely copy and distribute the diskette with the base files
- for a nominal distribution fee, not to exceed $10.
-
- 2) This disk contains a .COM file version of the sprite editor/designer,
- a .COM file of a sprite composer, and sample routines showing how to
- use the sprite files generated by the utility program. You may freely
- use the sprite files and the <COMPILED CODE> for the driver routines
- (mostly from Sprites.inc) in any of your own programs. If you find
- regular use, a $10 donation would be greatly appreciated, or better
- yet, buy the source code (see below).
-
- 3) I retain all rights to the SOURCE CODE of the two utilities and that
- of Sprites.inc, and I have not released that code into the Public
- Domain. You may acquire a copy of the commented Turbo Pascal source
- code for the two utilities in one of the following ways:
-
- 1) Send me a check for $20 ($15 plus S/H) OR
-
- 2) Send me a check for $15 and a blank double-sided, double-density
- 5 1/4 inch floppy diskette along with a PRE-PAID, SELF-ADDRESSED
- floppy diskette mailer OR
-
- 3) From another individual if you send me a legitimizing check
- for $15.
-
- You may not obtain or distribute the source code except under the
- conditions stated above. Nor may unaltered functions and procedures
- from the source code, or from sprites.inc, be incorporated into other
- source code of your own which you distribute. You really don't re-
- quire the source code unless you wish to learn from it, or modify it
- to your own needs. It would, for instance, be quite possible to re-
- compile the source code with overlays so that it might run on a 128k
- machine. It would also be possible to alter the size of the sprites.
-
- SORRY ABOUT THE LEGALITIES - HOWEVER, I DO WISH TO PROTECT
- MYSELF AND PERHAPS TO GAIN SOMETHING FROM MY TIME SPENT. YOUR
- COOPERATION WILL ENCOURAGE ME TO RELEASE MORE OF MY PROGRAMS.
- I WOULD APPRECIATE HEARING OF ANY BUGS OR IMPROVEMENTS.
-
-
-
- 2
-
- The following files will be found on this free distribution disk:
-
- {----------------------------------------------------------------}
-
- DESIGNER.COM The Sprite designing utility which allows you to
- create sprite arrays and store them in a table of
- up to 24 sprites written to disk. Single sprites
- may also be stored.
-
- {-----------------------------------------------------------------}
-
- DESIGNER.__1 These are necessary screen files for Designer.com
- DESIGNER.__2 and they must reside on the same disk drive.
-
- {-----------------------------------------------------------------}
-
-
- COMPOSER.COM A programming utility that allows you to load a
- saved screen file (or a blank screen) and a sprite
- table, and to move the sprites around freely so as
- to design an arrangement or an animation pathway.
- Composer gives screen coordinates of the active
- sprite, and you may write the positions to a
- printer. This output can be used to write code.
-
- {------------------------------------------------------------------}
-
- SPRITES.LIB These are the definitions and driver routines that
- allow you to use sprites in your own programs. You
- may not need them all. For a given program those
- that are unused may be deleted.
-
- {------------------------------------------------------------------}
-
- DEMOx.PAS A variety of sample programs that show how to do
- multiple page animation (4 color graphics mode),
- xor animation, zone-clearing animation and the
- like. Most of these use external files of sprite
- tables. There are eight demo programs.
-
- {------------------------------------------------------------------}
-
- DEMOx.TAB These are 3072 byte sprite tables (24 sprites)
- ????????.TAB which are stored on disk and used in the sample
- programs.
-
- {------------------------------------------------------------------}
-
- ????????.SPR These are 128 byte individual sprites stored on
- disk. They are used in the demo programs.
-
- {------------------------------------------------------------------}
-
- ????????.INC These are individual sprites that have been con-
- verted to typed constant arrays that may be di-
- rectly included in your code. Their sizes will
- vary.
-
- {------------------------------------------------------------------}
-
-
-
-
-
- 3
-
- THE PROGRAM
-
- The program loads immediately to the single sprite editor. There is
- also a sprite table editor which may be seen by pressing menu selection
- T for (T)able. You may return to the single sprite editor by pressing R
- for (R)eturn. I will explain each editor separately, the single sprite
- editor first.
-
- (* ******************************************************************* *)
-
-
- I. SINGLE SPRITE EDITOR/DESIGNER
-
- You will immediately see the sprite designing grid. It has dimensions
- of 24 pixels across and 20 pixels down. It designs sprites for the
- medium resolution 320 x 200 pixel 4 color graphics mode (GraphColorMode).
- The actual sized sprite is displayed in a box in the upper left-hand
- corner of the screen. The design grid is of course magnified.
-
- The following options are found on the main menu.
-
- {-----------------------------------------------------------------------}
-
- (N)ew Erases the work grid and sets the sprite array to zero.
- (S)ave Saves the sprite on the work grid to disk (128 byte file).
- (L)oad Loads a saved sprite from a disk file into the work grid.
- (T)able Changes over to the sprite table editor.
- (A)nim Xor animates sprite in the work grid at bottom of screen.
- (B)ackgr Changes background color for editor (0 - 16).
- (C)olrs Changes palette for the sprite editor (0 - 4).
- (D)imen Dimensions sprite in grid by rows and columns.
- (I)nc Generates include file code for defining sprites.
- (F)iles Gives a file directory and access to file rename/erase.
-
- (X) Exit Goodbye. Return to DOS.
-
- (0) Sets a pixel to background color (blank or erased).
- (1) Sets a pixel to green (or cyan ).
- (2) Sets a pixel to red (or magenta ).
- (3) Sets a pixel to brown (or white ).
-
- CURSOR KEYS Move the cursor around the workgrid.
-
-
- BRIEF EXPLANATIONS OF MENU SELECTIONS
-
- (Press the Indicated Character)
-
- {-----------------------------------------------------------------------}
-
- A more detailed explanation of each of these options follows below.
- All commands are case insensitive. You may use either lower or upper
- case.
-
- {------------------------------------------------------------------------}
-
-
-
-
-
-
-
-
-
-
- 4
-
- (N)ew Pressing N causes both the workgrid and the sprite array to
- be erased. All work is lost and you start anew. However, New
- does not erase the sprite table that might be loaded in the
- TABLE EDITOR.
-
- (S)ave Pressing S causes the current sprite (the one in the workgrid)
- to be saved to disk as a 128 byte file. This file contains a
- single sprite. It is my convention to name single-sprite files
- with the extension .SPR. You may abort this command by pressing
- <ENTER>.
-
- (L)oad Pressing L will allow you to load a single-sprite file into the
- workgrid. You will be asked for the name of the file. The files
- Santa.spr, Dragon.spr, Zone1.spr and Zone2.spr can be found on
- the distribution disk. You may abort this command by pressing
- <ENTER>.
-
- (T)able Pressing T will take you to the TABLE EDITOR. The current sprite
- in the workgrid will be taken along so that it may be loaded
- into the table. This current sprite will be seen at the center
- top of the sprite table screen.
-
- (A)nim Pressing A will cause the sprite currently loaded in the work-
- grid to be xor animated at the bottom of the screen. This will
- allow you a rough idea of what your sprite will look like in an
- animated sequence.
-
- (B)ckgr Pressing B will change the background color of the screen. You
- may step through all 16 possible colors. Keep in mind that the
- background color is not stored with the sprite when it is saved
- to disk, and in your programs you must set the background color
- you desire prior to display of the sprite.
-
- (C)olrs Pressing C changes the palette used for the screen display. You
- may step through all four palettes (0..3). Again, keep in mind
- that the palette is not stored with the sprite when it is saved
- to disk; in your programs you must set the palette prior to the
- display of the sprite.
-
- (D)imen Pressing D allows you to dimension the sprite. You will be
- prompted for the number of rows and columns which the sprite
- occupies. This is done so that display procedure will know how
- many lines and columns to write to the screen. This procedure
- does not waste time writing the unused portion of the sprite.
- A column is one byte wide (4 pixels) and you will see tick
- marks at the top of the grid. The columns are numbered 0 - 5.
- The row dimension is HALF of the number of rows seen on the
- workgrid (odd and even lines are stored separately in the
- sprite array). The rows may be seen as tick marks along the left
- hand edge of the work grid. The rows are numbered 0 - 9. If
- you do not follow this, you may obtain the correct dimensions
- by placing the cursor at the lower right hand corner of the
- sprite. The correct dimensions will appear as the first set of
- numbers at the lower left hand corner of the screen ( row and
- col ). The second set of numbers tell you the current dimen-
- sions of the sprite.
-
- (I)nc Pressing I allows you to convert the sprite which is current-
- ly loaded into the work grid to an include file. The include
- file redefines the sprite as a typed constant. This typed
- constant may be $I included in your code at compile time or
- may be copied directly into your code file. See Demo8.
-
-
- 5
-
-
- (F)iles Pressing F will give you a directory of files on the logged
- disk drive. You may also delete or rename files once the dir-
- ectory is displayed. For the convenience of Pascal programmers
- files with extensions .PAS, .BAK, .COM, .EXE, and .SYS are not
- displayed.
-
- (X) Exit Exit to DOS.
-
-
- (* ******************************************************************* *)
-
-
- II. TABLE EDITOR
-
- The Table editor allows creation of a table of up to 24 sprites. This
- table may be saved to disk and a 3072 byte file.
-
-
- The following options are found on the table editor screen:
-
- {-----------------------------------------------------------------------}
-
- (L)oad / (S)ave (E)nter / (C)hoose
- Table Sprite
-
-
- (R)eturn (N)ew (F)rameSeq
-
-
- Brief Summary of Table Commands
- ( press indicated key )
-
- {------------------------------------------------------------------------}
-
- A more detailed description of each one follows.
-
-
-
- (L)oad Table Reads a sprite table from disk. You will be prompted for
- a name. It is my convention to name all sprite tables with
- with the extension .TAB. You may abort this command by
- pressing <ENTER>.
-
-
- (S)ave Table Writes the currently active sprite table to disk as a
- 3072 byte file. It is my convention to name sprite tables
- with the extension .TAB. You may abort this command by
- pressing <ENTER>.
-
- (N)ew Clears the currently loaded table. All work is lost if it
- hasn't been previously saved. The currently active sprite
- is not lost. It may be erased by choosing a blank table
- entry (see (C)hoose below).
-
-
- When you enter the table editor the currently active sprite is displayed
- at the top center of the screen. If you return to the sprite editor this
- sprite will be re-loaded into the work grid. You may load this sprite
- into the sprite table by pressing E.
-
-
-
-
- 6
-
- (E)nter When you press E the currently active sprite will be
- entered into the sprite table. (This will be either the
- one that was loaded on the work grid or a new one if you
- used (C)hoose). You will be asked if it has been
- dimensioned and which table position you wish to enter
- it into. If you respond that it has not been dimensioned
- you will be given an opportunity to dimension it.
- You may abort this command by pressing <ENTER> after you
- respond to the dimensioning question.
-
- (C)hoose When you press C you may choose a new active sprite from
- the sprite table. You will be asked which number to
- choose. When you select a new sprite it will be displayed
- immediately at the top center of the screen. When you
- return to the sprite editor, the newly chosen sprite will
- be loaded into the work grid.
-
- (R)eturn pressing R returns you to the sprite editor. If you have
- chosen a new sprite from the sprite table this will take
- a few moments to be completed EVEN IF A BLANK TABLE ENTRY
- WAS CHOSEN, wait for the cursor. If you have not chosen a
- new sprite return will be immediate.
-
- (F)rameSeq This command allows you to check an animation sequence.
- You may display any range of sprites from the sprite table
- in sequence. The sequence must be a continuous one, but may
- involve any start and stop point in the table. You may
- display this sequence at a fixed location by setting step
- to zero, or simulate linear motion by setting step to 4,8
- or 12 pixels. You may also set a delay between each stage
- of the animation. Try a delay of about 75. If you display
- too rapidly the image will appear to be ghostly and to
- flicker. The eye needs a little time to grasp the image.
- You will be prompted for Start, Stop, Step and Delay.
-
- Erasing a Single Sprite
-
- You may erase a single sprite entry in the table by choosing a
- blank entry in the table with (C)hoose and then entering it with
- (E)nter into the position you wish to erase. Alternatively, you may
- return to the sprite editor and clear the work grid with (N)ew. The
- active sprite will then be a blank one. Return to the table and
- enter the blank whereever desired.
-
- Designing Animation
-
- You may notice that the actual-size sprite image in the upper left
- had corner of the sprite editor screen blinks as you move the cursor.
- This is intentional. If you go to the sprite table and load an image,
- when you return to the sprite editor the chosen sprite will be display-
- ed. Now make changes in the sprite on the work grid. As you do so the
- actual-size sprite will toggle between the originally loaded image and
- the one now under design. This really helps when designing successive
- frames for an animation sequence. Note that each sprite must be loaded
- into the sprite table and then chosen with (C)hoose in order for this
- feature to work. You cannot go to the sprite table, enter the sprite,
- and return to the editor to design a new frame. You must (C)hoose the
- sprite you have just entered before returning to the sprite editor.
- Of course once you have a sequence of sprites loaded into the sprite
- table you may use (F)rameSeq to see the actual animation.
-