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
DCEmu Freak
DCEmu Freak
Posts: 98
Joined: Tue May 02, 2017 3:11 pm

Does vmu_draw_lcd block? How fast can you call it?

Post by kazade » Thu Nov 08, 2018 3:50 pm

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: 5335
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

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

Post by BlueCrab » Thu Nov 08, 2018 7:15 pm

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