RUSH #01
29 мая 1999

Spectrum programming - A brief guide to the system encoder. Tips to author "boot'a", packer, music editor.

<b>Spectrum programming</b> - A brief guide to the system encoder. Tips to author
  QUICK GUIDE TO SYSTEM CODER


     The man who decided to write the system
program faces many challenges. This text is intended at least 
in part to help you make your program quality and comfortable. 
Naturally, I could not account for all the nuances, but all the 
same, if You take advantage of councils izlozhennmi

below, it will be easier and you yourself, and users of your 
programs. 

    This amended version of article, once published in the 
"Depth 1". DATA topic We intend to continue in subsequent 
issues "RU (S) H". 



  WHAT SHOULD BE CONSIDERED FIRST

     FOR CREATION OF SYSTEM SOFTWARE

1. Your product should be
into account all the advantages and disadvantages of the 
previous programs of this type. Learn the mistakes of others, 
and use all the achievements of their predecessors. 

2. Management program must be
flexible and varied. Standard set is: SINCLAIR (right)

                KURSOR,

                KEMPSTON (with validation)

                PAD (O, P, Q, A,

                            SPACE and M).
Also KEMPSTON and AY mice. If you do not
mouse, but you want to implement its support, you can read 
about how to do it in the following publications:

 about KEMPSTON mouse - "SPECTROFON 20" in

                    under "Design"
 of AY mouse - "ZX-POWER 1" in section

              "Iron."

3. You should always check KEMPSTON joystick and do not 
interrogate him if he is absent. Otherwise, all

machines without this port, your work will not work. Recall 
that if KEMPSTON'a not - bit 5-7 are installed.


4. Your program should make maximum
use all the resources of the machine on which it operates. Need 
to test available memory and run it

with him. I can advise to use
auto-configuration memory of the "ZX-FORMAT5",
written by CREATOR'om. It will allow your
program work with memory from 48k to
megabytes.

5. Copiers and other disk utilities have to work as a single 
drive, and with two. 

6. If a program has many mutable
parameters (more than three), just to make them write to the 
disk (SAVE SETUP). In this recording must be done inside the 
program, after checking its availability and location on the 
disk. 

7. If your program works with
the second mode, interrupt, to connect them
need to create a 257 byte table
clogged by a single number, because many
cars with tires not read # FF, and any number. This has already 
been much discussed, but still sometimes appear program

not considering it.

8. Naturally, the segments (pages)
switch need not port # FD, and
through a full port # 7FFD (dec: 32765).

9. When accessing the disk must be
connected to the first mode interrupt (IM 1).
If you for some reason you need
IM 2, you can use the interrupt vector tolko within the areas 
of fast memory (# 8000 - # BF00 (32768-49151) or

pages 0,1,2,3), with location
interrupt vectors in the slow areas of memory, the entire 
computer, and with it the TR-DOS, will operate at 25 percent 
slower, and disk operations will be disrupted. This is typical 
only for machines with a separate field of memory for the rest, 
for example, Pentagon, it does not matter but still it must be 
considered. On the separate fields of memory in detail in 
Belarusian newspaper "ECHO 2, suggest You read it.


       So is the transition to standard
trap mode (IM 1), must be restored in case I, the value 63 dec,
otherwise your program will not work on
many machines, including brand.



  Somewhat more detail COUNCIL

      CERTAIN TYPES OF PROGRAMS



  14, the Board PERSON Writing "boot":

1. Soon need to decide what to drive
This "boot" will be used. For
system is preferable to a simple but
easy to use interface, without special effects
and unnecessary frills. If the "boot"
be used for games and
demos, a different matter, effects, graphics and music are 
welcome. 

2. Naturally it should occupy as
may be less disk space.

3. The faster your "boot" will be loaded and run, the better. 
In any case, you should not hang him effects with long 
DECRUNCHER'ami. 

4. Try to time the screen was displayed the greatest amount of
files.

