-
Notifications
You must be signed in to change notification settings - Fork 102
feat: Switch port #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: Switch port #433
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4a022b6
some kind of switch port that uses the new thing
cobaltgit 79f95c8
who invited my man blud
cobaltgit 62905c9
fix audio
cobaltgit eff48d7
merge upstream
cobaltgit 1ced18e
switch: don't use gamecontrollerdb
cobaltgit a20197f
pls help
cobaltgit 554fd11
remove dupe args
cobaltgit 96730b0
correct dkp cmake toolchain path
cobaltgit 4cea0bc
load in memory aot
cobaltgit 51d4786
we already set the cmake toolchain for dkp, no need for this
cobaltgit cd52c60
make switch use glad
cobaltgit 365dc23
nvm, stick to glesv2
cobaltgit 503f531
force off legacy gl on switch
cobaltgit b3d1464
merge upstream
cobaltgit bd057a9
try this
cobaltgit d0f103b
Merge branch 'main' into nsw-round-2
cobaltgit be74ded
fix segv
cobaltgit 775434c
what the
cobaltgit de0826b
libnx input and sdl2 window size
cobaltgit bd906bb
nintendo facebutton layout
cobaltgit 6f60828
remove stray romfs exit
cobaltgit abe0f73
add switch to readme
cobaltgit 5074a85
merge upstream
cobaltgit addbc4b
change file location
Un1q32 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #include <stdio.h> | ||
| #include <string.h> | ||
| #include <switch.h> | ||
|
|
||
| #include "log.h" | ||
|
|
||
| #define LOG_BUFFER_SIZE 1024 | ||
|
|
||
| void platformLog(const logType type, const char *format, va_list va) { | ||
| const char* colourPrefix = ANSI_COLOUR_CODE_RESET; | ||
| const char* textPrefix = ""; | ||
| char buffer[LOG_BUFFER_SIZE]; | ||
|
|
||
| switch (type) { | ||
| case LOG_TYPE_NORMAL: | ||
| break; | ||
| case LOG_TYPE_WARNING: | ||
| colourPrefix = ANSI_COLOUR_CODE_BOLD_YELLOW; | ||
| textPrefix = "Warning: "; | ||
| break; | ||
| case LOG_TYPE_ERROR: | ||
| colourPrefix = ANSI_COLOUR_CODE_BOLD_RED; | ||
| textPrefix = "Error: "; | ||
| break; | ||
| case LOG_TYPE_DEBUG: | ||
| colourPrefix = ANSI_COLOUR_CODE_BOLD_PURPLE; | ||
| textPrefix = "Debug: "; | ||
| break; | ||
| } | ||
| int written = snprintf(buffer, sizeof(buffer), "%s", textPrefix); | ||
|
|
||
| if (written >= 0 && written < (int)sizeof(buffer)) { | ||
| vsnprintf(buffer + written, (int)sizeof(buffer) - written, format, va); | ||
| } | ||
| buffer[sizeof(buffer) - 1] = '\0'; | ||
|
|
||
| printf("%s%s%s", colourPrefix, buffer, ANSI_COLOUR_CODE_RESET); | ||
|
|
||
| svcOutputDebugString(buffer, strlen(buffer)); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #include <loop.h> | ||
| #include <switch.h> | ||
| #include <sys/stat.h> | ||
| #include <GLES3/gl3.h> | ||
|
|
||
| /* For SDL_main */ | ||
| #if defined(USE_SDL1) | ||
| #include <SDL/SDL_main.h> | ||
| #elif defined(USE_SDL2) | ||
| #include <SDL2/SDL_main.h> | ||
| #elif defined(USE_SDL3) | ||
| #include <SDL3/SDL_main.h> | ||
| #endif | ||
|
|
||
| int main(int argc, char* argv[]) { | ||
| (void)argc; | ||
| setbuf(stdout, NULL); | ||
| setbuf(stderr, NULL); | ||
|
|
||
| fsdevMountSdmc(); | ||
|
|
||
| CommandLineArgs args = {0}; | ||
|
|
||
| args.exitAtFrame = -1; | ||
| #ifdef ENABLE_VM_TRACING | ||
| args.traceBytecodeAfterFrame = 0; | ||
| #endif | ||
| args.speedMultiplier = 1.0; | ||
| args.fastForwardSpeed = 0.0; | ||
| args.osType = OS_WINDOWS; | ||
| args.profilerFramesBetween = 0; | ||
| args.loadType = DATAWINLOADTYPE_LOAD_IN_MEMORY_AHEAD_OF_TIME; | ||
| #if defined(ENABLE_MODERN_GL) | ||
| args.renderer = MODERN_GL; | ||
| #else | ||
| args.renderer = SOFTWARE; | ||
| #endif | ||
| args.dataWinPath = "sdmc:/switch/butterscotch/data.win"; | ||
| args.saveFolder = "sdmc:/switch/butterscotch"; | ||
|
|
||
| int ret = loop(args, argv[0]); | ||
| freeCommandLineArgs(&args); | ||
| return ret; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #define STB_IMAGE_IMPLEMENTATION | ||
| #include "stb_image.h" | ||
|
|
||
| #define STB_IMAGE_WRITE_IMPLEMENTATION | ||
| #include "stb_image_write.h" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.