Deja Vu #03
31 декабря 1997

Coding - New procedures for 1940: the shift of the attributes of the left and right, up and down, shift by one character to the left and right, up and down, shift by one pixel to the left and right, up and down; Merge images, inverting the screen, inverting the symbol vertically or horizontally; rotation symbol clockwise change attribute, change attributes.

<b>Coding</b> - New procedures for 1940: the shift of the attributes of the left and right, up and down, shift by one character to the left and right, up and down, shift by one pixel to the left and right, up and down; Merge images, inverting the screen, inverting the symbol vertically or horizontally; rotation symbol clockwise change attribute, change attributes.
Author: Sergey Kolotov, SerzhSoft
__________________________________________


        NEW "40 BEST PROCEDURES"


   In 1992, in the pages of a ZX-REVIEW
published an abridged translation of the book by J.
Hardman and E. Hyuzon "top 40 procedures."

                 The publication has caused the most

            rave chi
            Tutelo, because many in the
            rank sinkleristy with its

            by finally able to

            overcome all difficulties

            "Barrier machine code."

            But it is exactly five

            years, and old-timers ZX-REVIEW

                 was surprised to notice in
the first issue for 1997 is painfully familiar
name.

   All of the many reasons so convincingly set forth INFORKOMOM 
course largely correct. But in my (and not

only my) opinion, they did not give
People magazine publishers the right to spend
precious pages ZX-REVIEW print already
published at the time of the material.

   Instead of heading a "retro" is much more useful
and current could be introduced to "remake". And it does not 
print just the old, well-worn materials, and treat them

more deeply, to give examples of more effective implementation 
of programs and individual procedures.


   Get at least the same "40 procedures." Yes,
This work is very useful for beginners. But a little more 
experienced experts assembler will notice that the more of 
obemu reducible authors procedure, then invariably, it has more 
disadvantages more effectively implemented, has

greater number of "extra" commands ... Yes
Some "better procedures" are reduced
more than twice! And more: Comments
programs are for themselves listings that are very difficult to 
understand "what exactly happens when the procedure

at some stage. "Of course, a description of the type" C 
register is copied into the register B ", but such is the 
meaning, which behind this is not always clear ...


   It will be presented libraries, in
that has integrated graphics procedure to rewrite the principle 
of "forty of the best." Memory footprint decreased from 1,444 
bytes to 861 bytes! Each procedure commented in detail most of 
its listing, so to speak - on the spot. " 


  Listing and hex dump.


   Many of the procedures in their work requires
some pre-defined values ​​-
constants. Under these values ​​are allocated a special area of 
​​memory addressable tag CONSTS. In this case indicates CONSTS

address 23296, but of course this address
You can change to any other. The length of the constants of 8 
bytes. If any of the procedures, none of the constants does not 
change. Otherwise, it would have to call them Variable ...


   The procedures that manipulate the coordinates of points on 
the screen ostchet is in contrast to BASIC is not a bottom-up, 
and vice versa - Top-down. Such a reading of coordinates is 
much more convenient and is used in many other computers. Now 
you can specify Y coordinate from 0 to 191 (instead of 175)

ie it is possible to specify the coordinates of points on the 
screen that are in the bottom two rows to be allocated by error 
messages. When counting the same bottom-up, the maximum 
Y-coordinate is Y = 175, and to the lower two strings do not 
get. 


        BRIEF DESCRIPTION OF PROCEDURES:


   1. ASRL_LF - a procedure shifts the entire
screen attributes (color) to the left. The right column is 
filled with an attribute of the cell to at CONSTS (23,296). The 
length of the procedure, 22 bytes (was - 23 bytes). -Translated