5. The names of the programs must be well
readable. Choose the right font and
color of the window. It is desirable that the data window is 
not moved. Outside the same window do anything.


6. Management must be diverse and flexible. At the same time 
from the largest number of devices. If the file selection

occurs by the arrows, make
support KEMPSTON and AY mice.

     Personally, I am in the majority
cases to select the files I use
cursor keys (Extended Keyboard). In a survey of the keyboard, 
first verified pressing CAPS SHIFT, if

she pressed, the keys 5,6,7,8 polled as the Cursor joystick, 
except SINCLAIR. 

     Replacement disk is usually produced by pressing SPACE, it 
has become standard. It is also convenient to use the "ENTER" 
key as FIRE.


7. If your boot'e not implemented
automatic verification of disc replacement, before
starting the program should read
catalog and, if desired file
not there, take the directory already
the new drive and, of course, nothing
run.

8. Before starting the program you want to restore all system 
variables and all that is required for normal

work with the Basic. You can leave a black screen (the area is 
filled with the attributes of code 0) but in the system 
variables need to write the standard attributes. Also, 
desirable to clear all the memory that held the "boot".


9. Programs that use the 128k ROM or
128k Basic, very few (honestly, I
did not think of one), but programs that do not work with 
connected 128k ROM - set. Therefore, it is desirable

to "boot" immediately connected a 48k ROM
but with the active pages. If you do not know how to do it, 
take the line of downloaders assemblers "TASM", "ALASM"

or from some else. At 48k a computer, all will work fine.

10. Most casks files named
"Boot" does not appear, but sometimes it's inconvenient, so I 
advise that the output file, but when he recorded the first 
disk, a pointer to immediately move to the next file. Also, 
when searching for the name "boot", to inspect all eight 
letters, and not only the first four.


11. Sometimes in the same program
is somewhat Basic blocks, runs only one of them. This case
can provide, and do not show certain Basic files. Single 
standard in this case does not exist. Sometimes

do not display all files beginning with a lowercase letter, but 
this is not always convenient. In my opinion, easier to sift

all files that begin with a dot.

12. In some "boot'ah" realizivana
sort files in alphabetical order, but usually
it only complicates the work. Therefore,
Sort best to make you want to disable.

13. Useful, except when the file list
the screen is given a summary of the
disk. For example, his name, number of
free sectors and the number of files.

14. It is advisable not append rigidly
some music and make it easy
replaceable. In this case, there are two ways:
 can be stored in the memory of a player or a music editor and 
load  music files without the Player. Or for gruzhat compiled 
block player'om  of any editor, but he must wives be compiled 
under a certain  address. In any case, you must describe in 
detail the process of suspending write music. 



   IF YOU DECIDE TO WRITE COMPRESSOR ...


       First, he must allow to record compressed blocks without
decompressor to be able to uncompress a depacker'om many files.

       Secondly, you must attach to
compressor to the text version of the decompressor, so that any 
could change it to his taste, or try to accelerate.


       Time compression is not particularly important,
but the rate of decompression must be
as quickly as possible. Depacker must work at interrupt enable.

       When working with a variety of compressors was found 
that virtually all existing "Cruncher" (DSQ4, MS_PACK, LPC 
etc.) are not working correctly vsegada. One day, trying to 
compress a file, I tried 6 or 7, compressors, and no

One of them is not unpacked it right!
Usually, errors appear in the case
When a file is already kompressiruemy
compressed block or screen.

   I am not an expert in this field, but I dare to express 
their views, slightly smelling leymerstvom :-) ...

Apparently, the Packers puts its control codes, and 
re-compression they may coincide, which would entail

incorrect decompression (just do not hit
on the head if I said some
stupidity :-)) ... These glitches occur
rare, but try to get in your compressor nebylo them all.

      Zadolbalo me to write loader'y
programs. I would be glad to implement in the compressors of 
the function of several multipakinga Files suspension followed 
standard loader, which would itself rasbrasyval

files through the pages ...



   A FEW TIPS TO MAN Writing

           MUSIC EDITOR

