Fastest screen grabber

ZXNet echo conference «code.zx»

From Alexey Voskresensk To All 1 July 1997

Hi coding All!!! I present to your attention the procedure, which may be useful to you, and many will give you different ideas. This is, in fact, an installer for another process. fools - "Quick screen scam", in which the picture is packed. On average, the transfer 6912 bytes takes 30000...60000 so- Comrade Why such a range of values? And in because the procedure involves “frequency data analysis", and, naturally, transfer- whether the screen is half empty or full The most frequently repeated values will be take much less time than re- edge of a completely filled screen. But enough lyricism... How to use should I start this program? Firstly, in reg. Pair IX indicate the address in memory where the emissions will be located - your procedure along with the packaged inside it with a picture. Secondly, in reg. HL pair indicate address end of the picture +1. The picture should be loaded at (#4000-$5B00). Thirdly, reg. the BC pair must indicate the length of the picture divided in half (for example, measures, 6144/2). Then you can call the procedure ru INSTALL. As a result of her work: 1) from address IX the picture will be promoted ka in the form: ...LD DE,nn: PUSH DE: PUSH DE: LD DE,nn...; 2) after procedure IX will be indicated call to the next memory cell after "screen scammer"; 3) reg. pair BC will contain the value tion, equal to the number of cycles for whichthe resulting "thrower" will perform your task. Other comments as the procedure progresses. ====================== Gnawing line ========================= ; (c) 1997 Sudden Prodigy Incorporated INSTALL LD IX, procedure location address (e.g. #8000) LD HL, end of screen address +1 (e.g. #5B00) LD BC,screen length/2 (e.g. 6912/2=3456) D.I. EXX LD BC,#0A ;number of clock cycles for counting (LD DE,nn - ; 10 cycles of the Z80 processor :) LD DE,#37 ;number of cycles for all kinds of preparatory ; ny operations PUSH HL LD H,D LD L,H ;reset HL ADD HL,SP ;save SP EX DE,HL LD (IX+0),#F3 ;preparatory operations: LD (IX+1),#21 ; D.I. LD (IX+2),H ; LD HL,#0000 LD (IX+3),H ; ADD HL,SP LD (IX+4),#39 ; LD SP,nn LD (IX+5),#31 ; EXX LD (IX+6),L ;end address LD (IX+7),H ; screen LD DE,#08 ADD IX,DE LD SP,HL ;remove from stack DEC SP ; first 2 bytes DEC SP; data POP HL; screen PUSH HL JR NEXT AGAIN DEC SP ;remove DEC SP ; from the stack POP HL; current 2 bytesPUSH HL ; screen LD A,H ;frequency analysis :) CP D ; if the current two JR NZ,NEXT ; bytes of data LD A,L ; not equal to the previous ones C P E ; two bytes, then OK, otherwise JR Z,YES! ; switch to YES! NEXT EXX ADD HL,BC ;add the number of clock cycles (LD DE,nn) EXX LD (IX+0),#11 ;LD DE,nn LD (IX+1),L ; nn - current two LD (IX+2),H ; screen bytes INC IX INC IX INC IX YES! EXX ADD HL,BC ;add 11 bars (PUSH DE) INC HL EXX LD (IX+0),#D5 ;PUSH DE INC IX EX DE,HL ;save the current 2 bytes for comparison DEC BC ;if LD A,B ; not all - OR C ; then JR NZ,AGAIN ; again LD (IX+0),#F9 ;LD SP,HL LD (IX+1),#FB ; EI LD (IX+3),#C9 ; RET INC IX INC IX INC IX ;IX indicates the following ; cell after the procedure EXX EX DE,HL LD SP,HL ;restore SP POP HL; restore HL (for BASIC) PUSH DE EXX POP BC ;BC - the number of cycles that EI; the procedure will requireRET ; to "throw" the screen ; (PRINT USR INSTALL:) ==== Gnawing line ========================================== Greetings, LAS of "Sudden Prodigy Inc." P.S. I don't have a computer right now, so why kick Yuri Buravtsov for being admitted errors when reprinting :) - 812/01.14 P.P.S. Thanks to OneSOFT for help.