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

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

<b>Technology sprites</b> - Part 4: Format of sprites with a mask.
             MASKS


   As for masks, then there
would be difficult to entitle this
article, "These different masks,
because at the front all the masks
easy and standardized.

   For a start let us look at what exactly is a mask.
Look at the sprites from 3D games
BATMAN; you can see that
before the image of the man
is a figure,
which instead shows a man of his silhouette. Why does he need?
It's simple - when printing
sprite on the screen straight copy (LD A, (data); LD (screen), 
A or otherwise), we eliminate the background that was behind 
sprite, resulting in the sprite around the ugly form of 
emptiness, that spoils the overall impression of the game. Here 
zdesto and comes to the fore mask. The central processor has a 
in its arsenal, a logical command as AND. What happens to the 
screen, if the mask imposed on the screen with this Team:



      Screen 11111111 bytes

      byte mask 11100111

                  -------
      result 11100111


   As you see, you can see the space turned off pixels. Someone 
has probably already guessed: indeed, if we impose on the 
screen mask before you print yourself

sprite on the screen will turn an empty space - the size of a 
sprite. If we now print on the screen

sprite no direct copying, but
combine screen and sprite for OR,
then the sprite will fit into the purified
mask window and the background, which is located next to the 
sprite, not will be spoiled.


   How to create a mask. Once your sprite is ready, he
must create a mask, and make it very simple. Creation
Masks can be divided into 3 phases:

   First, we invert the sprite is drawn on (off included bits 
and include shutdown), the second stage - to erase all inside 
the silhouette, and finally, the third stage - we are expanding 
the internal space of the mask by 1 pixel. It is necessary to 
sprite when printing is not merged with background, and 
separated from it by a strip of one-pixel. 

   Well, the mask seems to be everything.
Let me just say that the memory mask
stored in the same form in which is stored corresponding
sprite.






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:
Advertising - Ads by V. Bogdanovich.
AD & D - Diary Bard Silver Rose.
Olden Z80 - Print a copy of Spectrum screen pseudographics.
Advertising - advertising and announcements.

В этот день...   6 May