Add basic main.c with console setup

Create minimal Switch homebrew application.
- Initialize console and input handling
- Basic event loop with exit on Plus button
- Foundation for BOTW save tool
This commit is contained in:
badblocks 2023-05-16 09:31:00 -07:00
parent 3e7538fffd
commit 46e530be36
No known key found for this signature in database

31
source/main.c Normal file
View file

@ -0,0 +1,31 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <switch.h>
int main(int argc, char **argv)
{
consoleInit(NULL);
// Configure input
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
PadState pad;
padInitializeDefault(&pad);
printf("BOTW Save Tool v0.1\n");
printf("Press + to exit\n");
// Main loop
while(appletMainLoop())
{
padUpdate(&pad);
u64 kDown = padGetButtonsDown(&pad);
if (kDown & HidNpadButton_Plus) break;
consoleUpdate(NULL);
}
consoleExit(NULL);
return 0;
}