1. If you have already decided to write it, then
You have to beat all existing before
The editor, otherwise why do it
to deal with. In this case, just need to write full-fledged 
converter of all editors in your.


2. It is important that served as a player
possible cycles. It is desirable to 2-3 thousand. Otherwise, 
the area of ​​your editor really shrink. 

3. Attach to the editor of the source
playera option in the format of any
assembly (preferably "TASM" because of
he easiest way to convert the file to
any other editor). You can also make the text the player in the 
usual text format.


4. First I advise to get acquainted with the editors on other 
platforms. I can recommend to see the editor

"OCTAMED" for AMIGA. I think you will find
there is a lot of useful ideas for service and your
editor will get much easier.

5. In addition to facilitating the life of a musician
should take care of coders who
will use music in their program. It will be very useful if you 
implement a realtime timer.To has a timer which will show the 
playback music up to interrupt. This

help to synchronize the music in a program with graphics.

6. Make the ability to change the ringing tone when playing, so
can be easily implemented zatihanie music. You can enter three 
variables in player'e that will contain the value maximum 
volume for channels A, B, C. 

7. Conclusion in any of the three channels should just cut off 
at any time play, to be let on This channel sound FX.


8. It would be an opportunity to make
move to any position. This will allow
quickly move to any place in melody
keep a few tunes in one or
For example, using the melody as a set
sound effects.

9. Listening to music on the Speccy, the majority of
do not realize that most of the tunes too much "fake" because 
of the program features some of the editors. But one of my 
friends from Kiev - Sasha - a professional musician and music 
by the adjuster. instruments drawn on it special attention. 
Thus, relying on his perfect ear for music :-), you can

say no "Sound Tracker'e", nor
"ST-pro", no "Pro Tracker'ah" no right, from a musical point of 
view, the sound generation. Only the old, old "ASM" good to 
hear functioning and accuracy of sound. 

      Thus, there are already converted
version of the third "Pro Tracker'a", in which
embed a spreadsheet of sound borrowed from the "ASM" 
Sendetskogo. 

      I hope everything's new editors
and their versions will consider this no small nuance.
All the same sound - the main thing in the music
editor.


 SOME SPECIFIC RECOMMENDATIONS FOR AUTHORS

           System Software



          1. "ALASM" by ALEM


        Assembler must understand the binary representation of 
numbers, written after the% sign (eg% 00000001). 

        When downloading a file pointer WORK
it is better to install the last recorded source.

        Opportunity to mark the text
different color or inversion. Just to celebrate in a different 
color lines with errors. 

        By pressing a combination opredelelennoy Clavey, the 
assembler must remember current position in the text, and then 
he should be able to quickly jump to that place.


        Teams disposable compilation
very convenient, but often found this
situation when loaded several
files one by one, and the tags are placed between them. In this 
case, when re- assembly address labels will be shot down. For 
example code fragment: 

  MUSIC + INCBIN "RAVE +"

  SPRITES + INCBIN "GFX_CODE"

  TABLE + INCBIN "DATA"
When the first compilation label values
TABLE SPRITES and will depend on the length
previous files, as it should be, but
during subsequent assembly when
marker "+" will be replaced by "-", and files
will not be loaded, all three labels will point to the same 
address. I think to avoid this, enough to remember when 
assembling the length all loadable files and then add them at 
each subsequent compilation. 

       It is also useful to disable the sound on
AY, after returning from the startup programs.

       You can also order untapped BREAK key in edit mode 
worked as ENTER, but with the translation line than on the 
label, and the field teams. 

       Work with the drive to better organize
as in "TASM-4", that is, load the disk directory in memory, and 
take options MRE files from there, not chasing the crown once 
times the zero track. 

And a few more tips, not only ALEM'u,
but also go out to all assemblers:


       Desirable for testing startup procedures are time
the best case up to the bar, just
worse, up to four, and in extreme
If at least up to the interruption
using the system counter (FRAMES).

       It is necessary that after leaving the
