mirror of https://github.com/mgba-emu/mgba.git
GUI: Add screenshot feature
This commit is contained in:
parent
ddaaf4ed68
commit
590d23ea8a
|
@ -19,6 +19,7 @@ enum {
|
||||||
RUNNER_EXIT = 2,
|
RUNNER_EXIT = 2,
|
||||||
RUNNER_SAVE_STATE = 3,
|
RUNNER_SAVE_STATE = 3,
|
||||||
RUNNER_LOAD_STATE = 4,
|
RUNNER_LOAD_STATE = 4,
|
||||||
|
RUNNER_SCREENSHOT = 5,
|
||||||
RUNNER_COMMAND_MASK = 0xFFFF,
|
RUNNER_COMMAND_MASK = 0xFFFF,
|
||||||
|
|
||||||
RUNNER_STATE_1 = 0x10000,
|
RUNNER_STATE_1 = 0x10000,
|
||||||
|
@ -168,6 +169,7 @@ void GBAGUIRunloop(struct GBAGUIRunner* runner) {
|
||||||
*GUIMenuItemListAppend(&stateLoadMenu.items) = (struct GUIMenuItem) { .title = "State 8", .data = (void*) (RUNNER_LOAD_STATE | RUNNER_STATE_8) };
|
*GUIMenuItemListAppend(&stateLoadMenu.items) = (struct GUIMenuItem) { .title = "State 8", .data = (void*) (RUNNER_LOAD_STATE | RUNNER_STATE_8) };
|
||||||
*GUIMenuItemListAppend(&stateLoadMenu.items) = (struct GUIMenuItem) { .title = "State 9", .data = (void*) (RUNNER_LOAD_STATE | RUNNER_STATE_9) };
|
*GUIMenuItemListAppend(&stateLoadMenu.items) = (struct GUIMenuItem) { .title = "State 9", .data = (void*) (RUNNER_LOAD_STATE | RUNNER_STATE_9) };
|
||||||
#endif
|
#endif
|
||||||
|
*GUIMenuItemListAppend(&pauseMenu.items) = (struct GUIMenuItem) { .title = "Take screenshot", .data = (void*) RUNNER_SCREENSHOT };
|
||||||
*GUIMenuItemListAppend(&pauseMenu.items) = (struct GUIMenuItem) { .title = "Exit game", .data = (void*) RUNNER_EXIT };
|
*GUIMenuItemListAppend(&pauseMenu.items) = (struct GUIMenuItem) { .title = "Exit game", .data = (void*) RUNNER_EXIT };
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -263,6 +265,9 @@ void GBAGUIRunloop(struct GBAGUIRunner* runner) {
|
||||||
vf->close(vf);
|
vf->close(vf);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case RUNNER_SCREENSHOT:
|
||||||
|
GBATakeScreenshot(runner->context.gba, 0);
|
||||||
|
break;
|
||||||
case RUNNER_CONTINUE:
|
case RUNNER_CONTINUE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue