Permalink
Browse files
GB, GBA Video: Move VRAM allocation to init
- Loading branch information...
Showing
with
2 additions
and
11 deletions.
-
+1
−5
src/gb/video.c
-
+1
−6
src/gba/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 @@ void GBVideoReset(struct GBVideo* video) { |
|
|
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));
|
|
|
|
|
|
@@ -69,7 +69,7 @@ static struct GBAVideoRenderer dummyRenderer = { |
|
|
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 @@ void GBAVideoReset(struct GBAVideo* video) { |
|
|
|
|
|
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));
|
|
|
|
0 comments on commit
748e194