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

Studies - The procedure for drawing a line.

<b>Studies</b> - The procedure for drawing a line.
(C) S. Medvedev, g.Uglich


   I would like to offer readers
"Revue," a procedure of drawing the line, the algorithm is 
slightly different from the algorithm procedure of "elementary 
graphs. 140.

; Draw subroutine
; At the entrance: BC - coordinates of the beginning; la line 
(B = Y, C = X) ; DE - coordinates of the end

; Line (D = Y, E = X)

DRAW EXX

          LD BC, # 1C14

          EXX

          LD A, B

          CP D

          JR NC, NO_EXX

          LD B, D

          LD D, A

          LD A, C

          LD C, E

          LD E, A
NO_EXX LD A, C

          SUB E

          JR NC, X_POSIT

          NEG

          EXX

          LD B, # 1D

          EXX
X_POSIT LD L, A
; Offset X

          LD A, B

          SUB D
; A - the Y offset

          CP L

          LD H, L

          LD B, L

          LD HX, B

          LD LX, A

          JR C, DONE

          EXX

          LD C, B

          LD B, # 14

          EXX

          LD H, A

          LD B, A

          LD HX, A

          LD A, L

          LD LX, A
DONE INC H

          INC LX

          EXX

          LD A, B

          LD (COMM), A

          LD A, C

          LD (COMM1), A

          EXX
NEXT PUSH HL

          PUSH DE

          PUSH BC

          CALL PLOT
; 'PLOT' - any procedure your mouth Novki point and the 
coordinates in the DE: ; D-Y, E-X. Recommend the procedure

; A. Astafieva.

          POP BC

          POP DE

          POP HL
COMM INC E; *

          LD A, HX

          SUB LX

          LD HX, A

          JR C, CARRY
COUNT DEC H

          JR NZ, NEXT

          RET
CARRY ADD A, B

          LD HX, A
COMM1 INC D; *

          JR COUNT2


    * - These commands can be
replaced by others, so here
You can simply write NOP.


   As can be seen, the program uses half Register IX, and
owners assemblers, not digesting "mnemonics LX / HX / LY /
HY, could write:
140.
 instead of LD LX, A - DEFB # DD

                    LD L, A

 instead of LD C, HX - DEFB # DD

                    LD C, H
 and t.d.2


   To clear conscience say
that the program was written "in
explanation "procedures from the demo" VIBRATIONS ".


           *







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 - Cheat Sheet - information on the management of the magazine.

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