Homebrew Bottom screen Flickering using libctru

Peanut42

Active Member
OP
Newcomer
Joined
Jun 27, 2015
Messages
44
Trophies
0
XP
194
Country
Mexico
Hi

Another difficult question, I have some flickering in my Paddle Puffle game. Especially when drawing to the bottom screen. I'm using libctru and a loop like this:

Code:
while (aptMainLoop () && !done) {
     last_time = svcGetSystemTick ();
     hidScanInput ();
     keys = hidKeysDown ();
     
     if (keys & KEY_START) {
       done = 1;
     }
     
     // Draw all the stuff to the top screen here
     
     //Wait for VBlank
     gspWaitForVBlank();
     
     gfxFlushBuffers();
     gfxSwapBuffers();
     
     // Draw all stuff to the bottom screen here
    
     // Here is the flickering !!!
     now_time = svcGetSystemTick ();
     if (now_time < last_time + FPS) svcSleepThread (last_time + FPS - now_time);
}

Some suggestions to avoid the bottom screen flickering?
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
There is something broken in ctrulib HW rendering, and if you're using the ctulib console, it uses HW rendering.

I had similar problems till last week, then there was a rollback on the ctrulib github to solve some HW rendering problems.

I installed that version and most of the problems are now solved (sometime the flickering starts again, but very seldom).

Try to update yout ctrulib to fix the problem.

P.S. : I don't know if the latest commit works fine, i'm abroad with a very bad connection.
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy

Peanut42

Active Member
OP
Newcomer
Joined
Jun 27, 2015
Messages
44
Trophies
0
XP
194
Country
Mexico
Why you draw bottom screen after flushing and swapping buffers?

That's my point, I don't know if flush buffers pushes both buffers. I found functions named gspWaitForVBlank0, gspWaitForVBlank1 and gspWaitForVBlank. The macro "gspWaitForVBlank" is an alias for "gspWaitForVBlank0". Don't know what exactly do gspWaitForVBlank1.

After drawing both screens, should I flush buffers, Wait for VBlank (for both? the 0 and 1) and swapbuffers?
The bottom screen uses doble buffering too?
 

MRJPGames

Pretty great guy
Member
Joined
Aug 17, 2013
Messages
1,199
Trophies
1
Location
The Netherlands
Website
fizazy.com
XP
1,676
Country
Netherlands
That's my point, I don't know if flush buffers pushes both buffers. I found functions named gspWaitForVBlank0, gspWaitForVBlank1 and gspWaitForVBlank. The macro "gspWaitForVBlank" is an alias for "gspWaitForVBlank0". Don't know what exactly do gspWaitForVBlank1.

After drawing both screens, should I flush buffers, Wait for VBlank (for both? the 0 and 1) and swapbuffers?
The bottom screen uses doble buffering too?
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForEvent(GSPEVENT_VBlank0, false);
The order I use.
 
D

Deleted User

Guest
There is something broken in ctrulib HW rendering, and if you're using the ctulib console, it uses HW rendering.

I had similar problems till last week, then there was a rollback on the ctrulib github to solve some HW rendering problems.

I installed that version and most of the problems are now solved (sometime the flickering starts again, but very seldom).

Try to update yout ctrulib to fix the problem.

P.S. : I don't know if the latest commit works fine, i'm abroad with a very bad connection.
Just an FYI, the ctrulib console does NOT use HW rendering, it draws directly to the framebuffer in software.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Well start walking towards them +1