- Add button-driven menu with multiple options - Wire up A button to add all Korok pins - Connect B button to count existing pins - Auto-initialize save system on startup - Cleaner main loop without manual save testing
40 lines
No EOL
770 B
C
40 lines
No EOL
770 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);
|
|
}
|
|
|
|
consoleExit(NULL);
|
|
return 0;
|
|
} |