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

Forum - The effects on the curb and Multicolor.

<b>Forum</b> - The effects on the curb and Multicolor.
(C) Plyasunov D., Kazan


   The 3-m room in 1996 (Section "Etudes") HACKER JOHN asked 
about the effects on the curb in INSULT MD. I would like to 
share it with the readers of reviews.


   And start with the basics: no longer a
secret that every computer
there is a signal STAFF Sync. On his arrival ULA began to 
deploy the image on the monitor, and scan speed is 8 pixels by 4

processor cycle (or 2 pixels per clock). Such work is repeated 
50 times per second. Simultaneously with the advent of CSI 
comes to the signal INT (more accurately say that the cause of

INT signal and the signal is
CSI. But more on this later). And I would like to
little fix VOLGAsoft'a:
image on the screen starts
based not on the signal INT, and
the signal CSI! Why am I singled out, I'll tell you in detail, 
because I think it is very important. In all the computers 
signal INT based on the signal CSI, and

generation circuit can be
different: where the signal is constructed
the leading edge of CSI, where
rear, where the row count is
in the beginning, and where at the end (do not tell "creators 
")... 


   Ca. Ed.: All quite understandable: for
simplify the scheme for the Pentagon signal INT
formed with the arrival of (the leading edge)
IAC, which was very convenient for programming. No need to 
calculate the delay. A standard machine INT is formed on the 
trailing edge of CSI. The latter solution is more difficult for 
an encoder, but there is compatibility with foreign programs,

using multicolor. There are still
Several methods of forming INT'a, but
consider them in this article makes no sense.


    Well, and, respectively, while
between the arrival of IAC and the formation of INT can be 
different! And therefore, MULTICOLOR, written

on one type of computer will not work on another. Because
and this sprites flicker on slower machines (like PROFI,
ATM), for example, have BOOT'e VAV'a
lost to MC PROFI. Now
are already appear remarks demoshki where
before starting your first offer to combine lines in BORDER'e 
with screen (ECHOLOGY +, KSAGIFT).



   Ca. Ed.: The following information is partly repeats the 
already published by us materials MULTICOLOR'u, but we decided

give it completely because it is given in
more simple (close to a particular
problem) form.


   And now, directly on the
screen: how many times it was written
REVIEW on the pages, the screen is
of the lines from 224 cycles each
(About 217 I do not know). See Figure 1.
Total number of such lines should be
312 (a PENTAGON'a 320, but it is not
dangerous). Multiplying, we find that
length of the interruption is equal to 69888 (in
PENTAGON'a - 71680). But not only that unlike computers. K
example, at RST7 PENTAGON, but not
everyone will have the right to go
hidden part INSULT'a, but from this the following fact: in his
PC INT formed on the leading edge of CSI, but on the other
PENTAGON'a types - on the back,
that's not the same BORDER.



             Border



             Screen



            224 cycles


             Figure 1.


   The theory seems to be everything. Now shaped as letters: it 
was noted that sweep speed is 2 pixels by 1 stroke. Hence,

that if we change the color
border very quickly, we can
achieve interesting effects.
Consider the command OUT (C), A:
This is the fastest team to send to the port, and it takes 12
cycles (there are even faster: OUT
(# FE), A - 11 clock cycles, but still
Replacement battery, how many
time will be ...), so the minimum possible "point" on
curb is 2 * 12 = 24 pixels, or 3 familiarity. Here's the
such points and will be our shaped as letters. And now an 
example program deducing the letter A on the curb:



                   **

                  *

   Template letters: *

                  ****

                  *

                  * 140.


       ORG # 8000

       LD HL, # FE00; filling a region of size 257 bytes

       LD DE, # FE01; byte # FF.

       LD BC, # 100

       LD (HL), # FF

       LDIR

       LD HL, # FFFF; address of the interrupt handler

       LD (HL), # C9; here is the only team RET


       DI; initialization IM 2

       LD A, # FE

       LD I, A

       IM 2

       EI

LOOP HALT; waiting for the arrival of INT

       EI

       LD BC, # 200, this latency
WAIT DEC BC; one run cycle takes 28

       LD A, B; cycles. This gives some

       OR C; advantage because increasing the value

       NOP; BC to 8, the delay will increase by 224

       JP NZ, WAIT; stroke, ie, 1 pixel down.


       LD BC, # 00FE; C-port curb, B-color of the border

       LD DE, # 0206; letter will be yellow on a red background.


       OUT (C), D; upper band letters

       OUT (C), E; only 12 * 4 = 48 cycles

       OUT (C), E

       OUT (C), D

       OUT (C), B; on black, and 12 cycles

       LD A, 10, a delay until the next line of 7 clocks
WAIT_1 DEC A; (4 +10) * 10 = 140 cycles

       JP NZ, WAIT_1; Total: 48 +12 +7 +140 = 207 cycles

       RET NZ; Team Dummy, complementary to 224

       INC HL; 5 +6 +6 = 17 cycles

       INC HL; 17 207 = 224 cycles. The line is finished!

       OUT (C), E; further by the second line

       OUT (C), D; Further, by analogy, many times

       OUT (C), D; what height you letter.

       OUT (C), E

       OUT (C), B

...........................

                           , There may be other actions
...........................


       LD A, # 7F; survey of the space key

       IN A, (# FE)

       RRA

       JP C, LOOP


       DI; recovery mode interrupts.

       LD A, # 3F

       LD I, A

       IM 1

       EI

       RET
2

   The procedure for drawing a point in
78 cycles.


   To operate this procedure
need a sign to 1 KB. Idea
I threw my friend vytsepiv
her out of some toys.
140.

     Input: B - coordinate Y, C - coordinate X.

PLOT LD H, # FA; to address # FA00 is a table

       LD L, B

       LD B, (HL); byte has already been formed

       INC H

       LD A, (HL)

       INC H

       LD L, C

       OR (HL)

       LD C, A

       INC H

       LD A, (BC); combine the display byte

       OR (HL); resulting

       LD (BC), A; and return it to the screen

       RET
2

   And now the program that produces a table in memory:
140.
CREAT LD HL, # FA00; start address table

                           , Should be "round" number

       LD C, # 1940

       CALL CREAT_1

       LD C, # 1948

       CALL CREAT_1

       LD C, # 1950

       CALL CREAT_1

140. LD L, B

       INC H

       XOR A

       LD C, # 1920
LOOP_1 LD B, # 08
LOOP_2 LD (HL), A

       INC HL

       DJNZ LOOP_2

       ADD A, # 20

       DEC C

       JR NZ, LOOP_1
LOOP_3 LD B, 8
LOOP_4 LD (HL), A

       INC HL

       DJNZ LOOP_4

       LD A, # 80
LOOP_5 LD (HL), A

       INC HL

       RRCA

       DJNZ LOOP_5

       RET

CREAT_1 LD B, # 40

       LD A, C
LOOP_6 LD (HL), A

       INC L

       INC A

       AND # 07

       OR C

       DJNZ LOOP_6

       RET
2

   I would also like a couple of words
say about the command HALT. Execute commands similar ztoy
implement a series of commands to the NOP
the arrival of an interrupt. When it comes to interrupt, the 
processor first DOVYPOLNYAET team on which he broke off, and 
only then moves to the interrupt. NOP command four-stroke, so 
when you run HALT may be four situations:

when INT come after a stroke NOP, two bars,
three bars and full implementation of this command. Therefore, 
the length our whole procedure should be

multiple of four cycles. If
This will not be, INT will
arrive with different delays from
0 to 3 cycles, which will affect
shake the letters on the curb.

   And one more thing. Always write synchronizers to your
effects on the curb for multicolor and for the effects of two
screens (blind, etc.).


   At the request of the author we publish his address:

420073 Kazan, ul.Gvardeyskaya,
d.32, komn.323, Plyasunova Dimitri.

INTERNET E-Mail: pavel@open.ksu.
ras.ru


           *







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:
photoscope - pictures of readers.
Sound - The paradoxes of digital sound: an article on analog-digital conversion / digital-analog conversion.
solid jokes - 18 anedotov. Announcement - What will happen in the next issue.

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