ZX Review #3-4
22 июля 1997

Studies - O. Smolyankin: Procedures for cleaning the screen. Output of text messages on the screen.

<b>Studies</b> - O. Smolyankin: Procedures for cleaning the screen. Output of text messages on the screen.
(C) Smolyankin Oleg, 1996.


   Oleg has sent several of cleaning the screen, which can be 
used in a variety of game programs. The first procedure 
produces a clean separation of familiarity of each half and 
shifts the contents of one half to the left, and another - 
vpravo.1412. 

 10 ORG 40000
 20 LD B, 8
 30 LOOP2 LD HL, 16384
 1940 PUSH BC
 50 HALT
 60 LD BC, # 0C00
 70 LOOP1 SLA (HL)
 80 INC HL
 1990 SRL (HL)
100 INC HL
110 DEC BC
120 LD A, B
130 OR C
140 JR NZ, LOOP1
150 POP BC
160 DJNZ LOOP2
170 LD HL, 22528
180 LD DE, 22529
190 LD BC, 767
200 LD (HL), # 47
210 LDIR
220 XOR A
230 OUT (254), A
240 RET2


   The following is a memory dump:

9C40: 6 August 1921 00 40 C5 76 01:87
9C48: 00 0C CB 26 23 CB 3E 23:30
9C50: 0B 78 B1 20 F5 C1 10 EA: F0
9C58: 21 00 58 11 01 58 01 FF: D7
9C60: 47 February 1936 ED B0 AF D3 FE: 98
9C68: C9 00 00 00 00 00 00 00: CD


     Following procedure Oleg
pulled out of a Hacker STINGER'a
STIFFLIP 'CO LOADER. Virtually the same procedure was published 
in ZX REVIEW 95 / 2. However, This differs in that line

formed register regeneration.
1412.
 10 ORG 40000
 20 LD HL, 16384
 30 LD B, 192
 1940 LOOP PUSH BC
 1950 PUSH HL
 1960 PUSH HL
 70 CALL LINE
 1980 POP HL
 90 CALL CLS
100 POP HL
110 CALL ADDR
120 POP BC
130 DJNZ LOOP
140 RET
150 LINE LD B, 32
160 LD A, R
170 AND 63
180 LD D, A
190 L1 LD A, (DE)
200 LD (HL), A
210 INC HL
220 INC DE
230 DJNZ L1
240 LD BC, 1000
250 PAUSE DEC BC
260 LD A, B
270 OR C
280 JR NZ, PAUSE
290 RET
300 CLS PUSH HL
310 POP DE
320 INC DE
330 LD (HL), 0
340 LD BC, 31
350 LDIR
360 RET
370 ADDR INC H
380 LD A, H
390 AND 7
400 RET NZ
410 LD A, L
420 ADD A, 32
430 LD L, A
440 RET C
450 LD A, H
SUB 460 8
470 LD H, A
480 RET
2

   And dump the program:

9C40: 21 00 40 06 C0 C5 E5 E5: 92
9C48: CD 57 9C E1 CD 6D 9C E1: 3C
9C50: CD 78 9C C1 10 EF C9 06:5 C
9C58: 20 ED 5F E6 3F 57 1A 77:6 D
9C60: 23 October 13 E8 FA 01 03 0B: 33
9C68: 78 B1 20 FB C9 E5 D1 13: DA
9C70: 36 00 01 1F 00 ED B0 C9: C8
9C78: 24 7C E6 07 C0 7D C6 20: C4
9C80: 6F D8 7C D6 C9 00 August 1967: ED


     The following procedure is similar
the previous one, only when treatment is not displayed band.
1412.
 10 ORG 40000
 20 LD HL, 22496
 30 EXX
 1940 PUSH HL
 50 LD HL, 16384
 60 LD B, 95
 1970 LOOP HALT
 80 EXX
 90 CALL CLS
100 DEC H
110 LD A, H
120 AND 7
130 CP 7
140 JR NZ, NEXT
150 LD A, L
160 SUB 32
170 LD L, A
180 JR C, NEXT
190 LD A, H
200 ADD A, 8
210 LD H, A
220 NEXT EXX
230 CALL CLS
240 INC H
250 LD A, H
260 AND 7
270 JR NZ, NEXT1
280 LD A, L
290 ADD A, 32
300 LD L, A
310 JR C, NEXT1
320 LD A, H
SUB 330 8
340 LD H, A
350 NEXT1 DJNZ LOOP
360 POP HL
370 EXX
380 RET
390 CLS LD E, L
400 LD D, 32
410 C1 LD (HL), 0
420 INC L
430 DEC D
440 JR NZ, C1
450 LD L, E
460 RET
2

   And dump the program:

