Sprite "one line" artifact on screen update. Somebody knows why?

Página 2/2
1 |

Por hope-hunter

Rookie (22)

imagem de hope-hunter

03-06-2022, 23:40

Calindro wrote:

Can you share your rom for investigation?

@Calindro, the original code is a project I made for the Basic 10-Liner Contest 2021. In the original, I reach 9/10 FPS only, but I think it still stay funny to play. Now, using more lines, I'm trying to speed up the program: speed-up the pre-renderization that needs about 4 minutes to finish (terrible) and speedup the gameplay. In last improvement I reach 20/25 FPS the was very impressive for me. I'm challenge me to use only MSX-BASIC instructions without any assembly routines.

It is hard to post the code here because I used non standart characters to compact the sprites definition. I think that it won't work, but I also can post the webMSX save state bellow.

0 'ÿþøðÓ©€¿ x`VUT@?83*^ \ Y X W P L H F D Ƶ¤“‚qo^M<+Z N C *B A àO J óñϏ@ #Šï³Ž·³·³’·³”·³˜·³š·³œ·³ž·³ ·³–·#¡çï#…¿ï#¢ï#n[n[†#ÙwÕ{ãwˁåw××§å§w§ß«§ã£Ë§'x|#£(Ó#ã1ÃßíOíßÃ'ÇïkWkïÇ'ÝïéGéïÝ'Ïíß?ßíÏ+¯‚ÍÑkk+Ûëvuã.ÍÑl*»ÇÝvu#ã-ÍÑk+ÛÝvvãu.ÍÑk,»ÇÝvu/ÍÑk,ÛÝvv2
1 DEFINTA-Z:DIMA(300-RND(-TIME)):DEFFNR=RND(1)*64:OPEN"GRP:"AS#1:SCREEN5,2,0:FORI=0TO3:SETPAGE,3-I:COLOR,-(I=3)-14*(I=0),0:CLS:NEXT:W$="v14l32o7deb":W$(3)="o7m256m17s8c4":VPOKE-32135,181:W$(2)="o7m256m28s8f3":VDP(19)=4:IFPEEK(45)>1THENVDP(26)=VDP(26)OR2
2 SOUND3,15:O=-32688:FORI=OTOI+178:A=PEEK(I)-35:G=(A>15ANDA<81):H=(A>80):P=-(1+(A-16)\8)*G-(9+(A-80)\2)*H:R=-(A<16)*AMOD16-G*AMOD8-H*AMOD2:B=PEEK(O-P-1):B=B-(PEEK(O-P-2)-96)*(B=32):FORD=DTOD+R:IFD<98THENA(D)=BELSEVPOKED+30622,B:VPOKED+28574-32*(D>193),B
3 NEXTD,I:FORI=0TO13:FORJ=0TO224STEP16:LINE(A(C+3)+J,A(C+2))-(A(C)+J,A(C+1)),A(56+I),BF:NEXT:VPOKEC-32180,A(C+1+4*(I>5)):VPOKEC-32178,4-4*(I>4)-12*(I>10):C=C+4:NEXT:SETPAGE,1:FORI=0TOI+511:VPOKEI,-39*(I<304)-10*(I>479)-(I\16-14)*(I>303ANDI<480):NEXT:L=4
4 SOUND4,95:SETPAGE2,2:FORW=WTO72STEP4:FORI=0TO169:A=128*I:VPOKEA+W,16+(W*14+I*24)MOD200:VPOKEA+W+1,(W*8-I*10)AND255:NEXTI,W:FORP=2TO3:SETPAGEP,P:FORI=0TO169:COPY(152,4)-(240,4),1TO(152,I):NEXT:FORI=0TO10:A=77+I*4:IFI<>6THENT=70+4*INT(FNR*P/(192/L))
5 X(I)=-X(I)*(P=3)-(X(5)+24+FNR*3)*(P=2):FORJ=TTOT+3STEP2:FORR=1TOA(J):X(I)=((X(I)+A(J+1)*(I<5)-A(J+1)*(I>4)))AND255:VPOKEA,X(I):A=A+128:NEXTR,J,I,P:SETPAGE0,0:A$="0o2v11cv13cv14co1v12b":W$(1)="l1"+A$:W$(0)="l2"+A$:VPOKE-32131,69:VDP(5)=7:VDP(12)=1
6 SOUND9,0:A=254ORPEEK(-1043)XORPEEK(-1051):IFA>1THENL=LOG(A)*1.45:GOTO4ELSEIFA=0GOTO6ELSEE=0:F=0:Y=0:Z=0:S=-1:T=S:FORI=0TO80:N=(I>8ANDI<16):D=3+N:SOUND7,56+14*N:O=20-8*N:COLOR=(1,3+N+(I<20),2+N,2):VPOKE-32134,O:VPOKE-32130,O:IFI=23ORPEEK(-1044)=251GOTO6
7 FORJ=0TO169STEP2:SOUND9,10:A=VDP(Q-5):COPY(0,J)-STEP(239,1),DTO(0,4),1:Y=-(Y-(3*(PEEK(-1049)=191)-3*(PEEK(-1046)=127))*(E=0)-(D=2))*(Y<195)-9*(E>2)-194*(Y>194):IFY>8GOTO8ELSES=S+1:SOUND12,40:SOUND4,85:SOUND10,16:SOUND13,0:PRESET(62,3):PRINT#1,S:Y=197
8 VDP(6)=PEEK(-3099)XOR1:VPOKE-32132,Y:Z=-(Z-(3*(PEEK(-1043)=223)-3*(PEEK(-1043)=191))*(F=0)-(D=2))*(Z<195)-9*(F>2)-194*(Z>194):COPY(0,J+1)-STEP(239,1),DTO(0,4),1:IFZ>8GOTO9ELSET=T+1:SOUND12,40:SOUND4,96:SOUND10,16:SOUND13,0:PRESET(174,3):PRINT#1,T:Z=197
9 VPOKE-32136,Z:Q=2:E=E+(E>0):F=F+(F>0):IFVDP(8)AND32THENPLAYW$:IFVDP(-3)<99THENE=5:VPOKE-32130,16:NEXTJ,IELSEF=5:VPOKE-32134,16:NEXTJ,IELSEQ=0:IFE=1ORF=1THENVPOKE-32130,O:VPOKE-32134,O:NEXTJ,IELSEIFJMOD76<>32ORPLAY(1)THENNEXTJ,IELSEPLAYW$(AAND3):NEXTJ,I

WebMSX Savestate:
Note: Remeber if you stop and run the program from start, you need to wait 4 minutes.

https://webmsx.org/?STATE_URL=https://drive.google.com/u/0/u...

Por hope-hunter

Rookie (22)

imagem de hope-hunter

04-06-2022, 03:37

@Arjan, I'm satisfied. Your explain makes all sense. It even explain why the failed line is showed just 16 pixels advanced. I thank you! This 16 pixels advanced was very strange and was bother me. oO
I even don't understand that "normal glitche" that I post after, using only PUTSPRITE. But this one, at least, is less annoying.

Por hope-hunter

Rookie (22)

imagem de hope-hunter

04-06-2022, 04:47

About the second glitch, using only Put Sprite. I think I finally I got it! Smile2

All solved! Thank you all! :)

Página 2/2
1 |