Add initial Wii U support

This commit is contained in:
Maschell 2020-12-06 23:06:12 +01:00
parent 69543f058c
commit 6517ae03e0
9 changed files with 215 additions and 2 deletions

26
.github/workflows/push_image.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Publish Docker Image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get release version
id: get_release_tag
run: |
echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV
echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
snapshot: true
cache: true
tags: "latest, ${{ env.RELEASE_VERSION }}"
dockerfile: Dockerfile.wiiu

2
.gitignore vendored
View File

@ -13,3 +13,5 @@ gba/include
libogc/include libogc/include
nds/include nds/include
gp2x/include gp2x/include
wiiu/wiiu_release
wiiu/lib

11
Dockerfile.wiiu Normal file
View File

@ -0,0 +1,11 @@
FROM wiiuenv/devkitppc:20200810
COPY --from=wiiuenv/libiosuhax:20200812 /artifacts $DEVKITPRO
WORKDIR tmp_build
COPY . .
RUN make include/libfatversion.h && cd wiiu && make clean && make && mkdir -p /artifacts/wut/usr && cp -r lib /artifacts/wut/usr && cp -r ../include /artifacts/wut/usr
WORKDIR /artifacts
FROM scratch
COPY --from=0 /artifacts /artifacts

View File

@ -32,6 +32,9 @@ cube-release: include/libfatversion.h
wii-release: include/libfatversion.h wii-release: include/libfatversion.h
$(MAKE) -C libogc PLATFORM=wii BUILD=wii_release $(MAKE) -C libogc PLATFORM=wii BUILD=wii_release
wiiu-release: include/libfatversion.h
$(MAKE) -C wiiu BUILD=wiiu_release
gp2x-release: include/libfatversion.h gp2x-release: include/libfatversion.h
$(MAKE) -C gp2x PLATFORM=gp2x BUILD=gp2x_release $(MAKE) -C gp2x PLATFORM=gp2x BUILD=gp2x_release
@ -51,6 +54,9 @@ cube-debug: include/libfatversion.h
wii-debug: include/libfatversion.h wii-debug: include/libfatversion.h
$(MAKE) -C libogc PLATFORM=wii BUILD=cube_debug $(MAKE) -C libogc PLATFORM=wii BUILD=cube_debug
wiiu-debug: include/libfatversion.h
$(MAKE) -C wiiu BUILD=wiiu_debug
gp2x-debug: include/libfatversion.h gp2x-debug: include/libfatversion.h
$(MAKE) -C gp2x BUILD=debug $(MAKE) -C gp2x BUILD=debug
@ -68,6 +74,9 @@ ogc-clean:
gp2x-clean: gp2x-clean:
$(MAKE) -C gp2x clean $(MAKE) -C gp2x clean
wiiu-clean:
$(MAKE) -C wiiu clean
dist-bin: nds-dist-bin gba-dist-bin ogc-dist-bin gp2x-dist-bin dist-bin: nds-dist-bin gba-dist-bin ogc-dist-bin gp2x-dist-bin
nds-dist-bin: include/libfatversion.h nds-release distribute/$(VERSTRING) nds-dist-bin: include/libfatversion.h nds-release distribute/$(VERSTRING)
@ -120,3 +129,6 @@ ogc-install: cube-release wii-release
gp2x-install: gp2x-release gp2x-install: gp2x-release
$(MAKE) -C gp2x install $(MAKE) -C gp2x install
wiiu-install: wiiu-release
$(MAKE) -C wiiu install

View File

