all repos — mgba @ 40d14fe6133b8df8f75be1e9f78a5e4bc7920a92

mGBA Game Boy Advance Emulator

3DS: General cleanup
Jeffrey Pfau jeffrey@endrift.com
Wed, 10 Dec 2014 03:13:26 -0800
commit

40d14fe6133b8df8f75be1e9f78a5e4bc7920a92

parent

2d6749f8c86b6c0ab9bf64f6666ad167f883226e

1 files changed, 2 insertions(+), 5 deletions(-)

jump to
M src/platform/3ds/main.csrc/platform/3ds/main.c

@@ -35,7 +35,6 @@ GBAVideoSoftwareRendererCreate(&renderer);

size_t stride = VIDEO_HORIZONTAL_PIXELS * BYTES_PER_PIXEL; color_t* videoBuffer = anonymousMemoryMap(stride * VIDEO_VERTICAL_PIXELS); - memset(videoBuffer, 0xFF, stride * VIDEO_VERTICAL_PIXELS); struct GBA* gba = anonymousMemoryMap(sizeof(struct GBA)); struct ARMCore* cpu = anonymousMemoryMap(sizeof(struct ARMCore)); int activeKeys = 0;

@@ -73,12 +72,10 @@ ARMRunLoop(cpu);

if (!inVblank) { if (GBARegisterDISPSTATIsInVblank(gba->video.dispstat)) { - u16 width, height; - u8* screen = gfxGetFramebuffer(GFX_BOTTOM, GFX_BOTTOM, &width, &height); - memcpy(screen, videoBuffer, stride * VIDEO_VERTICAL_PIXELS); + GX_RequestDma(0, (u32*) videoBuffer, (u32*) gfxGetFramebuffer(GFX_BOTTOM, GFX_BOTTOM, 0, 0), stride * VIDEO_VERTICAL_PIXELS); gfxFlushBuffers(); gfxSwapBuffersGpu(); - gspWaitForEvent(GSPEVENT_VBlank0, false); + gspWaitForVBlank(); hidScanInput(); } }