mirror of https://github.com/mgba-emu/mgba.git
3DS: Return to menu on exit
This commit is contained in:
parent
762ddb096d
commit
2236b27600
|
@ -105,15 +105,19 @@ int main() {
|
||||||
320, 240,
|
320, 240,
|
||||||
font, _drawStart, _drawEnd, _pollInput
|
font, _drawStart, _drawEnd, _pollInput
|
||||||
};
|
};
|
||||||
|
|
||||||
|
while (aptMainLoop()) {
|
||||||
|
char path[256];
|
||||||
|
if (!selectFile(¶ms, "/", path, sizeof(path), "gba")) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
_drawStart();
|
_drawStart();
|
||||||
GUIFontPrintf(font, 0, GUIFontHeight(font), GUI_TEXT_LEFT, 0xFFFFFFFF, "Loading...");
|
GUIFontPrintf(font, 130, (GUIFontHeight(font) + 240) / 2, GUI_TEXT_LEFT, 0xFFFFFFFF, "Loading...");
|
||||||
_drawEnd();
|
_drawEnd();
|
||||||
char path[256] = "/rom.gba";
|
if (!GBAContextLoadROM(&context, path, true)) {
|
||||||
if (!selectFile(¶ms, "/", path, sizeof(path), "gba") || !GBAContextLoadROM(&context, path, true)) {
|
continue;
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
GBAContextStart(&context);
|
GBAContextStart(&context);
|
||||||
|
|
||||||
while (aptMainLoop()) {
|
while (aptMainLoop()) {
|
||||||
hidScanInput();
|
hidScanInput();
|
||||||
int activeKeys = hidKeysHeld() & 0x3FF;
|
int activeKeys = hidKeysHeld() & 0x3FF;
|
||||||
|
@ -121,15 +125,15 @@ int main() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
GBAContextFrame(&context, activeKeys);
|
GBAContextFrame(&context, activeKeys);
|
||||||
GSPGPU_FlushDataCache(0, renderer.outputBuffer, 256 * VIDEO_VERTICAL_PIXELS * 2);
|
|
||||||
GX_SetDisplayTransfer(0, renderer.outputBuffer, GX_BUFFER_DIM(256, VIDEO_VERTICAL_PIXELS), tex->data, GX_BUFFER_DIM(256, VIDEO_VERTICAL_PIXELS), 0x000002202);
|
GX_SetDisplayTransfer(0, renderer.outputBuffer, GX_BUFFER_DIM(256, VIDEO_VERTICAL_PIXELS), tex->data, GX_BUFFER_DIM(256, VIDEO_VERTICAL_PIXELS), 0x000002202);
|
||||||
|
GSPGPU_FlushDataCache(0, tex->data, 256 * VIDEO_VERTICAL_PIXELS * 2);
|
||||||
gspWaitForPPF();
|
gspWaitForPPF();
|
||||||
_drawStart();
|
_drawStart();
|
||||||
sf2d_draw_texture_scale(tex, 40, 296, 1, -1);
|
sf2d_draw_texture_scale(tex, 40, 296, 1, -1);
|
||||||
_drawEnd();
|
_drawEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
GBAContextStop(&context);
|
GBAContextStop(&context);
|
||||||
|
}
|
||||||
GBAContextDeinit(&context);
|
GBAContextDeinit(&context);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
Loading…
Reference in New Issue