9C40: 21 E0 57 D9 E5 21 00 40:53
9C48: 06 5F 76 D9 CD 7A 9C 25: A0
9C50: 7C E6 07 FE 20 July 0A 7D: 01
9C58: D6 20 6F 38 04 7C C6 08: DF
9C60: 67 D9 CD 7A 9C 24 7C E6: A5
9C68: July 20 0A 7D C6 20 6F 38:3 F
9C70: 04 August 1967 7C D6 10 D3 E1: 95
9C78: D9 C9 5D 16 20 36 00 2C: AB
9C80: 15 20 FA 6B C9 00 00 00:7 F


   The last procedure clears
change screen attributes. She produces a gradual increase of 
the outlines. And each once the screen color changes.

1412.
 10 ORG 40000
 20 LD A, 7
 30 CALL MAIN
 40 LD A, 5
 50 CALL MAIN
 60 LD A, 1
 70 CALL MAIN
 80 XOR A
 90 CALL MAIN
100 LD HL, 16384
110 LD DE, 16385
120 LD BC, 6911
130 LD (HL), 0
140 LDIR
150 LD A, (23693)
160 PUSH AF
170 RRCA
180 RRCA
190 RRCA
200 AND 7
210 OUT (254), A
220 POP AF
230 JR M1
240 MAIN OUT (254), A
250 LD E, A
260 RLCA
270 RLCA
280 RLCA
290 XOR E
300 M1 LD HL, 22528
310 LD BC, # 2018
320 LD D, # 0C
330 L1 PUSH DE
340 PUSH BC
350 PUSH HL
360 PUSH AF
370 CALL CLS
380 HALT
390 HALT
400 POP AF
410 POP HL
420 LD BC, 33
430 ADD HL, BC
440 POP BC
450 DEC B
460 DEC B
470 DEC C
480 DEC C
490 POP DE
500 DEC D
510 JR NZ, L1
520 RET
530 CLS LD (MEM1), A
540 LD DE, 32
550 LD A, B
560 LD (MEM2), A
570 LD A, C
580 LD (MEM3), A
590 LD A, (MEM2)
600 LD B, A
610 LD A, (MEM1)
620 C1 LD (HL), A
630 INC HL
640 DJNZ C1
650 DEC HL
660 LD A, (MEM3)
670 LD B, A
680 LD A, (MEM1)
690 C2 LD (HL), A
700 ADD HL, DE
710 DJNZ C2
720 AND A
730 SBC HL, DE
740 LD A, (MEM2)
750 LD B, A
760 LD A, (MEM1)
770 C3 LD (HL), A
780 DEC HL
790 DJNZ C3
800 INC HL
810 LD A, (MEM3)
820 LD B, A
830 LD A, (MEM1)
840 C4 LD (HL), A
850 AND A
860 SBC HL, DE
870 DJNZ C4
880 RET
890 MEM1 DEFB 0
900 MEM2 DEFB 0
910 MEM3 DEFB 02


   And dump the program:

9C40: 3E 07 CD 6E 9C 3E 05 CD: 08
9C48: 6E 9C 3E 01 CD 6E 9C AF: B3
9C50: CD 6E 9C 21 00 40 11 01:36
9C58: 40 01 FF 1A 36 00 ED B0: 21
9C60: 3A 8D 5C F5 0F 0F 0F E6: 27
9C68: 07 D3 FE F1 July 18 D3 FE: BD
9C70: 5F 7 July 2007 AB 21 00 58: A4
9C78: January 18, 1920 1916 0C D5 C5 E5: EE
9C80: F5 CD 96 9C 76 76 F1 E1: CE
9C88: 21 January 2000 09 May 2005 C1 0D: 27
9C90: 0D D1 15 20 E8 C9 32 D8: FA
9C98: 9C 20 November 2000 78 32 D9 9C: 20
9CA0: 79 32 DA 9C 3A D9 9C 47:53
9CA8: 3A D8 9C 77 Oct. 23 FC 2B: C3
9CB0: 3A DA 9C 47 3A D8 9C 77:68
9CB8: October 19 FC A7 ED 52 3A D9: 72
9CC0: 9C 47 3A D8 9C 77 2B 10:9 F
9CC8: FC 23 3A DA 9C 47 3A D8: 8C
9CD0: 9C 77 A7 ED 52 10 FA C9: 38
9CD8: 00 00 00 00 00 00 00 00:74

