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

Studies - scrolling lines of text in the specified window. Attribute scroller. Diagonal scrolling.

<b>Studies</b> - scrolling lines of text in the specified window. Attribute scroller. Diagonal scrolling.
(C) Komandin IG, Kaluga


   I would like to propose for your consideration its programs 
from over I've worked with recently

time.


   1. This program performs
scrolling in the specified window as much as
lines of text (word, as in the credits for movies).
144.
1910; UP-SCROLLER
1920; (C) ZX-MANIACS
30 ORG 40000
40 ENT
50 INIT LD HL, TEXT
60 LD (TEXTP), HL
70 SCROLL LD HL, (TEXTP)
80 XOR A
90 LD (LINE), A
100 LD A, (HL)
110 OR A
120 JR Z, INIT
130 LD B, 8
140 M1 PUSH BC
150 PUSH HL
160 LD DE, 22506
170 LD B, 12
180 M2 PUSH HL
190 LD A, (HL)
200 LD H, 0
210 LD L, A
220 ADD HL, HL
230 ADD HL, HL
240 ADD HL, HL
250 PUSH DE
260 LD DE, (23606)
270 ADD HL, DE
280 LD A, (LINE)
290 LD D, 0
300 LD E, A
310 ADD HL, DE
320 POP DE
330 LD A, HL
340 LD (DE), A
350 INC DE
360 POP HL
370 INC HL
380 DJNZ M2
390 CALL SRL_UP
400 POP HL
410 POP BC
420 LD A, (LINE)
430 INC A
440 LD (LINE), A
450 DJNZ M1
460 LD HL, (TEXTP)
470 LD DE, 12
480 ADD HL, DE
490 LD (TEXTP), HL
500 RET
510SRL_UP LD DE, # 400A
520 LD H, D
530 LD L, E
540 INC H
550 LD BC, # 0CBF
560 UPS1 PUSH BC
570 PUSH HL
580 UPS2 LD A, (HL)
590 LD (DE), A
600 INC HL
610 INC DE
620 DJNZ UPS2
630 POP DE
640 LD H, D
650 LD L, E
660 INC H
670 LD A, H
680 AND 7
690 JR NZ, NXT_U
700 LD BC, # 00E0
710 SBC HL, BC
720 LD A, H
730 AND 7
740 JR Z, NXT_U
750 LD BC, # 0700
760 SBC HL, BC
770 NXT_U POP BC
780 DEC C
790 RET Z
800 JR UPS1
810 LINE DEFB 0
820 TEXTP DEFW TEXT
830 TEXT DEFM "**** UP ****"
840 DEFM "* SCROLLER *"

850 DEFM "* IS WRITTEN *"
860 DEFM "**** BY ****"
870 DEFM "* KOMANDIN *"
880 DEFM "*** ILYA ***"
890 DEFM "* ZX-MANIACS *"
900 DEFM "***** *****"
910 DEFM ""
920 DEFM ""
930 DEFM ""
940 DEFB 0
2

   Now we'll talk about how
change the output window. In line
160 is given the address of the lower-left corner of the 
window, in line 510 - upper left. Window width is defined in 
lines 170 and 480 (in familiarity). On line 550 in the register 
B is stored width of the window (in familiarity), while in case 
C - height of the box-1 (in pixels).

The text of the program reads from memory by rows, equal to the 
width windows, so that should bring him back the same way.


   The program is almost no change procedure is used Kulikov 
