Peanut-GB
Peanut-GB copied to clipboard
core: allow LCD rendering to happen in separate thread
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.
Considering this screenshot from the pandoc:
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.