Put sprite 2X2 with mask and pixel by pixel

ZXNet echo conference «code.zx»

From Slavka Kalinin To All 4 September 2000

Greetings, All! People tell me how to make a subject faster? Or if vlomak can give a similar procedure from Chv1? And then I was toiling here and it was really normal and I didn’t write, damn it, I don’t even know, it’s probably not meant to be I need to become a normal coder. By the way, a sprite can have any format and be rolled out maybe in a buffer, and not in registers, but the main thing is that it worked faster, I just decided to make a game here with the engine a little like chv1, like a map with normal terrain It is clearly displayed, but I can’t quickly display units. That's all. Bye, All! [ASPECT] [ZX-NEWS] [SOSG] [CGE] [ARTVIEW] [AON] [NEWDIZZY] [GAMEBIT] [DIZZY#A] [THE KNIGHT'S ARENA] to be continued ... __________________ NewArt/N-DISCOVERY ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

From George Valnin To Slavka Kalinin 7 September 2000

Hello Slavka! 04 Sep 00 22:53, Slavka Kalinin -> All: SK> People tell me how to make a subject faster? For example like this: DE - screen HL - sprite + mask LD A,(DE) ; took a byte from the screen INC E AND(HL); put a mask on him INC L OR(HL); put a sprite on the mask INC L LD (DE),A ; shoved back into the screen 40 CLOCKS PER OUTPUT ONE BYTE Erase LD (HL), A; INC L or by stack... You can use the stack: POP DE ; SP - mask/sprite LD A, (HL) ; HL - screen AND E OR D LD(HL),A INC L 36 BARKS. Or like this: POP HL (address in the screen from the table of addresses of all columns of the screen), you can also ADD HL,DE (DE-offset of the sprite), and so only one column of addresses is needed. We lay out the procedure for the entire sprite: LD A,(HL) AND #XX OR #XX LD(HL),A INC L 32 measures Each sprite has its own procedure. I hope everything is clear and you can figure out the rest yourself - I’ve given you enough hints. SK> Or if vlomak can give you a similar procedure SK> from Chv1? You don't need to take anything from there... ;) SK> Otherwise I was toiling here and it’s really normal and SK> did not write, It's not scary. Everyone has had a hard time at some point. SK> damn it, I don’t even know, it’s probably not meant to be SK> become a normal coder for me.You will if you don't stop there. And we need to think about assigned task to the last. Sometimes it's useful to look through someone else's code, especially from branded games, look for errors there... SK> By the way, a sprite can have any format and be rolled SK> maybe in a buffer, not in registers, but the main thing is to be SK> worked faster You can't do it quickly with rolling... SK> I just decided to make a game here with the engine SK> a little similar to chv1, like a map with normal terrain SK> is clearly displayed, but units cannot be displayed quickly. Why did you sit down to write a game if you can’t display the sprite? Best regards, George aka -=GPV=-.

From Slavka Kalinin To All 11 September 2000

