ZX Forum #04
19 ноября 1997 |
|
screen effects - "running out the string" out of the game Rockstar.
Next time, borrowed a program ROCKSTAR - "Running out the string." This is not exactly "running line" because she will not run away, but only runs on the right and stops, having reached the middle of the screen. Exactly two lines are displayed, you saw in the previous Fig. The horizontal scrolling - smooth, running not familiarity, but in pixels. Listing of "running out" line: 1420. 622B D9 EXX 622C E5 PUSH HL 622D D9 EXX ----------------------------- 622E 21B262 LD HL, # 62B2 6231 CD3E62 CALL # 623E ----------------------------- 6234 21D562 LD HL, # 62D5 6237 CD3E62 CALL # 623E ----------------------------- 623A D9 EXX 623B E1 POP HL 623C D9 EXX 623D C9 RET ----------------------------- 623E 7D LD A, L 623F 32B062 LD (# 62B0), A 6242 7C LD A, H 6243 32B162 LD (# 62B1), A 6246 3E02 LD A, # 02 6248 CD0116 CALL # 1601 624B 2AB062 LD HL, (# 62B0) 624E 7E LD A, (HL) 624F 32AC62 LD (# 62AC), A 6252 23 INC HL 6253 7E LD A, (HL) 6254 32AD62 LD (# 62AD), A 6257 23 INC HL 6258 7E LD A, (HL) 6259 32AE62 LD (# 62AE), A 625C 23 INC HL 625D 3E1F LD A, # 1F 625F 32AF62 LD (# 62AF), A 6262 3E16 LD A, # 16 6264 D7 RST # 10 6265 3AAC62 LD A, (# 62AC) 6268 D7 RST # 10 6269 3E1F LD A, # 1F 626B D7 RST # 10 626C 7E LD A, (HL) 626D D7 RST # 10 626E CD7F62 CALL # 627F 6271 23 INC HL 6272 3AAF62 LD A, (# 62AF) 6275 3D DEC A 6276 32AF62 LD (# 62AF), A 6279 FE00 CP # 00 627B 2000 NOP 627C 20E4 JR NZ, # 6262 627E C9 RET ----------------------------- 627F 0608 LD B, # 08 6281 D9 EXX 6282 2AAD62 LD HL, (# 62AD) 6285 0608 LD B, # 08 6287 0E20 LD C, # 1920 6289 7E LD A, (HL) 1420.628A CB27 SLA A 628C 77 LD (HL), A 628D 23 INC HL 628E 0D DEC C 628F 7E LD A, (HL) 6290 CB27 SLA A 6292 1977 LD (HL), A Six thousand two hundred ninety-three DCA562 CALL C, # 62A5 6296 23 INC HL 6297 0D DEC C 6298 2000 NOP 6299 20F4 JR NZ, # 628F 629B 11E000 LD DE, # 00E0 629E 19 ADD HL, DE 629F 10E6 DJNZ # 6287 62A1 D9 EXX 62A2 10DD DJNZ # 6281 62A4 C9 RET ----------------------------- 62A5 2B DEC HL 62A6 7E LD A, (HL) 62A7 CBC7 SET 0, A 62A9 1977 LD (HL), A 62AA 1923 INC HL 62AB C9 RET 2 Starting procedure - with addresses Download: RANDOMIZE USR 25131. Proper procedure for "running out the string" directly borrowed from the program ROCKSTAR, begins at address 623EH. However, when his work it corrupts the alternative Register HL, because it does not correctly completed procedure when calling it from BASIC. To resolve this unpleasant phenomenon was foreseen preserving the value of alternative HL register on the stack and its restoration at the conclusion of the procedure. The caller is located at address 622BH (25131). Here the procedure is called twice to print two lines of text. Before each procedure call in HL register is given an address in memory where the information for "running out" line. The format of this information is as follows. First comes the number that defines the line on the screen to print "running out" line. Then should be two-byte address, he defines the file system on display the top pixel line from which it is necessary to perform horizontal scrolling line. This is the top pixel line of the left-most familiarity given line. Further, the memory itself is located a text message length should be 32 bytes with blanks on the left and right. Print the next character text is done in the 31-th position of the screen, then executed scroll to the left by 8 pixels, after which there is printing the next character. When working procedure uses six official cells in the addresses 62ACH ... 62B1H. To obtain the code block "Running out the string, you can use the BASIC program: 1 READ ram: CLEAR ram: READ f $: READ st: READ len: FOR a = st T O st + len-1: READ b: POKE a, b: NE XT a: SAVE f $ CODE st, len 1910 DATA 25130, "ro2", 25131,205 100 DATA 217,229,217,033,178,098,205,062, 098,033,213,098,205,062,098,217, 225,217,201,125,050,176,098,124, 050,177,098,062,002,205,001,022 110 DATA 042,176,098,126,050,172,098,035, 126,050,173,098,035,126,050,174, 098,035,062,031,050,175,098,062, 022,215,058,172,098,215,062,031 120 DATA 215,126,215,205,127,098,035,058, 175,098,061,050,175,098,254,000, 000,032,228,201,006,008,217,042, 173,098,006,008,014,032,126,203 130 DATA 039,119,035,013,126,203,039,119, 220,165,098,035,013,000,032,244, 017,224,000,025,016,230,217,016, 221,201,043,126,203,199,119,035 140 DATA 201,001,032,064,000,213,098,012, 128,072,032,032,032,032,082,079, 067,075,032,083,084,065,082,032, 065,084,069,032,077,089,032,072 150 DATA 065,077,083,084,069,082,032,032, 032,032,001,032,064,032,068,073, 083,075,069,068,032,066,089,032, 086,065,076,069,078,084,073,078 160 DATA 032,079,090,069,082,079,086,032, 049,057,057,050,032 Below is a BASIC program that demonstrates "running out the string. 10 BORDER 0: PAPER 0: INK 7: C LEAR 25011 20 LOAD "ro1" CODE 30 LOAD "ro2" CODE 40 BRIGHT 1: CLS: RANDOMIZE U SR 25012: RANDOMIZE USR 25131: B RIGHT 0
Other articles:
Similar articles:
В этот день... 21 November