Programmers - 14 tips for writing boot, tips for writing Compressor, a few tips for writing Music Editor. Recommendations to the author Alasm and STS.

Depth #01
__________________________________________
                                        
Text : VIATOR                       
                                        
Music: COOPER                       
                                        
__________________________________________
                                        
                                        
                                        
                                        
                                        
HELLO SOI AND ALL CRYSTAL DREAM !!!!!!! 
I sat down to write this text at night, right away
after our telephone conversation.     
                                        
    I've been meaning to write for a long time
a similar article, but never got around to it
hands.  Finally I'm finally fed up
lamers with their left software, and I decided that
This article is sorely needed.         
                                        
                                        
 BRIEF GUIDE FOR SYSTEM CODER. 
                                        
   The man who decided to writesystemic
program, faces many
difficulties.  This text is intended at least
partially help you make your
the program is high-quality and convenient.
Naturally, I could not take into account all the nuances,
but still, if you use
with the tips outlined below, it will be easier and
To you, and to your users
programs.                               
                                        
                                        
                                        
 WHAT SHOULD BE CONSIDERED FIRST 
   WHEN CREATING A SYSTEM PROGRAM.    
                                        
1. Your work must contain
all advantages and disadvantages are taken into account
previous programs of this type. Learn
on other people's mistakes, and use everything
achievements of their predecessors.      
                                        
2. Management in the program must be
flexible and varied. Standard on-
bor is: SINCLAIR (right),      
                KURSOR,                 
                KEMPSTON (with check)  
                KEYBOARD (O,P,Q,A,   
                SPACE and M ).
                                        
And also KEMPSTON and mouse AU. If you have
don't have a mouse, but you want to implement one
support, you can read about how
do this in the following publications:       
                                        
about KEMPSTON mouse - "SPECTROFON 2O" in   
                   section "Designer"
 about the mouse control - "ZX-POWER 1" in the section    
 "Iron".                 
                                        
3. Always check availability
KEMPSTON joystick and do not interrogate it,
if it is missing.  Otherwise, for everyone
machines without this port Yours
the product will not work. Let me remind you,
what if  there is no KEMPSTON - bits 5-7
installed.                            
                                        
4. Your program should be as
use all the machine's resources to
which she works.     Needed
test the available memory and
work with him. I can advise
use the auto-configurator
memory from  "ZX-FORMATS",  written
CREATOR.It will allow your program
work with memory from 48k to megabytes. 
                                        
5. Copiers and other disk utilities
should work with one drive,
so with two.                          
                                        
6. If the program has a lot of changeable
parameters (more than three), just
you need to burn them to disk
(SAVE SETUP). In this case, you need to record
produce inside the program itself,
having first checked its availability and
location on disk.                
                                        
7. If your program works with
second interrupt mode, connect them
it is necessary to create a  257 byte table,
filled with one number, because  in many
on machines, it is not #FF that is read from the bus, but
any number.   There's already a lot about this
it was said, but still sometimes
programs appear that do not take into account
this.                                  
                                        
8.   Naturally, segments (pages)
you need to switch not through the #FD port, but
through fullport #7FFD (dec: 32765).   
                                        
9. When accessing the disk there must be
the first interrupt mode (IM) is enabled
1).  If for some reason you
IM 2 required, can be used
interrupt vector only within
fast memory areas  (#8OOO-#BFOO
(32768-49151)or in pages O,1,2,3 ),
when the interrupt vector is located in
slow memory area, all
the computer, and with it TR-DOS, will become
run 25 percent slower, and
disk operations will be disrupted. This
This is only true for cars with
a separate memory field for the rest,
for example Pentagon, it does not have
values, but it's still needed
take into account.  About separate memory fields
written in detail in the Belarusian newspaper
"ECHO 2", I advise you to read it.     
                                        
                                        
                                        
 SOME MORE DETAILED TIPS ON  
 CERTAIN TYPES OF PROGRAMS.  14 TIPS FOR A PERSON WRITING “voot”.  
                                        
1. You immediately need to decide for which disks
this "voot" will be used. For
system ones are preferable to simple ones, but
convenient shells, without various effects
and unnecessary bells and whistles.  If "hey"
intended to be used for games and
demo, then another thing, effects,
graphics and music are welcome. 
                                        
2. Naturally, he should occupy as
less disk space possible.            
                                        
3. The faster your “voot” will be
boot and run, the better. In
in any case, you should not hang it from
him effects with long DECRUNCHERS. 
                                        
4. Try to simultaneously
the screen was displayed the largest
number of files.                      
                                        
5. Program names should be good
readable.  Choose a suitable font and
window color.  It is advisable that the window with
files did not move.  3a outside
windows do whatever you want.                
                                        
6. Management should be diverse
and flexible.  At the same time from the greatest
number of devices.If the file selection
occurs using the arrow, do
support for KEMPSTON and AU mice.          
     Personally, I am in the overwhelming majority
cases I use to select files
cursor keys (extended
keyboard).   When polling the keyboard,
First, the CAPS SHIFT press is checked,
if it is pressed, then keys 5,6,7,8
are polled as CURSOR joystick, otherwise
like SINCLAIR.                           
     The disk is usually replaced by
