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

Studies - Graphic effect "color bars".

<b>Studies</b> - Graphic effect
            ETUDES



Music by ZET

(C) Ivan Roshchin, Moscow, 1996


   Bring to your attention I wrote a program that implements a 
nice visual effect: the screen moving color bars, which fades 
each other. This full-screen REAL-TIME takes effect only about 
60% of the time processor. Sequence

bands and smooth transition between them can be changed.

140 .;*********************************************** *****

CLR0 EQU 0; COLOR BANDS
CLR1 EQU 1; (downward)
CLR2 EQU 2
CLR3 EQU 3
CLR4 EQU 4
CLR5 EQU 5
CLR6 EQU 6

;************************************************* ***

DEMO LD C, 0; vertical displace

; STRIP lifting:

LOOP1 CALL SHOW; DRAW BAND

        CALL KEY; ANYTHING pressed?

        RET NZ; IF YES, EXIT

        INC C; INCREASED DISPLACEMENT

        LD A, C; reached the limit?

        CP TABMAXA-23

        JP NZ, LOOP1; IF NO, CONTINUE.

; STRIP DOWN:


        DEC C; REDUCE

        DEC C; OFFSET
LOOP2 CALL SHOW; DRAW BAND

        CALL KEY; ANYTHING pressed?

        RET NZ; IF YES, EXIT

        DEC C; REDUCE THE OFFSET

        LD A, C; reached the minimum?

        CP # FF

        JP NZ, LOOP2; IF NO, CONTINUE.


        LD C, 1; OTHERWISE GO TO

        JP LOOP1; beginning the program.

;***************************************
; PROCEDURE SHOW
; LOG: C-BAND VERTICAL DISPLACEMENT (IN
; Familiarity)
; OUTPUT: Mimicking PASS. PICTURE.

SHOW; FIRST, an imaging ATTRIBUTES:


        LD DE, TABL_A; ADDRESS attribute table

        LD H, 0; HL = OFFSET

        LD L, C

        ADD HL, DE; add an offset

        LD DE, # 5800; beginning of the file ATTRIBUTES


        HALT; WAITING FOR THE START OF FRAME

        DI; disable interruptions, TK

                ; WILL manipulated from the stack.

NEXT_A LD A, (DE); which attribute picture?

        CP (HL); what we need?

        JP Z, RETU; IF YES, DO NOT PEESYLAEM


        PUSH HL; SAVE ADDRESS OF SOURCE


        LD A, (HL); BYTES FROM THE SOURCE

        LD (M1 +1), SP; PRESERVE SP (NOTE WHERE).

        LD HL, # 20, generates a new

        ADD HL, DE; ADDRESS STACK

        LD SP, HL

        LD D, A; than fill

        LD E, A; STRING


        PUSH DE; forming one

        PUSH DE; STRING

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE

        PUSH DE


        EX DE, HL; In DE NEW ADDRESS RECEIVER

M1 LD SP, 0; RESTORE SP.

                         ; This command LOAD SP

                         ; DONE twice as fast

                         ; Than a team of LD SP, (NN).

        POP HL; RESTORE HL

        JP NE_RETU; WAY, TEAM JP

                         ; Run faster

                         ; WHAT TEAM JR.

; If a line is was necessary to fill,
, Increases DE (addr. RECEIVER) FOR # 20:

RETU LD A, # 20, looks like it is

        ADD A, E; unusual, but

        LD E, A; WORKS

        LD A, 0; FASTER.

        ADC A, D

        LD D, A

, Otherwise the destination address has already been increased.

NE_RETU INC HL; Source Address

        LD A, D

        CP # 5B

        JP NZ, NEXT_A

And now draw the image:


        LD L, C; Offset in familiarity

        SLA L; multiplied by 8

        SLA L

        SLA L

        RES 7, L

        LD B, L; GET OFFSET TABLE


        LD H, 0; HL = OFFSET. TABLE

        LD DE, TABL; ADDRESS TABLE

        ADD HL, DE

        EX DE, HL

        LD HL, # 4000; HOME DISPLAY FILE

And here, on the contrary, HL-receiver address, A
; DE-source address.

NEXT LD A, (DE); an imaging BYTES

        CP (HL); Compares with the image.

        JP Z, RET3; If zero, do not send


        PUSH HL; SAVE ADDRESS OF RECEIVER

, Increases HL (addr. RECEIVER) FOR # 20:


        LD A, # 20, looks like it is

        ADD A, L; unusual, but

        LD L, A; WORKS

        LD A, 0; FASTER.

        ADC A, H

        LD H, A


        LD (M2 +1), SP; PRESERVE SP

        LD SP, HL; SP indicates the end of STRING


        LD A, (DE)

        LD H, A; than fill

        LD L, A; STRING


        PUSH HL; forming one

        PUSH HL; STRING

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

        PUSH HL

