diff --git a/Makefile b/Makefile index 7e28341..801cacb 100644 --- a/Makefile +++ b/Makefile @@ -44,9 +44,9 @@ INCLUDES := src # options for code generation #--------------------------------------------------------------------------------- CFLAGS := -std=gnu11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \ - -O3 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE) + -O3 -D__wiiu__ -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE) CXXFLAGS := -std=gnu++11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \ - -O3 -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE) + -O3 -D__wiiu__ -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE) ASFLAGS := -mregnames LDFLAGS := -nostartfiles -Wl,-Map,$(notdir $@).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size,-wrap,_malloc_r,-wrap,_free_r,-wrap,_realloc_r,-wrap,_calloc_r,-wrap,_memalign_r,-wrap,_malloc_usable_size_r,-wrap,valloc,-wrap,_valloc_r,-wrap,_pvalloc_r,--gc-sections @@ -56,7 +56,7 @@ MAKEFLAGS += --no-print-directory #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- -LIBS := -lgcc -lgd -lpng -lz -lfreetype -lvorbisidec -liosuhax +LIBS := -lgcc -lgd -lpng -lz -lfreetype -lvorbisidec -lfat -liosuhax #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing @@ -115,7 +115,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ # build a list of library paths #--------------------------------------------------------------------------------- export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) -L$(PORTLIBS)/lib + -L$(PORTLIBS)/lib export OUTPUT := $(CURDIR)/$(TARGET) .PHONY: $(BUILD) clean install diff --git a/src/main.c b/src/main.c index a394868..dae5e06 100644 --- a/src/main.c +++ b/src/main.c @@ -3,8 +3,10 @@ #include #include #include +#include #include #include +#include #include "dynamic_libs/os_functions.h" #include "dynamic_libs/fs_functions.h" #include "dynamic_libs/gx2_functions.h" @@ -110,18 +112,26 @@ int Menu_Main(void) //! Initialize FS * //!******************************************************************* log_printf("Mount SD partition\n"); - mount_sd_fat("sd"); - int res = IOSUHAX_Open(); + int fsaFd = -1; + int iosuhaxMount = 0; + + int res = IOSUHAX_Open(NULL); if(res < 0) { log_printf("IOSUHAX_open failed\n"); + mount_sd_fat("sd"); } - - int fsaFd = IOSUHAX_FSA_Open(); - if(fsaFd < 0) + else { - log_printf("IOSUHAX_FSA_Open failed\n"); + iosuhaxMount = 1; + fatInitDefault(); + + fsaFd = IOSUHAX_FSA_Open(); + if(fsaFd < 0) + { + log_printf("IOSUHAX_FSA_Open failed\n"); + } } mount_fs("slccmpt01", fsaFd, "/dev/slccmpt01", "/vol/storage_slccmpt01"); @@ -217,18 +227,29 @@ int Menu_Main(void) //!******************************************************************* log_printf("Unmount SD\n"); - unmount_sd_fat("sd"); - unmount_fs("slccmpt01"); - unmount_fs("storage_odd_tickets"); - unmount_fs("storage_odd_updates"); - unmount_fs("storage_odd_content"); - unmount_fs("storage_odd_content2"); - unmount_fs("storage_slc"); - unmount_fs("storage_mlc"); - unmount_fs("storage_usb"); - IOSUHAX_FSA_Close(fsaFd); - IOSUHAX_Close(); + if(iosuhaxMount) + { + fatUnmount("sd"); + fatUnmount("usb"); + IOSUHAX_sdio_disc_interface.shutdown(); + IOSUHAX_usb_disc_interface.shutdown(); + + unmount_fs("slccmpt01"); + unmount_fs("storage_odd_tickets"); + unmount_fs("storage_odd_updates"); + unmount_fs("storage_odd_content"); + unmount_fs("storage_odd_content2"); + unmount_fs("storage_slc"); + unmount_fs("storage_mlc"); + unmount_fs("storage_usb"); + IOSUHAX_FSA_Close(fsaFd); + IOSUHAX_Close(); + } + else + { + unmount_sd_fat("sd:/"); + } log_printf("Release memory\n"); //memoryRelease(); diff --git a/src/net.c b/src/net.c index 21cb64d..6bf3b7d 100644 --- a/src/net.c +++ b/src/net.c @@ -34,9 +34,9 @@ misrepresented as being the original software. #include "dynamic_libs/socket_functions.h" #include "net.h" -#define MAX_NET_BUFFER_SIZE (60*1024) +#define MAX_NET_BUFFER_SIZE (64*1024) #define MIN_NET_BUFFER_SIZE 4096 -#define FREAD_BUFFER_SIZE (60*1024) +#define FREAD_BUFFER_SIZE (64*1024) extern u32 hostIpAddress; diff --git a/src/virtualpath.c b/src/virtualpath.c index 4d6eda8..f007623 100644 --- a/src/virtualpath.c +++ b/src/virtualpath.c @@ -102,6 +102,7 @@ void MountVirtualDevices() VirtualMountDevice("storage_slc:/"); VirtualMountDevice("storage_mlc:/"); VirtualMountDevice("storage_usb:/"); + VirtualMountDevice("usb:/"); } void UnmountVirtualPaths()