running program without clearing the screen,
could enter into a special mode
calculate the on-screen addresses. Namely
mode when the screen goes Index
value in one byte, or one point, and
FIRE is displayed when you address this
byte of the OSD file in the attribute and the coordinates X and 
Y. 

       Would benefit from a team that
binds the following address compilation
to smooth hexadécimal address.

       Would like to see in the assembler
were commands like: SAVE TRACK TO 159 0
and RESTORE 0 TRACK FROM 159.

       Also useful would be the presence of
cleanup functions and pages.



            2. STS by STALKER


       If writing the file to disk there
already a file with the same name and
This is in the catalog, it
need to erase and write a new file
his place, as does the vast majority of programs.

       When you enter the numerical parameters for
different functions, such as COPY, be tied to the input number 
is not right edge of the box, and to the left so as not to

had to continually move the cursor to the
several characters to the right.



   3. PERFECT COMMANDER by JAMES ADVENT

       In my version of the Commander, there is one small but 
nasty bug: when copying multiple files

the disk on which it remains less than 256
sectors, Commander sometimes "pretend"
that copying went well, but in fact the latest files are not 
overwritten. If the Commander restarted everything will be 
copied perfectly. 

       Before watching the screen, better
scoring attributes Code 0, curb and better
always leave a black, so-as "intellectual opredelyalka" 
sometimes looks like a full color blind, I tell you how

Artist ...


       It will not hurt as elementary
compiled music player, with
it himself commander must "hide" in the
pages and load music from player'om
at any address.

       Much to the article will be viewing standard text files 
with profiles 42 and 64 characters per line.


       I wish that was implemented
standard feature of saving a copy of the directory on 159'om 
track. 


       But still please Plug 48k
ROM and clears all memory when running programs.

       It was just wonderful, would, if
Would you sold in the Commander line and
valuable work with MS-DOS. Zadolbalo
to copy the files using a text editor ... :-)



     4. TOTAL COMMANDER by Dr. L0VE


       Be sure to make "hot" keys, as with windows to work too 
slowly. 

       I advise you to pick a better color
a commander, that he did not look so
too gaudy, it's just distracting information.

       Necessary to realize the opportunity
Launch code files.

       Ability to select any masks
output files.



      BEST VIEWER 2.5 by Ivan Roshine


     Just a wonderful thing! I can not get enough!

     What is lacking for complete happiness:


    Playing not to compile files
from "ST-pro" (as in "X-player'e").

     Ability to view text in the format 42 characters per line, 
and possibly in different encoding (WORD, D. Mihaylova

(Amiga), etc.).

     Browse archives sprite format
"SprGen 5.1" from Real Software.

     The Office of Kempston'a.

     Possibility of increasing the window faylrikvestorom where 
file lists would go to several rows. 

     Displaying the auxiliary system information (starting 
address and length the file name of the drive, etc.).


     According to the "urgent request of viewers," playing 
music in podgruzhennoy the background while you view the text,

eg.

     In general, it would be best'om of best'ov
unite "BV" and "Perfect" into a coherent whole, or supplement 
"BV" all the attributes shells, focusing on the "Perfect" ...




     In this article I have considered only
several programs, but if you have
any ideas or comments on the system soft'u, contact us and we 
will continue this subject to the following numbers of "RU (S) 
H". 

    Creators of the programs and their users
must communicate and work together
to make into new products and changes
improvement.


      We wish you every success in the

       create the software programs!





Other articles:

AMIGA NEWS - AMIGA OS v3.5 - questions and answers.

AMIGA NEWS - Description of image file viewer - Fast JPEG.

AMIGA NEWS - Programming on the Amiga: Amiga On the inside, Graphics coprocessors Features assembler.

AMIGA NEWS - Events of 1998 (summary of events).

AMIGA NEWS - Cheat'y For Amiga-games: After The War, Magicland Dizzy, Fantasy World Dizzy, Alien Breed, Exolon, Jagar Zj2200, Goblins, Mega Ball, Prince Of Persia, Projects-x, UGH!, Rick Dangerous-2.