Vadim SRL_UP (line 510 800 ZX-REVIEW N3'96, P.34). By course of 
events in the above procedure was found a Oshibochka. Line 60 
should look like this: 


          LD BC, # 20BF

otherwise the screen is stretched the first line of the field 
attributes. 


   2. The next program - a few extravagant an attribute 
scroller ("put on pop ").

140.
INIT LD HL, TEXT

          LD (TEXTP), HL

          LD HL, BUFF

          LD DE, BUFF +1

          LD BC, 7

          LD (HL), 0

          LDIR

          XOR A

          LD (COL), A

          LD A, 48

          LD (COLOUR), A
SCROLL LD A, (COL)

          OR A

          JR Z, LDIRB

          LD HL, 22528;!

          LD DE, 22529;!

          LD BC, 7

          LD (HL), 0

          LDIR

          LD B, 8

          LD DE, 22528;!

          LD HL, BUFF
L1 AND A

          SLA (HL)

          JR NC, NEXT

          LD A, (COLOUR)

          LD (DE), A
NEXT INC HL

          INC DE

          DJNZ L1

          LD B, 23 ;!!!!!

          LD HL, 23232 ;!!!!

          LD DE, 23264;!
L2 PUSH BC

          PUSH HL

          PUSH DE

          LD BC, 8

          LDIR

          POP DE

          POP HL

          LD D, H

          LD E, L

          LD BC, 32

          SBC HL, BC

          POP BC

          DJNZ L2


          LD A, (COL)

          DEC A

          LD (COL), A

          RET
LDIRB LD A, 8

          LD (COL), A

          LD HL, (TEXTP)

          LD A, (HL)

          OR A

          JR Z, INIT

          INC HL

          LD (TEXTP), HL

          CP 1916

          JR NZ, PASS

          LD A, (HL)

          LD (COLOUR), A

          INC HL

          LD (TEXTP), HL

          JR LDIRB
PASS LD H, 0

          LD L, A

          ADD HL, HL

          ADD HL, HL

          ADD HL, HL

          LD DE, (23606)

          ADD HL, DE

          LD DE, BUFF

          LD BC, 8

          LDIR

          JR SCROLL

BUFF DEFS 8
COL DEFB 0
COLOUR DEFB 48
TEXTP DEFW TEXT
TEXT DEFB 16,120,127,32,16,16

        DEFM "ZX-MANIACS"

        DEFB 16,32

        DEFM "(KALUGA '"

        DEFB 16,48
3 DEFM "1996"

        DEFB 16,32

        DEFM ")"

        DEFB 0
2

   As always, on how to change
Output window scroller. In line
marked with an exclamation point, has to enter the address of 
the attributes corresponding upper-left corner of the window. In

line with two exclamation
signs need to put the address on the
one greater. In line with the three characters - the address of 
the lower-left corner of the window, in line with the four 
characters - the address of 32 is less than the previous one. 
In line with the same five exclamation marks recorded height of 
the window (in the familiarity). 

   You can go on line to change the color output attributes.
To this end, the text is inserted
code 16, followed by the value of the required attribute. The 
value of this As is known, is calculated by

formula

FLASH * 128 + BRIGHT * 64 + PAPER * 8 + INK

Just do not forget that in this
scrolling color of the letters - is PAPER, and
Background Color - INK.


   3. This program - diagonal scrolling. More precisely -
psevdodiagonalny (not as a
IWAMOTO in STEG'e), but looks good too. True, I advise
specifically to make SCROLL'a
decoder with an elongated upper part (where the character takes 
in the height of seven pixels, and empty in familiarity is

only the bottom line).
140.
INIT LD HL, TEXT

          LD (TEXTP), HL

          XOR A

          LD (COL), A

          LD HL, BUFF

          LD DE, BUFF +1

          LD BC, 7

          LD (HL), 0

          LDIR
SCROLL LD A, (COL)

          OR A

          JR NZ, LDIRB

          XOR A

          LD HL, BUFF

          LD DE, 22523

          LD B, 8
M1 SLA (HL)

          RRA

          INC HL

          DJNZ M1

          LD (DE), A

          LD HL, 16389

          LD B, 24
M2 PUSH BC

          LD B, 8
M3 LD D, H

          LD E, L

          CALL DOWN

          PUSH HL

          PUSH DE

          LD A, (HL)

          SLA A

          LD (DE), A

          DEC HL

          DEC DE

          LD A, (HL)

          RLA

          LD (DE), A

          DEC HL

          DEC DE

          LD A, (HL)

          RLA

          LD (DE), A

          POP DE

          POP HL

          DJNZ M3

          POP BC

          INC HL

          DJNZ M2

          LD A, (COL)

          DEC A

          LD (COL), A

          LD HL, 22522

          LD DE, 22523

          LD BC, Feb.

          LD (HL), 0

          LDIR

          RET
LDIRB LD HL, (TEXTP)

          LD A, (HL)

          OR A

          JR Z, INIT

          INC HL

          LD (TEXTP), HL

          LD H, 0

          LD L, A

          ADD HL, HL

          ADD HL, HL

          ADD HL, HL

          LD DE, (23606)

          ADD HL, DE

          LD DE, BUFF

          LD BC, 8

          LDIR

          LD A, 8

          LD (COL), A

          JR SCROLL
COL DEFB 0
BUFF DEFS 8
TEXTP DEFW TEXT
TEXT DEFM "45 - ANGLE SCROLL"

       DEFM "IS WRITTEN BY"

       DEFM "KOMANDIN ILYA"

       DEFM "(ZX-MANIACS)"
3 DEFM "KALUGA '1996"

       DEFM ""

       DEFM ""

       DEFB 0
2

   This program is quite zamorochena and makes no checks, so it 
is better to do It does not change. Incidentally, it is 
necessary to leave the sides of the traveling line width of the 
void in familiarity, as scrolled band width of a 
three-familiarity. 

   And finally, how
run these programs. In principle, all three approaches is the 
same procedure: 140.


          CALL INIT
LOOP HALT

          CALL SCROLL

          LD A, 127

          IN A, (254)

          RRA

          JR C, LOOP

          RET2


           *







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 - A newspaper's letter BROM'a.
Contest - The first logo for FunTop'a.
Assembler - nachinyuschim: playing music on interrupts, running line and the procedure for hours.
Advertising - Advertising and announcements ...

В этот день...   28 April