under the address 62000 (HEX: # F230).

   2. ASRL_RG - a shift of the entire screen to the right 
attributes. The left column is filled with an attribute of 
CONSTS. The length of the procedure, 21 bytes (19 bytes). 
Located at 62022 (# F246).


   3. ASRL_UP - shift up the whole screen attributes. The 
bottom line of the attribute is populated from CONSTS. The 
length of the procedure, 19 bytes (21 bytes). Address: 62043 (# 
F25B). 

   4. ASRL_DN - shift the entire display attributes down. The 
upper line is filled with an attribute of CONSTS. Length: 20 
bytes (21 bytes). Address: 62062 (# F26E).


   5. SSRL_LF - a shift of the entire screen to the left
one character (graphic). The right column
familiarity is cleared. Length of 20 bytes (21
bytes). Address: 62082 (# F282).

   6. SSRL_RG - a shift of the entire screen to the right
one character. The left column familiarity
cleared. Length of 19 bytes (22 bytes). Address: 62102 (# F296).

   7. SSRL_UP - translation of the whole screen up
one character. The bottom line of familiarity
cleared. Length 55 bytes (68 bytes). Address:
62,121 (# F2A9).

   8. SSRL_DN - a shift of the entire screen down
one character. The top line of familiarity is cleared. Length 
55 bytes (73 bytes). Address: 62,176 (# F2E0).


   9. PSRL_LF - a shift of the entire screen to the left
one pixel (graphics). The right column
pixel is cleared. Length of 16 bytes (17
bytes). Address: 62231 (# F317).

  10. PSRL_RG - a shift of the entire screen to the right
one pixel. The left column of pixels
cleared. Length 17 bytes (17 bytes). Address:
62,247 (# F327).

  11. PSRL_UP - translation of the whole screen up
one line of pixels. Bottom row of pixels is cleared. Length of 
38 bytes (91 bytes). Address: 62264 (# F338).


  12. PSRL_DN - a shift of the entire screen down
one line of pixels. The upper line
pixel is cleared. Length of 38 bytes (90 bytes). Address: 62302 
(# F35E). 

  13. SCR_MRG - merge two images
(Graphics, on the basis of OR). Double-byte
constant at CONSTS must contain the address of the placement of 
the second picture in memory (overlay). The result is put on 
the screen. The length of the procedure, 17 bytes (Previously - 
21 bytes). Address of accommodation: 62,340 (# F384).


  14. SCR_INV - invert the screen
(Graphics, on principle). All the pixels change their value to 
the opposite. The length of the procedure, 12 bytes (was - 18 
bytes). Address: 62357 (# F395).


  15. SINV_UD - invert symbol
vertically. Arrow pointing up
is directed downward, and vice versa.
In the double-byte variable at CONSTS
must contain the address of a variable character. The length of 
the procedure, 20 bytes (or was). Address allocation: 62369 (# 
F3A1). 

  16. SINV_LR - invert symbol
horizontally. Arrow pointing left, is directed to the right, 
and vice versa. In the double-byte variable at CONSTS must 
contain the address of a variable character. The length of the 
procedure, 17 bytes (was - 19 bytes). Address allocation: 62,389

(# F3B5).

  17. SROTATE - rotate the character in a clockwise direction 
by 90 degrees. In the double-byte variable at CONSTS must 
contain the address of a variable character. Length 26 bytes 
(previously - 42 bytes). Address: 62406 (# F3C6).


  18. ACHANGE - change the attributes of all symbols of the 
screen. Bit operation. In a cell at CONSTS should contain the 
mask bits: Bits that are installed in the mask are the 
attributes same, and the bits that are masked

null value - would have zero
value and the attributes (operations and (not
"Since "!)). In a cell at CONSTS +1 must
bytes to be included whose bits
will be introduced in all the attributes of the screen, ie,
If this byte is a bit turned on,
then it will be installed in all the attributes
(OR operation). The length of the procedure 16 bytes
(21 bytes). Address: 624320 (# F3E0).

  19. AREPLC - search the attributes of a specific value and 
replace each found a new attribute value. In cell at CONSTS 
should contain byte value to be replaced (that look). In a cell 
at CONSTS +1 should be the value of the substitute bytes (the

replace). The length of the procedure, 18 bytes (22
bytes). Address: 62448 (# F3F0).

  20. PAINT - fill certain
screen area, bounded by a line of pixels (fill). The starting 
point is given by placing it at the X

CONSTS, and the coordinates of Y - to the address
CONSTS +1. If the Y coordinate greater than 191 or
point in these coordinates is already installed, the program is 
interrupted by an emergency. This procedure is not moveable 
because of the challenges procedures POINT. When shading is 
actively used by the stack - it stored the coordinates of the 
line fills. When painted over a large area of ​​complex shapes, 
and need more space in RAM - between the end of BASIC-program 
and address set by the operator CLEAR

(The contents of the system variable RAMTOP).
If memory space is not enough, you can
crash. The procedure takes 88
bytes, and together with the procedure POINT - 123
bytes, which is more than half
length of the procedure in 1992 (263 bytes!).
Address PAINT: 62,466 (# F402).

  21. POINT - address calculation point in
screen, given the coordinates and check
state this point (ON / OFF). Attention!
This procedure can be used
only from the machine code (starting from BASIC will give 
nothing). Before calling, you must install the register E X 
coordinate (0 .. 255), and in case D - Y coordinate

(0 .. 191) tested the point. The output of the procedure set in 
the register pair HL byte address on the screen, which is 
point, and in case C - the point in this mask byte (one bit set 
in the unit). Depending on how turned on a point or

No flag is set zero: Z - point
not included, NZ - point is included. If
point is set (apparently), the register A
(Battery) is identical in meaning
Register with C, and if the point is not set, then A is reset. 
Register B is always exit from the procedure is zero. The 
length of the procedure, 35 bytes (the original would occupy 
about 70 bytes). Address allocation: 62,554 (# F45A).


  22. PFIGURE - construction of any previously
a certain figure (pattern) on the screen.
Coordinates of the initial (starting) points are given the same 
procedure PAINT. Template set in the BASIC string variable A $

(You can change to any other, slightly
adjusting assembly listing or
dump). A string of characters is as follows
format (a bit different from the original):


      "5" - to reduce the X-coordinate

      "6" - to increase the Y-coordinate

         (The count goes from top to bottom)

      "7" - to reduce the Y-coordinate

      "8" - to increase the X-coordinate

      "0" - to put the point


    Any other characters inogriruyutsya.

   If the string variable does not exist
or does not contain any information that
program interrupts their work. Control
for withdrawal of the initial Y-coordinate is not because
part of the figure can still be seen. Therefore, checking out 
off the screen introduced in the cycle of forming a pattern.

Ability to 'wrap-round' is preserved, ie
still, when you exit X-coordinates for
the left side of the screen, the pattern appears
right, and vice versa. The procedure is not moveable. Length 
PFIGURE: 98 bytes, and with used routine POINT - 133

bytes, which is still much smaller than the original (196 
bytes). Address: 62589 (# F47D). If the "open" procedure call 
POINT, then PFIGURE will be moved and will occupy about 125 
bytes! 

  23. PSCALER - copy of the screen
in another region of the same screen with a possible increase 
up to X and / or Y. Constants are used: 

Address Name Comment
CONSTS X1_OLD one of two primary

                X-coordinate pryamoug-ka
CONSTS +1 Y1_OLD one of two primary

                Y-coordinate pryamoug-ka
CONSTS +2 X2_OLD one of two primary

                X-coordinate pryamoug-ka
CONSTS +3 Y2_OLD one of two primary

                Y-coordinate pryamoug-ka
CONSTS +4 XSCALE magnitude larger

                to X
CONSTS +5 YSCALE magnitude larger

                on Y
CONSTS +6 X_NEW coordinates of the left upper
                On the corner of the screen,
CONSTS +7 Y_NEW which is

                copy


   Coordinates of the initial rectangle
Copy set in the constants
X1_OLD, Y1_OLD, X2_OLD, Y2_OLD, moreover,
can be arranged in any order. The procedure itself will 
determine the smallest and largest coordinates.  Emergency exit 
procedures are in the following cases:


1. XSCALE = 0 - zoom scale on the X

                zero
2. YSCALE = 0 - zoom scale on the Y

                zero
3. Y_NEW> 191 - the new Y coordinate vyho
                leads off the screen
4. Y1_OLD> 191 - Y1 coordinate of the old you
                goes beyond the screen
5. Y2_OLD> 191 - Y1 coordinate of the old you
                goes beyond the screen


   Like the original, the program does not
control that would check the possibility
placement of the new picture on the screen. If
this does not work, something might happen
failure.

   When performing the procedure at first throws a stack 
bitmaps copied rectangular screen and then draws it to the new 
location, increasing necessary. Therefore, if the stack is not 
enough space on it, as in the procedure PAINT can happen 
freeze, reset, Error ...


   If you want to copy a piece of the screen was the same size 
as this, it is necessary to establish the scale of 1:1 - Add a 
constant XSCALE and YSCALE edinichki. When you double the 
amount there should be dvoechki, and so on ...


   The procedure is not moveable from the use of sub POINT. 
PSCALER occupies 174 bytes, and with POINT - 209

bytes. In any case, it is much less
than the original - 335 bytes! Address of accommodation:
62,687 (# F4DF).

   So, here you are, and got acquainted with a new 
implementation of "best procedures." But I advise you not 
delude ourselves - some of the procedures it should be possible 
to reduce more ... However, in this will inevitably have to 
sacrifice something: speed of execution, or transferability,

Finally, just the time spent. I hope that the figures in this 
article, the program will be useful, at least - Maybe they just 
touch up on you any thoughts ... Beginners can

try to compare the procedure in 1992 with
new, learn the principles of creating a more
effective programs, tools for the integration of many different 
procedures in one large library of ... Experienced programmers 
also may get a lot of fun, laughing mischievously given work. 
But it is also a plus: amuse people - a very necessary work! So 
I wish to all readers:



    Enjoy working with LOVED SPECCY!

;----------------------------------------;
, 40 New Best Routines (graphic);
; (C) SerzhSoft, Shadrinsk, may-june, 1997;
; Old length: 1444 b - new length: 861 b;
;----------------------------------------;

        ORG 62000; address assembles
                         tion
;----------------------------------------;
CONSTS EQU 23296; address of the buffer concentration
                         constants (8 bytes)
;----------------------------------------;
; Shift attributes to the left (22 <= 23)
;----------------------------------------;
ASRL_LF

        LD DE, # 5800; DE = address of first
                             Vågå bytes

                             Attributes
LP_ASLF LD H, D; copied

                             DE to HL

        LD L, E; and increased

                             HL per unit

        INC HL; HL = address of the second
                             rogo bytes

                             Attributes

        LD BC, # 001F; <line length

                             attributes> - 1

        LDIR; line shift

                             Attributes

                             left

        LD A, (CONSTS); color filling
                             of after

                             shift

        LD (DE), A; set

                             new attribute

        INC DE; transition to

                             whether
                             Research from the bottom

        LD A, D; if the attributes

                             has ended

        CP # 5B; and we have come across

                             a buffer

                             Printer

        JR C, LP_ASLF; then STOP, ina
                             Th shift

                             more

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift attributes to the right (21 <= 23)
;----------------------------------------;
ASRL_RG

        LD DE, # 5AFF; address last
                             He bytes

                             Attributes
LP_ASRG LD H, D; copied

                             DE to HL -

        LD L, E; Last

                             byte lines

                             Attributes

        DEC HL; penultimate

                             byte lines

                             Attributes

        LD BC, # 001F; <line length

                             attributes> - 1

        LDDR; line shift

                             Attributes

                             right

        LD A, (CONSTS); color filling
                             of after

                             shift

        LD (DE), A; set

                             new attribute

        DEC DE; transition to

                             whether
                             SRI top

        BIT 3, D; if we all

                             even in the attributes
                             max,

        JR NZ, LP_ASRG; then repeat

                             cycle for the lyrics.

                             line

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift attributes up (19 <= 21)
;----------------------------------------;
ASRL_UP

        LD HL, # 5820; address of the second

                             Line attributes
                             Comrade

        LD DE, # 5800; address of the first

                             Line attributes
                             Comrade

        LD BC, # 02E0; move:

                             23 lines of

                             32 bytes

        LDIR; shift 23

                             bottom line

                             Up

        LD A, (CONSTS); color for
                             complement the lower
                             her line
LP_ASUP LD (DE), A; set

                             new attribute

        INC E; if filled
                             Does the whole village
                             glacial line

        JR NZ, LP_ASUP; (E = 0) then

                             interrupt

                             cycle

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift attributes down (20 <= 21)
;----------------------------------------;
ASRL_DN

        LD HL, # 5ADF; address of the end

                             second-line

                             bottom

        LD DE, # 5AFF; address of the end

                             the lowest

                             line

        LD BC, # 02E0; move: 23

                             Line 32

                             Byte

        LDDR; shift 23

                             top line

                             down

        LD A, (CONSTS); color for
                             complement ver
                             hney line
LP_ASDN LD (DE), A; set

                             new attribute

        DEC E; if reached

                             the very first
                             first byte

        JR NZ, LP_ASDN; of Atri
                             casks (E = 0);

                             then STOP

        LD (DE), A; and establishes
                            Vai this byte

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift left one character (20 <= 21)
;----------------------------------------;
SSRL_LF

        LD DE, # 4000; top domains
                             Graphic Tee
LP_SSLF LD H, D; address of the first

        LD L, E; byte line

        INC HL; address of the second

                             byte lines

        LD BC, # 001F; how many bytes

                             shift

        LDIR; line shift

                             Left on 1

                             bytes

        XOR A; resets ak
                             kumulyator and

                             have brought

        LD (DE), A; the last

                             (Right) bytes

                             line

        INC DE; transition to

                             whether
                             line (bottom)

        LD A, D; if the attributes

        CP # 58; "still have not seen
                             give, "

        JR C, LP_SSLF; then repeat

                             cycle for the lyrics.

                             line

        RET; exit from the
                             procedure
;----------------------------------------;
; Right shift by one character (19 <= 22)
;----------------------------------------;
SSRL_RG

        LD DE, # 57FF; Last

                             bytes of

                             Graphics
LP_SSRG LD H, D; address last
                             He bytes

        LD L, E; current line

        DEC HL; address before
                             last

                             Byte

        LD BC, # 001F; shift: 31

                             bytes

        LDDR; line shift

                            graphic to the right

        XOR A; clear the accumulative
                             mulyator and for
                             so

        LD (DE), A; first (le
                             vy) bytes are
                             Booths line

        DEC DE; transition to

                             whether
                             Institute of higher

        BIT 6D; if we have

                             not "come across"

                             in ROM

        JR NZ, LP_SSRG; we continue

                             spin cycle

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift up one character (55 <= 68)
;----------------------------------------;
SSRL_UP

        LD DE, # 4000; top of the screen
                             Noah region
LP_SSU1 PUSH DE; store ad
                             interest on line

                             stack

        LD BC, # 0020, in line - 32

                             Byte

        LD A, E; The register DE

                             is hell
                             res

        ADD A, C; top Do
                             Research Institute. In Regis
                             triangle

        LD L, A; HL should

                             get the hell
                             res

        LD A, D; line, lying
                             ing from below

                             step 8.

        JR NC, GO_SSUP; To this end,

                             Register E

                             we add 32

        ADD A, # 08; and records

                             L. If proiGO_SSUP LD H, A; zoshlo 
transition                              complement, then


                             H = D +8

        LDIR; transfer of one

                             line (32

                             bytes)

        POP DE; recovered
                             Vai address

                             start line

        LD A, H; check: a

                             whether it is time

                             We zakrug
        CP # 58; lyatsya? (Ne
                             renesli all

                             1923 series)

        JR NC, LP_SSU2; if so,

                             transition to

                             cleanup

        INC D ;------------;

        LD A, D;

                               DOWN_DE

        AND # 07; standard

                              sequence
                              sequence

        JR NZ, LP_SSU1; commands

                              transition to

                              line down

        LD A, E; on-screen
                              region

        ADD A, # 20, (to register

                              DE)

        LD E, A;

        JR C, LP_SSU1; input:

                              DE - Address

                              line

        LD A, D; Output:

                              DE - Address

                              line below

        SUB # 08; used

                              battery

        LD D, A;

        JR LP_SSU1 ;------------;
LP_SSU2 XOR A; cleaning Accu
                             mulyatora
LP_SSU3 LD (DE), A; with him on
                             power -

        INC E; cleaning of one

                             line image
                             tion

        JR NZ, LP_SSU3; total: 32

                             Byte

        LD E, # E0; transition to

                             next

        INC D; (lower) if
                             Research images
                             of

        BIT 3, D; filled

                             all subsequent
                             tions series?

        JR Z, LP_SSU2; if not,

                             continue

                             fill

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift down by one character (55 <= 73)
;----------------------------------------;
SSRL_DN

        LD DE, # 57FF; address last
                             He bytes

                             Graphics
LP_SSD1 PUSH DE; retained hell
                             res end if
                             SRI

        LD BC, # 0020; the length of one

                             line image
                             tion

        LD A, E; in register HL

        SUB C; get the hell
                             res

        LD L, A; end of the line

        LD A, D; overlying

        JR NC, GO_SSDN; starting with

                             step

        SUB # 08; of 8 pixels

                             (Lines):
GO_SSDN LD H, A; HL = how to
                             feast; DE =

                             where

        LDDR; transfer of one

                             Line graphs

        POP DE; recovered
                             Vai address

                             end of line

        BIT 6, H; if we have already

                             not in the screen,

        JR Z, LP_SSD2; then go

                             to clean

        LD A, D ;------------;

        DEC D; UP_DE

        AND # 07; standard

                              sequence
                              sequence

        JR NZ, LP_SSD1; commands

                              transition to

                              line up

        LD A, E; in screen

                              area (for

        SUB # 20; register DE)

        LD E, A;

        JR C, LP_SSD1; input: DE

                             - The address line

        LD A, D; output: DE

                             - The address line

                              above

        ADD A, # 08; used

                              battery

        LD D, A;

        JR LP_SSD1 ;------------;
LP_SSD2 XOR A; cleaning Accu
                             mulyatora
LP_SSD3 LD (DE), A; cleaning of one

        DEC E; line image
                             tion:

        JR NZ, LP_SSD3; (31 bytes)

        LD (DE), A; clear the most

                             first byte

                             line

        LD E, # 1F; transition to

                             next

                             (Top)

        DEC D; through a number of

                             eight lines

        BIT 6, D; we are not yet on
                             fell in the ROM?

        JR NZ, LP_SSD2; if not,

                            purify further

        RET; exit from the
                             procedure
;----------------------------------------;
; Left shift by one pixel (16 <= 17)
;----------------------------------------;
PSRL_LF

        LD HL, # 57FF; address last
                             He bytes

                             Graphics
LP_PSL1 OR A; reset

                             carry flag

                             CF

        LD B, # 20, in the same line

                             - 32 bytes
LP_PSL2 RL (HL); CF <- [shifts
                             my bytes] <-CF

                             (Left)

        DEC HL; transition to

                             previous

                             byte lines

        DJNZ LP_PSL2; shift cycle

                             for one if

                             SRI

        BIT 6, H; we are still in the equivalent
                             wound?

        JR NZ, LP_PSL1; if so,

                             shift the following
                             lowing line

        RET; exit from the
                             procedure
;----------------------------------------;
; Right shift by one pixel (17)
;----------------------------------------;
PSRL_RG

        LD HL, # 4000; address of the first

                             Byte Graphics

        LD C, # C0; move -

                             192 lines
LP_PSR1 OR A; CF = 0 for empty
                             one column

                             left

        LD B, # 20, the number of bytes in

                             one line
LP_PSR2 RR (HL); shift of one

                             bytes to the right

        INC HL; next

                             byte lines

                             Image

        DJNZ LP_PSR2; shift the entire

                             line - 32

                             Byte

        DEC C; reduce

                             counter lines

        JR NZ, LP_PSR1; if pushed

                             all the lines, then

                             STOP

        RET; exit from the
                             procedure


;----------------------------------------;
; Upward shift by one pixel (38 <= 91)
;----------------------------------------;
PSRL_UP

        LD DE, # 4000; starting address

                             Graphics

                             (Verh. line)
LP_PSU1 LD H, D; copied

                             start address

        LD L, E; line graphs

                             in HL

        LD BC, # 0020, the size of one

                             line
                             Th shift

                             more

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift attributes to the right (21 <= 23)
;----------------------------------------;
ASRL_RG

        LD DE, # 5AFF; address last
                             He bytes

                             Attributes
LP_ASRG LD H, D; copied

                             DE to HL -

        LD L, E; Last

                             byte lines

                             Attributes

        DEC HL; penultimate

                             byte lines

                             Attributes

        LD BC, # 001F; <line length

                             attributes> - 1

        LDDR; line shift

                             Attributes

                             right

        LD A, (CONSTS); color filling
                             of after

                             shift

        LD (DE), A; set

                             new attribute

        DEC DE; transition to

                             whether
                             SRI top

        BIT 3, D; if we all

                             even in the attributes
                             max,

        JR NZ, LP_ASRG; then repeat

                             cycle for the lyrics.

                             line

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift attributes up (19 <= 21)
;----------------------------------------;
ASRL_UP

        LD HL, # 5820; address of the second

                             Line attributes
                             Comrade

        LD DE, # 5800; address of the first

                             Line attributes
                             Comrade

        LD BC, # 02E0; move:

                             23 lines of

                             32 bytes

        LDIR; shift 23

                             bottom line

                             Up

        LD A, (CONSTS); color for
                             complement the lower
                             her line
LP_ASUP LD (DE), A; set

                             new attribute

        INC E; if filled
                             Does the whole village
                             glacial line

        JR NZ, LP_ASUP; (E = 0) then

                             interrupt

                             cycle

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift attributes down (20 <= 21)
;----------------------------------------;
ASRL_DN

        LD HL, # 5ADF; address of the end

                             second-line

                             bottom

        LD DE, # 5AFF; address of the end

                             the lowest

                             line

        LD BC, # 02E0; move: 23

                             Line 32

                             Byte

        LDDR; shift 23

                             top line

                             down

        LD A, (CONSTS); color for
                             complement ver
                             hney line
LP_ASDN LD (DE), A; set

                             new attribute

        DEC E; if reached

                             the very first
                             first byte

        JR NZ, LP_ASDN; of Atri
                             casks (E = 0);

                             then STOP

        LD (DE), A; and establishes
                            Vai this byte

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift left one character (20 <= 21)
;----------------------------------------;
SSRL_LF

        LD DE, # 4000; top domains
                             Graphic Tee
LP_SSLF LD H, D; address of the first

        LD L, E; byte line

        INC HL; address of the second

                             byte lines

        LD BC, # 001F; how many bytes

                             shift

        LDIR; line shift

                             Left on 1

                             bytes

        XOR A; resets ak
                             kumulyator and

                             have brought

        LD (DE), A; the last

                             (Right) bytes

                             line

        INC DE; transition to

                             whether
                             line (bottom)

        LD A, D; if the attributes

        CP # 58; "still have not seen
                             give, "

        JR C, LP_SSLF; then repeat

                             cycle for the lyrics.

                             line

        RET; exit from the
                             procedure
;----------------------------------------;
; Right shift by one character (19 <= 22)
;----------------------------------------;
SSRL_RG

        LD DE, # 57FF; Last

                             bytes of

                             Graphics
LP_SSRG LD H, D; address last
                             He bytes

        LD L, E; current line

        DEC HL; address before
                             last

                             Byte

        LD BC, # 001F; shift: 31

                             bytes

        LDDR; line shift

                            graphic to the right

        XOR A; clear the accumulative
                             mulyator and for
                             so

        LD (DE), A; first (le
                             vy) bytes are
                             Booths line

        DEC DE; transition to

                             whether
                             Institute of higher

        BIT 6D; if we have

                             not "come across"

                             in ROM

        JR NZ, LP_SSRG; we continue

                             spin cycle

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift up one character (55 <= 68)
;----------------------------------------;
SSRL_UP

        LD DE, # 4000; top of the screen
                             Noah region
LP_SSU1 PUSH DE; store ad
                             interest on line

                             stack

        LD BC, # 0020, in line - 32

                             Byte

        LD A, E; The register DE

                             is hell
                             res

        ADD A, C; top Do
                             Research Institute. In Regis
                             triangle

        LD L, A; HL should

                             get the hell
                             res

        LD A, D; line, lying
                             ing from below

                             step 8.

        JR NC, GO_SSUP; To this end,

                             Register E

                             we add 32

        ADD A, # 08; and records

                             L. If proiGO_SSUP LD H, A; zoshlo 
transition                              complement, then


                             H = D +8

        LDIR; transfer of one

                             line (32

                             bytes)

        POP DE; recovered
                             Vai address

                             start line

        LD A, H; check: a

                             whether it is time

                             We zakrug
        CP # 58; lyatsya? (Ne
                             renesli all

                             1923 series)

        JR NC, LP_SSU2; if so,

                             transition to

                             cleanup

        INC D ;------------;

        LD A, D;

                               DOWN_DE

        AND # 07; standard

                              sequence
                              sequence

        JR NZ, LP_SSU1; commands

                              transition to

                              line down

        LD A, E; on-screen
                              region

        ADD A, # 20, (to register

                              DE)

        LD E, A;

        JR C, LP_SSU1; input:

                              DE - Address

                              line

        LD A, D; Output:

                              DE - Address

                              line below

        SUB # 08; used

                              battery

        LD D, A;

        JR LP_SSU1 ;------------;
LP_SSU2 XOR A; cleaning Accu
                             mulyatora
LP_SSU3 LD (DE), A; with him on
                             power -

        INC E; cleaning of one

                             line image
                             tion

        JR NZ, LP_SSU3; total: 32

                             Byte

        LD E, # E0; transition to

                             next

        INC D; (lower) if
                             Research images
                             of

        BIT 3, D; filled

                             all subsequent
                             tions series?

        JR Z, LP_SSU2; if not,

                             continue

                             fill

        RET; exit from the
                             procedure
;----------------------------------------;
; Shift down by one character (55 <= 73)
;----------------------------------------;
SSRL_DN

        LD DE, # 57FF; address last
                             He bytes

                             Graphics
LP_SSD1 PUSH DE; retained hell
                             res end if
                             SRI

        LD BC, # 0020; the length of one

                             line image
                             tion

        LD A, E; in register HL

        SUB C; get the hell
                             res

        LD L, A; end of the line

        LD A, D; overlying

        JR NC, GO_SSDN; starting with

                             step

        SUB # 08; of 8 pixels

                             (Lines):
GO_SSDN LD H, A; HL = how to
                             feast; DE =

                             where

        LDDR; transfer of one

                             Line graphs

        POP DE; recovered
                             Vai address

                             end of line

        BIT 6, H; if we have already

                             not in the screen,

        JR Z, LP_SSD2; then go

                             to clean

        LD A, D ;------------;

        DEC D; UP_DE

        AND # 07; standard

                              sequence
                              sequence

        JR NZ, LP_SSD1; commands

                              transition to

                              line up

        LD A, E; in screen

                              area (for

        SUB # 20; register DE)

        LD E, A;

        JR C, LP_SSD1; input: DE

                             - The address line

        LD A, D; output: DE

                             - The address line

                              above

        ADD A, # 08; used

                              battery

        LD D, A;

        JR LP_SSD1 ;------------;
LP_SSD2 XOR A; cleaning Accu
                             mulyatora
LP_SSD3 LD (DE), A; cleaning of one

        DEC E; line image
                             tion:

        JR NZ, LP_SSD3; (31 bytes)

        LD (DE), A; clear the most

                             first byte

                             line

        LD E, # 1F; transition to

                             next

                             (Top)

        DEC D; through a number of

                             eight lines

        BIT 6, D; we are not yet on
                             fell in the ROM?

        JR NZ, LP_SSD2; if not,

                            purify further

        RET; exit from the
                             procedure
;----------------------------------------;
; Left shift by one pixel (16 <= 17)
;----------------------------------------;
PSRL_LF

        LD HL, # 57FF; address last
                             He bytes

                             Graphics
LP_PSL1 OR A; reset

                             carry flag

                             CF

        LD B, # 20, in the same line

                             - 32 bytes
LP_PSL2 RL (HL); CF <- [shifts
                             my bytes] <-CF

                             (Left)

        DEC HL; transition to

                             previous

                             byte lines

        DJNZ LP_PSL2; shift cycle

                             for one if

                             SRI

        BIT 6, H; we are still in the equivalent
                             wound?

        JR NZ, LP_PSL1; if so,

                             shift the following
                             lowing line

        RET; exit from the
                             procedure
;----------------------------------------;
; Right shift by one pixel (17)
;----------------------------------------;
PSRL_RG

        LD HL, # 4000; address of the first

                             Byte Graphics

        LD C, # C0; move -

                             192 lines
LP_PSR1 OR A; CF = 0 for empty
                             one column

                             left

        LD B, # 20, the number of bytes in

                             one line
LP_PSR2 RR (HL); shift of one

                             bytes to the right

        INC HL; next

                             byte lines

                             Image

        DJNZ LP_PSR2; shift the entire

                             line - 32

                             Byte

        DEC C; reduce

                             counter lines

        JR NZ, LP_PSR1; if pushed

                             all the lines, then

                             STOP

        RET; exit from the
                             procedure


;----------------------------------------;
; Upward shift by one pixel (38 <= 91)
;----------------------------------------;
PSRL_UP

        LD DE, # 4000; starting address

                             Graphics

                             (Verh. line)
LP_PSU1 LD H, D; copied

                             start address

        LD L, E; line graphs

                             in HL

        LD BC, # 0020, the size of one

                             line




Other articles:

Amiga Sensor - naked under the gaze Rulez.

Amiga Sensor - steepest home computer - Amiga.

Coding - Demos kodit I want!

Coding - New procedures for 1940: the shift of the attributes of the left and right, up and down, shift by one character to the left and right, up and down, shift by one pixel to the left and right, up and down; Merge images, inverting the screen, inverting the symbol vertically or horizontally; rotation symbol clockwise change attribute, change attributes.

Coding - The procedure of the "floating attributes.

Software - Review of the demoscene: Bizarre Construction, Real Action, Rise, Xtaz, Abyss, Acid Revolution, Spirius, Rage, Art Vision, Ecstatic, Fractals, Popew UP, Excess.

Software - Review of the game prograkmm: mirror maze of death, Angles, noughts and crosses.

Aperativchik - Competition for the most buggy cracked version of the magazine.

Entry - On the control of obolochke Deja VU.

Entry - From the authors.

Hall of Fame - An Interview with Alexander Kotolvym (CAV / Auryn group).

Hall of Fame - schA tell you!

About Me - The story of creation Playgear Company.

users - How to print articles from journals in Scorpio.

attempt at writing - Short Story "The War Continues" (Chapter 4.5).

Advertising - Advertisements and announcements ...

Seven and 1 / 2 - Bribes! (Interview with the doctor).

Seven and 1 / 2 - Presentation Deja VU.

Topic - Enlight'97 - a brief report.

Topic - Speccy and the future ....

Topic - On the forward-looking and just TECHNO music.


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

Similar articles:
Humor - anecdotes.

В этот день...   23 November