System - description of the editor and sprite generator SCG.

ZX User #03
-------------------------------------------------------------
                       ___
       ____________ / / __ __
      / ______ / / / / / / / ISSUE 3
     /__/ _/ _/ / / __ / / / / _____ _____
           _/ _/ / / _ / / / / / / / ___/ / ___ 
         _/ _/ / / / / / / / / /___ / /__ / / / /
       _/ _/ ___ / / / / / / / /___ / / //_/ / / _/_/
     _/ /____ / _/ / /__/ / / / / /___ / / / /
    /___________// _____/ / / /_//__//_/   
             / / ______________ / /_______________ 
            /__/ _______________//_____________________

---------------------------------------------------------------

       In this issue, dear readers, you will break off with some
our other sections. More precisely, you will see:


                     SYSTEM
                     LETTERS FROM READERS (Amiga club)
                     ADVERTISING

                       ____________________________________
  / _____ / ___ ___ ____ ___ ___
_/ _/ Z80 _/ _ / // _// / / /_ /___// / /
 _/_/ _ _ __/_ / /_/// / / / / //__/
 _//__/_/___/ /__ / //___ / /__ / / // /
    __=====__/ /_ ___________________________________



  The SCG program proposed for consideration is a general
torus and sprite editor. The difference between this program and the hugeA lot of these are the presence of a built-in animator
and the mode of cutting sprites both from the screen and from the data file -
nal, drawing mode in a sprite, as well as a mode for working with windows.
Version 4.2 is similar to version 4.1, but it has fixed
some animation mode errors.
  If you discover any errors, inaccuracies, or you
If you have any wishes or suggestions, please contact
to the authors.

 The program can store in its memory up to 5 sprites of size
13X22 acquaintances and up to 1300 sprites sized 1X1 acquaintances.

               The program includes the following files:

 SCG 4.2 - Sprite editor and generator
 SCGH 4.2 - A short description of the editor,
            the code block of which can be
            if the need arises,
            print on a printer
 S.CON - Sprite Converter
 DEMO1 - Sprite set "HARE"
 DEMO2 - Sprite set "SKELETON"
 TEXTURE - A small set of textures for
            filling the sprite with a given background
 getO ┐ Source texts of output procedures
 get1 │ yes to the screen of sprites in four
 get2 │ various formats written
 getЗ ┘ in GENS-4 assembler format
 prspr - Procedure for displaying one
            a new sprite from the set according to his
            number.


                     ╔──────────────────╗
                     │Description of the editor│
                     ╚──────────────────╝╔══════════════╗
                       ║Basic mode║
                       ╚══════════════╝


 In main mode, you will see three windows on the screen:
┌────────┐┌──┐ Where: 1-editable window
│1 ││2 │ 2-sprite
│ │└──┘ 3-information window
│ │
│ │ Place in the editable window
│ │ enlarged 8 times
│ │ sprite section.
└────────┘
┌────────┐
│3 │
└────────┘

               The information window contains:

 KEYS - Current control
 FREE..100% - Amount of free memory
 SPRITE....0000 - Sprite number
 SIZE....02Х02 - Sprite size
 SPRITES..0000 - total number of sprites

 When controlling the cursor in an edited window, you must remember
a few rules.

 First: by pressing the 'FIRE' key you turn on the pixel. Repeat
By pressing you turn off this pixel.

 Second: if the cursor goes beyond the boundaries of the window being edited, then
the position of the edited window in the sprite changes.
The position will also change if you press and hold
'SYMBOL SHIFT' key, you will use the control keys
nia.  This is done to ensure fast movement
by sprite, if such a need arises.

 In the main mode, you can do some simple operations -
