Skip to content
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

Wii U Port #21

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
*.map
*.lst

# Wii U files
*.rpx

# Switch files
*.nro
*.nacp
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Compiling for GameCube requires the same libogc libraries from [devkitPro](https
### Original Xbox
Clone [this fork of nxdk](https://github.com/dracc/nxdk/tree/xgu) directly next to the Terri-Fried folder, then [install the nxdk prerequisites](https://github.com/XboxDev/nxdk/wiki/Getting-Started). Follow the instructions [here](https://github.com/Voxel9/xbox-xgu-examples#quick-guide) to fix the XGU headers in nxdk. This is a temporary fix for some duplicate symbol linker errors.
Now `cd` to the `Terri-fried/xbox` folder and run `make`. An XBE file should be built in the `bin` folder. Copy the contents of the `bin` folder to your Xbox and run `default.xbe`.
### Wii U
Requires devkitpro, devkitPPC, [wut](https://github.com/devkitPro/wut), [libromfs-wiiu](https://github.com/yawut/libromfs-wiiu) and the following packages to be installed with dkp-pacman:
`wiiu-pkg-config`, `wiiu-sdl2`, `wiiu-sdl2_mixer`, `wiiu-sdl2_image` `wiiu-sdl2_ttf`
Once installed `cd` to `Terri-Fried/wiiu` and run `make`. Create a folder on your SD card with any name in the directory `/wiiu/apps` and copy the file(s) `Terri-Fried.rpx` (`icon.png` and `meta.xml` *optional*) into that folder. You will also need to create a folder on the root of your SD card named `Terri-Fried`. You can then launch via the Homebrew Launcher.
### Nintendo Switch
Requires devkitpro, devkitARM, libNX and the following packages to be installed via dkp-pacman:
`switch-pkg-config`, `switch-SDL2`, `switch-SDL2_mixer`, `switch-SDL2_image` `switch-SDL2_ttf`
Expand Down
134 changes: 134 additions & 0 deletions wiiu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#-------------------------------------------------------------------------------
.SUFFIXES:
#-------------------------------------------------------------------------------

ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif

TOPDIR ?= $(CURDIR)

include $(DEVKITPRO)/wut/share/wut_rules

#-------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
# ROMFS is a folder to generate app's romfs
#-------------------------------------------------------------------------------
TARGET := Terri-Fried
BUILD := build
SOURCES := source
INCLUDES := include
ROMFS := romfs

#-------------------------------------------------------------------------------
# options for code generation
#-------------------------------------------------------------------------------
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(MACHDEP)

CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__

CFLAGS += `powerpc-eabi-pkg-config --libs sdl2 SDL2_mixer SDL2_image SDL2_ttf` -lwut -lm

CXXFLAGS := $(CFLAGS)

ASFLAGS := -g $(MACHDEP)
LDFLAGS := -g $(MACHDEP) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)

LIBS := `powerpc-eabi-pkg-config --libs sdl2 SDL2_mixer SDL2_image SDL2_ttf` -lwut -lm

#-------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level
# containing include and lib
#-------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(WUT_ROOT)


#-------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#-------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#-------------------------------------------------------------------------------

export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR)

export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)

CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))

#-------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#-------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#-------------------------------------------------------------------------------
export LD := $(CC)
#-------------------------------------------------------------------------------
else
#-------------------------------------------------------------------------------
export LD := $(CXX)
#-------------------------------------------------------------------------------
endif
#-------------------------------------------------------------------------------

export SRCFILES := $(CPPFILES) $(CFILES) $(SFILES)
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)

export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)

export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)

.PHONY: $(BUILD) clean all

#-------------------------------------------------------------------------------
all: $(BUILD)

$(BUILD): $(SRCFILES)
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#-------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).rpx $(TARGET).elf

#-------------------------------------------------------------------------------
else
.PHONY: all

#-------------------------------------------------------------------------------
# romfs
#-------------------------------------------------------------------------------
include $(PORTLIBS_PATH)/wiiu/share/romfs-wiiu.mk
CFLAGS += $(ROMFS_CFLAGS)
CXXFLAGS += $(ROMFS_CFLAGS)
LIBS += $(ROMFS_LIBS)
OFILES += $(ROMFS_TARGET)
#-------------------------------------------------------------------------------

DEPENDS := $(OFILES:.o=.d)

#-------------------------------------------------------------------------------
# main targets
#-------------------------------------------------------------------------------
all : $(OUTPUT).rpx

$(OUTPUT).rpx : $(OUTPUT).elf

$(OUTPUT).elf : $(OFILES)

-include $(DEPENDS)

#-------------------------------------------------------------------------------
endif
#-------------------------------------------------------------------------------
Binary file added wiiu/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions wiiu/meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="1">
<name>Terri-Fried</name>
<coder>PolyMars (Port by Fangal)</coder>
<version>1.0</version>
<release_date>20200505000000</release_date>
<short_description>A Ludum Dare 46 Game</short_description>
<long_description>Everyone is dead except for... an egg. Humanity is depending on you to make sure this egg survives. Balance power and precision in Terri-Fried, a game made in 72 hours for Ludum Dare 46

Hold the A button and move the left stick or use your fingers to form a trajectory for the egg, and release to send it flying!

</long_description>


</app>
Binary file added wiiu/romfs/resources/click.wav
Binary file not shown.
Binary file added wiiu/romfs/resources/coin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wiiu/romfs/resources/coin.wav
Binary file not shown.
Binary file added wiiu/romfs/resources/die.wav
Binary file not shown.
Binary file added wiiu/romfs/resources/egg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wiiu/romfs/resources/font.otf
Binary file not shown.
Binary file added wiiu/romfs/resources/launch.wav
Binary file not shown.
Binary file added wiiu/romfs/resources/lava.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wiiu/romfs/resources/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wiiu/romfs/resources/platform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wiiu/romfs/resources/scorebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wiiu/romfs/resources/select.wav
Binary file not shown.
Binary file added wiiu/romfs/resources/splash.wav
Binary file not shown.
Binary file added wiiu/romfs/resources/splash_egg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading