gray: expose pointers to the screen buffers

This commit is contained in:
Lephe 2021-05-01 18:29:36 +02:00
parent c4ec06d6ab
commit 78bf9dac7d
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 13 additions and 0 deletions

View File

@ -144,4 +144,8 @@ void dgray_getdelays(uint32_t *light, uint32_t *dark);
These pointers can be used for custom rendering functions. */
void dgray_getvram(uint32_t **light, uint32_t **dark);
/* dgray_getscreen(): Get the current screen pointers
These pointers can be used to make screen captures. */
void dgray_getscreen(uint32_t **light, uint32_t **dark);
#endif /* GINT_GRAY */

View File

@ -258,3 +258,12 @@ void dgray_getvram(uint32_t **light, uint32_t **dark)
if(light) *light = vrams[base & 2];
if(dark) *dark = vrams[base | 1];
}
/* dgray_getscreen(): Get the current screen pointers */
void dgray_getscreen(uint32_t **light, uint32_t **dark)
{
int base = st ^ 2;
if(light) *light = vrams[base & 2];
if(dark) *dark = vrams[base | 1];
}