tions with sprite:

 'C.S.+0' -- Clears the entire sprite
 'C.S.+9' -- Clearing the editedwindows
 'C.S.+8' -- Remove the border around the sprite
 'C.S.+7' -- Invert sprite
 'C.S.+6' -- Invert window
 'C.S.+5' -- Sprite rotation (square)
 'C.S.+4' -- Vertical mirror
 'C.S.+3' -- Horizontal mirror
 'C.S.+2' -- Undo last action
 'C.S.+1' -- Prohibit/enable printing
             tour of the editable window

   'S.S.+S.S.' -- call the main menu.


                        ╔════════════╗
                        ║Main Menu║
                        ╚════════════╝



    When you call the main menu, you will see:
          ┌───────────────┐
          ├───────────────┼┐
          │FILES ││
          │SIZE ││
          │SETUP ││
          │SPRITE ││
          │WINDOWS ││
          │MEMORY ││
          │SPRITE CUT-OUT││
          │ANIMATOR ││
          │DRAWING ││
          │TIME ││
          │VERSION ││
          │EXIT ││
          └┬──────────────┘│
           └───────────────┘
 One of the items in this menu will be highlighted with a dark stripe, which
paradise is the cursor.  Using the 'UP' and 'DOWN' keys you
move the cursor through the various options. Select the option on which
When the cursor is standing, press the 'FIRE' key.



                      ┌────────────────┐
                      │Working with files│
                      └────────────────┘


 After selectionFILES options you will get a menu where you can
select:

CATALOG - Disk directory
SET OUTPUT - All sprites are unloaded
ENTER SET - Loads all sprites
SPRITE OUTPUT - One sprite is unloaded
INPUT SPRITE - One sprite is loaded
OUTPUT -Output of the current sprite
ENTER - Enter the current sprite
ADDING A SET -Add a set of sprites
EXIT - Exit this menu

  By current we mean the sprite you are working with.

                     Things to consider:

 First: the program works with the current drive.

 Second: one sprite or set of sprites is loaded at the end of the pa-
memory, but sometimes it (memory) is not enough.

 Third: when the set is loaded, all old sprites are erased.

  When you select the I/O option, you will be prompted to enter a name
file and its type. If you are happy with the file name you are working with,
worked for the last time, press 'ENTER' and enter its type. Type can-
It can be anything. If for any reason you change your mind, click
'C.S+S.S.' and you will exit this mode.

 If in disk output mode you enter the name of a file that is already
Yes, the old file will be erased.

 If there is no file whose name you specified in the download mode,
ruzki, you will see a corresponding message.

 After selecting the option to upload one sprite, you must select it no-
measures.(see section "CHOOSING A SPRITE")

  When browsing a catalog to continue browsinguse
any control key. After viewing, information will be provided
mation over the entire disk as a whole:

 NAME - Disk name
 DELETE - Number of files deleted
 FILES - Total number of files on disk
 FREE - Amount of free space

  In disk directory browsing mode, disks are not displayed on the screen.
erased files and as a result there may be gaps between
file names. No need to worry, this is not a glitch.

  In case you press 'C.S.+S.S.' during a pause during sleep
If you watch the catalogue, you will immediately interrupt viewing and return to the menu. But
if you press 'C.S.+2', you will first be informed
disk information.


                  ┌─────────────────────────┐
                  │Changing sprite size│
                  └─────────────────────────┘

 By selecting the SIZE option in the main menu and manipulating the up keys,
adjustment, you change the size of the sprite. The outline of the sprite and its di-
measures written in the information window changes according to
with the current situation. Having set the required dimensions, press
'FIRE', and having confirmed the change, you can consider that you have changed the
sprite measures.

 It is necessary to take into account that the part of the sprite that is outside the
frames are destroyed and cannot be restored.



                        ┌─────────────┐
                        │CHOOSING A SPRITE│
                        └─────────────┘


 A menu will appear in front of you:┌─────────────────┐
           ├─────────────────┼┐
           │SPRITE NUMBER:0000││
           └┬────────────────┘│
            └─────────────────┘

 Using the control keys, select the number of the sprite you need.
Yes. You can refuse the selection by pressing 'C.S.+S.S.'.

RIGHT -- increase the number by one.
LEFT -- decrease the number by one.
UP -- increasing the number by ten.
DOWN -- decrease the number by ten.
FIRE -- select the sprite with the current number.

 If you press 'C.S.+1' in selection mode, you can
