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

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.)

<b>Technology sprites</b> - 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.)
   STRUCTURE sprite BLOCKS


   This is perhaps one of the most
bulk and intricate parts
this narrative. In it I
talk about how to coexist in
memory sprite and a mask, which
data help us to quickly
find the address of the sprite in memory
and much more.

   Finally I will touch on in his
story we have found other sprites. Look at them,
they do not happen to have different
form. This seemingly insignificant fact, as
mask, located on different sides of the sprite, is not a minor. 
It was from her location relative to the sprite which affects 
the speed print sprite, as well as the appearance and

playability of the program.

   Let's look at the sprite
from the game 3D BATMAN. Here, the mask
and Sprite are separate
sprites and printed at a time - this is quite a common way
Storage sprites, but the seal of the sprite is time consuming 
(of course, this notion respect, and everything depends on

talent of the programmer). Next
sprite from the program ELEFANT-1
interesting is the fact that it is a somewhat unclear what, in 
fact, it shows. Well, but if you try and connect

among themselves or, more precisely, put
order with no spaces, familiarity 1, 3, 5, and next to them, 2
4, 6. Is not it true, now all
understandable and even beautiful.

   This is another way of storing
in the memory mask and sprite, which, in my opinion, the most
successful, and in print spends very little time. This is 
because say, chess storage method sprite when alternate

byte mask, and byte sprite.

   Program JAK THE NIPPER-2
offers us another way
Storage sprites, when the mask and
Sprite is a great
sprite. In this case, the program works pretty print
quickly, though inferior to the previous method.

   On the character format, I will not tell because of the
This much has been written. You can
read more about this format in the journals "ZX-Revue" or the 
book "How to write a game in assembly "

by "Peter". There you will find a program to print such
sprites.

   Now, what data
to help us in our work with
sprites.

   I can distinguish two types of blocks noncharacter sprites 
(hereinafter I will only talk about noncharacter sprites, so I 
will use the word sprites) - it blocks consisting of sprites

the same size, and the second
type - blocks of dissimilar sprites. In the first case, the 
title of Sprite is minimal - it is 2 bytes - length and height 
of the sprites, and also 2 bytes (often enough

1) - the length of one sprite in bytes. These data are 
sufficient, to quickly locate desired

sprite into memory, and just as quickly
to print them.

   A second type of blocks harder then four bytes at
the whole block did not get off. In this
If there are two ways:
1) before the unit sprites drawn up a table in which each 
sprite allocated 4 bytes - 2 bytes in length and height of the 
sprite and another 2 bytes - the address of the sprite in

memory. Instead of a specific address sometimes indicate the 
shift to sprite, in this case, sprites

You can move in memory. This type of table let's call
individual, 2) a second type of table can be called a 
cross-cutting. Here No single table, but before

Each sprite put all the same
4 bytes with a slight difference: 2
bytes - the length and height of sprite
(It) and 2 bytes - address / offset to the NEXT sprite.

   As a separate table
was described by the first of it we
First we'll talk. Similar
header format is the best because it provides
the fastest access to sprite
whereas the second method requires
special program to determine the location of the sprite
memory. We must note one more
moment - with direct addressing
(When given a specific address
sprite) moving sprites
memory becomes impossible, and
header block sprites completed another 2 bytes (for all
block), who report address
fixation, it is relatively
some addresses were fixed
sprites.

   In some games, the sprites are not
monochrome and color, so
In addition to the mask and sprite to them
join another, and data attributes. Attributes are stored in the
same format as the sprites, but
there is one thing - for
Mask attributes is no need, pay attention to it so as not to
spend the extra memory.

   Another recommendation - the height of the sprite is best to 
immediately set in pixels, in order to print does not spend its 
computation time. 

   After reviewing all the major issues, the format of sprites, 
we turn to the practical side of, and consider different 
procedures for printing sprites.







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:
animated cartoon - Description tekstovgo editor of ZX-Winword, allowing to make graphical inserts in the text, and its utility Sprite Cutter - Cutting these insertions.

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