Greetings, All! People, here is a program that I was able to write, but as you can see This is far from ideal, so please, if you can’t break it, try it speed it up, the prite format can be anything you want, the procedure is quick three plowed. ;SPRITE FORMAT IS THIS: ;1-BYTE SPRITE,2-BYTE MASK ;3-BYTE SPRITE,4-BYTE MASK ;5-BYTE SPRITE,5-BYTE MASK ;7-BYTE SPRITE,8-BYTE MASK ;THIS WAS THE LEFT SIDE OF THE SPRITE, ;RIGHT GOES ALSO, MASK ;OVERLAYED BY AND, AT COPPER ;OVERLAYED BY XOR BUT I'M STILL ;NEDAPER HOW TO DO IT BY XOR SO ;IT WORKED FASTER THAN THIS ;PROCEDURE FOR SCROLLING AND WITHDRAWING ONE ;LINES OF HALF OF THE SPRITE. LD SP;SPRITE ADDRESS LD HL;ADDRESS ON SCREEN POP DE XOR A SRL E:RRA LD C,A LD A,255 SCF RR D RRA LD B,A LD A,(HL) AND D OR E LD(HL),A INC L LD A,(HL) AND B OR C LD(HL),A DEC L INC H ;==============> 113 BLOCKS MINIMUM AND ;197 CLOCKS MAXIMUM IF SHIFT IS NECESSARY ;GET A 4 PIXEL SPRITE. ;IF MORE THAN 4 THEN SHIFT TO ANOTHER ;THE GOING SIDE. That's all. Bye, All! [ASPECT] [ZX-NEWS] [SOSG] [CGE] [ARTVIEW] [AON] [NEWDIZZY] [GAMEBIT] [DIZZY#A] [THE KNIGHT'S ARENA] to be continued ... __________________ NewArt/N-DISCOVERY ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

From Aleksandr Majorov To Slavka Kalinin 13 September 2000

Hello Slavka! 11 Sep 00 22:30, Slavka Kalinin -> All: [skipped] SK> People here is a program that I was able to write, but as you can see SK> this is far from an idea, so please, if it doesn’t break, then try SK> speed it up, the text format can be any except the quick procedure SK> plowed three times. By the way, your subject did not turn out well. More precisely, the sprite is not 2x2, but 1xX SK> ;SPRITE FORMAT IS THIS: SK> ;1-BYTE SPRITE,2-BYTE MASK SK> ;3-BYTE SPRITE,4-BYTE MASK SK> ;5-BYTE SPRITE,5-BYTE MASK SK> ;7-BYTE SPRITE,8-BYTE MASK SK> ;THIS WAS THE LEFT SIDE OF THE SPRITE, SK> ;RIGHT GOES ALSO, MASK I didn’t even see the right one! [skip] SK> LD SP; SPRITE ADDRESS Are you sure that you will have time to throw out _everything_ your sprites through a stack of 1 int? SK> LD HL;ADDRESS ON SCREEN SK> POP DE SK> XOR A SK> SRL E:RRA SK> LD C,A SK> LD A,255 SK> SCF SCF: SBC A,A So faster/shorter SK> RR D SK> RRA SK> LD B,A SK> LD A,(HL) SK> AND D SK> OR E SK> LD (HL),A Uh-huh, now you display the data in the following byte. Where is the output of the right half of the sprite? she must come here! SK> INC L SK> LD A,(HL) SK> AND B SK> OR C SK> LD (HL),A SK> DEC L SK> INC H SK> ;==============> 113 BLOCKS MINIMUM AND SK> ;197 CLOCKS MAXIMUM IF YOU NEED TO SHIFT SK> ;GET A 4 PIXEL SPRITE . SK> ;IF MORE THAN 4 THEN SHIFT TO ANOTHER SK> ;THE WAY SIDE. For some reason I don’t see a change in the number of shifts... This is what I can advise. Only advice, but not ready advice! Store data as DATA0, DATA1, MASK0, MASK1 (perhaps "0" and "1" should be swapped!) And make any changes as POP HL; we took a picture of the sprite XOR A ADD HL,HL: RLA EX DE,HL EX AF,AF';so in A'-D-E the sprite picture POP HL ;removed the sprite mask LD A,#FF SCF: ADC HL,HL: RLA LD B,H: LD C,L ;in A-B-C sprite mask OUT_ADDR EQU $+1: LD HL,???? ;where to display minus ADYN AND (HL): EX AF,AF' OR (HL): LD (HL),A LD A,(HL): AND B: OR D: LD (HL),A LD A,(HL): AND C: OR E: LD (HL),A I didn’t count the beats - I was lazy. But this is more like the truth than it is for you. And your letter in which you ask for lard we didn't receive... Ugh.... I mean, I fucking threw away your letter, actually *soap* to me, but in the echo of ZX(!). Moreover, it is written not in real name but in pseudo! Do you even get along with your head sometimes? This can be written in our local echoes, or in general with soap. Alexand

From Oleg Grigoriev To Kirill Frolov 14 September 2000

Let your enemies, Kirill, die without sons! 8 September 2000 at 13:37, Kirill Frolov ═> Oleg Grigoriev: KF>>> ld hl, nnnn KF>>> push hl KF>>> ld hl, nnnn KF>>> push hl KF>>> .... OG>> well, well. hl is not suitable for this at all. KF> Will it be faster via DE? definitely. after all, only hl can be driven into sp. but it’s better in general through bc, and de use as a pointer to the address table. those. something like this: ex de hl ld e (hl) inc l ld d (hl) inc l ex de hl ld sp hl .16 ld bc #0000 push bc inc h ld sp hl ; .16 ld bc #0000 push bc ; repeat this 7 times and see the beginning. if it is necessary in color, then the addresses in the attributes and senior ones are entered into the table address bytes on the screen. The beginning of the spitting is being corrected a little. specifically The above is, of course, for scrolling by lines. [WBR, Oleg. ] [ 02:05 14 September XXXV A.S. ]

From Eugene Stahov To Aleksandr Majorov 15 September 2000

Hello, Aleksandr. 13 Sep 00 11:51, you wrote to Slavka Kalinin: AM> I didn’t even see the right one! AM> [skip] SK>> LD SP;SPRITE ADDRESS AM> Are you sure that you will have time to throw out _everything_ AM> your sprites via a stack of 1 int? SK>> LD HL;ADDRESS ON SCREEN SK>> POP DE Don't care about int... Do we raise the sprite by DE? ;Interrupt handling: ISR: LD (SP_REST+1),SP LD (DE_REST+1),DE EX DE,HL ;!!! EX (SP),HL ;pc ;!!! LD(RET_ISR),HL LDSP,ISR_SP PUSH DE ;hl PUSH BC PUSH AF POP AF POP B.C. POP HL SP_REST: LD SP,0 DE_REST: LD DE,0 EI RET_ISR: JP 0 Well, it's time to wrap things up. I went to code. Eugene