From e2c507855f8ec00e6724aa4d761b6c5493090c0d Mon Sep 17 00:00:00 2001 From: Lephe Date: Sat, 26 Nov 2022 18:31:04 +0100 Subject: [PATCH] render-cg: allocate VRAM in _ostk to keep _uram for large allocs --- src/render-cg/dvram.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/render-cg/dvram.c b/src/render-cg/dvram.c index 96c7c18..0bbde2b 100644 --- a/src/render-cg/dvram.c +++ b/src/render-cg/dvram.c @@ -1,5 +1,6 @@ #include -#include +#include +#include /* Up to two VRAM pointers can be set, for triple buffering. */ static uint16_t *vram_1 = NULL, *vram_2 = NULL; @@ -13,7 +14,13 @@ bool dvram_init(void) /* Leave MARGIN bytes on each side of the region; this enables some important optimizations in the image renderer. We also add another 32 bytes so we can manually 32-align the region */ - uint32_t region = (uint32_t)malloc(DWIDTH*DHEIGHT*2 + MARGIN*2 + 32); + uint32_t region = (uint32_t)kmalloc(DWIDTH*DHEIGHT*2 + MARGIN*2 + 32, +#if !defined(GINT_NO_OS_STACK) + "_ostk" +#else + NULL +#endif + ); if(region == 0) return false;