ZX Review #5-6
04 ноября 1997

ethidium - The calculation of addresses in the file attributes. Program scrolling specified window 1 pixel to the right. Cleanup of the specified window. Procedure display images from the buffer.

<b>ethidium</b> - The calculation of addresses in the file attributes. Program scrolling specified
 window 1 pixel to the right. Cleanup of the specified window. Procedure display images from the buffer.
(C) D. Konovalov, Tver


   1. Very small (15 bytes,
57 cycles) procedure for calculating the addresses in the file 
attributes. Y coordinate in register E, X in register D. 140.


        LD A, E

        RRCA

        RRCA

        RRCA

        LD L, A

        AND 31

        OR 88

        LD H, A

        LD A, L

        AND 252

        OR D

        LD L, A
2

   2. But the program scrolls the specified window by 1 pixel
vpravo.140.


        ORG 40000


        LD A, (HGT)

        LD C, A

        LD HL, (Y)
START PUSH HL

        LD A, L

        AND 7

        RRCA

        RRCA

        RRCA

        ADD A, H

        LD H, L

        LD L, A

        LD A, H

        AND # 18

        OR # 40

        LD H, A

        LD B, 8
ST PUSH HL

        PUSH BC

        LD A, (LEN)

        LD B, A

        AND A
ST1 RR (HL)

        INC HL

        DJNZ ST1

        POP BC

        POP HL

        INC H

        DJNZ ST

        POP HL

        INC L

        DEC C

        RET Z

        JR START

Y DEFB 0
X DEFB 0
LEN DEFB 10; width of the window
HGT DEFB 10; window height
2

   The program does not check out whether the window off the 
screen. To scroll place on 4

pixel, it is necessary to make the following
change: AND A replaced by XOR
A, RR (HL) is replaced by RRD.


   3. This program is designed to clean the specified window
screen. She does this as follows: one pixel line is scrolled to 
the right, the other left, then right again, etc.

140.

        ORG 40000


        LD A, (HGT)

        LD C, A

        LD HL, (Y)
START PUSH HL

        LD A, L

        RRCA

        RRCA

        RRCA

        ADD A, H

        LD H, L

        LD L, A

        LD A, H

        AND # 18

        OR # 40

        LD H, A

        LD B, 4
ST PUSH BC

        LD A, (LEN)

        LD B, A

        AND A
ST1 RR (HL)

        INC HL

        DJNZ ST1

        AND A

        LD A, (LEN)

        LD B, A

        DEC HL

        INC H
ST2 RL (HL)

        DEC HL

        DJNZ ST2

        INC HL

        POP BC

        INC H

        DJNZ ST

        POP HL

        INC L

        DEC C

        RET Z

        JR START

Y DEFB 0
X DEFB 0
LEN DEFB 10
HGT DEFB 10
2

   This procedure is not clear
All the window - it makes only one
passage. For a complete window cleaning
it must be cyclically called from
another program.


   4. And the latter procedure.
It displays a picture of
buffer at 41,000. Picture like "leaves" from the left
edge of the screen to the right, and then being transferred 
attributes. 140.


        ORG 40000


        LD B, 64
ST LD C, 192

        LD DE, 16384

        LD HL, 41000
RUN PUSH BC

        LD C, 2

        XOR A
WORK LD B, 32
LOOP RRD

        INC HL

        DJNZ LOOP

        EX DE, HL

        DEC C

        JR NZ, WORK

        POP BC

        OR A

        DEC C

        JR NZ, RUN

        DJNZ ST

        LD DE, 22528

        LD HL, 47144

        LD BC, 768

        LDIR

        RET
2

   About me: I am 15 years old, fascinated
adventyurnymi and strategic
games.

   Daniel also asked to publish his address for fans
adventyur: 170004, Tver-4,
ul.Stroiteley, 8 / 2,
kv.121, Konovalov, Daniel.


   Ca. Ed.: And once again be reminded of optimization 
software. At the end of program 2 and 3 is a sequence of 
commands: 


        RET Z

        JR START


   But it would be better to replace it with:


        JR NZ, START

        RET


   What's the difference? And in that second
version is faster, because
first option the team holds RET Z
number of times and the whole cycle, and in
the second - once. Of course, there is no
plays a special role, but imagine
that the loop is not 10, but, say,
10000 times. Here is the 5 cycles are translated into
big waste of time.


            *







Other articles:

Adventure Project - Design and razrabotaka Adventyurnyh and RPG games.

Adventure Project - Russification adventyur.

TR-DOS for beginners - Continued.

Authoring - Scorpion 2000 (S. Zonov).

Authoring - Trampoline (S. Veremeenko).

Business Card - a new electronic humor magazine "SpectrofUn".

Crossing Dragon - Promotion of the game Finders Keepers.

Crossing Dragon - Promotion of the game Knight Tyme.

Crossing Dragon - Game Promotions Spellbound.

Crossing Dragon - Game Promotions Stormbringer.

Retro - 40 best procedures: Merge images, rotation of the symbol clockwise Inverting character, changing the attribute, fill circuit construction templates (Dzh.Hardman, E. Hyuzon.).

Expert Tips - Total Eclipse 2.

Expert Tips Super League.

Forum Games - Description of the game land of myths.

Forum Games - Passage Renegade.

Forum Games - Subtleties trading game Elite

Forum - Studying and debugging @ files using STS 5.1. Features of debugging using a monitor STS. Bugfix STS 5.1.

Forum - compression programs.

forum - Reduction in the time format. On the recording sectors while formatting. Rebuilding the screen for one interrupt.

Forum - Features assembly ZX ASM 3.0.

Forum - As for the BASIC compiler "Blast".

Forum - With regard to relotsiruemyh programs.

Forum - Program "Flame" and "Dragon."

reader-reader - TR-DOS: how to avoid mistakes?

reader-reader - The effective work with the drive.

ethidium - The calculation of addresses in the file attributes. Program scrolling specified window 1 pixel to the right. Cleanup of the specified window. Procedure display images from the buffer.

Studies - LED channel music processor. The procedure for cleaning the screen. Proposal for standardization.

Studies - A set of eight programs of "extension" screen. Two procedures are manifestations of the screen.

Studies - New themes for development.

Studies - Playback software tool from the editors of digitized music.

Studies - processing program @ BASIC files.

Studies - The procedure for turning the symbol 90 degrees clockwise.

Studies - The procedure for searching text files.

Studies - Screen procedure "UP HL".


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

Similar articles:
CCLFSTM - All disk copier 128/512K.
Special Edition - International Festival of Computer Art Chaos Constructions '999 (part 3).

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