Use libmocha insteads of libiosuhax

This commit is contained in:
Maschell 2022-07-26 16:27:20 +02:00
parent 4481e3959a
commit 1e8d70119b
10 changed files with 35 additions and 19 deletions

View File

@ -1,6 +1,6 @@
FROM wiiuenv/devkitppc:20200810
FROM wiiuenv/devkitppc:20220724
COPY --from=wiiuenv/libiosuhax:20200812 /artifacts $DEVKITPRO
COPY --from=wiiuenv/libmocha:20220726 /artifacts $DEVKITPRO
WORKDIR tmp_build
COPY . .

View File

@ -3,13 +3,13 @@
## Usage
Link the application with:
```
-lntfs -liosuhax
-lntfs -libmocha
```
## Dependencies
To be able to use libntfs for the Wii u, you need to install the following dependencies:
- [libiosuhax](https://github.com/wiiu-env/libiosuhax)
- [libmocha](https://github.com/wiiu-env/libmocha)
## Building
```
@ -21,5 +21,5 @@ The image `wiiuenv/libntfs` on [Docker Hub](https://hub.docker.com/r/wiiuenv/lib
Example:
```
COPY --from=wiiuenv/libntfs:20201210 /artifacts $DEVKITPRO
COPY --from=wiiuenv/libntfs:20220726 /artifacts $DEVKITPRO
```

View File

@ -32,7 +32,8 @@ extern "C" {
#include <ogc/disc_io.h>
#include <gccore.h>
#elif defined (__WIIU__)
#include <iosuhax_disc_interface.h>
#include <mocha/disc_interface.h>
#include <mocha/mocha.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef int32_t s32;

View File

@ -56,14 +56,14 @@ endif
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS :=
LIBS := -lwut
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
ifeq ($(PLATFORM),wiiu)
LIBDIRS := $(WUT_ROOT)/usr
LIBDIRS := $(WUT_ROOT)/usr $(WUT_ROOT)
endif
#---------------------------------------------------------------------------------

View File

@ -44,7 +44,8 @@
#include <stdint.h>
#if defined (__WIIU__)
#include <iosuhax_disc_interface.h>
#include <mocha/disc_interface.h>
#include <mocha/mocha.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef int32_t s32;

View File

@ -29,7 +29,8 @@
#include "cache2.h"
#if defined (__WIIU__)
#include <iosuhax_disc_interface.h>
#include <mocha/disc_interface.h>
#include <mocha/mocha.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef int32_t s32;

View File

@ -25,14 +25,14 @@
#include <malloc.h>
static inline void* ntfs_alloc (size_t size) {
return malloc(size);
return memalign(0x40, size);
}
static inline void* ntfs_align (size_t size) {
#ifdef __wii__
return memalign(32, size);
return memalign(0x40, size);
#else
return malloc(size);
return memalign(0x40, size);
#endif
}

View File

@ -53,11 +53,9 @@ const INTERFACE_ID ntfs_disc_interfaces[] = {
};
#elif defined (__WIIU__)
#include <iosuhax_disc_interface.h>
const INTERFACE_ID ntfs_disc_interfaces[] = {
{"sd", &IOSUHAX_sdio_disc_interface},
{"usb", &IOSUHAX_usb_disc_interface},
{"sd", &Mocha_sdio_disc_interface},
{"usb", &Mocha_usb_disc_interface},
{NULL, NULL}
};

View File

@ -42,7 +42,8 @@
#include "unistr.h"
#if defined (__WIIU__)
#include <iosuhax_disc_interface.h>
#include <mocha/disc_interface.h>
#include <mocha/mocha.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef int32_t s32;

View File

@ -39,6 +39,18 @@
#include "compat.h"
#else /* GEKKO */
#ifdef __WIIU__
typedef int32_t BOOL;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif
typedef uint8_t u8; /* Unsigned types of an exact size */
typedef uint16_t u16;
typedef uint32_t u32;
@ -87,7 +99,8 @@ typedef sle64 leLSN;
* Cygwin has a collision between our BOOL and <windef.h>'s
* As long as this file will be included after <windows.h> were fine.
*/
#ifndef GEKKO
#ifndef GEKKO
#ifndef __WIIU__
#ifndef _WINDEF_H
/**
* enum BOOL - These are just to make the code more readable...
@ -113,6 +126,7 @@ typedef enum {
#endif
} BOOL;
#endif /* defined _WINDEF_H */
#endif /* defined __WIIU__ */
#endif /* defined GECKO */
/**