Does vmu_draw_lcd block? How fast can you call it?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
kazade
Insane DCEmu
Insane DCEmu
Posts: 145
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Tue May 02, 2017 3:11 pm
Has thanked: 3 times
Been thanked: 34 times

Does vmu_draw_lcd block? How fast can you call it?

Post by kazade »

I'm adding VMU support to my game engine, and I just have a few questions about vmu_draw_lcd.

- Does vmu_draw_lcd wait until the submitted frame can be displayed, or does it return immediately in the case that the VMU is not ready?
- What's the refresh time of the VMU display? How many frames can I submit per second?

I'm thinking that I should move VMU screen updates into a thread so that there's no risk of blocking the main loop, but I don't want to do that if it's not necessary.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Does vmu_draw_lcd block? How fast can you call it?

Post by BlueCrab »

Basically, because of how the maple code is set up (and how it uses DMA), you can only do a maximum of one frame per vblank. The function does indeed block until the VMU accepts the frame, so you probably do want to use a thread for it if you don't want it blocking your main thread.

It used to be possible in KOS to call the VMU LCD drawing code fast enough to emulate grayscale images on the screen, however this is no longer the case (nor has it been for a while).
Post Reply