Page 1 of 1

nxtBasic : first 5 lines flicker ih the screen

Posted: Thu Jul 25, 2024 4:27 pm
by funkheld
hello, good day.

I did a test.
fill the entire screen with "B".
nxtbasic is slow.

when the screen is scrolled to the right with the "E" key, the top 5 lines flicker. I fixed this with "sleep 1" in the basic of the x16.

how can I get rid of the flickering here in nxtbasic?

thanks.
greeting

Code: Select all

SCREEN 128

gosub ascii

z=255
StartEdit:
    Loop:
        Key$=GET
        if Key$="Q" then GOSUB links
	if Key$="E" then GOSUB rechts
    Goto loop
end

links:
print " LINKS"
return

rechts:
 z=z-1
 if z=-1 then 
   z=255
   u=u-1
   Poke $9F38,u 
 endif	
  
 Poke $9F37,z
return

ascii:
 For d= 1 to 8000
   VPoke 1,$b000+d+1,2  
   VPoke 1,$b000+d,0*16+2
 next d
return

Re: nxtBasic : first 5 lines flicker ih the screen

Posted: Thu Jul 25, 2024 6:09 pm
by unartic
Here is an example which fills the screen in a blink. I also added the left and right scrolling. The SLEEP 0 makes nxtBasic wait until the 'electronbeam' is in VBLANK, so this should prevent the filcker.


Code: Select all

SCREEN 128
FILLSCREEN 0
gosub ascii
HScroll=0
ScrollAmount = 3
StartEdit:
    Loop:
        Key$=GET
        if Key$="Q" then GOSUB links
	    if Key$="E" then GOSUB rechts
    Goto loop
end

links:
    if HScroll>ScrollAmount then
        HScroll=HScroll-ScrollAmount
        SLEEP 0
        POKEN $9F37,CHR$(HScroll MOD 256) + CHR$(HScroll/256) 
    end if
return

rechts:
    HScroll=HScroll+ScrollAmount
    SLEEP 0
    POKEN $9F37,CHR$(HScroll MOD 256) + CHR$(HScroll/256) 
return

ascii:
    line$ = SPC(256)    'this way 256 bytes are reservers, so no relocation of string space needed
    line$=""
    for i = 1 to 128
        'Build a string of 128 pairs of letter B CHR$(2) and a color byte CHR$(2)
        line$ = line$ + CHR$(2) + CHR$(2) 
    next
    
    'VPOKE a line at a time
    For d= 0 to GETROWS()-1
        VPOKEN 1,$b000 + (d*256),line$
    next d
return

Re: nxtBasic : first 5 lines flicker ih the screen

Posted: Thu Jul 25, 2024 7:05 pm
by funkheld
hello, that works wonderfully.

there is no more flickering.
the execution speed has increased.

you programmed it well, thank you.

greetings.

Re: nxtBasic : first 5 lines flicker ih the screen

Posted: Fri Jul 26, 2024 10:17 am
by funkheld
1 byte always appears at the top left.

You can see it better with cls.

I can't get rid of the byte.

Thanks.
greeting

Re: nxtBasic : first 5 lines flicker ih the screen

Posted: Fri Jul 26, 2024 11:17 am
by unartic
Yes, you have to ignore that for the moment ;-)

nxtBasic uses vera fx for very fast multiplication for which the result is written to vram, currently at address $00000. I have to move it to a non-visble part of memory. I'll make sure that happens with the next release.

So for now: just ignore it, it will go away :-)

Re: nxtBasic : first 5 lines flicker ih the screen

Posted: Fri Jul 26, 2024 12:17 pm
by funkheld
hello, thank you for your great help.

when I try something new at the age of 76 jahr , I always have a lot of questions.

greetings

Re: nxtBasic : first 5 lines flicker ih the screen

Posted: Fri Aug 02, 2024 5:26 pm
by mortarm
I'd say when anybody tries anything new, they're gonna have a lot of questions.