ZX Forum #04
19 ноября 1997

Technology sprites - Part 3: Format of sprites.

<b>Technology sprites</b> - Part 3: Format of sprites.
      These different Sprite


   The time has come to deal with
formats sprites and methods
store them. We are with you most of the sprites found by
Search sprites and only one -
by searching for characters. From
What we can conclude - non-character storage format is more 
convenient than a character. To understand what their 
differences, let's look at the format in which they are stored 
in memory. For example, take the sprite size

2 familiarity in length and 1 in height:


          1 byte 2 bytes 1 byte 9 byte

          3 bytes 4 bytes 2 bytes 10 bytes

          5 byte 6 byte 3 bytes 11 bytes

          7 bytes 8 bytes 4 bytes 12 bytes

          9 bytes 10 bytes 5 bytes 13 bytes

         11 bytes 12 bytes 6 bytes 14 bytes

         13 bytes 14 bytes 7 bytes 15 bytes

         15 bytes 16 bytes 8 bytes 16 bytes


             non-character character


   If you look closely at the picture, you will see that
character sprite is stored in memory as a font your computer, 
then is in the form of a set of characters that are printed on 
the screen in sequence. These sprites can print a simple 
operator BASIC PRINT, if before that point in

variable, which stores the address of the font, the address of 
our sprite minus 256 bytes. In machine Codes can use the 
command RST # 10. The basic work Printing sprites we shift on 
ROM computer and it would seem, it's good. But such spraty very 
slowly printed on the screen, and if your program a lot of 
moving objects, will become very slow noticeable. This format 
is suitable Print static or low

moving sprites, such as in the program KRAKOUT. The logs we 
could see and excellent from those used in the ROM of the 
principles print, which work much faster, but still not fast 
enough. 

   With regard to non-character
format sprites, here you
ROM does not work, and a program for
Print You will have to create
themselves, but this method of storage
Sprite provides optimum speed for printing.

   There is another character format store sprites
which is even more sluggish,
than the previous one. I would not
dwell on it, but this
format advocated in the "ZX" Revue "(individual correspondents)
and in an interesting book
by "Peter" How to write a play
in assembler. "

   Let's look at this format.

   The method is based on the fact that empty familiarity 
(which can be seen dotted line) are ignored and a sprite not 
saved. This saves a few bytes, but brings in

procedure for printing complexity in its
organization, and complexity in the description of the sprite. 
Look how it is stored in memory:


TITLE:

DATA 26 (of familiarity in

         sprite).
DATA 0,0,7,0,1,7,0,4,7,0,5,7

         (First row familiarity)
DATA 1,0,7,1,1,7,1,2,7,1,3,7

         and so on.

DATA.


   Further data come from familiarity in
type font.


   A description of each familiarity, in addition to its data, 
is given another 3 bytes: the first - the coordinate Y, which 
is measured from the upper left corner, the second - the X, 
which is counted as from the upper left corner, and the third 
byte - attributes (ink, paper, bright,

flash in one). In our case
let them remain four familiarity, and
sprite occupies in the memory 287
byte, whereas if we
saved it in the form of non-character sprite, it would occupy
240 (although we did not save empty familiarity) bytes. Hence
Conclusion: The savings can be achieved only when a large 
number of empty familiarity that is extremely rare, but the 
printing process much more complicated. 

   Perhaps there is still any
Format sprites, but I do not
met, and we proceed to
Review of masks.






Other articles:

Help - Description of the shell of an electronic book "ZX-FORUM 4.

Secrets of Successful Design - Head for the book "Design your Programs

screen effects - Running a string of R-Type.

screen effects - clearing the screen of Zynaps.

screen effects - "minimize" the screen from Comando Tracer.

screen effects - smooth "decay" of the screen Sommando Tracer.

screen effects - changed the character set for the original stylized font from the game Rockstar.

screen effects - "running out the string" out of the game Rockstar.

screen effects - "pouring" the screen of the game Rockstar.

screen effects - a complex multi-effects from the game Bubbler.

New top 40 procedures - scrolling display, a fusion of two images, inverting screen, rotate characters, replacement of attributes, fill a closed loop, the calculation of addresses in the screen, copy of the screen, etc.

Technology sprites - Part 1: Introduction.

Technology sprites - Part 2: The hunt for sprites (search and pulling).

Technology sprites - Part 3: Format of sprites.

Technology sprites - Part 4: Format of sprites with a mask.

Technology sprites - Part 5: Structure sprite blocks (both co-exist in memory sprite and mask, what data to help us quickly find the address of the sprite in memory, and much more.)

Technology sprites - Part 6: preparation of data for publication.

Technology sprites - Part 8: Printing sprites (coordinates are given in familiarity).

Technology sprites - Part 9: Printing sprites (coordinates given in pixels).

Technology sprites - Part 10: a review of programs to work with sprites and graphics.

world of sound Spectrum - Chapter 1: The Physics of Sound.

world of sound Spectrum - Chapter 2: Operator BEEP, Creating effects on BEEPe, Making Music on BEEPe.

world of sound Spectrum - Chapter 3: How is the sound device (BEEP'ra and methods of sound production).

world of sound Spectrum - Chapter 4: Programming sound in assembler.

world of sound Spectrum - Chapter 4.1: Programming sound effects - Tone, Noise, Complexes effects.

world of sound Spectrum - Chapter 4.2: Programming Sound Effects - Volume Control.

world of sound Spectrum - chapter 4.3: Sound Effects - Management timbre.

world of sound Spectrum - Chapter 4.4: Programming sound effects - music programming.

world of sound Spectrum - Chapter 4.5: Programming sound effects - Polyphonic ringtones (polyphonic).

world of sound Spectrum - chapter 4.6: Treatment of external signals - digitization.

world of sound Spectrum - Chapter 4.7: Handling of external signals - Reverberation.

world of sound Spectrum - chapter 4.8: Synthesis of speech.

world of sound Spectrum - Chapter 4.9: audio playback interrupt.

world of sound Spectrum - Chapter 5: The operator PLAY for music coprocessor AY- 3-8910 (AY-3-8912).

world of sound Spectrum - Chapter 5.1: Creating effects operator PLAY.

world of sound Spectrum - Chapter 5.2: Making Music on PLAYe.

world of sound Spectrum - Chapter 6.1: Description of the coprocessor registers of the musical AY- 3-8910 (AY-3-8912).

world of sound Spectrum - Chapter 6.2: Programming effects and music under the musical coprocessor AY- 3-8910 (AY-3-8912).

world of sound Spectrum - Chapter 7: Software Review ZX-Spectrum to create sounds and music.

world of sound Spectrum - chapter 7.1: Editor, Sound Effects SUPER SOUND.

world of sound Spectrum - Chapter 7.2: Music Editor Wham the Music Box.

world of sound Spectrum - Annex 1, 2: Listings sound effects SUPER SOUND'a, tips assembler.


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

Similar articles:
News - You've seen Triumph Word? Dark Raven disappeared, T (c) S set about trying to write a viewer, HTML, came here Dissonator, Ldir joined the Invaders.

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