It’s easy to dial the number of the desired sprite. This is done to
so that with a large number of small-sized sprites you can
selecting the desired sprite is more convenient and faster.



                     ┌───────────────────┐
                     │PROGRAM SETTINGS│
                     └───────────────────┘


 By selecting the SETTINGS option you can:

 1. Select a joystick (Campston, Sinclear).

 2. Redefine control keys.

 3. Change the colors of paper, ink, border in the main mode
bot programs.



                    ┌────────────────────┐
                    │Operations with sprites│
                    └────────────────────┘


 By selecting this option you will get a menu:
            ┌──────────────┐
            ├──────────────┼┐
            │CLEAR ││
            │SHIFT ││
            │ROTATION ││
            │SCROLL │││INVERSION ││
            │COLORING ││
            │MIRROR ││
            │REMOVE PAINT ││
            │FILLING ││
            │CANCEL ││
            │BACKGROUND FILL ││
            │EXIT ││
            └┬─────────────┘│
             └──────────────┘

 CLEAR means clearing the entire sprite with attributes. Pre-
They will ask you if you are sure about this.

 After selecting SHIFT you must select its type. There are only 2 of them: shift by 1
symbol with attributes and shift by 1 pixel without attributes.Shift
carried out by pressing control keys. For example, when you press
'RIGHT' shifts to the right by pressing 'DOWN' - down, etc.

 ROTATION is the rotation of the sprite clockwise. In this case,
Please note that only square sprites can be rotated.

 SCROLL - almost the same as shift, but what is higher
outside the sprite appears on the other side of this sprite
ta.

 Option INVERSION - inverts the entire sprite.

 COLORING.In this mode you will be offered a menu:

┌──────────┐
├──────────┼┐ Setting the colors for coloring
│PAPER ││ select the COLORING option, and
│INK ││ moving the cursor in the sprite
│BRIGHTNESS ││color the sprite.Exit
│FLASHING ││ of this mode - 'C.S.+S.S.'
│COLORING ││
│FILLING ││
│EXIT ││ In color selection mode, right
└┬─────────┘│ in the upper corner of the screen
 └──────────┘ the symbol 'A' will appear -
 ny on the current backgroundink, brightness and
 flashing.

 The FILL option in coloring mode means filling the entire current
a common sprite with the given attributes.

 MIRROR.After choosing, you will only need to set the required
display type (horizontal/vertical).Vertical
display is carried out by pressing the UP/DOWN keys, horizontal
Talent - RIGHT/LEFT. Exit mode - 'FIRE'.

 By selecting the REMOVE PAINTS option you will fill in the attributes of the sprite
mi, which has a screen in main mode.

 FILL. This is filling a closed contour with the included pixels -
mi.Place the flickering dot inside the outline and feel free to press
'FIRE'.

 The UNDO option undoes the last action, just like
'C.S.+2' in main mode.

 The BACKGROUND FILL option is almost similar to the FILL option with the same
the only difference is that the filling is done with some kind of texture,
located in memory as a sprite of 1X1 character size. To the program
Attached is a small set of 32 textures, completely similar
textures from the TEXTURED FILL menu due to
famous graphic editor ARTSTUDIO.


                      ┌─────────────────┐
                      │Operations with windows│
                      └─────────────────┘

 By selecting the WINDOWS option, you will enter the mode of working with windows in the sprite.
then you will be prompted for the following actions:

CLEAR -- Clear window
SHIFT -- Shift the contents of the window
ROTATION -- Rotation of window (square)SCROLL -- Scroll the contents of the window
INVERSION -- Window inversion
MIRROR -- Mirror image of a window
MOVE -- Move the contents of the window
SET -- Set window
TO MEMORY -- Places the window into memory
UNDO -- Undo the last action
EXIT -- Return to main menu


                     ┌──────────────────┐
                     │Memory Operations│
                     └──────────────────┘

 In this mode, a menu will appear before your eyes:
┌────────────────┐ The first option of this
├────────────────┼┐ menu sends sprite to
│SPRITE IN MEMORY ││ memory.
│SPRITE FROM MEMORY││
│PRINT SPRITE││ The second option is reverse
│OVERLAY SPRITE ││ this operation. Iterating
│DELETE SET ││ set, select the desired one
│DELETE SPRITE ││ you sprite and press
│EXIT ││ 'FIRE'.If you press
└┬───────────────┘│ 'C.S.+S.S.' then you're out
 └────────────────┘ exit from this mode.

 You can type any type into the current sprite on the screen.