SPACE key, this has already become a standard.
It is also convenient to use the key
"ENTER" as in FIRE.                       
                                        
7. If in your opinion it is not implemented
automatic disk change check,
before starting the program you must
re-read the catalog and in case
the required file will not be there, display
directory of the new disk and, naturally,
don't run anything.                    
                                        
8. Before starting the program, you must
restore all system variables and
everything that is required for normal operation
Basic'a.  The screen can be left black
(the attribute area is filled with O code), and
here in system variables you need
write down standard attributes.  Also,
It is advisable to clear all memory that
occupied "voot".9. Programs using 128k ROM or
128k Basic, very little (to be honest, then
I still don’t remember a single one), but
programs that don't work with
connected 128k ROM - a lot.
Therefore, it is advisable that “voot” immediately
I also connected 48k ROM, but with active
pages.   If you don't know how to do it
do, take the lines from the loaders
assemblers "TASM", "ALASM" or from
something else. On a 48k computer
everything will also work fine.     
                                        
1O.  In most boot files, files named
"voot" are not displayed, but sometimes it is
inconvenient, so I recommend this file
output, but if it is written first to
disk, then immediately move the pointer
to the next file.  Also, when searching
name "voot", you need to check everything
eight letters, not just the first four. 
                                        
11. Sometimes in the same program
there are several Basic blocks,
Only one of which is launched. This one
the case can be foreseen, and not
output certain Basic files.
There is no single standard in this case
exists. Sometimes all files are not displayed,
starting with a small letter, but
This method is not always convenient. On my
look, it’s more convenient to filter out all files,
startingfrom the point.                   
                                        
12. In some "voots" it is implemented
sort files alphabetically, but usually
it just makes things more difficult. Therefore
It is better to make sorting disabled.   
                                        
13. Useful when, in addition to the list of files
brief information about
disk.  For example, his name, quantity
free sectors and number of files. 
                                        
14. It is advisable not to hang it harshly
certain music, and it’s easy to make
changeable.   In this case there are two
way:                                
 can be stored in player memory from
any music editor and
upload a file with music without a player.
Or load the compiled block from
player from any editor, but with
in this case it must be compiled under
specific address. In any case it is necessary
describe the hanging process in detail
music.                                 
                                        
                                        
 IF YOU DECIDED TO WRITE A COMPRESSOR...  
                                        
     First, he must allow
write compressed blocks without
decompressor so that you can
decompressone depacKer
a lot of files.                           
     Secondly, you must make an effort to
compressor text option
decompressor so that anyone can use it
change to your taste or try
speed up.                               
     Compression time is not particularly important,
but the decompression rate should be
as fast as possible.  DepacKer must
work normally when allowed
interruptions.                            
     When working with various
compressors it turned out that almost
all existing "crunchers"
(DSQCH, MS_RASK, LPC, etc.) do not work
always correct.   One day, trying
compress the file, I tried 6
or 7 compressors, and none of them
unpacked it correctly! Usually errors
appear when
the compressed file is already compressed
block or screen.                         
   I am not an expert in this
area, but I dare to express my opinion
an opinion that smacks of lameness a little
:-) ... Apparently, the packers are setting up
your control codes, and when repeated
compression they can coincide, that
will lead to incorrect
decompression (just don't hit it on the head,
if I said something stupid :-) )...
Such glitches occur rarely, but
tryso that in your compressor
they weren't there at all.                       
                                        
                                        
 SOME ADVICE FOR A PERSON WRITING   
 MUSIC EDITOR.          
                                        
1. If you have already decided to write it, then you
must surpass all existing ones
this is the editors, otherwise why would they
engage.   In that case, just
it is necessary to write a complete
converter from all editors to yours.     
                                        
2. It is important that the player occupies as much space as possible
fewer cycles. Preferably 2-3 thousand. B
otherwise scope of use
your editor will be very narrow.         
                                        
3. Attach the source to the editor
playera version in any format
assembler (preferably "TASM" because from
The easiest way is to convert the file to
any other editor).  You can also
attach the player text in normal
text format.                      
                                        
4. First of all, I advise you to read
with editors on other platforms. I can
advise to look at the editor
"OCTAMED" on AMIGA. I think you will find
there's a bunch thereuseful ideas about the service and your
the editor will be much more convenient.     
                                        
5. In addition to making life easier for a musician,
you should also take care of the encoder, which
will use music in his
program.  It will be very convenient if you
implement realtime timer. That is
timer that will show the time
playing music with precision
interruptions. This will help synchronize
music in a graphics program.          
                                        
6. Make change possible
melody volume during playback,
so that it can be easily implemented
the music fades out.   You can enter three
variables in the player that will
contain the value of the maximum
volume for channels A, B, C.            
                                        
7. Output to any of the three channels must
just pass out at any time
playing so you can start
on this channel sound FX.               
                                        
8. It would be nice to make it possible
move to any position. This will allow
quickly go to any place in the melody,
store several melodies in one or,
for example, use a melody as a set
sound effects. ADVICE TO A PERSON WHO DECIDED TO WRITE  
 GRAPHIC EDITOR.          
                                        