********************************


   The following procedures are devoted to
found text messages on
screen.


(C) Oleg Smolyankin.


   Bring to your attention
procedure, which I pulled out
various boot loaders. All they
designed to display text messages. So:


   The first procedure:
145.

     ORG 40000

     ENT

     LD A, 2

     CALL # 1601

     LD B, 31
L2 LD A, 22

     RST 1916

     LD A, 12

     RST 1916

     LD A, B

     RST 1916

     LD A, 32

     SUB B

     PUSH BC

     LD HL, 23760

     LD B, A
L1 LD A, (HL)

     RST 1916

     INC HL

     DJNZ L1

     POP BC

     DEC B

     LD A, B

     CP 255

     JR NZ, L2

     RET
2

   Its a dump:

9C40: 3E 02 CD 16 January 2006 1F 3E: 63
9C48: 16 D7 3E 0C D7 78 D7 3E: 7F
9C50: 20 90 C5 21 D0 5C 47 7E: 73
9C58: D7 Oct. 23 FB C1 May 1978 FE: 35
9C60: FF 20 E4 C9 00 00 00 00: C8


   The text should be in the very first BASIC-line operator for 
REM. The string length is fixed - 32 characters (if needed 
less, you can add spaces Up to 32 characters).



   2nd procedure:
145.

     ORG 40000

     ENT

     LD HL, 16384

     LD B, 7
L7 PUSH HL

     PUSH BC
L6 PUSH BC

     PUSH HL

     LD B, 32
L5 RR (HL)

     INC HL

     DJNZ L5

     POP HL

     POP BC

     DJNZ L6

     POP BC

     POP HL

     INC H

     DJNZ L7

     JR L8
L9 PUSH HL

     POP DE

     INC DE

     LD (HL), A

     LD BC, 32

     LDIR

     RET
L8 LD A, # 46

     LD HL, 23168

     CALL L9

     LD A, # 42

     LD HL, 23200

     CALL L9

     LD HL, 16384

     LD DE, 20608

     CALL L10

     LD DE, 20640
L10 LD A, 4
L11 LD BC, 32

     PUSH DE

     PUSH HL

     LDIR

     POP HL

     POP DE

     INC H

     INC D

     INC D

     DEC A

     JR NZ, L11

     RET
2

   Its a dump:

9C40: 21 00 40 06 07 E5 C5 C5: B9
9C48: E5 June 20 CB 1E Oct. 23 FB: 06
9C50: E1 C1 10 F3 C1 E1 24 10:67
9C58: EC 18 0A E5 D1 13 77 1:43
9C60: 20 00 ED B0 C9 3E 46 21:27
9C68: 80 5A CD 5B 9C 3E 42 21:43
9C70: A0 5A CD 5B 9C 21 00 40:2 B
9C78: November 1980 50 CD 81 9C 11 A0: 90
9C80: 50 3E 04 01 20 00 D5 E5: 89
9C88: ED B0 E1 D1 24 14 14 3D: FC
9C90: 20 F1 C9 00 00 00 00 00:06


   Before using this
procedure, the screen must be cleared so: BORDER 0: PAPER 0: INK
0: CLS.

   Type in anything in the top row, and call
this procedure. You'll see that
happen. The procedure is very suitable for processing 
downloaders. 


   Third procedure is
Print double-height characters.
145.

       ORG 30000
POS EQU # 0000
LEN EQU 27
FONT1 EQU 40000
FONT2 EQU 50000

       ENT

       LD IX, 15616

       LD HL, FONT1

       LD DE, FONT2

       LD B, 96
L3 PUSH BC

       LD B, 4
L1 LD A, (IX +0)

       LD (HL), A

       INC HL

       LD (HL), A

       INC HL

       INC IX

       DJNZ L1

       LD B, 4
L2 LD A, (IX +0)

       LD (DE), A

       INC DE

       LD (DE), A

       INC DE

       INC IX

       DJNZ L2

       POP BC

       DJNZ L3

       LD A, 2

       CALL # 1601

       LD HL, FONT1-256

       LD (23606), HL

       LD DE, TEXT

       LD BC, POS

       PUSH DE

       PUSH BC

       CALL POSIT

       LD BC, LEN

       CALL # 203C

       LD HL, FONT2-256

       LD (23606), HL

       POP BC

       INC B

       CALL POSIT

       POP DE

       LD BC, LEN

       CALL # 203C

       RET
