ZX Review #7-8-9-10
08 ноября 1997

Studies - sprite scroller. Procedure display screen.

<b>Studies</b> - sprite scroller. Procedure display screen.
(C) Komandin IG, Kaluga


   Offer my program from.
This sprite scroller with the possibility of using sprites
height from 1 to 8, and familiarity
width from 1 to 31 familiarity.
140.
; (C) ZX-MANIACS
; SPECIAL FOR INFORCOM
3; KALUGA'1996


          ORG 40000

DX EQU 4
DY EQU 4

          CALL INIT

          CALL SCROLL

          RET
INIT LD HL, BUFF

          LD DE, BUFF +1

          LD BC, DX * DY * 8-1

          LD (HL), 0

          LDIR

          LD HL, TEXT

          LD (TEXTP), HL

          LD HL, 41000

          LD (FONT), HL

          XOR A

          LD (COL), A

          RET
SCROLL LD A, (COL)

          OR A

          JR Z, LDCOL

          DEC A

          LD (COL), A

          JR NEXT
LDCOL CALL LDIRB

          LD A, DX * 8

          LD (COL), A
NEXT LD HL, # 481F;!

          LD DE, BUFF + DX-1

          LD B, DY
LOOP PUSH BC

          PUSH HL

          LD B, 8
LOOP1 PUSH BC

          PUSH HL

          EX DE, HL

          AND A

          LD B, DX
LOOP3 RL (HL)

          DEC HL

          DJNZ LOOP3

          EX DE, HL

          LD B, 32;!
LOOP2 RL (HL)

          DEC HL

          DJNZ LOOP2

          POP HL

          LD B, DX * 2
LOOP4 INC DE

          DJNZ LOOP4

          POP BC

          INC H

          DJNZ LOOP1

          POP HL

          LD BC, 32

          ADD HL, BC

          POP BC

          DJNZ LOOP

          RET
LDIRB LD HL, (TEXTP)

          LD A, (HL)

          OR A

          JR NZ, NEXTA

          LD HL, TEXT

          LD (TEXTP), HL

          LD A, 32;!

          JR NEXTB
NEXTA INC HL

          LD (TEXTP), HL
NEXTB SUB 32

          LD H, A

          LD C, DX * DY

          LD L, 0

          LD B, L

          LD A, 8
L1 ADD HL, HL

          JR NC, L2

          ADD HL, BC
L2 DEC A

          JR NZ, L1

          ADD HL, HL

          ADD HL, HL

          ADD HL, HL

          LD DE, (FONT)

          ADD HL, DE

          LD DE, BUFF

          LD BC, DX * DY * 8

          LDIR

          RET

COL DEFB DX * 8
TEXTP DEFW TEXT
FONT DEFW 41000
BUFF DEFS DX * DY * 8
TEXT DEFM "MEGA SPRITE"

          DEFM "SCROLL IS"

          DEFM "WRITTEN BY"

          DEFM "KOMANDIN ILYA"

          DEFM "(ZX-MANIACS)"

       3 DEFM ", KALUGA'1996"

          DEFB 0
2

   And now some annotations to the program.


   1. As a basis for program
used a running line
Sergei Kaminsky (ZX REVIEW N3 '
1995, p.43-45).

   2. The program also uses the procedure MUL_3 Alexei
Zhil'tsova (ZX REVIEW N3'1995, p.
35-36).

   3. Although the size of sprites
procedure and can be very
great, I would not recommend to use sprites larger than
6x6 familiarity. First, the character set for these sprites 
takes more than 27 kilobytes and secondly, the speed, then

programs are not instantaneous. If
You are running out of BASIC, then you
would have to abandon the usual PAUSE 1 is already in sprites
more than 3x3 familiarity. However, the native, fortunately,
You can use the HALT even at fairly large sprites.

   4. When getting your program, you
should use the assembler,
perceiving the mathematical
operation "multiply", or if you
have to recalculate some numbers manually, which will agree, is 
not very convenient. 

   5. How to create a sprite