The likelihood that you will write
such an extensive project is extremely small. Except
In addition, we (AVALON) write the GFX editor ourselves.
Therefore, instead of giving advice
you, I will ask everyone who has
interesting ideas, contact me and
share them.                         
    We also recently heard that
graphic editors write in Chisinau,
St. Petersburg and Kharkov, but so far confirmation
We do not have this data.  If this
indeed, we ask the groups,
those involved in this, contact us and
combine our efforts.  We're ready
only 2O-25 percent, but at the same time,
there are a whole bunch of ideas and preparations. Not
I would like to do what someone
already done...                           
                                        
   tel. (O4622) 5-36-O8 (Victor)      
  address: 2SOOOS Ukraine,       
   Chernigov,           
   st. Kyiv,          
   6 / 34.               
   Onishchenko to Victor.      
                                        
                                        
                                        
 SPECIFIC RECOMMENDATIONS TO AUTHORS     
 SOME SYSTEM PROGRAMS.     
                                        
                                        
    1. "ALASM" wu ALEM           
                                        
      The assembler must
understand binary representation of numbers,
written after the % sign (for example
%OOOOOOOO1).                             
      When loading a WORK file, the cursor
It’s better to immediately install it to the latest one
recorded source.                    
      Ability to mark part of the text
a different color or inversion.  Also
mark lines with a different color
mistakes.                               
      By pressing a certain
key combinations, the assembler must
remember the current position in the text,and
then he should be able to
quick transition to this place.         
      One-time compilation commands
very convenient, but this happens often
situation when several are loaded
files one by one, and tags
are located between them. At the same time
reassembling mark addresses
will be shot down.    For example fragment
programs:                              
                                        
  MUSIC +INCBIN "RAVE+"            
  SPRITES +INCBIN "GFX_CODE"            
  TABLE +INCBIN "DATA"             
When compiling for the first time, the label values
SPRITES and TABLE will depend on the length
previous files, as it should be, but
during subsequent assembly, when
the "+" marker will be replaced with "-", and the files
will not load, all three labels
will point to the same address.
I think to avoid this,
it is enough to remember when
assembling the length of all loaded
files and then add them each time
subsequent compilation.                 
       It is also useful to mute the sound
AU, after returning from the launched
programs.                              
       It is also possible to
unused BREAK key in mode
editing worked like ENTER, but with
line feed not on the fieldmarks, and on
command field.                            
       Works better with the disk
organize as in "TASM-4", that is
load the disk directory into memory and
take the parameters of the prmo files from there, do not
drive the head to zero again
track.                                   
                                        
And a few more tips not only
ALEM, and all assembler creators:
                                        
       It is advisable to provide
testing of launched procedures
time, at best accurate to
tact, a little worse with an accuracy of four,
and in extreme cases, at least with accuracy
before interruption using system
counter (FRAMES).                     
       It is necessary that after leaving
running program without clearing the screen,
it was possible to enter a special mode
calculation of screen addresses. Namely in
mode when the pointer moves across the screen
one byte or one point in size, and
pressing FIRE displays the address of this
bytes in the screen file, in the area
attributes and X and Y coordinates.        
       It would be useful to have a team that
binds the next compilation address to
straight hexadecimal address.       
       I would like it in assemblers
there were commands like: SAVE O TRACK TO 159 and
RESTORE O TRACK FROM 159. 2. STS vu STALKER           
                                        
       If when writing a file to disk there
there will already be a file with the same name and when
this is located at the end of the directory, it
need to erase and write a new file to
his place is like overwhelming
most programs.                   
       When entering numeric parameters for
various functions, for example COPY,
it is necessary to bind the entered numbers not
to the right edge of the window, and to the left, so as not
I had to constantly move the cursor to
a few signs to the right.                
                                        
                                        
                                        
                                        
 3. PERFECT COMMANDER wu JAMES ADVENT  
                                        
       In my version of commander,
there is one minor, but
unpleasant glitch: when copying
several files to the disk on which
Less than 256 sectors left, Commander
sometimes "pretends" to be copying
went well, but in fact the last
files are not overwritten.   If
commanderrestart, everything will be fine
copied perfectly.                    
       Before viewing the screen, it's better
fill attributes with code O.              
       It also wouldn't hurt to have some basic
compiled music player,
at the same time, the commander himself must
"hide" in the pages and load
music with player for any address.     
                                        
   4. TOTAL COMMANDER wu Dr. LOVE     
                                        
       Be sure to make it "hot"
keys, because working with windows is too much
slowly.                               
 I advise you to better choose the colors in
commander, so that he doesn't look like that
too colorful, it just gets in the way
perception of information.                  
       Needs to be implemented
ability to run code files.     
       Possibility to choose any mask
for output files.                   
                                        
                                        
     In this article I have only considered
several programs, but if you have
any ideas or comments on
system soft, write to me or at
editors and we will continue this topic in
next issues of the magazine.              
                                        
    We wishcreative success in business    
    creating system programs!!!     
                                        
                                        

Share your thoughts about the article