POSIT LD A, # 16

       RST 1916

       LD A, B

       RST 1916

       LD A, C

       RST 1916

       RET
TEXT DEFM "SMOLY"

       DEFM "ANKIN OLE"

       DEFM "G PRESENTS"
2

   Its a dump:

7530: DD 21 00 21 40 3D 9C 11: EE
7538: 50 C3 C5 June 1960 June 2004 DD: D2
7540: 7E 00 77 23 77 23 DD 23:67
7548: 10 June 2004 F5 DD 7E 00 12:39
7550: December 13, 1913 DD October 23 F5 C1: C3
7558: 10 E2 3E 02 CD January 1916 21:04
7560: 40 9B 22 36 5C November 1991 75:7 B
7568: 01 00 00 D5 C5 CD 1989 75:43
7570: 01 1B 00 CD 3C 20 21 50:9 B
7578: C2 22 36 5C C1 04 CD 89:7 E
7580: 75 D1 01 1B 00 CD 3C 20:80
7588: C9 3E 16 D7 78 D7 79 D7: 90
7590: C9 20 20 20 53 4D 4F 4C: 69
7598: 59 41 4E 4B 49 4E 20 4F: 46
75A0: 4C 45 47 20 50 52 45 53:47
75A8: 45 4E 54 53 00 00 00 00:57

********************************






Other articles:

TR-DOS for beginners - Part 1.

Authoring - General Sound - Multimedia for the ZX Spectrum!

Business Card - Introducing the new electronic journal "Major Wares" (c) Codebusters & VMG

Computer novella - Knight Lore "legends of chivalry times."

New Programs - I. Roshchin. HELP_Z80. Davydov. Catalog's Base v1.8.

description of the shell of the journal "ZX-REVIEW"

Crossing Dragon - Aavlon, Castle of Dreams, Erik the Viking.

Crossing Dragon - Eureka!, Eye of Bain, Kentilla.

Crossing - Sherlock, Apollo, Shadows of Mordor, Rigels Revenge, Temple of Terror, ID, That's the Spirit, Return to Ithaka.

Retro - Dzh.Hardman, E. Hyuzon. Top 40 procedures.

Expert Tips - Castle Master.

Expert Tips - Firelord.

Expert Tips - Stonkers.

Forum Games - Insult Megademo, Catch 23, Livingstone, Rock Star ate my Hampster, UFO-2: Devils of the Abyss, Terminator 2, Venturama, The Spririts, Nipper, Sweewo'S World, King's Bounti -2, Hacker 2, Black Magic, Satcom, Star Heritage.

Forum - A. Gura. Code programmer.

Forum - A. Strelnikov. Prospects of development of ZX Spectrum.

Forum - Davydov. According to materials published in the ZX-REVIEW: Some issues related to autostart BASIC programs. Redefine Keys. How to print 42 characters per line. The procedure of multiplication HL = B * C. Refinement cloning downloaders. Mini-driver disk.

Forum - With 'Light'. Music processor ZX-Speccy.

Forum - Dmitry Fyodorov: Print images with a mask with pixel precision. Algorithm for calculating the address coordinates to within a pixel.

Forum - I. Roshchin. Sharing ZX ASM 3.0 and STS 5.1.

Forum - M. Bekarev. The calculation of the address display area of familiarity, and vice versa.

Forum - VP Fedin. Refinement Profi for conflict-free peripheral connectivity.

Forum - S. Astrov. Pseudorandom number generator.

reader-reader - V. Sirotkin. Protection program (look at the problem).

reader-reader - I. Roshchin. Display driver for the computer, "Pentagon-128.

Studies - A. Savinov: The procedure for displaying a double-height characters. Procedure "dissolution" of characters.

Studies - A. Urzha. The procedure for drawing a circle.

Studies - V. Sirotkin. Program checksum.

Studies - E. Volchkov. Improvement routines address calculation system on display file.

Studies - E. Frost. Running line.

Studies - I. Komandin. The program display screen.

Studies - I. Roshchin. Two graphic effect.

Studies - M. Lazutov: The modernization program font. Program encode / decode block codes. The effect of the attributes.

Studies - O. Smolyankin: Procedures for cleaning the screen. Output of text messages on the screen.


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

Similar articles:
Sweetest ... - The analysis of the game "GREMLINS".
Likbez - a full description and full disassembler ROM (part 11).
Thoughts aloud - Doom of Inlayte'97: news from the Flash and Softland.

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