diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a775c0e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +source/wiiu_release/* +source/wii_release/* +source/cube_release/* +lib/* \ No newline at end of file diff --git a/Makefile b/Makefile index 1af50f9..eda2013 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -default: cube-release wii-release +default: cube-release wii-release wiiu-release all: debug release -debug: cube-debug wii-debug +debug: cube-debug wii-debug wiiu-debug -release: cube-release wii-release +release: cube-release wii-release wiiu-release cube-debug: $(MAKE) -C source PLATFORM=cube BUILD=cube_debug @@ -13,12 +13,18 @@ cube-debug: wii-debug: $(MAKE) -C source PLATFORM=wii BUILD=wii_debug +wiiu-debug: + $(MAKE) -C source PLATFORM=wiiu BUILD=wiiu_debug + cube-release: $(MAKE) -C source PLATFORM=cube BUILD=cube_release wii-release: $(MAKE) -C source PLATFORM=wii BUILD=wii_release +wiiu-release: + $(MAKE) -C source PLATFORM=wiiu BUILD=wiiu_release + clean: $(MAKE) -C source clean @@ -28,7 +34,10 @@ cube-install: cube-release wii-install: wii-release $(MAKE) -C source wii-install PLATFORM=wii -install: wii-install +wiiu-install: wiiu-release + $(MAKE) -C source wiiu-install PLATFORM=wiiu + +install: wiiu-install run: install $(MAKE) -C example diff --git a/include/ntfs.h b/include/ntfs.h index 62f2f71..7182d2f 100644 --- a/include/ntfs.h +++ b/include/ntfs.h @@ -27,9 +27,18 @@ extern "C" { #endif -#include -#include -#include +#if defined(__gamecube__) || defined (__wii__) + #include + #include + #include +#elif defined (__wiiu__) + #include + typedef uint8_t u8; + typedef uint16_t u16; + typedef int32_t s32; + typedef uint32_t u32; + typedef int mutex_t; +#endif /* NTFS errno values */ #define ENOPART 3000 /* No partition was found */ diff --git a/source/Makefile b/source/Makefile index 6a6bbec..abf1d61 100644 --- a/source/Makefile +++ b/source/Makefile @@ -7,6 +7,10 @@ ifeq ($(strip $(DEVKITPPC)),) $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") endif +ifeq ($(PLATFORM),wiiu) +include $(DEVKITPPC)/wii_rules +endif + ifeq ($(PLATFORM),wii) include $(DEVKITPPC)/wii_rules endif @@ -20,7 +24,7 @@ endif # SOURCES is a list of directories containing source code # INCLUDES is a list of directories containing extra header files #--------------------------------------------------------------------------------- -BUILD ?= wii_release +BUILD ?= wiiu_release SOURCES := . INCLUDES := ../include LIBDIR := ../lib @@ -37,11 +41,17 @@ ifeq ($(BUILD),cube_debug) CFLAGS += -DDEBUG CXXFLAGS += -DDEBUG endif + ifeq ($(BUILD),wii_debug) CFLAGS += -DDEBUG CXXFLAGS += -DDEBUG endif +ifeq ($(BUILD),wiiu_debug) +CFLAGS += -DDEBUG +CXXFLAGS += -DDEBUG +endif + #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- @@ -93,7 +103,7 @@ $(BUILD): #--------------------------------------------------------------------------------- clean: @echo clean ... - @rm -fr wii_debug wii_release cube_debug cube_release $(LIBDIR) + @rm -fr wii_debug wii_release wiiu_release cube_debug cube_release $(LIBDIR) all: $(NTFSBIN) @@ -105,6 +115,10 @@ wii-install: cp ../include/ntfs.h $(PORTLIBS)/include cp ../lib/wii/libntfs.a $(PORTLIBS)/lib +wiiu-install: + cp ../include/ntfs.h $(PORTLIBS)/include + cp ../lib/wiiu/libntfs.a $(PORTLIBS)/lib + #--------------------------------------------------------------------------------- else diff --git a/source/cache2.h b/source/cache2.h index 21daca7..089a942 100644 --- a/source/cache2.h +++ b/source/cache2.h @@ -42,9 +42,19 @@ #include #include -#include -#include -#include + +#if defined (__wiiu__) + #include + typedef uint8_t u8; + typedef uint16_t u16; + typedef int32_t s32; + typedef uint32_t u32; + typedef int mutex_t; +#elif defined(__gamecube__) || defined (__wii__) + #include + #include + #include +#endif typedef struct { sec_t sector; @@ -54,7 +64,7 @@ typedef struct { u8* cache; } NTFS_CACHE_ENTRY; -typedef struct { +typedef struct NTFS_CACHE_{ const DISC_INTERFACE* disc; sec_t endOfPartition; unsigned int numberOfPages; diff --git a/source/gekko_io.h b/source/gekko_io.h index bc5516a..3bc63fe 100644 --- a/source/gekko_io.h +++ b/source/gekko_io.h @@ -27,8 +27,18 @@ #include "types.h" #include "cache2.h" -#include -#include + +#if defined (__wiiu__) + #include + typedef uint8_t u8; + typedef uint16_t u16; + typedef int32_t s32; + typedef uint32_t u32; + typedef int mutex_t; +#elif defined(__gamecube__) || defined (__wii__) + #include + #include +#endif #define MAX_SECTOR_SIZE 4096 diff --git a/source/ntfsinternal.c b/source/ntfsinternal.c index 58f35c1..3e06666 100644 --- a/source/ntfsinternal.c +++ b/source/ntfsinternal.c @@ -51,6 +51,15 @@ const INTERFACE_ID ntfs_disc_interfaces[] = { { NULL, NULL } }; +#elif defined (__wiiu__) +#include + +const INTERFACE_ID ntfs_disc_interfaces[] = { + {"sd", get_io_wiiu_sd}, + {"usb", get_io_wiiu_usb}, + {NULL, NULL} +}; + #elif defined(__gamecube__) #include diff --git a/source/ntfsinternal.h b/source/ntfsinternal.h index 11dfb8f..093ba92 100644 --- a/source/ntfsinternal.h +++ b/source/ntfsinternal.h @@ -40,8 +40,18 @@ #include "efs.h" #include "unistr.h" -#include -#include +#if defined (__wiiu__) + #include + typedef uint8_t u8; + typedef uint16_t u16; + typedef int32_t s32; + typedef uint32_t u32; + typedef int mutex_t; +#elif defined(__gamecube__) || defined (__wii__) + #include + #include +#endif + #include #define NTFS_MOUNT_PREFIX "ntfs" /* Device name prefix to use when auto-mounting */