A sprite from memory is smaller or equal in size to the current one. This is
can be done by selecting the PRINT SPRITE option in this menu.

 The OVERLAY SPRITE option is similar to the previous one with the only difference being
Note that the sprite is “imprinted” by OVER 1.

 DELETE SET.After selecting, you will be asked if you are sure about
this. Selecting 'YES' will delete all sprites from memory.

 DELETING A SPRITE differs from DELETING A SET only in that
removed frommemory one sprite chosen by you.

                          ┌─────────┐
                          │Drawing│
                          └─────────┘

  In this mode you will be offered several different options
ant images in a sprite of primitives such as points, lines, circles
and other things.

 I would especially like to note the drawing of quadrilaterals. This is not
only squares. It all depends on the order in which you put-
those 4 points. The fact is that the first point connects to the second
swarm, second with third and so on. Try it yourself to get
the whole picture.

 When drawing a circle, you first select its center. Then you select
Determine the length of the radius. The circle turns out to be clipped, that is
those points that go beyond the sprite are not depicted on the screen
are.

 By selecting the ERASER option, you can erase various images.


 It must be said that for accuracy in all options of the "DRAWING" menu
cursor with which you set the required parameters,
designed as a single point, so be careful.



                 ┌───────────────────────────┐
                 │Setting the time and timer│
                 └───────────────────────────┘


 The sprite editor has a time countdown mode. As in many
in other programs, when the program accesses the disk drive,
time stops.

 By selecting the TIME option in the main menu, you can set the time
and timer by selectingthe corresponding option from the proposed menu.

 When the timer starts and works, sound signals will sound.
fishing can be stopped by pressing 'C.S.+1'



                           ┌──────┐
                           │Version│
                           └──────┘


  By selecting this option, you will find out the version number of the version you have.
SCG program.



                     ╔──────────────────╗
                     │Description of the animator│
                     ╚──────────────────╝


 So, you've already drawn or cut out a whole bunch of
sprites and now you can look and slightly “revive” them, select
equals the ANIMATOR option in the main menu. Of course, this is the simplest animation
Mator, who is still far from “monsters” like “ANIMATOR 2.0”,
distributed by INFORCOM, but it is not intended for this purpose -
chen. Its purpose is to roughly estimate how the sprites will be
look like on the screen.

 The animator is easy to use. You will be offered the following me-
nude:
         ┌──────────────────┐
         ├──────────────────┼┐
         │DELAY AMOUNT ││
         │INCREASE DELAY││
         │REDUCE DELAY││
         │DELAY STEP ││
         │SEQUENCE││
         │ANIMATION ││
         │CIRCLE ANIMATION ││
         │EXIT ││
         └┬─────────────────┘│
          └──────────────────┘
 The speed of the animation is determined by the amount of delay. The greater the delay
identity enteredyou to the request, the more slowly it is executed
animation.

 One unit of delay value is equal to 0.02 seconds (or one
fiftieth second, which is the same).

 DELAY STEP changes the amount by which the value changes
delays in options

           INCREASE DELAY
           REDUCE DELAY

  Before starting the animation, you need to set the sequence
activity.Having selected the appropriate option, select the ones you need
sprites. Exit from this mode - 'C.S.+S.S.'. In case you don't
need any specific sprites, then answer 'YES' to the question -
grew up

                     "ARE THE SPRITES IN ORDER?"

and the first two hundred sprites (if there are more than two hundred) will be included
into sequence.

  After selecting the ANIMATION option and assuming that the sequence is specified
When the sprites become active, the animation begins.

 In animation mode, after going through the entire sequence,
Ty, the animation stops, and you find yourself in the animator menu.

 Circular animation differs from ordinary animation in that after
passing through the entire sequence, the animation does not stop, but
continues from the beginning.

 Pressing 'FIRE' during the animation will interrupt the animation.

  Option EXIT - exit to the main menu.

 By the way, after exiting the animator menu, the sequence that