M2 LD SP, 0; RESTORE SP

        POP HL; RESTORE ADDRESS OF RECEIVER

RET3 INC DE; HAS INCREASED SOURCE ADDRESS

        INC B; INCREASED COUNTER

        LD A, B

        CP TABMAX; ACHIEVED MAX. ADDRESS?

        JP NZ, TAB_OK

        LD B, 0; IF YES, Zeroing COUNTER

        LD DE, TABL; AND GO TO TOP OF TABLE

TAB_OK INC H; SINGLE

        LD A, H; NEW ADDRESS

        AND 7 LINES ON

        LD A, H; SCREEN

        JP NZ, NEW_OK; AT

        LD A, L; LAST

        ADD A, 32; STRING.

        LD L, A

        LD A, H

        JP C, NEW_OK

        LD A, H

        SUB 8

        LD H, A

NEW_OK CP # 58

        JP NZ, NEXT


        EI

        RET

;***************************************

TABMAX EQU 16 * 8, the size of data sets (see below)

TABL DB% 00000000; the data to

        DB% 00000000; smooth transition between

        DB% 00000000; colored stripes.

        DB% 00000000; WAY, FROM THEM

        DB% 00000000; DEPENDS ON SPEED

        DB% 00000000; PROCEDURE SHOW.

        DB% 00000000

        DB% 00000000

        DB% 00000000

        DB% 00000000

        DB% 00000000

        DB% 00000000

        DB% 00000000

        DB% 00000000

        DB% 00000000

        DB% 00000000


        DB% 00001000

        DB% 00000000

        DB% 10000000

        DB% 00000000

        DB% 00001000

        DB% 10000000

        DB% 00001000

        DB% 10000000


        DB% 00100010

        DB% 10001000

        DB% 00100010

        DB% 10001000

        DB% 00100010

        DB% 10001000

        DB% 00100010

        DB% 10001000

        DB% 00100010

        DB% 10001000

        DB% 00100010

        DB% 10001000

        DB% 00100010

        DB% 10001000

        DB% 00100010

        DB% 10001000


        DB% 00100010

        DB% 01010101

        DB% 10001000

        DB% 01010101

        DB% 00100010

        DB% 01010101

        DB% 10001000

        DB% 01010101

        DB% 00100010

        DB% 01010101

        DB% 00100010

        DB% 01010101

        DB% 10001000

        DB% 01010101

        DB% 00100010

        DB% 01010101

        DB% 10001000

        DB% 01010101

        DB% 00100010

        DB% 01010101


        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101

        DB% 10101010

        DB% 01010101


        DB% 10101010

        DB% 01110111

        DB% 10101010

        DB% 11011101

        DB% 10101010

        DB% 01110111

        DB% 10101010

        DB% 11011101

        DB% 10101010

        DB% 01110111

        DB% 10101010

        DB% 11011101

        DB% 10101010

        DB% 01110111

        DB% 10101010

        DB% 11011101

        DB% 10101010

        DB% 01110111

        DB% 10101010

        DB% 11011101


        DB% 11011101

        DB% 01110111

        DB% 11011101

        DB% 01110111

        DB% 11011101

        DB% 01110111

        DB% 11011101

        DB% 01110111

        DB% 11011101

        DB% 01110111

        DB% 11011101

        DB% 01110111

        DB% 11011101

        DB% 01110111

        DB% 11011101

        DB% 01110111


        DB% 01111111

        DB% 11110111

        DB% 01111111

        DB% 11110111

        DB% 11111111

        DB% 01111111

        DB% 11111111

        DB% 11110111

;************************************************* *******

TABMAXA EQU 6 * 16 +2, the size of data sets (see below)

TABL_A DB CLR0 * 8 + CLR1; FROM THEM DEPENDS

        DB CLR0 * 8 + CLR1; COLOR OF EACH STRIP

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

140. DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1

        DB CLR0 * 8 + CLR1


        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2

        DB CLR1 * 8 + CLR2


        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3

        DB CLR2 * 8 + CLR3


        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4

        DB CLR3 * 8 + CLR4


        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5

        DB CLR4 * 8 + CLR5


        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6

        DB CLR5 * 8 + CLR6


        DB CLR6 * 8 + CLR6

        DB CLR6 * 8 + CLR6

;**************************************
; PROCEDURE KEY returns a flag Z = 0
; If your keyboard ANYTHING down.

KEY XOR A

        IN A, (254)

        AND% 00011111

        CP% 00011111

        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 authors - the fifth issue of the journal.
Demo Party - an invitation to Latvia demopati PHAT'9.
Mozzhechek - having phun: Few ordinary jokes - not stsenovogo content.
From the authors - newspapers have had their own BBS.
ZX-Party - a deep discussion about the ludicrous position demomeykerov against the creators of virtual worlds - geymmeykerov.

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