@ -52,6 +52,8 @@ extern "C" {
#else #else
# ifdef NDS # ifdef NDS
# include <nds/disc_io.h> # include <nds/disc_io.h>
# elif defined(__WIIU__)
# include <iosuhax_disc_interface.h>
# else # else
# include <disc_io.h> # include <disc_io.h>
# endif # endif

View File

@ -55,6 +55,12 @@
#elif defined(GP2X) #elif defined(GP2X)
#include <gp2xtypes.h> #include <gp2xtypes.h>
#include <disc_io.h> #include <disc_io.h>
#elif defined(__WIIU__)
#include <iosuhax_disc_interface.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef int32_t s32;
typedef uint32_t u32;
#endif #endif
// Platform specific options // Platform specific options
@ -79,6 +85,9 @@
#elif defined (GP2X) #elif defined (GP2X)
#define DEFAULT_CACHE_PAGES 16 #define DEFAULT_CACHE_PAGES 16
#define DEFAULT_SECTORS_PAGE 8 #define DEFAULT_SECTORS_PAGE 8
#elif defined (__WIIU__)
#define DEFAULT_CACHE_PAGES 4
#define DEFAULT_SECTORS_PAGE 64
#endif #endif
#endif // _COMMON_H #endif // _COMMON_H

View File

@ -38,8 +38,25 @@ is available, wrapper functions are used.
The list is terminated by a NULL/NULL entry. The list is terminated by a NULL/NULL entry.
*/ */
/* ====================== Wii U ====================== */
#if defined (__WIIU__)
#include <iosuhax_disc_interface.h>
static const DISC_INTERFACE* get_io_wiiu_sd (void) {
return &IOSUHAX_sdio_disc_interface;
}
static const DISC_INTERFACE* get_io_wiiu_usb (void) {
return &IOSUHAX_usb_disc_interface;
}
const INTERFACE_ID _FAT_disc_interfaces[] = {
{"sd", get_io_wiiu_sd},
{"usb", get_io_wiiu_usb},
{NULL, NULL}
};
/* ====================== Wii ====================== */ /* ====================== Wii ====================== */
#if defined (__wii__) #elif defined (__wii__)
#include <sdcard/wiisd_io.h> #include <sdcard/wiisd_io.h>
#include <ogc/usbstorage.h> #include <ogc/usbstorage.h>
#include <sdcard/gcsd.h> #include <sdcard/gcsd.h>

1
wiiu/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
release/*

133
wiiu/Makefile Normal file
View File

@ -0,0 +1,133 @@
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
include $(DEVKITPRO)/wut/share/wut_rules
#---------------------------------------------------------------------------------
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
# DATA is a list of directories containing binary files
# LIB is where the built library will be placed
# all directories are relative to this makefile
#---------------------------------------------------------------------------------
BUILD ?= release
SOURCES := ../source source
INCLUDES := ../include
DATA :=
LIB := $(TOPDIR)/wiiu/lib
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(MACHDEP)
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
CXXFLAGS := $(CFLAGS)
ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
ifneq ($(BUILD),debug)
export WIIUBIN := $(LIB)/libfat.a
else
export WIIUBIN := $(LIB)/libfatd.a
CFLAGS += -DFAT_DEBUG
endif
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS :=
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(WUT_ROOT)/usr
#---------------------------------------------------------------------------------
# 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 TOPDIR ?= $(CURDIR)/..
export DEPSDIR := $(CURDIR)/$(BUILD)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
.PHONY: $(BUILD) clean
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr debug release $(LIB) include
all: $(WIIUBIN)
dist-bin:
@mkdir -p include
@cp $(TOPDIR)/include/fat.h $(TOPDIR)/include/libfatversion.h include
@tar --exclude=.svn --exclude=*CVS* -cvjf $(TOPDIR)/distribute/$(VERSTRING)/libfat-nds-$(VERSTRING).tar.bz2 include lib
install:
@mkdir -p $(DESTDIR)$(WUT_ROOT)/usr/lib
@mkdir -p $(DESTDIR)$(WUT_ROOT)/usr/include
@cp -v lib/libfat.a $(DESTDIR)$(WUT_ROOT)/usr/lib
@cp -v $(TOPDIR)/include/fat.h $(TOPDIR)/include/libfatversion.h $(DESTDIR)$(WUT_ROOT)/usr/include
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(WIIUBIN) : $(OFILES) $(LIB)
@rm -f "$(WIIUBIN)"
@$(AR) rcs "$(WIIUBIN)" $(OFILES)
@echo built ... $(notdir $@)
$(LIB):
mkdir $(LIB)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------