the number you set remains unchanged. If, as a result of the work,
If the number of sprites decreases, the sequence may be shortened
tickle. If the quantitysprites have increased or remain
changed, the animation sequence will not change.

 The SCG program comes with something like demonstration ro-
faces for the animation mode. These are the files "DEMO1" and "DEMO2".

 Load any of these files as a set, enter the animation mode
mation, set a sequence that includes in order
all sprites of the loaded set, set the animation speed and
start animation.



               ╔───────────────────────────────╗
               │Description of sprite cut mode│
               ╚───────────────────────────────╝


 After selecting the SPRITE CUT-OUT option from the main menu, you will enter
this mode. A menu will appear in front of you:
            ┌─────────────┐
            ├─────────────┼┐
            │CATALOG ││
            │SCREEN FILE││
            │DATA FILE ││
            │INFORMATION ││
            │EXIT ││
            └┬────────────┘│
             └─────────────┘

 CATALOG - disk directory.
 SCREEN FILE - cutting sprites from the screen
 DATA FILE - cutting sprites from disk
 INFORMATION - information about the current state
                 waiting for the program
 EXIT - exit to main mode



                  ┌─────────────────────────┐
                  │Cutting sprites from the screen│
                  └─────────────────────────┘


 Select the SCREEN FILE option from the menu, enter a file name, wait
wait until hewill load. Now, moving around the screen the flickering
square, select the desired area of the screen and press 'FIRE'. That's it,
what was inside the frame is sent to memory, if there is any
There is a tight spot. In this case, a sound signal is given. If sig-
there was no cash, which means the sprite was not cut out.

  Exit from this mode - 'C.S.+S.S.'

  Changing the size of the cut sprite'S.S.+control key-
visha'.

 It is necessary to remember that when exiting the mode, the picture on the screen
the wound is not saved and you will need to download it again.



                  ┌────────────────────────┐
                  │Cutting sprites from disk│
                  └────────────────────────┘


  Select the DATA FILE option. Enter a file name. The memory will be
There are only 11 sectors.

  The following information will be displayed in the upper left corner of the screen:
general content:

  TRACK -- current track number
  SECTOR -- current sector number
  FORMAT -- current clipping format type
              (see sprite formats)

          Control keys:

 Right - increases the address by 1
 Left - decreases the address by 1
 Down - increases the address by 8
 Up - decreases the address by 8
 Fire - places the sprite into memory
 0 - 11 sectors forward
 9 - 11 sectors ago
 8 - 1 sector forward
 7 - 1 sector back
 6 - format 0
 5 - format 2
 4 - format 1
 3 - format 3
 S.S.+ control key - changecut size
sprite.
 C.S.+S.S. - exit the mode.



                         ┌──────────┐
                         │Information│
                         └──────────┘


 By selecting this option you will receive:

FREE - amount of free memory
SIZE - current size of the cut
           sprite
SPRITES - total number of sprites
FORMAT - current format



                      ┌────────────────┐
                      │Sprite formats│
                      └────────────────┘


 There are four formats in total: zero, first, second and third.

 Sprites in all four formats have the following byte-byte
structure:

1.Sprite horizontal size (L) - 1 byte
2. Sprite vertical size (H) - 1 byte
3. Bit design of sprites - H*L*8
                                      byte
4.Color attributes - H*L
                                      byte

  In zero format bit construction
 sprite size for example 2X2 looks
 like this:
 ┌────┬────┐
 │1 │9 │ Where 1,..,32 are bytes, consecutive
 │... │... │ closely located in pa-
 │8 A│16 B│ wrinkled.
 ├────┼────┤
 │17 │25 │ The letters A,B,C,D indicate
 │... │... │ color display row
 │24 C│32 D│ new attributes.
 └────┴────┘

  It should be noted that SCG works with zero-format sprites.
mat, and the other three formats are used only when cutting
sprites from the data block.

 Let's take the samesprite size 2X2. In the first format, bit
