Peanut-GB icon indicating copy to clipboard operation
Peanut-GB copied to clipboard

core: allow LCD rendering to happen in separate thread

Open deltabeard opened this issue 1 year ago • 1 comments

Peanut-GB would signal to the frontend that it should call gb_lcd_render_line() with copied sprite data and LCD registers. This would allow the LCD drawing -- which requires a lot of time -- to be completed on a separate thread whilst emulation continues.

deltabeard avatar May 26 '23 17:05 deltabeard

Considering this screenshot from the pandoc: PPU Mode Timings

The gb_lcd_render_line() function could run in a separate thread whilst remaining within the timing of the GB CPU such that OAM is processed during OAM scan where the OAM is inaccessible (unless using OAM DMA, which is ignored here), and then the LCD rendering can be done in Mode 3, where the VRAM is also inaccessible. This means that copying the OAM and VRAM will not be necessary to render the LCD in a separate thread.

deltabeard avatar Oct 05 '23 12:10 deltabeard