set for the scroller - it is
Your concern, but I would advise
use the Yuri Alekhine (ZX REVIEW 1'95, p. 45). In
Basically, it can be easily
remake for sprites of any
size.

   6. At the end of the text messages, recorded from the label 
TEXT, the program automatically writes another space. It's not 
an eccentricity of the author, but a necessity, but if you want 
should be issued is not a space, and any other symbol, are 
registered the code into the battery in the string

marked with three exclamation icon.

   7. Now it's time to tell you how to change these
scroller. Dimensions of the sprite
horizontal and vertical variables are defined in the DX and DY,
respectively, at the very beginning
program. Byte address in the display area corresponding to
top right corner of the output scroller is given in a row
with one exclamation point
and the length of the window - with two. Attention! Make sure 
the window to display scrolling text does not go beyond 
one-third screen, otherwise there will be bugs!


   8. Scroller similar program run by Sergei Kaminsky - see 1 
st para. 


        Sincerely, ZX-MANIACS.


          *

(C) Komandin IG, Kaluga


   Propose a procedure screen display horizontal lines. Offer 
full and simplified procedures, although quality of the latter 
to me, honestly speaking, does not like.

140.
; (C) ZX-MANIACS
; SPECIAL FOR INFORCOM
;

          ORG 40000

          ENT

BUFF EQU 41000

          LD HL, TABL

          LD DE, TABL +1

          LD BC, 191

          LD (HL), 0

          LDIR

          LD B, 192

          LD HL, 14000; *
LOOP PUSH BC
LOOP1 PUSH HL

          LD A, (HL)

          CP 192

          JR NC, CONT

          LD HL, TABL

          LD D, 0

          LD E, A

          ADD HL, DE

          LD B, A

          LD A, (HL)

          OR A

          JR NZ, CONT

          INC A

          LD (HL), A

          LD A, B

          LD C, 0

          CALL 8880

          LD D, H

          LD E, L

          LD BC, BUFF-16384

          ADD HL, BC

          LD BC, 32

          LDIR

          HALT

          POP HL

          POP BC

          DEC HL

          DJNZ LOOP

          LD HL, BUFF +6144

          LD DE, 22528

          LD BC, 768

          LDIR

          RET

CONT POP HL

          DEC HL

          JR LOOP1

TABL DEFS 192



          ORG 40000


          LD BC, 400

          LD HL, 14000; *
LOOP PUSH BC
LOOP1 PUSH HL

          LD A, (HL)

          CP 192

          JR NC, CONT

          LD C, 0

          CALL 8880

          LD D, H

          LD E, L

          LD BC, BUFF-16384

          ADD HL, BC

          LD BC, 32

          LDIR

          HALT

          POP HL

          POP BC

          DEC HL

          DEC BC

          LD A, B

          OR C

          JR NZ, LOOP

          LD HL, BUFF

          LD DE, 16384

          LD BC, 6912

          LDIR

          RET

CONT POP HL

          DEC HL

          JR LOOP1

BUFF EQU 41000
2

   In lines with an asterisk, given the address in the ROM used 
as a generator of random numbers. By changing this address, You 
can get different sequences of output images. 


   The following procedure is like
puts a picture of the individual
lines, falling from above.
140.
; (C) ZX-MANIACS
; SPECIAL FOR INFORCOM
;

          ORG 40000

BUFF EQU 41000


          LD A, 191

          LD BC, 49152
LOOP PUSH BC

          PUSH AF

          CALL 8880

          LD DE, BUFF-16384

          ADD HL, DE

          POP AF

          PUSH AF

          INC A

          LD B, A

          XOR A
LOOP1 PUSH BC

          PUSH AF

          PUSH HL

          CALL 8880

          EX DE, HL

          POP HL

          PUSH HL

          LD BC, 32

          LDIR

          POP HL; *

          POP AF

          PUSH AF
140. PUSH HL

          DEC A

          CALL 8880

          LD D, H

          LD E, L

          INC DE

          LD (HL), 0

          LD BC, 31

          LDIR

          LD B, 250
PAUSE NOP

          NOP

          DJNZ PAUSE; **

          POP HL

          POP AF

          INC A

          POP BC

          DJNZ LOOP1

          POP AF

          DEC A

          POP BC

          DJNZ LOOP

          LD HL, BUFF +6144

          LD DE, 22528

          LD BC, 768

          LDIR

          RET
2

   Falling speed lines can be
changed by changing the amount on line
before the label PAUSE. With a small delay in the image
I began to tremble visibly. In
Basically, I am inclined to attribute all
it to the eccentricities of my computer (I have, for example, 
very strong shaking screen LASER

SQUAD), but who knows ... If
delete all lines beginning with
line with an asterisk, and
up to the line with two asterisks (inclusive), we get the 
shortest ever offered programs "Pouring" screen.



   The following program shows
screen rather zamorochennym way, so I will not even
attempt to describe its action
words. I can only advise
poizmenyat number in line with
star and see what
will (try to put there, for example, number 190).
140.
; (C) ZX-MANIACS
;

          ORG 40000

BUFF EQU 41000


          LD B, 192

          LD HL, # 4000

          LD DE, 22497
LOOP PUSH BC

          PUSH HL

          PUSH DE

          LD A, 255, *

          LD B, 16
LOOP1 LD (HL), A

          INC HL

          INC HL

          LD (DE), A

          INC DE

          INC DE

          DJNZ LOOP1

          POP DE

          CALL UP

          POP HL

          CALL DOWN

          POP BC

          HALT

          DJNZ LOOP

          LD HL, # 4001

          LD DE, 22496

          LD B, 192
LOOP2 PUSH BC

          PUSH HL

          PUSH DE

          LD B, 16
LOOP3 PUSH BC

          LD BC, BUFF-16384

          ADD HL, BC

          LD A, (HL)

          SBC HL, BC

          LD (HL), A

          INC HL

          INC HL

          EX DE, HL

          ADD HL, BC

          LD A, (HL)

          SBC HL, BC

          LD (HL), A

          EX DE, HL

          INC DE

          INC DE

          POP BC

          DJNZ LOOP3

          POP DE

          CALL UP

          POP HL

          CALL DOWN

          POP BC

          HALT

          DJNZ LOOP2

          LD HL, BUFF +6144

          LD DE, 22528

          LD BC, 768

          LDIR

          RET
DOWN INC H

          LD A, H

          AND 7

          RET NZ

          LD A, L

          ADD A, 32

          LD L, A

          RET C

          LD A, H

          SUB 8

          LD H, A

          RET
UP DEC D

          LD A, D

          AND 7

          CP 7

          RET NZ

          LD A, E

          SUB 32

          LD E, A

          RET C

          LD A, D

          ADD A, 8

          LD D, A

          RET
2

          *







Other articles:

TR-DOS for beginners - The end.

Computer novella - Prince of Persia.

Computer novella - Laser team (the game Laser Squad).

Crossing Dragon - Game Rapscallion.

Crossing Dragon - Playing The Runes of Zendos.

Crossing Dragon - Playing The Saga.

Crossing Dragon - Game Witch's Cauldron.

Crossing Dragon - Create Adventyuru. Review of the editors.

Crossing Dragon - Create a dictionary to Adventyurnoy game.

Program, which we choose - The possible consequences of using undocumented commands.

Program, which we choose - About noticed irregularities in some programs and suggestions for future versions.

Program, which we choose - A proposal to all the authors of software, printers, memory dump. Programmers protect discs from being copied.

Program, which we choose - A few suggestions to improve the assembly.

Program, which we choose - Suggestions for refining ZX Word v2.5.

Program, which we choose - The "Spectrum emulator" v1.2.

Program, which we choose - What could want in a perfect assembly.

Retro - 40 best procedures: Copying data in memory.

Retro - 40 best procedures: Exchange token.

Retro - 40 best procedures: Determination addresses BASIC string.

Retro - 40 best procedures: Determination of the length of BASIC programs.

Retro - 40 best procedures: Determination of the amount of free memory.

Retro - 40 best procedures for: Search and replace strings.

Retro - 40 best procedure: Find the string.

Retro - 40 best procedures: Search for the string.

Retro - 40 best procedures: the list of variables.

Retro - 40 best procedures: an increase and up the screen.

Retro - 40 best treatments: Removal of REM-strings.

Retro - 40 best procedures: Remove the block of the program.

Expert Tips - Game Fredloader.

Expert Tips - Game Robin of Sherwood: The Touchstones of Rhianon.

Expert Tips - Game Scorpions: Die Machines.

Expert Tips - Game Terropods.

page iS-DOS - Description of system restarts IS DOS.

Forum - An algorithm for recognizing characters.

Forum - Time undocumented command processor Z80.

Forum - The concept of a high-color screen resolution.

Forum - A few Pokes to a game. Program Hacman96.

Forum - As for the new DOS and BIOS settings for the Spectrum.

Forum - Multicolor program on any computer model. Using the 2 nd screen Multicolor'a. Demonstration of the text. Electronic journals.

Forum - Project ZX Config.

Forum - Improve Art Studio. Ideas on file compression.

Forum - ZX Spectrum emulator for IBM. About the hexadecimal system. Program ZX-Stars. Oddities in the Elita

Forum - The effects on the curb and Multicolor.

reader-reader - ZX Spectrum 128 - new opportunities, new challenges.

reader-reader - With 'Light'. Spectrum and expert system.

reader-reader - The printer driver for the Scorpion.

reader-reader - Print numbers in different number systems.

reader-reader - Programming arcade game with scrolling screen.

reader-reader - The procedure for printing labels assembler XAS to monitor debugger STS 4.3.

Studies - attribute scrolling text. "Gasilka" screen. A simplified version of the procedure, "Curtain". Procedure is enriched with pictures. Procedure display images on the points.

Studies - Graphic effect "color bars".

Studies - Driver screen printing 64 characters per line.

Studies - Set of protective boot.

Studies - Address to the drive mode IM 2. Working with non-standard disc format.

Studies - Print the character, magnified by 8 times. The program "pouring" screen. The procedure for screen-saver on the points. Clear screen in Terminator'e. Search strings in memory. System character set conversion.

Studies - Program - cataloger of disks.

Studies - Program the output values of the amplitude channel music. coprocessor on the curb.

Studies - Program the output image.

Studies - The program plugs sprite.

Studies - Cleanup of the specified window screen.

Studies - The program sort the array in ascending order. The procedure for filling the screen specified attribute. Procedure display pictures. The effect of moving towards the stars. "Shower", coming from the upper left corner of the screen. The procedure of "shedding" pictures on the pixel lines. The program of "pulling" the picture at an angle of 45 degrees. Three procedures "Scroll".

Studies - The printing of numbers.

Studies - The procedure for drawing a character with attributes.

Studies - The procedure for display pictures. Fade-OUT effect (picture goes beyond the edge of the screen). Visual effect "Fountain." Fade-OUT effect, mimicking the TV off. Procedure "Ignition" pictures. The program continuously drawing a picture.

Studies - The procedure for drawing a line.

Studies - The procedure for making optimal symbol table.

Studies - scrolling lines of text in the specified window. Attribute scroller. Diagonal scrolling.

Studies - sprite scroller. Procedure display screen.

Studies - Short procedure indicating the amplitude channel music. coprocessor. Way to subtract a constant from a register pair HL.

Studies - The formula for calculating the day of the week.


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

Similar articles:
From the Editor - Presentation of the first issue of the newspaper.
user interface - parse mail. Letters from readers: Kolotushkin Sergei, Dmitrii Shadrin, Bernik Eugene.
Mosaic - how to access the drive through "direct programming VG93. On the electronic newspaper "Dl News". About the picture format of PCX.
Ottyag - A Tale of Pentium Pentiumovicha Pentiumova. 20 things you can do if your favorite team lost on the road. Toilet, as a measure of human values.

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