mirror of https://github.com/mgba-emu/mgba.git
GB, GBA Video: Move VRAM allocation to init
This commit is contained in:
parent
d0277a7125
commit
748e1943f7
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue