nxtBasic : first 5 lines flicker ih the screen

All aspects of programming on the Commander X16.
Post Reply
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

nxtBasic : first 5 lines flicker ih the screen

Post 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
Attachments
screenb.jpg
screenb.jpg (476.47 KiB) Viewed 1462 times
unartic
Posts: 145
Joined: Sat Oct 28, 2023 3:26 pm

Re: nxtBasic : first 5 lines flicker ih the screen

Post 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
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: nxtBasic : first 5 lines flicker ih the screen

Post by funkheld »

hello, that works wonderfully.

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

you programmed it well, thank you.

greetings.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: nxtBasic : first 5 lines flicker ih the screen

Post 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
Attachments
fehler1.jpg
fehler1.jpg (18.79 KiB) Viewed 1385 times
fehler.jpg
fehler.jpg (4.22 KiB) Viewed 1386 times
unartic
Posts: 145
Joined: Sat Oct 28, 2023 3:26 pm

Re: nxtBasic : first 5 lines flicker ih the screen

Post 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 :-)
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: nxtBasic : first 5 lines flicker ih the screen

Post 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
mortarm
Posts: 298
Joined: Tue May 16, 2023 6:21 pm

Re: nxtBasic : first 5 lines flicker ih the screen

Post by mortarm »

I'd say when anybody tries anything new, they're gonna have a lot of questions.
Post Reply