GB, GBA Video: Move VRAM allocation to init
Vicki Pfau vi@endrift.com
Sat, 30 Dec 2017 14:20:37 -0500
2 files changed,
2 insertions(+),
11 deletions(-)
M
src/gb/video.c
→
src/gb/video.c
@@ -56,7 +56,7 @@ void GBVideoInit(struct GBVideo* video) {
video->renderer = &dummyRenderer; video->renderer->cache = NULL; video->renderer->sgbRenderMode = 0; - video->vram = 0; + video->vram = anonymousMemoryMap(GB_SIZE_VRAM); video->frameskip = 0; video->modeEvent.context = video;@@ -99,10 +99,6 @@
video->frameCounter = 0; video->frameskipCounter = 0; - if (video->vram) { - mappedMemoryFree(video->vram, GB_SIZE_VRAM); - } - video->vram = anonymousMemoryMap(GB_SIZE_VRAM); GBVideoSwitchBank(video, 0); video->renderer->vram = video->vram; memset(&video->oam, 0, sizeof(video->oam));
M
src/gba/video.c
→
src/gba/video.c
@@ -69,7 +69,7 @@
void GBAVideoInit(struct GBAVideo* video) { video->renderer = &dummyRenderer; video->renderer->cache = NULL; - video->vram = 0; + video->vram = anonymousMemoryMap(SIZE_VRAM); video->frameskip = 0; video->event.name = "GBA Video"; video->event.callback = NULL;@@ -91,11 +91,6 @@ mTimingSchedule(&video->p->timing, &video->event, VIDEO_HDRAW_LENGTH);
video->frameCounter = 0; video->frameskipCounter = 0; - - if (video->vram) { - mappedMemoryFree(video->vram, SIZE_VRAM); - } - video->vram = anonymousMemoryMap(SIZE_VRAM); video->renderer->vram = video->vram; memset(video->palette, 0, sizeof(video->palette));