forked from sdlpal/sdlpal
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
365 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 @@ | ||
TARGET = sdlpal | ||
|
||
INTER = .switch | ||
|
||
PREFIX = aarch64-none-elf | ||
|
||
SOURCES = . .. ../adplug | ||
CFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c)) | ||
CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp)) | ||
OFILES = $(CFILES:.c=$(INTER).o) $(CPPFILES:.cpp=$(INTER).o) | ||
|
||
CCFLAGS = -D__SWITCH__ -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -O3 -I. -I.. | ||
CCFLAGS += -I$(DEVKITPRO)/portlibs/switch/include -I$(DEVKITPRO)/portlibs/switch/include/SDL2 -I$(DEVKITPRO)/libnx/include | ||
CXXFLAGS = $(CCFLAGS) -std=c++11 | ||
CFLAGS = $(CCFLAGS) -std=gnu99 -D_GNU_SOURCE | ||
LDFLAGS = -L/opt/devkitpro/portlibs/switch/lib -lSDL2 -L/opt/devkitpro/libnx/lib -lGLESv2 | ||
LDFLAGS += -lEGL -lglapi -ldrm_nouveau -lnx -specs=$(DEVKITPRO)/libnx/switch.specs | ||
|
||
all: $(TARGET).nro | ||
|
||
$(TARGET).nro: $(TARGET).elf | ||
nacptool --create "sdlpal" "usineur" "1.0-nx" $(TARGET).nacp | ||
elf2nro $(TARGET).elf $(TARGET).nro --icon=icon.jpg --nacp=$(TARGET).nacp | ||
|
||
$(TARGET).elf: $(OFILES) | ||
@$(PREFIX)-g++ $(CXXFLAGS) $(OFILES) -o $@ $(LDFLAGS) | ||
|
||
%$(INTER).o: %.c | ||
@echo [CC] $< | ||
@$(PREFIX)-gcc $(CFLAGS) -c $< -o $@ | ||
|
||
%$(INTER).o: %.cpp | ||
@echo [CC] $< | ||
@$(PREFIX)-g++ $(CXXFLAGS) -c $< -o $@ | ||
|
||
nxlink: $(TARGET).nro | ||
nxlink -a $(SWITCHIP) $(TARGET).nro -s -p $(TARGET)/$(TARGET).nro | ||
|
||
clean: | ||
@rm -rf $(OFILES) $(TARGET).nro $(TARGET).nacp $(TARGET).elf |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,53 @@ | ||
#ifndef PAL_CONFIG_H | ||
# define PAL_CONFIG_H | ||
|
||
# define PAL_HAS_GLSL 1 | ||
# define PAL_HAS_JOYSTICKS 1 | ||
# define PAL_HAS_MOUSE 0 | ||
# define PAL_HAS_MP3 0 | ||
# define PAL_HAS_OGG 0 | ||
# define PAL_HAS_OPUS 0 | ||
# define PAL_PREFIX "." | ||
# define PAL_SAVE_PREFIX "." | ||
|
||
# define PAL_DEFAULT_WINDOW_WIDTH 640 | ||
# define PAL_DEFAULT_WINDOW_HEIGHT 480 | ||
|
||
# define PAL_VIDEO_INIT_FLAGS (SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE) | ||
# define PAL_SDL_INIT_FLAGS (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) | ||
# define PAL_SCALE_SCREEN TRUE | ||
|
||
# define PAL_PLATFORM "Nintendo Switch" | ||
# define PAL_CREDIT "usineur" | ||
# define PAL_PORTYEAR "2020" | ||
|
||
# define PAL_FILESYSTEM_IGNORE_CASE 1 | ||
# define PAL_HAS_PLATFORM_SPECIFIC_UTILS 1 | ||
# define PAL_HAS_PLATFORM_STARTUP 1 | ||
|
||
# include <strings.h> | ||
# include <switch.h> | ||
|
||
# define SWITCH_SCREEN_W 1280 | ||
# define SWITCH_SCREEN_H 720 | ||
|
||
# define BTN_A 0 | ||
# define BTN_B 1 | ||
# define BTN_X 2 | ||
# define BTN_Y 3 | ||
# define BTN_L 6 | ||
# define BTN_R 7 | ||
# define BTN_ZL 8 | ||
# define BTN_ZR 9 | ||
# define BTN_PLUS 10 | ||
# define BTN_MINUS 11 | ||
# define BTN_LEFT 12 | ||
# define BTN_UP 13 | ||
# define BTN_RIGHT 14 | ||
# define BTN_DOWN 15 | ||
# define STICK_UP 0 | ||
# define STICK_DOWN 1 | ||
# define STICK_LEFT 2 | ||
# define STICK_RIGHT 3 | ||
|
||
#endif |
Oops, something went wrong.