AMIGA NEWS - Amiga GFX-chip Permedia2.

AMIGA NEWS - Amiga today.

Spectrum programming - Fast 3D-calculations: an advanced algorithm.

Spectrum programming - Sound effects for a music processor and combine with the main melody.

Spectrum programming - Mirroring bytes and restoration of the background buffer.

Spectrum programming - A brief guide to the system encoder. Tips to author "boot'a", packer, music editor.

Spectrum programming - Modern methods of coding and modern ways of working with graphics.

The End - an epilogue.

ZX-SOFT - "Black Raven II ": Get ready for another hit from Copper Feet!

ZX-SOFT - Description of programs: Real Commander v1.6

ZX-SOFT - arguments about the demo: Forever vs Refresh.

Ator - The authors of the magazine.

Virtual Speccy - Conversion of graphics on the Spectrum to the PC and Amiga.

Virtual Speccy - The emulator of CodeBusters on the Amiga.

Virtual Speccy - Emulators ZX-SPECTRUM on the PC: Where to get the latest FAQ on emulating ZX-Spectrum, What Emulators are most useful - an emulator Luntera, UKV v1.2, Shalaev. What kind of files with the extension *. $ b, *. $ c, *. $ s, *. $ z, *. $ w? How to read format "hobeta". How and in what emulator You can work in the iS-DOS. Convert files. Z80 to. $ and vice versa. Files with the extension. Fdi. Problems with the emulator UKV. How to get a clean disk image file (. Trd) Emulator Shalaev. Is there a Russian ZX-oriented FTP or WWW server? Hobeta refuses to read / write drives 3.5 "- what to do?

Entry - the story of creating a magazine.

Entry - On order stsenovogo magazine - RUSH.

Interview - A great interview with ANTARES.

Interview - An Interview with Kvazar'om of RUSH.

Interview - An interview with a group of Vitebsk Power group.

Informatsrium - CD with the emulator and the ZX-software.

Informatsrium - Interesting INTERNET addresses.

Informatsrium - Overview of magazines and books about the Amiga.

Journal - Platformobesie - cross-platform wrapper for the magazine.

Parallel Worlds - The history of central processors and Windows.

Parallel Worlds - an overview of the computer models Macintosh.

Development Spectrum - 128 colors on the Spectrum (graphic description of the expansion of the palette).

Development Spectrum - Lock the keyboard port when connecting SPECCY C-DOS modem.

Development Spectrum - New Speccy - AZXMONSTRUM 512K.

Development SPECTRUM - New Spectrum from Sinclair.

Development Spectrum - The descendants of the processor Z80.

Advertising - a detailed price list of firm Scorpio.

Advertising - Advertisements and announcements ...

Advertising - Advertising Company X-Trade.

meaning without a sense - Short Stories: The happiest man, third eye, the Savior of the Universe, Tsvetik-semitsvetik, Life has just begun, the Last Judgement.

Scene vs professional - has assembled a team of the best people from the scene, we can create programs of the highest quality ...

Stsenohroniya - tenacious Spectrum: Spectrum of roads, most of us. Why?

Stsenohroniya - A brief overview of news from the band RUSH.

Stsenohroniya - Overview of the stage-event: Alliance, Alchemist Research, Asphyxia, Brokimsoft, CodeBusters, Concern Chaos, Copper Feet, Crystal Dream, Digital Reality, E0Mage, Energy Minds, Entire, Excess, Fatality etc.

Stsenohroniya - Echoes Fun Top'98.

Stsenohroniya - Draft Long Live Amiga, designed to assist the establishment and development amigovskoy scene.

Office shell - on the ZX version of the shell.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Miscellaneous - about cats, save lives.
Pulse scenes - Report from the Assembly Party'99 (Finland).
Stuck? - Description of the game "Smagli - 2.
Hit Parade - the top 10 programs on the basis of sales of firm Welcome.

В этот день...   21 November