The sprite design looks like this:
 ┌────┬────┐
 │1 │2 │ Where 1,..,32 are bytes, consecutive
 │... │... │ closely located in pa-
 │7 A│8 B│ crumpled.
 ├────┼────┤
 │9 │10 │ The letters A,B,C,D indicate
 │... │... │ color display row
 │25 C│32 D│ new attributes.
 └────┴────┘

  In the second format, the bit construction of the sprite is 2X2 in size
looks like this:
 ┌────┬────┐
 │1 │17 │ Where 1,..,32 are bytes, serial
 │... │... │ closely located in pa-
 │8 A│24 C│ wrinkled.
 ├────┼────┤
 │9 │25 │ The letters A,B,C,D indicate
 │... │... │ color display row
 │16 B│32 D│ new attributes.
 └────┴────┘

 The third format is a slightly modified sprite format, with
which LASER BASIC works with. However, the sprite bitmap
remained unchanged. Bit design of the sprite size 2X2
looks like this:
 ┌────┬────┐
 │1 │2 │ Where 1,..,32 are bytes, consecutive
 │... │... │ closely located in pa-
 │29 A│30 C│ wrinkled.
 ├────┼────┤
 │3 │4 │ The letters A,B,C,D indicate
 │... │... │ color display row
 │31 B│32 D│ new attributes.
 └────┴────┘

 After the "SCG" program in the GENS 4 assembler format there are
texts of procedures for displaying sprites on the screen in these four formats -
tah:

         getO - null format
         get1 - first format
         get2 - second formatgetЗ - third format



                ╔────────────────────────────╗
                │Description of sprite converter│
                ╚────────────────────────────╝


 The sprite converter is not included in the "SCG" program itself and is
completely independent program.
 When you launch the sprite converter, you will see five windows on the screen,
holding various information:
┌───────────┐ Where: 1-catalog window
│1 │ 2-option window
│ │ 3-information window 1
│ │ 4-window service
└───────────┘ 5-information window 2
┌──────┐┌───┐
│2 ││3 │ At the top of the window there is one
│ │└───┘ there is a red stripe
│ │┌───┐ colors. This is the selection cursor.
│ ││4 │ File selected by cursor
└──────┘└───┘ selection will be loaded into the pa-
┌───────────┐ wrinkle when selecting an option
│5 │ LOADING.
└───────────┘

 The directory window prints files whose type corresponds to those
tabernacle mask. Erased files are not displayed on the screen.

 Options are selected using the arrow cursor. When installing
cursor on an option, it is highlighted in inverse color. In the control
The cursor uses KEMPSTON and KEYS:
               'A' - up
               'Z' -- down
               'O' - left
               'P' -- right
               'M' is a choice.

 The options window contains eight options:

NEW DISK -- Read disk directory.
UP -- Movefiles up so
                to position the cursor
                selection for the one you are interested in
                file.
DOWN -- Move files down.
LOAD -- Read into memory the selected
                file.
NEW FORMAT -- Select the format to which
                will be carried out
                version.
PROCESS -- Converting sprites to selected
                early format with subsequent
                output to disk.
VIEW -- View sprites loaded
                women's set. In this case:
                'RIGHT' is the next sprite.
                'LEFT' is the previous sprite.
                'UP'-Plus 10 sprites.
                'DOWN'-Minus 10 sprites.
                'FIRE'-Exit mode.
VERSION -- Information about the version of the
                vertora.

 A little more about the PROCESS option. When you select this option and when
provided that the set of sprites is loaded into memory, it will produce
conversion. You will then be asked for the file name to output.

 Information window number one contains information about the current
mask:
                ┌──────┐
                │MASK:│
                │ .   │
                └──────┘
 "." sign means that all types of files are displayed on the screen.

 The service window contains three options:

  MASK -- Set the type of files output to
            screen.
  DOS -- Exit to TR-DOS.
  BASIC -- Output to BASIC.

 INinformation window number two contains information about the number
the quality of sprites of the loaded set and the type of format in which
det a conversion was made from a zero formatter when selecting the option
PROCESS.

 After the conversion and output of the results, the converter memory is cleared -
is completed and the program is ready for a new cycle of work.

Share your thoughts about the article