- Properly unmount save device before application exit - Prevents potential file system issues - Ensures clean shutdown process
42 lines
No EOL
839 B
C
42 lines
No EOL
839 B
C
#include <string.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <switch.h>
|
|
#include "save_basic.h"
|
|
#include "ui_basic.h"
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
setvbuf(stdout, NULL, _IONBF, BUFSIZ);
|
|
consoleInit(NULL);
|
|
|
|
// Configure input
|
|
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
|
|
PadState pad;
|
|
padInitializeDefault(&pad);
|
|
|
|
// Initialize save system
|
|
openSave();
|
|
processSave();
|
|
|
|
// Initialize UI
|
|
initUI();
|
|
|
|
bool exit = false;
|
|
|
|
// Main loop
|
|
while(appletMainLoop() && !exit)
|
|
{
|
|
padUpdate(&pad);
|
|
u64 kDown = padGetButtonsDown(&pad);
|
|
|
|
exit = handleButtonPress(kDown);
|
|
|
|
consoleUpdate(NULL);
|
|
}
|
|
|
|
// Unmount save data before exit
|
|
fsdevUnmountDevice("save");
|
|
consoleExit(NULL);
|
|
return 0;
|
|
} |