Merge pull request #4486 from aliaspider/master
(ngc/Wii/WiiU) buildfix for devkitpro r29.
This commit is contained in:
commit
187c1dc5a7
|
@ -125,7 +125,7 @@ ifeq ($(HAVE_LOGGER), 1)
|
|||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += -DGEKKO
|
||||
CFLAGS += -DGEKKO -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
|
||||
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_THREADS := 1
|
||||
|
|
|
@ -78,11 +78,6 @@ ifeq ($(strip $(DEVKITPRO)),)
|
|||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(WUT_ROOT)),)
|
||||
$(error "Please set WUT_ROOT in your environment. export WUT_ROOT=<path to>WUT")
|
||||
endif
|
||||
|
||||
|
||||
export PATH := $(PATH):$(DEVKITPPC)/bin
|
||||
|
||||
PREFIX := powerpc-eabi-
|
||||
|
@ -96,12 +91,19 @@ STRIP := $(PREFIX)strip
|
|||
NM := $(PREFIX)nm
|
||||
LD := $(CXX)
|
||||
|
||||
ELF2RPL := $(WUT_ROOT)/tools/bin/elf2rpl
|
||||
ELF2RPL := wiiu/wut/elf2rpl/elf2rpl
|
||||
|
||||
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -I$(WUT_ROOT)/include -I$(DEVKITPRO)/portlibs/ppc/include
|
||||
ifneq ($(findstring Linux,$(shell uname -a)),)
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
else
|
||||
ELF2RPL := $(ELF2RPL).exe
|
||||
endif
|
||||
|
||||
|
||||
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include
|
||||
LIBDIRS := -L. -L$(DEVKITPRO)/portlibs/ppc/lib
|
||||
|
||||
CFLAGS := -mrvl -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS := -mwup -mcpu=750 -meabi -mhard-float
|
||||
LDFLAGS :=
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
|
@ -116,8 +118,9 @@ ASFLAGS := $(CFLAGS) -mregnames
|
|||
CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
||||
#CFLAGS += -fomit-frame-pointer -mword-relocations
|
||||
#CFLAGS += -Wall
|
||||
CFLAGS += -Dstatic_assert=_Static_assert
|
||||
CFLAGS += -DWIIU -D__wiiu__ -DMSB_FIRST
|
||||
|
||||
#todo: remove -DWIIU and use the built-in macros instead (HW_WUP or __wiiu__).
|
||||
CFLAGS += -DWIIU -DMSB_FIRST
|
||||
CFLAGS += -DHAVE_MAIN
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
@ -144,8 +147,7 @@ LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm -lfat -liosuhax
|
|||
RPX_OBJ = wiiu/system/stubs_rpl.o
|
||||
HBL_ELF_OBJ = wiiu/system/dynamic.o wiiu/system/stubs_elf.o
|
||||
|
||||
RPX_LDFLAGS := -L$(WUT_ROOT)/lib -L$(DEVKITPPC)/lib
|
||||
RPX_LDFLAGS += -pie -fPIE
|
||||
RPX_LDFLAGS := -pie -fPIE
|
||||
RPX_LDFLAGS += -z common-page-size=64 -z max-page-size=64
|
||||
RPX_LDFLAGS += -T wiiu/link_rpl.ld
|
||||
RPX_LDFLAGS += -nostartfiles
|
||||
|
@ -193,14 +195,17 @@ all: $(TARGETS)
|
|||
%.depend: ;
|
||||
|
||||
|
||||
$(ELF2RPL):
|
||||
$(MAKE) -C wiiu/wut/elf2rpl/
|
||||
|
||||
$(TARGET).elf: $(OBJ) $(HBL_ELF_OBJ) libretro_wiiu.a wiiu/link_elf.ld
|
||||
$(LD) $(OBJ) $(HBL_ELF_OBJ) $(LDFLAGS) $(HBL_ELF_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
$(TARGET).rpx.elf: $(OBJ) $(RPX_OBJ) libretro_wiiu.a wiiu/link_elf.ld
|
||||
$(LD) $(OBJ) $(RPX_OBJ) $(LDFLAGS) $(RPX_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
$(TARGET).rpx: $(TARGET).rpx.elf
|
||||
-$(ELF2RPL) $(notdir $<) $@
|
||||
$(TARGET).rpx: $(TARGET).rpx.elf $(ELF2RPL)
|
||||
-$(ELF2RPL) $(TARGET).rpx.elf $@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(RPX_OBJ) $(HBL_ELF_OBJ) $(TARGET).elf $(TARGET).rpx.elf $(TARGET).rpx
|
||||
|
|
|
@ -18,19 +18,11 @@
|
|||
#include <malloc.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sndcore2/core.h>
|
||||
#include <sndcore2/device.h>
|
||||
#include <sndcore2/drcvs.h>
|
||||
#include <sndcore2/result.h>
|
||||
#include <sndcore2/voice.h>
|
||||
#include <coreinit/time.h>
|
||||
#include <coreinit/cache.h>
|
||||
#include <coreinit/thread.h>
|
||||
#include <coreinit/spinlock.h>
|
||||
#include <wiiu/os.h>
|
||||
#include <wiiu/ax.h>
|
||||
|
||||
#include "wiiu/wiiu_dbg.h"
|
||||
#include "wiiu/system/memory.h"
|
||||
#include "wiiu/multivoice.h"
|
||||
|
||||
#include "audio/audio_driver.h"
|
||||
#include "performance_counters.h"
|
||||
|
|
|
@ -207,7 +207,7 @@ static void frontend_gx_get_environment_settings(
|
|||
#ifdef HW_DOL
|
||||
chdir("carda:/retroarch");
|
||||
#endif
|
||||
getcwd(g_defaults.dir.core, MAXPATHLEN);
|
||||
getcwd(g_defaults.dir.core, PATH_MAX_LENGTH);
|
||||
|
||||
last_slash = strrchr(g_defaults.dir.core, '/');
|
||||
if (last_slash)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include "tasks/tasks_internal.h"
|
||||
#include "runloop.h"
|
||||
#include <nsysnet/socket.h>
|
||||
#include <sys/socket.h>
|
||||
#include "fs/fs_utils.h"
|
||||
#include "fs/sd_fat_devoptab.h"
|
||||
#include "system/dynamic.h"
|
||||
|
@ -45,15 +45,15 @@
|
|||
#include "system/exception.h"
|
||||
#include <sys/iosupport.h>
|
||||
|
||||
#include <coreinit/foreground.h>
|
||||
#include <proc_ui/procui.h>
|
||||
#include <vpad/input.h>
|
||||
#include <sysapp/launch.h>
|
||||
#include <padscore.h>
|
||||
#include <wiiu/os/foreground.h>
|
||||
#include <wiiu/procui.h>
|
||||
#include <wiiu/sysapp.h>
|
||||
#include <wiiu/ios.h>
|
||||
#include <wiiu/vpad.h>
|
||||
#include <wiiu/kpad.h>
|
||||
|
||||
#include <fat.h>
|
||||
#include <iosuhax.h>
|
||||
#include "ios.h"
|
||||
|
||||
#include "wiiu_dbg.h"
|
||||
|
||||
|
@ -214,7 +214,7 @@ void log_deinit(void)
|
|||
log_socket = -1;
|
||||
}
|
||||
}
|
||||
static int log_write(struct _reent *r, int fd, const char *ptr, size_t len)
|
||||
static ssize_t log_write(struct _reent *r, void* fd, const char *ptr, size_t len)
|
||||
{
|
||||
if(log_socket < 0)
|
||||
return len;
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <coreinit/screen.h>
|
||||
#include <coreinit/cache.h>
|
||||
#include <wiiu/os.h>
|
||||
#include <wiiu/gx2.h>
|
||||
|
||||
#include "../../driver.h"
|
||||
#include "../../configuration.h"
|
||||
|
@ -31,15 +31,16 @@
|
|||
#include "../../menu/menu_driver.h"
|
||||
#endif
|
||||
|
||||
#include "gx2.h"
|
||||
#include "system/memory.h"
|
||||
#include "system/wiiu.h"
|
||||
#include "tex_shader.h"
|
||||
|
||||
#include "wiiu_dbg.h"
|
||||
|
||||
#include "../font_driver.h"
|
||||
|
||||
#undef _X
|
||||
#undef _B
|
||||
|
||||
#define _X 0x00
|
||||
#define _Y 0x01
|
||||
#define _Z 0x02
|
||||
|
@ -126,7 +127,7 @@ static const wiiu_render_mode_t wiiu_render_mode_map[] =
|
|||
{1920, 1080, GX2_TV_RENDER_MODE_WIDE_1080P} /* GX2_TV_SCAN_MODE_1080P */
|
||||
};
|
||||
|
||||
static wiiu_set_position(position_t* position, GX2ColorBuffer* draw_buffer, float x0, float y0, float x1, float y1)
|
||||
static int wiiu_set_position(position_t* position, GX2ColorBuffer* draw_buffer, float x0, float y0, float x1, float y1)
|
||||
{
|
||||
position[0].x = (2.0f * x0 / draw_buffer->surface.width) - 1.0f;
|
||||
position[0].y = (2.0f * y0 / draw_buffer->surface.height) - 1.0f;
|
||||
|
@ -851,7 +852,7 @@ static void wiiu_gfx_set_texture_enable(void* data, bool state, bool full_screen
|
|||
}
|
||||
|
||||
static void wiiu_gfx_set_osd_msg(void* data, const char* msg,
|
||||
const struct font_params* params, void* font)
|
||||
const void* params, void* font)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -872,9 +873,9 @@ static const video_poke_interface_t wiiu_poke_interface =
|
|||
wiiu_gfx_apply_state_changes,
|
||||
#ifdef HAVE_MENU
|
||||
wiiu_gfx_set_texture_frame,
|
||||
#endif
|
||||
wiiu_gfx_set_texture_enable,
|
||||
wiiu_gfx_set_osd_msg,
|
||||
#endif
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include <vpad/input.h>
|
||||
#include <padscore.h>
|
||||
#include <wiiu/vpad.h>
|
||||
#include <wiiu/kpad.h>
|
||||
|
||||
#include "../input_config.h"
|
||||
#include "../input_driver.h"
|
||||
|
|
|
@ -74,8 +74,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef WIIU
|
||||
#include <coreinit/time.h>
|
||||
#include "wiiu/system/wiiu.h"
|
||||
#include <wiiu/os/time.h>
|
||||
#endif
|
||||
|
||||
#if defined(_3DS)
|
||||
|
|
|
@ -33,8 +33,7 @@
|
|||
#elif defined(GEKKO) || defined(__PSL1GHT__) || defined(__QNX__)
|
||||
#include <unistd.h>
|
||||
#elif defined(WIIU)
|
||||
#include <coreinit/thread.h>
|
||||
#include "system/wiiu.h"
|
||||
#include <wiiu/os/thread.h>
|
||||
#elif defined(PSP)
|
||||
#include <pspthreadman.h>
|
||||
#elif defined(VITA)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <coreinit/filesystem.h>
|
||||
#include <wiiu/fs.h>
|
||||
|
||||
/* FS defines and types */
|
||||
#define FS_MAX_LOCALPATH_SIZE 511
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#include <gctypes.h>
|
||||
#include <wut_types.h>
|
||||
#include <wiiu/types.h>
|
||||
|
||||
int MountFS(void *pClient, void *pCmd, char **mount_path);
|
||||
int UmountFS(void *pClient, void *pCmd, const char *mountPath);
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
* distribution.
|
||||
***************************************************************************/
|
||||
#include <errno.h>
|
||||
//#include <ogc/disc_io.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/dirent.h>
|
||||
#include <string.h>
|
||||
|
@ -30,8 +29,8 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include "fs_utils.h"
|
||||
#include <coreinit/mutex.h>
|
||||
#include <coreinit/filesystem.h>
|
||||
#include <wiiu/os/mutex.h>
|
||||
#include <wiiu/fs.h>
|
||||
|
||||
#define FS_ALIGNMENT 0x40
|
||||
#define FS_ALIGN(x) (((x) + FS_ALIGNMENT - 1) & ~(FS_ALIGNMENT - 1))
|
||||
|
@ -204,7 +203,7 @@ static int sd_fat_open_r (struct _reent *r, void *fileStruct, const char *path,
|
|||
}
|
||||
|
||||
|
||||
static int sd_fat_close_r (struct _reent *r, int fd)
|
||||
static int sd_fat_close_r (struct _reent *r, void* fd)
|
||||
{
|
||||
sd_fat_file_state_t *file = (sd_fat_file_state_t *)fd;
|
||||
if(!file->dev) {
|
||||
|
@ -226,7 +225,7 @@ static int sd_fat_close_r (struct _reent *r, int fd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static off_t sd_fat_seek_r (struct _reent *r, int fd, off_t pos, int dir)
|
||||
static off_t sd_fat_seek_r (struct _reent *r, void* fd, off_t pos, int dir)
|
||||
{
|
||||
sd_fat_file_state_t *file = (sd_fat_file_state_t *)fd;
|
||||
if(!file->dev) {
|
||||
|
@ -264,7 +263,7 @@ static off_t sd_fat_seek_r (struct _reent *r, int fd, off_t pos, int dir)
|
|||
return result;
|
||||
}
|
||||
|
||||
static ssize_t sd_fat_write_r (struct _reent *r, int fd, const char *ptr, size_t len)
|
||||
static ssize_t sd_fat_write_r (struct _reent *r, void* fd, const char *ptr, size_t len)
|
||||
{
|
||||
sd_fat_file_state_t *file = (sd_fat_file_state_t *)fd;
|
||||
if(!file->dev) {
|
||||
|
@ -325,7 +324,7 @@ static ssize_t sd_fat_write_r (struct _reent *r, int fd, const char *ptr, size_t
|
|||
return done;
|
||||
}
|
||||
|
||||
static ssize_t sd_fat_read_r (struct _reent *r, int fd, char *ptr, size_t len)
|
||||
static ssize_t sd_fat_read_r (struct _reent *r, void* fd, char *ptr, size_t len)
|
||||
{
|
||||
sd_fat_file_state_t *file = (sd_fat_file_state_t *)fd;
|
||||
if(!file->dev) {
|
||||
|
@ -384,7 +383,7 @@ static ssize_t sd_fat_read_r (struct _reent *r, int fd, char *ptr, size_t len)
|
|||
}
|
||||
|
||||
|
||||
static int sd_fat_fstat_r (struct _reent *r, int fd, struct stat *st)
|
||||
static int sd_fat_fstat_r (struct _reent *r, void* fd, struct stat *st)
|
||||
{
|
||||
sd_fat_file_state_t *file = (sd_fat_file_state_t *)fd;
|
||||
if(!file->dev) {
|
||||
|
@ -422,7 +421,7 @@ static int sd_fat_fstat_r (struct _reent *r, int fd, struct stat *st)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int sd_fat_ftruncate_r (struct _reent *r, int fd, off_t len)
|
||||
static int sd_fat_ftruncate_r (struct _reent *r, void* fd, off_t len)
|
||||
{
|
||||
sd_fat_file_state_t *file = (sd_fat_file_state_t *)fd;
|
||||
if(!file->dev) {
|
||||
|
@ -444,7 +443,7 @@ static int sd_fat_ftruncate_r (struct _reent *r, int fd, off_t len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int sd_fat_fsync_r (struct _reent *r, int fd)
|
||||
static int sd_fat_fsync_r (struct _reent *r, void* fd)
|
||||
{
|
||||
sd_fat_file_state_t *file = (sd_fat_file_state_t *)fd;
|
||||
if(!file->dev) {
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SOL_SOCKET 0xFFFF
|
||||
|
||||
#define INADDR_ANY 0
|
||||
|
||||
#define PF_UNSPEC 0
|
||||
#define PF_INET 2
|
||||
#define PF_INET6 23
|
||||
|
||||
#define AF_UNSPEC PF_UNSPEC
|
||||
#define AF_INET PF_INET
|
||||
#define AF_INET6 PF_INET6
|
||||
|
||||
#define SOCK_STREAM 1
|
||||
#define SOCK_DGRAM 2
|
||||
|
||||
#define MSG_OOB 0x0001
|
||||
#define MSG_PEEK 0x0002
|
||||
#define MSG_DONTWAIT 0x0004
|
||||
#define MSG_DONTROUTE 0x0000 // ???
|
||||
#define MSG_WAITALL 0x0000 // ???
|
||||
#define MSG_MORE 0x0000 // ???
|
||||
#define MSG_NOSIGNAL 0x0000 // there are no signals
|
||||
|
||||
#define SHUT_RD 0
|
||||
#define SHUT_WR 1
|
||||
#define SHUT_RDWR 2
|
||||
|
||||
#define IPPROTO_IP 0
|
||||
#define IPPROTO_TCP 6
|
||||
#define IPPROTO_UDP 17
|
||||
|
||||
/*
|
||||
* SOL_SOCKET options
|
||||
*/
|
||||
#define SO_REUSEADDR 0x0004 // reuse address
|
||||
#define SO_LINGER 0x0080 // linger (no effect?)
|
||||
#define SO_OOBINLINE 0x0100 // out-of-band data inline (no effect?)
|
||||
#define SO_SNDBUF 0x1001 // send buffer size
|
||||
#define SO_RCVBUF 0x1002 // receive buffer size
|
||||
#define SO_SNDLOWAT 0x1003 // send low-water mark (no effect?)
|
||||
#define SO_RCVLOWAT 0x1004 // receive low-water mark
|
||||
#define SO_TYPE 0x1008 // get socket type
|
||||
#define SO_ERROR 0x1009 // get socket error
|
||||
|
||||
typedef uint32_t socklen_t;
|
||||
typedef uint16_t sa_family_t;
|
||||
|
||||
struct sockaddr
|
||||
{
|
||||
sa_family_t sa_family;
|
||||
char sa_data[];
|
||||
};
|
||||
|
||||
struct sockaddr_storage
|
||||
{
|
||||
sa_family_t ss_family;
|
||||
char __ss_padding[26];
|
||||
};
|
||||
|
||||
struct linger
|
||||
{
|
||||
int l_onoff;
|
||||
int l_linger;
|
||||
};
|
||||
|
||||
struct in_addr
|
||||
{
|
||||
unsigned int s_addr;
|
||||
};
|
||||
|
||||
struct sockaddr_in
|
||||
{
|
||||
short sin_family;
|
||||
unsigned short sin_port;
|
||||
struct in_addr sin_addr;
|
||||
char sin_zero[8];
|
||||
};
|
||||
|
||||
void socket_lib_init();
|
||||
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
|
||||
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
|
||||
int socketclose(int sockfd);
|
||||
int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
|
||||
int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
|
||||
int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
|
||||
int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen);
|
||||
int listen(int sockfd, int backlog);
|
||||
ssize_t recv(int sockfd, void *buf, size_t len, int flags);
|
||||
ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen);
|
||||
ssize_t send(int sockfd, const void *buf, size_t len, int flags);
|
||||
ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);
|
||||
int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen);
|
||||
int shutdown(int sockfd, int how);
|
||||
int socket(int domain, int type, int protocol);
|
||||
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
|
||||
char *inet_ntoa(struct in_addr in);
|
||||
int inet_aton(const char *cp, struct in_addr *inp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <wiiu/ax/core.h>
|
||||
#include <wiiu/ax/device.h>
|
||||
#include <wiiu/ax/drcvs.h>
|
||||
#include <wiiu/ax/multivoice.h>
|
||||
#include <wiiu/ax/result.h>
|
||||
#include <wiiu/ax/voice.h>
|
|
@ -0,0 +1,50 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "result.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void(*AXFrameCallback)(void);
|
||||
|
||||
enum AX_INIT_RENDERER
|
||||
{
|
||||
AX_INIT_RENDERER_32KHZ = 0,
|
||||
AX_INIT_RENDERER_48KHZ = 1,
|
||||
};
|
||||
typedef uint32_t AXInitRenderer;
|
||||
|
||||
enum AX_INIT_PIPELINE
|
||||
{
|
||||
AX_INIT_PIPELINE_SINGLE = 0,
|
||||
AX_INIT_PIPELINE_FOUR_STAGE = 1,
|
||||
};
|
||||
typedef uint32_t AXInitPipeline;
|
||||
|
||||
typedef struct AXProfile
|
||||
{
|
||||
uint32_t __unknown[0x22];
|
||||
}AXProfile;
|
||||
|
||||
typedef struct AXInitParams
|
||||
{
|
||||
AXInitRenderer renderer;
|
||||
uint32_t __unknown;
|
||||
AXInitPipeline pipeline;
|
||||
}AXInitParams;
|
||||
|
||||
void AXInit();
|
||||
void AXQuit();
|
||||
void AXInitWithParams(AXInitParams *params);
|
||||
BOOL AXIsInit();
|
||||
void AXInitProfile(AXProfile *profile, u32 count);
|
||||
uint32_t AXGetSwapProfile(AXProfile *profile, u32 count);
|
||||
AXResult AXSetDefaultMixerSelect(u32 unk0);
|
||||
AXResult AXRegisterAppFrameCallback(AXFrameCallback callback);
|
||||
uint32_t AXGetInputSamplesPerFrame();
|
||||
uint32_t AXGetInputSamplesPerSec();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "result.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void(*AXDeviceFinalMixCallback)(void*);
|
||||
typedef void(*AXAuxCallback)(void*, void*);
|
||||
|
||||
enum AX_DEVICE_MODE
|
||||
{
|
||||
// Unknown
|
||||
AX_DEVICE_MODE_UNKNOWN
|
||||
};
|
||||
typedef uint32_t AXDeviceMode;
|
||||
|
||||
enum AX_DEVICE_TYPE
|
||||
{
|
||||
AX_DEVICE_TYPE_TV = 0,
|
||||
AX_DEVICE_TYPE_DRC = 1,
|
||||
AX_DEVICE_TYPE_CONTROLLER = 2,
|
||||
};
|
||||
typedef uint32_t AXDeviceType;
|
||||
|
||||
AXResult AXGetDeviceMode(AXDeviceType type, AXDeviceMode *mode);
|
||||
AXResult AXGetDeviceFinalMixCallback(AXDeviceType type, AXDeviceFinalMixCallback *func);
|
||||
AXResult AXRegisterDeviceFinalMixCallback(AXDeviceType type, AXDeviceFinalMixCallback func);
|
||||
AXResult AXGetAuxCallback(AXDeviceType type, uint32_t unk0, uint32_t unk1, AXAuxCallback *callback, void **userData);
|
||||
AXResult AXRegisterAuxCallback(AXDeviceType type, uint32_t unk0, uint32_t unk1, AXAuxCallback callback, void *userData);
|
||||
AXResult AXSetDeviceLinearUpsampler(AXDeviceType type, uint32_t unk0, uint32_t unk1);
|
||||
AXResult AXSetDeviceCompressor(AXDeviceType type, uint32_t unk0);
|
||||
AXResult AXSetDeviceUpsampleStage(AXDeviceType type, BOOL postFinalMix);
|
||||
AXResult AXSetDeviceVolume(AXDeviceType type, uint32_t id, uint16_t volume);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,54 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "result.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Unknown
|
||||
AX_DRC_VS_MODE_UNKNOWN
|
||||
} AXDRCVSMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Unknown
|
||||
AX_DRC_VS_OUTPUT_UNKNOWN
|
||||
} AXDRCVSOutput;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Unknown
|
||||
AX_DRC_VS_LC_UNKNOWN
|
||||
} AXDRCVSLC;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Unknown
|
||||
AX_DRC_VS_SPEAKER_POS_UNKNOWN
|
||||
} AXDRCVSSpeakerPosition;
|
||||
|
||||
typedef enum AX_DRC_VS_SURROUND_GAIN
|
||||
{
|
||||
// Unknown
|
||||
AX_DRC_VS_SURROUND_GAIN_UNKNOWN
|
||||
} AXDRCVSSurroundLevelGain;
|
||||
|
||||
AXResult AXGetDRCVSMode(AXDRCVSMode *mode);
|
||||
AXResult AXSetDRCVSMode(AXDRCVSMode mode);
|
||||
AXResult AXSetDRCVSDownmixBalance(AXDRCVSOutput output, float balance);
|
||||
AXResult AXSetDRCVSLC(AXDRCVSLC lc);
|
||||
AXResult AXSetDRCVSLimiter(BOOL limit);
|
||||
AXResult AXSetDRCVSLimiterThreshold(float threshold);
|
||||
AXResult AXSetDRCVSOutputGain(AXDRCVSOutput output, float gain);
|
||||
AXResult AXSetDRCVSSpeakerPosition(AXDRCVSOutput output, AXDRCVSSpeakerPosition pos);
|
||||
AXResult AXSetDRCVSSurroundDepth(AXDRCVSOutput output, float depth);
|
||||
AXResult AXSetDRCVSSurroundLevelGain(AXDRCVSSurroundLevelGain gain);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -1,6 +1,10 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "voice.h"
|
||||
|
||||
#ifndef _MULTIVOICE_H_
|
||||
#define _MULTIVOICE_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -9,8 +13,8 @@ typedef struct
|
|||
AXVoice *v[];
|
||||
} AXMVoice;
|
||||
|
||||
void AXAcquireMultiVoice(uint32_t prio, void *cb, uint32_t cbarg, void *setup, AXMVoice **mvoice);
|
||||
void AXSetMultiVoiceDeviceMix(AXMVoice *mvoice, AXDeviceType type, uint32_t id, uint32_t bus, uint16_t vol, int16_t delta);
|
||||
void AXAcquireMultiVoice(u32 prio, void *cb, u32 cbarg, void *setup, AXMVoice **mvoice);
|
||||
void AXSetMultiVoiceDeviceMix(AXMVoice *mvoice, AXDeviceType type, u32 id, u32 bus, u16 vol, s16 delta);
|
||||
void AXSetMultiVoiceOffsets(AXMVoice *mvoice, AXVoiceOffsets *offsets);
|
||||
void AXSetMultiVoiceCurrentOffset(AXMVoice *mvoice, uint32_t offset);
|
||||
void AXSetMultiVoiceState(AXMVoice *mvoice, AXVoiceState state);
|
||||
|
@ -20,4 +24,6 @@ void AXSetMultiVoiceSrcRatio(AXMVoice *mvoice, float ratio);
|
|||
bool AXIsMultiVoiceRunning(AXMVoice *mvoice);
|
||||
void AXFreeMultiVoice(AXMVoice *mvoice);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
AX_RESULT_SUCCESS = 0,
|
||||
AX_RESULT_INVALID_DEVICE_TYPE = -1,
|
||||
AX_RESULT_INVALID_DRC_VS_MODE = -13,
|
||||
AX_RESULT_VOICE_IS_RUNNING = -18,
|
||||
AX_RESULT_DELAY_TOO_BIG = -19,
|
||||
}AXResult;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,178 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "device.h"
|
||||
#include "result.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void(*AXVoiceCallbackFn)(void *);
|
||||
typedef void(*AXVoiceCallbackExFn)(void *, uint32_t, uint32_t);
|
||||
|
||||
enum AX_VOICE_FORMAT
|
||||
{
|
||||
AX_VOICE_FORMAT_ADPCM = 0,
|
||||
AX_VOICE_FORMAT_LPCM16 = 10,
|
||||
AX_VOICE_FORMAT_LPCM8 = 25,
|
||||
};
|
||||
typedef uint16_t AXVoiceFormat;
|
||||
|
||||
enum AX_VOICE_LOOP
|
||||
{
|
||||
AX_VOICE_LOOP_DISABLED = 0,
|
||||
AX_VOICE_LOOP_ENABLED = 1,
|
||||
};
|
||||
typedef uint16_t AXVoiceLoop;
|
||||
|
||||
enum AX_VOICE_RENDERER
|
||||
{
|
||||
AX_VOICE_RENDERER_DSP = 0,
|
||||
AX_VOICE_RENDERER_CPU = 1,
|
||||
AX_VOICE_RENDERER_AUTO = 2,
|
||||
};
|
||||
typedef uint32_t AXVoiceRenderer;
|
||||
|
||||
enum AX_VOICE_RATIO_RESULT
|
||||
{
|
||||
AX_VOICE_RATIO_RESULT_SUCCESS = 0,
|
||||
AX_VOICE_RATIO_RESULT_LESS_THAN_ZERO = -1,
|
||||
AX_VOICE_RATIO_RESULT_GREATER_THAN_SOMETHING = -2,
|
||||
};
|
||||
typedef int32_t AXVoiceSrcRatioResult;
|
||||
|
||||
enum AX_VOICE_SRC_TYPE
|
||||
{
|
||||
AX_VOICE_SRC_TYPE_NONE = 0,
|
||||
AX_VOICE_SRC_TYPE_LINEAR = 1,
|
||||
AX_VOICE_SRC_TYPE_UNK0 = 2,
|
||||
AX_VOICE_SRC_TYPE_UNK1 = 3,
|
||||
AX_VOICE_SRC_TYPE_UNK2 = 4,
|
||||
};
|
||||
typedef uint32_t AXVoiceSrcType;
|
||||
|
||||
enum AX_VOICE_STATE
|
||||
{
|
||||
AX_VOICE_STATE_STOPPED = 0,
|
||||
AX_VOICE_STATE_PLAYING = 1,
|
||||
};
|
||||
typedef uint32_t AXVoiceState;
|
||||
|
||||
enum AX_VOICE_TYPE
|
||||
{
|
||||
// Unknown
|
||||
AX_VOICE_TYPE_UNKNOWN
|
||||
};
|
||||
typedef uint32_t AXVoiceType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
AXVoiceFormat dataType;
|
||||
AXVoiceLoop loopingEnabled;
|
||||
uint32_t loopOffset;
|
||||
uint32_t endOffset;
|
||||
uint32_t currentOffset;
|
||||
const void *data;
|
||||
} AXVoiceOffsets;
|
||||
|
||||
typedef struct AXVoice AXVoice;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
AXVoice *next;
|
||||
AXVoice *prev;
|
||||
} AXVoiceLink;
|
||||
|
||||
struct AXVoice
|
||||
{
|
||||
uint32_t index;
|
||||
AXVoiceState state;
|
||||
uint32_t volume;
|
||||
AXVoiceRenderer renderer;
|
||||
AXVoiceLink link;
|
||||
AXVoice *cbNext;
|
||||
uint32_t priority;
|
||||
AXVoiceCallbackFn callback;
|
||||
void *userContext;
|
||||
uint32_t syncBits;
|
||||
uint32_t _unknown[0x2];
|
||||
AXVoiceOffsets offsets;
|
||||
AXVoiceCallbackExFn callbackEx;
|
||||
uint32_t callbackReason;
|
||||
float unk0;
|
||||
float unk1;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t volume;
|
||||
int16_t delta;
|
||||
} AXVoiceDeviceBusMixData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
AXVoiceDeviceBusMixData bus[4];
|
||||
} AXVoiceDeviceMixData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t volume;
|
||||
int16_t delta;
|
||||
} AXVoiceVeData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t predScale;
|
||||
int16_t prevSample[2];
|
||||
} AXVoiceAdpcmLoopData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int16_t coefficients[16];
|
||||
uint16_t gain;
|
||||
uint16_t predScale;
|
||||
int16_t prevSample[2];
|
||||
} AXVoiceAdpcm;
|
||||
|
||||
/* AXVoice Sample Rate Converter */
|
||||
typedef struct
|
||||
{
|
||||
uint16_t ratio_int;
|
||||
uint16_t ratio_fraction;
|
||||
uint16_t currentOffsetFrac;
|
||||
int16_t lastSample[4];
|
||||
} AXVoiceSrc;
|
||||
|
||||
AXVoice *AXAcquireVoice(uint32_t priority, AXVoiceCallbackFn callback, void *userContext);
|
||||
AXVoice *AXAcquireVoiceEx(uint32_t priority, AXVoiceCallbackExFn callback, void *userContext);
|
||||
BOOL AXCheckVoiceOffsets(AXVoiceOffsets *offsets);
|
||||
void AXFreeVoice(AXVoice *voice);
|
||||
uint32_t AXGetMaxVoices();
|
||||
uint32_t AXGetVoiceCurrentOffsetEx(AXVoice *voice, const void *samples);
|
||||
uint32_t AXGetVoiceLoopCount(AXVoice *voice);
|
||||
void AXGetVoiceOffsets(AXVoice *voice, AXVoiceOffsets *offsets);
|
||||
BOOL AXIsVoiceRunning(AXVoice *voice);
|
||||
void AXSetVoiceAdpcm(AXVoice *voice, AXVoiceAdpcm *adpcm);
|
||||
void AXSetVoiceAdpcmLoop(AXVoice *voice, AXVoiceAdpcmLoopData *loopData);
|
||||
void AXSetVoiceCurrentOffset(AXVoice *voice, uint32_t offset);
|
||||
AXResult AXSetVoiceDeviceMix(AXVoice *voice, AXDeviceType type, uint32_t id, AXVoiceDeviceMixData *mixData);
|
||||
void AXSetVoiceEndOffset(AXVoice *voice, uint32_t offset);
|
||||
void AXSetVoiceEndOffsetEx(AXVoice *voice, uint32_t offset, const void *samples);
|
||||
AXResult AXSetVoiceInitialTimeDelay(AXVoice *voice, uint16_t delay);
|
||||
void AXSetVoiceLoopOffset(AXVoice *voice, uint32_t offset);
|
||||
void AXSetVoiceLoopOffsetEx(AXVoice *voice, uint32_t offset, const void *samples);
|
||||
void AXSetVoiceLoop(AXVoice *voice, AXVoiceLoop loop);
|
||||
void AXSetVoiceOffsets(AXVoice *voice, AXVoiceOffsets *offsets);
|
||||
void AXSetVoicePriority(AXVoice *voice, uint32_t priority);
|
||||
void AXSetVoiceRmtIIRCoefs(AXVoice *voice, uint16_t filter, ...);
|
||||
void AXSetVoiceSrc(AXVoice *voice, AXVoiceSrc *src);
|
||||
AXVoiceSrcRatioResult AXSetVoiceSrcRatio(AXVoice *voice, float ratio);
|
||||
void AXSetVoiceSrcType(AXVoice *voice, AXVoiceSrcType type);
|
||||
void AXSetVoiceState(AXVoice *voice, AXVoiceState state);
|
||||
void AXSetVoiceType(AXVoice *voice, AXVoiceType type);
|
||||
void AXSetVoiceVe(AXVoice *voice, AXVoiceVeData *veData);
|
||||
void AXSetVoiceVeDelta(AXVoice *voice, int16_t delta);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,269 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint32_t FSDirectoryHandle;
|
||||
typedef uint32_t FSFileHandle;
|
||||
typedef uint32_t FSPriority;
|
||||
|
||||
typedef enum FSStatus
|
||||
{
|
||||
FS_STATUS_OK = 0,
|
||||
FS_STATUS_CANCELLED = -1,
|
||||
FS_STATUS_END = -2,
|
||||
FS_STATUS_MAX = -3,
|
||||
FS_STATUS_ALREADY_OPEN = -4,
|
||||
FS_STATUS_EXISTS = -5,
|
||||
FS_STATUS_NOT_FOUND = -6,
|
||||
FS_STATUS_NOT_FILE = -7,
|
||||
FS_STATUS_NOT_DIR = -8,
|
||||
FS_STATUS_ACCESS_ERROR = -9,
|
||||
FS_STATUS_PERMISSION_ERROR = -10,
|
||||
FS_STATUS_FILE_TOO_BIG = -11,
|
||||
FS_STATUS_STORAGE_FULL = -12,
|
||||
FS_STATUS_JOURNAL_FULL = -13,
|
||||
FS_STATUS_UNSUPPORTED_CMD = -14,
|
||||
FS_STATUS_MEDIA_NOT_READY = -15,
|
||||
FS_STATUS_MEDIA_ERROR = -17,
|
||||
FS_STATUS_CORRUPTED = -18,
|
||||
FS_STATUS_FATAL_ERROR = -0x400,
|
||||
} FSStatus;
|
||||
|
||||
typedef enum FSError
|
||||
{
|
||||
FS_ERROR_NOT_INIT = -0x30001,
|
||||
FS_ERROR_BUSY = -0x30002,
|
||||
FS_ERROR_CANCELLED = -0x30003,
|
||||
FS_ERROR_END_OF_DIR = -0x30004,
|
||||
FS_ERROR_END_OF_FILE = -0x30005,
|
||||
FS_ERROR_MAX_MOUNT_POINTS = -0x30010,
|
||||
FS_ERROR_MAX_VOLUMES = -0x30011,
|
||||
FS_ERROR_MAX_CLIENTS = -0x30012,
|
||||
FS_ERROR_MAX_FILES = -0x30013,
|
||||
FS_ERROR_MAX_DIRS = -0x30014,
|
||||
FS_ERROR_ALREADY_OPEN = -0x30015,
|
||||
FS_ERROR_ALREADY_EXISTS = -0x30016,
|
||||
FS_ERROR_NOT_FOUND = -0x30017,
|
||||
FS_ERROR_NOT_EMPTY = -0x30018,
|
||||
FS_ERROR_ACCESS_ERROR = -0x30019,
|
||||
FS_ERROR_PERMISSION_ERROR = -0x3001A,
|
||||
FS_ERROR_DATA_CORRUPTED = -0x3001B,
|
||||
FS_ERROR_STORAGE_FULL = -0x3001C,
|
||||
FS_ERROR_JOURNAL_FULL = -0x3001D,
|
||||
FS_ERROR_UNAVAILABLE_COMMAND = -0x3001F,
|
||||
FS_ERROR_UNSUPPORTED_COMMAND = -0x30020,
|
||||
FS_ERROR_INVALID_PARAM = -0x30021,
|
||||
FS_ERROR_INVALID_PATH = -0x30022,
|
||||
FS_ERROR_INVALID_BUFFER = -0x30023,
|
||||
FS_ERROR_INVALID_ALIGNMENT = -0x30024,
|
||||
FS_ERROR_INVALID_CLIENTHANDLE = -0x30025,
|
||||
FS_ERROR_INVALID_FILEHANDLE = -0x30026,
|
||||
FS_ERROR_INVALID_DIRHANDLE = -0x30027,
|
||||
FS_ERROR_NOT_FILE = -0x30028,
|
||||
FS_ERROR_NOT_DIR = -0x30029,
|
||||
FS_ERROR_FILE_TOO_BIG = -0x3002A,
|
||||
FS_ERROR_OUT_OF_RANGE = -0x3002B,
|
||||
FS_ERROR_OUT_OF_RESOURCES = -0x3002C,
|
||||
FS_ERROR_MEDIA_NOT_READY = -0x30030,
|
||||
FS_ERROR_MEDIA_ERROR = -0x30031,
|
||||
FS_ERROR_WRITE_PROTECTED = -0x30032,
|
||||
FS_ERROR_INVALID_MEDIA = -0x30033,
|
||||
} FSError;
|
||||
|
||||
typedef enum FSMode
|
||||
{
|
||||
FS_MODE_READ_OWNER = 0x400,
|
||||
FS_MODE_WRITE_OWNER = 0x200,
|
||||
FS_MODE_EXEC_OWNER = 0x100,
|
||||
|
||||
FS_MODE_READ_GROUP = 0x040,
|
||||
FS_MODE_WRITE_GROUP = 0x020,
|
||||
FS_MODE_EXEC_GROUP = 0x010,
|
||||
|
||||
FS_MODE_READ_OTHER = 0x004,
|
||||
FS_MODE_WRITE_OTHER = 0x002,
|
||||
FS_MODE_EXEC_OTHER = 0x001,
|
||||
} FSMode;
|
||||
|
||||
typedef enum FSStatFlags
|
||||
{
|
||||
FS_STAT_DIRECTORY = 0x80000000,
|
||||
} FSStatFlags;
|
||||
|
||||
typedef enum FSVolumeState
|
||||
{
|
||||
FS_VOLUME_STATE_INITIAL = 0,
|
||||
FS_VOLUME_STATE_READY = 1,
|
||||
FS_VOLUME_STATE_NO_MEDIA = 2,
|
||||
FS_VOLUME_STATE_INVALID_MEDIA = 3,
|
||||
FS_VOLUME_STATE_DIRTY_MEDIA = 4,
|
||||
FS_VOLUME_STATE_WRONG_MEDIA = 5,
|
||||
FS_VOLUME_STATE_MEDIA_ERROR = 6,
|
||||
FS_VOLUME_STATE_DATA_CORRUPTED = 7,
|
||||
FS_VOLUME_STATE_WRITE_PROTECTED = 8,
|
||||
FS_VOLUME_STATE_JOURNAL_FULL = 9,
|
||||
FS_VOLUME_STATE_FATAL = 10,
|
||||
FS_VOLUME_STATE_INVALID = 11,
|
||||
} FSVolumeState;
|
||||
|
||||
typedef enum FSMountSourceType
|
||||
{
|
||||
FS_MOUNT_SOURCE_SD = 0,
|
||||
FS_MOUNT_SOURCE_UNK = 1,
|
||||
} FSMountSourceType;
|
||||
|
||||
typedef struct FSClient
|
||||
{
|
||||
uint32_t __unknown[0x5C0];
|
||||
} FSClient;
|
||||
|
||||
typedef struct FSCmdBlock
|
||||
{
|
||||
uint32_t __unknown[0x2A0];
|
||||
} FSCmdBlock;
|
||||
|
||||
typedef struct FSStat
|
||||
{
|
||||
FSStatFlags flags;
|
||||
FSMode mode;
|
||||
uint32_t owner;
|
||||
uint32_t group;
|
||||
uint32_t size;
|
||||
uint32_t __unknown[0x14];
|
||||
} FSStat;
|
||||
|
||||
typedef struct FSStateChangeInfo
|
||||
{
|
||||
uint32_t __unknown[0x3];
|
||||
} FSStateChangeInfo;
|
||||
|
||||
typedef void(*FSAsyncCallback)(FSClient *, FSCmdBlock *, FSStatus, uint32_t);
|
||||
|
||||
typedef struct FSAsyncData
|
||||
{
|
||||
uint32_t callback;
|
||||
uint32_t param;
|
||||
uint32_t __unknown;
|
||||
} FSAsyncData;
|
||||
|
||||
typedef struct FSDirectoryEntry
|
||||
{
|
||||
FSStat info;
|
||||
char name[256];
|
||||
} FSDirectoryEntry;
|
||||
|
||||
typedef struct FSMountSource
|
||||
{
|
||||
uint32_t __unknown[0xC0];
|
||||
} FSMountSource;
|
||||
|
||||
FSStatus fsDevInit();
|
||||
FSStatus fsDevExit();
|
||||
|
||||
void FSInit();
|
||||
void FSShutdown();
|
||||
|
||||
FSStatus FSAddClient(FSClient *client, uint32_t flags);
|
||||
FSStatus FSDelClient(FSClient *client, uint32_t flags);
|
||||
uint32_t FSGetClientNum();
|
||||
void FSInitCmdBlock(FSCmdBlock *block);
|
||||
FSStatus FSSetCmdPriority(FSCmdBlock *block, FSPriority priority);
|
||||
void FSSetStateChangeNotification(FSClient *client, FSStateChangeInfo *info);
|
||||
FSStatus FSGetCwd(FSClient *client, FSCmdBlock *block, char *buffer, uint32_t bufferSize,
|
||||
uint32_t flags);
|
||||
FSStatus FSChangeDir(FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags);
|
||||
FSStatus FSChangeDirAsync(FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags,
|
||||
FSAsyncData *asyncData);
|
||||
FSStatus FSGetStat(FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat,
|
||||
uint32_t flags);
|
||||
FSStatus FSGetStatAsync(FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat,
|
||||
uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSRemove(FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags);
|
||||
FSStatus FSRemoveAsync(FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags,
|
||||
FSAsyncData *asyncData);
|
||||
FSStatus FSOpenFile(FSClient *client, FSCmdBlock *block, const char *path, const char *mode,
|
||||
FSFileHandle *handle, uint32_t flags);
|
||||
FSStatus FSOpenFileAsync(FSClient *client, FSCmdBlock *block, const char *path, const char *mode,
|
||||
FSFileHandle *outHandle, uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSCloseFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t flags);
|
||||
FSStatus FSCloseFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t flags,
|
||||
FSAsyncData *asyncData);
|
||||
FSStatus FSOpenDir(FSClient *client, FSCmdBlock *block, const char *path, FSDirectoryHandle *handle,
|
||||
uint32_t flags);
|
||||
FSStatus FSOpenDirAsync(FSClient *client, FSCmdBlock *block, const char *path,
|
||||
FSDirectoryHandle *handle, uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSMakeDir(FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags);
|
||||
FSStatus FSMakeDirAsync(FSClient *client, FSCmdBlock *block, const char *path, uint32_t flags,
|
||||
FSAsyncData *asyncData);
|
||||
FSStatus FSReadDir(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle,
|
||||
FSDirectoryEntry *entry, uint32_t flags);
|
||||
FSStatus FSReadDirAsync(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle,
|
||||
FSDirectoryEntry *entry, uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSRewindDir(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, uint32_t flags);
|
||||
FSStatus FSCloseDir(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, uint32_t flags);
|
||||
FSStatus FSCloseDirAsync(FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle,
|
||||
uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSChangeMode(FSClient *client, FSCmdBlock *block, char *path, FSMode mode, uint32_t flags);
|
||||
FSStatus FSChangeModeAsync(FSClient *client, FSCmdBlock *block, char *path, FSMode mode,
|
||||
uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSGetFreeSpaceSize(FSClient *client, FSCmdBlock *block, char *path, u64 *outSize,
|
||||
uint32_t flags);
|
||||
FSStatus FSGetFreeSpaceSizeAsync(FSClient *client, FSCmdBlock *block, char *path, u64 *outSize,
|
||||
uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSGetStatFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat,
|
||||
uint32_t flags);
|
||||
FSStatus FSGetStatFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat,
|
||||
uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSReadFile(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size,
|
||||
uint32_t count, FSFileHandle handle, uint32_t unk1, uint32_t flags);
|
||||
FSStatus FSReadFileAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size,
|
||||
uint32_t count, FSFileHandle handle, uint32_t unk1, uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSReadFileWithPos(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size,
|
||||
uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, uint32_t flags);
|
||||
FSStatus FSReadFileWithPosAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size,
|
||||
uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, uint32_t flags,
|
||||
FSAsyncData *asyncData);
|
||||
FSStatus FSWriteFile(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size,
|
||||
uint32_t count, FSFileHandle handle, uint32_t unk1, uint32_t flags);
|
||||
FSStatus FSWriteFileAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size,
|
||||
uint32_t count, FSFileHandle handle, uint32_t unk1, uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSWriteFileWithPos(FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size,
|
||||
uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, uint32_t flags);
|
||||
FSStatus FSWriteFileWithPosAsync(FSClient *client, FSCmdBlock *block, uint8_t *buffer,
|
||||
uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, uint32_t flags,
|
||||
FSAsyncData *asyncData);
|
||||
FSStatus FSGetPosFile(FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle, uint32_t *pos,
|
||||
uint32_t flags);
|
||||
FSStatus FSGetPosFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle,
|
||||
uint32_t *pos, uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSSetPosFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos,
|
||||
uint32_t flags);
|
||||
FSStatus FSSetPosFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos,
|
||||
uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSFlushFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t flags);
|
||||
FSStatus FSFlushFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t flags,
|
||||
FSAsyncData *asyncData);
|
||||
FSStatus FSTruncateFile(FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t flags);
|
||||
FSStatus FSTruncateFileAsync(FSClient *client, FSCmdBlock *block, FSFileHandle handle,
|
||||
uint32_t flags, FSAsyncData *asyncData);
|
||||
FSStatus FSRename(FSClient *client, FSCmdBlock *block, const char *oldPath, const char *newPath,
|
||||
uint32_t flags);
|
||||
FSStatus FSRenameAsync(FSClient *client, FSCmdBlock *block, const char *oldPath,
|
||||
const char *newPath, uint32_t flags, FSAsyncData *asyncData);
|
||||
FSVolumeState FSGetVolumeState(FSClient *client);
|
||||
FSError FSGetLastErrorCodeForViewer(FSClient *client);
|
||||
FSStatus FSGetMountSource(FSClient *client, FSCmdBlock *cmd, FSMountSourceType type,
|
||||
FSMountSource *out, uint32_t flags);
|
||||
FSStatus FSMount(FSClient *client, FSCmdBlock *cmd, FSMountSource *source, const char *target,
|
||||
uint32_t bytes, uint32_t flags);
|
||||
FSStatus FSUnmount(FSClient *client, FSCmdBlock *cmd, const char *target, uint32_t flags);
|
||||
FSStatus FSBindMount(FSClient *client, FSCmdBlock *cmd, const char *source, const char *target,
|
||||
uint32_t flags);
|
||||
FSStatus FSbindUnmount(FSClient *client, FSCmdBlock *cmd, const char *target, uint32_t flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <wiiu/gx2/context.h>
|
||||
#include <wiiu/gx2/common.h>
|
||||
#include <wiiu/gx2/display.h>
|
||||
#include <wiiu/gx2/displaylist.h>
|
||||
#include <wiiu/gx2/draw.h>
|
||||
#include <wiiu/gx2/enum.h>
|
||||
#include <wiiu/gx2/event.h>
|
||||
#include <wiiu/gx2/mem.h>
|
||||
#include <wiiu/gx2/registers.h>
|
||||
#include <wiiu/gx2/sampler.h>
|
||||
#include <wiiu/gx2/shaders.h>
|
||||
#include <wiiu/gx2/state.h>
|
||||
#include <wiiu/gx2/surface.h>
|
||||
#include <wiiu/gx2/swap.h>
|
||||
#include <wiiu/gx2/tessellation.h>
|
||||
#include <wiiu/gx2/texture.h>
|
||||
|
|
@ -1,21 +1,4 @@
|
|||
#ifndef GX2_H
|
||||
#define GX2_H
|
||||
#include <gx2/clear.h>
|
||||
#include <gx2/context.h>
|
||||
#include <gx2/display.h>
|
||||
#include <gx2/displaylist.h>
|
||||
#include <gx2/draw.h>
|
||||
#include <gx2/enum.h>
|
||||
#include <gx2/event.h>
|
||||
#include <gx2/mem.h>
|
||||
#include <gx2/registers.h>
|
||||
#include <gx2/sampler.h>
|
||||
#include <gx2/shaders.h>
|
||||
#include <gx2/state.h>
|
||||
#include <gx2/surface.h>
|
||||
#include <gx2/swap.h>
|
||||
#include <gx2/tessellation.h>
|
||||
#include <gx2/texture.h>
|
||||
#pragma once
|
||||
|
||||
#define GX2_SCAN_BUFFER_ALIGNMENT 0x1000
|
||||
#define GX2_SHADER_ALIGNMENT 0x100
|
||||
|
@ -30,4 +13,3 @@
|
|||
#define GX2_TRUE TRUE
|
||||
#define GX2_FALSE FALSE
|
||||
|
||||
#endif // GX2_H
|
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct GX2ShadowState
|
||||
{
|
||||
uint32_t config[0xB00];
|
||||
uint32_t context[0x400];
|
||||
uint32_t alu[0x800];
|
||||
uint32_t loop[0x60];
|
||||
uint32_t __unk_0[0x20];
|
||||
uint32_t resource[0xD9E];
|
||||
uint32_t __unk_1[0x22];
|
||||
uint32_t sampler[0xA2];
|
||||
uint32_t __unk_2[0x3C];
|
||||
} GX2ShadowState;
|
||||
|
||||
typedef struct GX2ContextState
|
||||
{
|
||||
GX2ShadowState shadowState;
|
||||
uint32_t __unk_0;
|
||||
uint32_t shadowDisplayListSize;
|
||||
uint32_t __unk_1[0x2FC];
|
||||
uint32_t shadowDisplayList[192];
|
||||
} GX2ContextState;
|
||||
|
||||
void GX2SetupContextStateEx(GX2ContextState *state, BOOL unk1);
|
||||
void GX2GetContextStateDisplayList(GX2ContextState *state, void *outDisplayList, uint32_t *outSize);
|
||||
void GX2SetContextState(GX2ContextState *state);
|
||||
void GX2SetDefaultState();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
#include "surface.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2SetTVEnable(BOOL enable);
|
||||
void GX2SetDRCEnable(BOOL enable);
|
||||
|
||||
void GX2CalcTVSize(GX2TVRenderMode tvRenderMode, GX2SurfaceFormat surfaceFormat,
|
||||
GX2BufferingMode bufferingMode, uint32_t *size, uint32_t *unkOut);
|
||||
void GX2CalcDRCSize(GX2DrcRenderMode drcRenderMode, GX2SurfaceFormat surfaceFormat,
|
||||
GX2BufferingMode bufferingMode, uint32_t *size, uint32_t *unkOut);
|
||||
void GX2SetTVBuffer(void *buffer, uint32_t size, GX2TVRenderMode tvRenderMode,
|
||||
GX2SurfaceFormat surfaceFormat, GX2BufferingMode bufferingMode);
|
||||
void GX2SetDRCBuffer(void *buffer, uint32_t size, GX2DrcRenderMode drcRenderMode,
|
||||
GX2SurfaceFormat surfaceFormat, GX2BufferingMode bufferingMode);
|
||||
void GX2SetTVScale(uint32_t x, uint32_t y);
|
||||
void GX2SetDRCScale(uint32_t x, uint32_t y);
|
||||
|
||||
GX2TVScanMode GX2GetSystemTVScanMode();
|
||||
GX2TVScanMode GX2GetSystemDRCScanMode();
|
||||
GX2DrcRenderMode GX2GetSystemDRCMode();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void
|
||||
GX2BeginDisplayListEx(void *displayList, uint32_t bytes, BOOL unk1);
|
||||
uint32_t GX2EndDisplayList(void *displayList);
|
||||
void GX2DirectCallDisplayList(void *displayList, uint32_t bytes);
|
||||
void GX2CallDisplayList(void *displayList, uint32_t bytes);
|
||||
BOOL GX2GetDisplayListWriteStatus();
|
||||
BOOL GX2GetCurrentDisplayList(void **outDisplayList, uint32_t *outSize);
|
||||
void GX2CopyDisplayList(void *displayList, uint32_t bytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,51 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2SetAttribBuffer(uint32_t index, uint32_t size, uint32_t stride, void *buffer);
|
||||
|
||||
void GX2DrawEx(GX2PrimitiveMode mode,
|
||||
uint32_t count,
|
||||
uint32_t offset,
|
||||
uint32_t numInstances);
|
||||
|
||||
void GX2DrawEx2(GX2PrimitiveMode mode,
|
||||
uint32_t count,
|
||||
uint32_t offset,
|
||||
uint32_t numInstances,
|
||||
uint32_t baseInstance);
|
||||
|
||||
void GX2DrawIndexedEx(GX2PrimitiveMode mode,
|
||||
uint32_t count,
|
||||
GX2IndexType indexType,
|
||||
void *indices,
|
||||
uint32_t offset,
|
||||
uint32_t numInstances);
|
||||
|
||||
void GX2DrawIndexedEx2(GX2PrimitiveMode mode,
|
||||
uint32_t count,
|
||||
GX2IndexType indexType,
|
||||
void *indices,
|
||||
uint32_t offset,
|
||||
uint32_t numInstances,
|
||||
uint32_t baseInstance);
|
||||
|
||||
void GX2DrawIndexedImmediateEx(GX2PrimitiveMode mode,
|
||||
uint32_t count,
|
||||
GX2IndexType indexType,
|
||||
void *indices,
|
||||
uint32_t offset,
|
||||
uint32_t numInstances);
|
||||
|
||||
void GX2SetPrimitiveRestartIndex(uint32_t index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,498 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum GX2AAMode
|
||||
{
|
||||
GX2_AA_MODE1X = 0,
|
||||
GX2_AA_MODE2X = 1,
|
||||
GX2_AA_MODE4X = 2
|
||||
} GX2AAMode;
|
||||
|
||||
typedef enum GX2AlphaToMaskMode
|
||||
{
|
||||
GX2_ALPHA_TO_MASK_MODE_NON_DITHERED = 0,
|
||||
GX2_ALPHA_TO_MASK_MODE_DITHER_0 = 1,
|
||||
GX2_ALPHA_TO_MASK_MODE_DITHER_90 = 2,
|
||||
GX2_ALPHA_TO_MASK_MODE_DITHER_180 = 3,
|
||||
GX2_ALPHA_TO_MASK_MODE_DITHER_270 = 4,
|
||||
} GX2AlphaToMaskMode;
|
||||
|
||||
typedef enum GX2AttribFormat
|
||||
{
|
||||
GX2_ATTRIB_FORMAT_UNORM_8 = 0x0,
|
||||
GX2_ATTRIB_FORMAT_UNORM_8_8 = 0x04,
|
||||
GX2_ATTRIB_FORMAT_UNORM_8_8_8_8 = 0x0A,
|
||||
|
||||
GX2_ATTRIB_FORMAT_UINT_8 = 0x100,
|
||||
GX2_ATTRIB_FORMAT_UINT_8_8 = 0x104,
|
||||
GX2_ATTRIB_FORMAT_UINT_8_8_8_8 = 0x10A,
|
||||
|
||||
GX2_ATTRIB_FORMAT_SNORM_8 = 0x200,
|
||||
GX2_ATTRIB_FORMAT_SNORM_8_8 = 0x204,
|
||||
GX2_ATTRIB_FORMAT_SNORM_8_8_8_8 = 0x20A,
|
||||
|
||||
GX2_ATTRIB_FORMAT_SINT_8 = 0x300,
|
||||
GX2_ATTRIB_FORMAT_SINT_8_8 = 0x304,
|
||||
GX2_ATTRIB_FORMAT_SINT_8_8_8_8 = 0x30A,
|
||||
|
||||
GX2_ATTRIB_FORMAT_FLOAT_32 = 0x806,
|
||||
GX2_ATTRIB_FORMAT_FLOAT_32_32 = 0x80d,
|
||||
GX2_ATTRIB_FORMAT_FLOAT_32_32_32 = 0x811,
|
||||
GX2_ATTRIB_FORMAT_FLOAT_32_32_32_32 = 0x813,
|
||||
} GX2AttribFormat;
|
||||
|
||||
typedef enum GX2AttribIndexType
|
||||
{
|
||||
GX2_ATTRIB_INDEX_PER_VERTEX = 0,
|
||||
GX2_ATTRIB_INDEX_PER_INSTANCE = 1,
|
||||
} GX2AttribIndexType;
|
||||
|
||||
typedef enum GX2BlendMode
|
||||
{
|
||||
GX2_BLEND_MODE_ZERO = 0,
|
||||
GX2_BLEND_MODE_ONE = 1,
|
||||
GX2_BLEND_MODE_SRC_COLOR = 2,
|
||||
GX2_BLEND_MODE_INV_SRC_COLOR = 3,
|
||||
GX2_BLEND_MODE_SRC_ALPHA = 4,
|
||||
GX2_BLEND_MODE_INV_SRC_ALPHA = 5,
|
||||
GX2_BLEND_MODE_DST_ALPHA = 6,
|
||||
GX2_BLEND_MODE_INV_DST_ALPHA = 7,
|
||||
GX2_BLEND_MODE_DST_COLOR = 8,
|
||||
GX2_BLEND_MODE_INV_DST_COLOR = 9,
|
||||
GX2_BLEND_MODE_SRC_ALPHA_SAT = 10,
|
||||
GX2_BLEND_MODE_BOTH_SRC_ALPHA = 11,
|
||||
GX2_BLEND_MODE_BOTH_INV_SRC_ALPHA = 12,
|
||||
GX2_BLEND_MODE_BLEND_FACTOR = 13,
|
||||
GX2_BLEND_MODE_INV_BLEND_FACTOR = 14,
|
||||
GX2_BLEND_MODE_SRC1_COLOR = 15,
|
||||
GX2_BLEND_MODE_INV_SRC1_COLOR = 16,
|
||||
GX2_BLEND_MODE_SRC1_ALPHA = 17,
|
||||
GX2_BLEND_MODE_INV_SRC1_ALPHA = 18,
|
||||
} GX2BlendMode;
|
||||
|
||||
typedef enum GX2BlendCombineMode
|
||||
{
|
||||
GX2_BLEND_COMBINE_MODE_ADD = 0,
|
||||
GX2_BLEND_COMBINE_MODE_SUB = 1,
|
||||
GX2_BLEND_COMBINE_MODE_MIN = 2,
|
||||
GX2_BLEND_COMBINE_MODE_MAX = 3,
|
||||
GX2_BLEND_COMBINE_MODE_REV_SUB = 4,
|
||||
} GX2BlendCombineMode;
|
||||
|
||||
typedef enum GX2BufferingMode
|
||||
{
|
||||
GX2_BUFFERING_MODE_SINGLE = 1,
|
||||
GX2_BUFFERING_MODE_DOUBLE = 2,
|
||||
GX2_BUFFERING_MODE_TRIPLE = 3,
|
||||
} GX2BufferingMode;
|
||||
|
||||
typedef enum GX2ChannelMask
|
||||
{
|
||||
GX2_CHANNEL_MASK_R = 1,
|
||||
GX2_CHANNEL_MASK_G = 2,
|
||||
GX2_CHANNEL_MASK_RG = 3,
|
||||
GX2_CHANNEL_MASK_B = 4,
|
||||
GX2_CHANNEL_MASK_RB = 5,
|
||||
GX2_CHANNEL_MASK_GB = 6,
|
||||
GX2_CHANNEL_MASK_RGB = 7,
|
||||
GX2_CHANNEL_MASK_A = 8,
|
||||
GX2_CHANNEL_MASK_RA = 9,
|
||||
GX2_CHANNEL_MASK_GA = 10,
|
||||
GX2_CHANNEL_MASK_RGA = 11,
|
||||
GX2_CHANNEL_MASK_BA = 12,
|
||||
GX2_CHANNEL_MASK_RBA = 13,
|
||||
GX2_CHANNEL_MASK_GBA = 14,
|
||||
GX2_CHANNEL_MASK_RGBA = 15,
|
||||
} GX2ChannelMask;
|
||||
|
||||
typedef enum GX2ClearFlags
|
||||
{
|
||||
GX2_CLEAR_FLAGS_DEPTH = 1,
|
||||
GX2_CLEAR_FLAGS_STENCIL = 2,
|
||||
GX2_CLEAR_FLAGS_BOTH = (GX2_CLEAR_FLAGS_DEPTH | GX2_CLEAR_FLAGS_STENCIL),
|
||||
} GX2ClearFlags;
|
||||
|
||||
typedef enum GX2CompareFunction
|
||||
{
|
||||
GX2_COMPARE_FUNC_NEVER = 0,
|
||||
GX2_COMPARE_FUNC_LESS = 1,
|
||||
GX2_COMPARE_FUNC_EQUAL = 2,
|
||||
GX2_COMPARE_FUNC_LEQUAL = 3,
|
||||
GX2_COMPARE_FUNC_GREATER = 4,
|
||||
GX2_COMPARE_FUNC_NOT_EQUAL = 5,
|
||||
GX2_COMPARE_FUNC_GEQUAL = 6,
|
||||
GX2_COMPARE_FUNC_ALWAYS = 7,
|
||||
} GX2CompareFunction;
|
||||
|
||||
typedef enum GX2DrcRenderMode
|
||||
{
|
||||
GX2_DRC_RENDER_MODE_DISABLED = 0,
|
||||
GX2_DRC_RENDER_MODE_SINGLE = 1,
|
||||
} GX2DrcRenderMode;
|
||||
|
||||
typedef enum GX2EventType
|
||||
{
|
||||
GX2_EVENT_TYPE_VSYNC = 2,
|
||||
GX2_EVENT_TYPE_FLIP = 3,
|
||||
GX2_EVENT_TYPE_DISPLAY_LIST_OVERRUN = 4,
|
||||
} GX2EventType;
|
||||
|
||||
typedef enum GX2EndianSwapMode
|
||||
{
|
||||
GX2_ENDIAN_SWAP_NONE = 0,
|
||||
GX2_ENDIAN_SWAP_8_IN_16 = 1,
|
||||
GX2_ENDIAN_SWAP_8_IN_32 = 2,
|
||||
GX2_ENDIAN_SWAP_DEFAULT = 3,
|
||||
} GX2EndianSwapMode;
|
||||
|
||||
typedef enum GX2FetchShaderType
|
||||
{
|
||||
GX2_FETCH_SHADER_TESSELLATION_NONE = 0,
|
||||
GX2_FETCH_SHADER_TESSELLATION_LINE = 1,
|
||||
GX2_FETCH_SHADER_TESSELLATION_TRIANGLE = 2,
|
||||
GX2_FETCH_SHADER_TESSELLATION_QUAD = 3,
|
||||
} GX2FetchShaderType;
|
||||
|
||||
typedef enum GX2FrontFace
|
||||
{
|
||||
GX2_FRONT_FACE_CCW = 0,
|
||||
GX2_FRONT_FACE_CW = 1,
|
||||
} GX2FrontFace;
|
||||
|
||||
typedef enum GX2IndexType
|
||||
{
|
||||
GX2_INDEX_TYPE_U16_LE = 0,
|
||||
GX2_INDEX_TYPE_U32_LE = 1,
|
||||
GX2_INDEX_TYPE_U16 = 4,
|
||||
GX2_INDEX_TYPE_U32 = 9,
|
||||
} GX2IndexType;
|
||||
|
||||
typedef enum GX2InvalidateMode
|
||||
{
|
||||
GX2_INVALIDATE_MODE_ATTRIBUTE_BUFFER = 1 << 0,
|
||||
GX2_INVALIDATE_MODE_TEXTURE = 1 << 1,
|
||||
GX2_INVALIDATE_MODE_UNIFORM_BLOCK = 1 << 2,
|
||||
GX2_INVALIDATE_MODE_SHADER = 1 << 3,
|
||||
GX2_INVALIDATE_MODE_COLOR_BUFFER = 1 << 4,
|
||||
GX2_INVALIDATE_MODE_DEPTH_BUFFER = 1 << 5,
|
||||
GX2_INVALIDATE_MODE_CPU = 1 << 6,
|
||||
GX2_INVALIDATE_MODE_STREAM_OUT_BUFFER = 1 << 7,
|
||||
GX2_INVALIDATE_MODE_EXPORT_BUFFER = 1 << 8,
|
||||
GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER= GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_ATTRIBUTE_BUFFER,
|
||||
GX2_INVALIDATE_MODE_CPU_TEXTURE = GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_TEXTURE,
|
||||
GX2_INVALIDATE_MODE_CPU_SHADER = GX2_INVALIDATE_MODE_CPU | GX2_INVALIDATE_MODE_SHADER,
|
||||
} GX2InvalidateMode;
|
||||
|
||||
typedef enum GX2InitAttributes
|
||||
{
|
||||
GX2_INIT_END = 0,
|
||||
GX2_INIT_CMD_BUF_BASE = 1,
|
||||
GX2_INIT_CMD_BUF_POOL_SIZE = 2,
|
||||
GX2_INIT_ARGC = 7,
|
||||
GX2_INIT_ARGV = 8,
|
||||
} GX2InitAttributes;
|
||||
|
||||
typedef enum GX2LogicOp
|
||||
{
|
||||
GX2_LOGIC_OP_CLEAR = 0x00,
|
||||
GX2_LOGIC_OP_NOR = 0x11,
|
||||
GX2_LOGIC_OP_INV_AND = 0x22,
|
||||
GX2_LOGIC_OP_INV_COPY = 0x33,
|
||||
GX2_LOGIC_OP_REV_AND = 0x44,
|
||||
GX2_LOGIC_OP_INV = 0x55,
|
||||
GX2_LOGIC_OP_XOR = 0x66,
|
||||
GX2_LOGIC_OP_NOT_AND = 0x77,
|
||||
GX2_LOGIC_OP_AND = 0x88,
|
||||
GX2_LOGIC_OP_EQUIV = 0x99,
|
||||
GX2_LOGIC_OP_NOP = 0xAA,
|
||||
GX2_LOGIC_OP_INV_OR = 0xBB,
|
||||
GX2_LOGIC_OP_COPY = 0xCC,
|
||||
GX2_LOGIC_OP_REV_OR = 0xDD,
|
||||
GX2_LOGIC_OP_OR = 0xEE,
|
||||
GX2_LOGIC_OP_SET = 0xFF,
|
||||
} GX2LogicOp;
|
||||
|
||||
typedef enum GX2PrimitiveMode
|
||||
{
|
||||
GX2_PRIMITIVE_MODE_LINES = 2,
|
||||
GX2_PRIMITIVE_MODE_LINE_STRIP = 3,
|
||||
GX2_PRIMITIVE_MODE_TRIANGLES = 4,
|
||||
GX2_PRIMITIVE_MODE_TRIANGLE_FAN = 5,
|
||||
GX2_PRIMITIVE_MODE_TRIANGLE_STRIP = 6,
|
||||
GX2_PRIMITIVE_MODE_QUADS = 19,
|
||||
GX2_PRIMITIVE_MODE_QUAD_STRIP = 20,
|
||||
} GX2PrimitiveMode;
|
||||
|
||||
typedef enum GX2PolygonMode
|
||||
{
|
||||
GX2_POLYGON_MODE_POINT = 0,
|
||||
GX2_POLYGON_MODE_LINE = 1,
|
||||
GX2_POLYGON_MODE_TRIANGLE = 2,
|
||||
} GX2PolygonMode;
|
||||
|
||||
typedef enum GX2RenderTarget
|
||||
{
|
||||
GX2_RENDER_TARGET_0 = 0,
|
||||
GX2_RENDER_TARGET_1 = 1,
|
||||
GX2_RENDER_TARGET_2 = 2,
|
||||
GX2_RENDER_TARGET_3 = 3,
|
||||
GX2_RENDER_TARGET_4 = 4,
|
||||
GX2_RENDER_TARGET_5 = 5,
|
||||
GX2_RENDER_TARGET_6 = 6,
|
||||
} GX2RenderTarget;
|
||||
|
||||
typedef enum GX2RoundingMode
|
||||
{
|
||||
GX2_ROUNDING_MODE_ROUND_TO_EVEN = 0,
|
||||
GX2_ROUNDING_MODE_TRUNCATE = 1,
|
||||
} GX2RoundingMode;
|
||||
|
||||
typedef enum GX2SamplerVarType
|
||||
{
|
||||
GX2_SAMPLER_VAR_TYPE_SAMPLER_1D = 0,
|
||||
GX2_SAMPLER_VAR_TYPE_SAMPLER_2D = 1,
|
||||
GX2_SAMPLER_VAR_TYPE_SAMPLER_3D = 3,
|
||||
GX2_SAMPLER_VAR_TYPE_SAMPLER_CUBE = 4,
|
||||
} GX2SamplerVarType;
|
||||
|
||||
typedef enum GX2ScanTarget
|
||||
{
|
||||
GX2_SCAN_TARGET_TV = 1,
|
||||
GX2_SCAN_TARGET_DRC = 4,
|
||||
} GX2ScanTarget;
|
||||
|
||||
typedef enum GX2ShaderMode
|
||||
{
|
||||
GX2_SHADER_MODE_UNIFORM_REGISTER = 0,
|
||||
GX2_SHADER_MODE_UNIFORM_BLOCK = 1,
|
||||
GX2_SHADER_MODE_GEOMETRY_SHADER = 2,
|
||||
GX2_SHADER_MODE_COMPUTE_SHADER = 3,
|
||||
} GX2ShaderMode;
|
||||
|
||||
typedef enum GX2ShaderVarType
|
||||
{
|
||||
GX2_SHADER_VAR_TYPE_INT = 2,
|
||||
GX2_SHADER_VAR_TYPE_FLOAT = 4,
|
||||
GX2_SHADER_VAR_TYPE_FLOAT2 = 9,
|
||||
GX2_SHADER_VAR_TYPE_FLOAT3 = 10,
|
||||
GX2_SHADER_VAR_TYPE_FLOAT4 = 11,
|
||||
GX2_SHADER_VAR_TYPE_INT2 = 15,
|
||||
GX2_SHADER_VAR_TYPE_INT3 = 16,
|
||||
GX2_SHADER_VAR_TYPE_INT4 = 17,
|
||||
GX2_SHADER_VAR_TYPE_MATRIX4X4 = 29,
|
||||
} GX2ShaderVarType;
|
||||
|
||||
typedef enum GX2StencilFunction
|
||||
{
|
||||
GX2_STENCIL_FUNCTION_KEEP = 0,
|
||||
GX2_STENCIL_FUNCTION_ZERO = 1,
|
||||
GX2_STENCIL_FUNCTION_REPLACE = 2,
|
||||
GX2_STENCIL_FUNCTION_INCR_CLAMP = 3,
|
||||
GX2_STENCIL_FUNCTION_DECR_CLAMP = 4,
|
||||
GX2_STENCIL_FUNCTION_INV = 5,
|
||||
GX2_STENCIL_FUNCTION_INCR_WRAP = 6,
|
||||
GX2_STENCIL_FUNCTION_DECR_WRAP = 7,
|
||||
} GX2StencilFunction;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GX2_SURFACE_DIM_TEXTURE_1D = 0,
|
||||
GX2_SURFACE_DIM_TEXTURE_2D = 1,
|
||||
GX2_SURFACE_DIM_TEXTURE_3D = 2,
|
||||
GX2_SURFACE_DIM_TEXTURE_CUBE = 3,
|
||||
GX2_SURFACE_DIM_TEXTURE_1D_ARRAY = 4,
|
||||
GX2_SURFACE_DIM_TEXTURE_2D_ARRAY = 5,
|
||||
GX2_SURFACE_DIM_TEXTURE_2D_MSAA = 6,
|
||||
GX2_SURFACE_DIM_TEXTURE_2D_MSAA_ARRAY = 7,
|
||||
} GX2SurfaceDim;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GX2_SURFACE_FORMAT_INVALID = 0x00,
|
||||
GX2_SURFACE_FORMAT_UNORM_R4_G4 = 0x02,
|
||||
GX2_SURFACE_FORMAT_UNORM_R4_G4_B4_A4 = 0x0b,
|
||||
GX2_SURFACE_FORMAT_UNORM_R8 = 0x01,
|
||||
GX2_SURFACE_FORMAT_UNORM_R8_G8 = 0x07,
|
||||
GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8 = 0x01a,
|
||||
GX2_SURFACE_FORMAT_UNORM_R16 = 0x05,
|
||||
GX2_SURFACE_FORMAT_UNORM_R16_G16 = 0x0f,
|
||||
GX2_SURFACE_FORMAT_UNORM_R16_G16_B16_A16 = 0x01f,
|
||||
GX2_SURFACE_FORMAT_UNORM_R5_G6_B5 = 0x08,
|
||||
GX2_SURFACE_FORMAT_UNORM_R5_G5_B5_A1 = 0x0a,
|
||||
GX2_SURFACE_FORMAT_UNORM_A1_B5_G5_R5 = 0x0c,
|
||||
GX2_SURFACE_FORMAT_UNORM_R24_X8 = 0x011,
|
||||
GX2_SURFACE_FORMAT_UNORM_A2_B10_G10_R10 = 0x01b,
|
||||
GX2_SURFACE_FORMAT_UNORM_R10_G10_B10_A2 = 0x019,
|
||||
GX2_SURFACE_FORMAT_UNORM_BC1 = 0x031,
|
||||
GX2_SURFACE_FORMAT_UNORM_BC2 = 0x032,
|
||||
GX2_SURFACE_FORMAT_UNORM_BC3 = 0x033,
|
||||
GX2_SURFACE_FORMAT_UNORM_BC4 = 0x034,
|
||||
GX2_SURFACE_FORMAT_UNORM_BC5 = 0x035,
|
||||
GX2_SURFACE_FORMAT_UNORM_NV12 = 0x081,
|
||||
|
||||
GX2_SURFACE_FORMAT_UINT_R8 = 0x101,
|
||||
GX2_SURFACE_FORMAT_UINT_R8_G8 = 0x107,
|
||||
GX2_SURFACE_FORMAT_UINT_R8_G8_B8_A8 = 0x11a,
|
||||
GX2_SURFACE_FORMAT_UINT_R16 = 0x105,
|
||||
GX2_SURFACE_FORMAT_UINT_R16_G16 = 0x10f,
|
||||
GX2_SURFACE_FORMAT_UINT_R16_G16_B16_A16 = 0x11f,
|
||||
GX2_SURFACE_FORMAT_UINT_R32 = 0x10d,
|
||||
GX2_SURFACE_FORMAT_UINT_R32_G32 = 0x11d,
|
||||
GX2_SURFACE_FORMAT_UINT_R32_G32_B32_A32 = 0x122,
|
||||
GX2_SURFACE_FORMAT_UINT_A2_B10_G10_R10 = 0x11b,
|
||||
GX2_SURFACE_FORMAT_UINT_R10_G10_B10_A2 = 0x119,
|
||||
GX2_SURFACE_FORMAT_UINT_X24_G8 = 0x111,
|
||||
GX2_SURFACE_FORMAT_UINT_G8_X24 = 0x11c,
|
||||
|
||||
GX2_SURFACE_FORMAT_SNORM_R8 = 0x201,
|
||||
GX2_SURFACE_FORMAT_SNORM_R8_G8 = 0x207,
|
||||
GX2_SURFACE_FORMAT_SNORM_R8_G8_B8_A8 = 0x21a,
|
||||
GX2_SURFACE_FORMAT_SNORM_R16 = 0x205,
|
||||
GX2_SURFACE_FORMAT_SNORM_R16_G16 = 0x20f,
|
||||
GX2_SURFACE_FORMAT_SNORM_R16_G16_B16_A16 = 0x21f,
|
||||
GX2_SURFACE_FORMAT_SNORM_R10_G10_B10_A2 = 0x219,
|
||||
GX2_SURFACE_FORMAT_SNORM_BC4 = 0x234,
|
||||
GX2_SURFACE_FORMAT_SNORM_BC5 = 0x235,
|
||||
|
||||
GX2_SURFACE_FORMAT_SINT_R8 = 0x301,
|
||||
GX2_SURFACE_FORMAT_SINT_R8_G8 = 0x307,
|
||||
GX2_SURFACE_FORMAT_SINT_R8_G8_B8_A8 = 0x31a,
|
||||
GX2_SURFACE_FORMAT_SINT_R16 = 0x305,
|
||||
GX2_SURFACE_FORMAT_SINT_R16_G16 = 0x30f,
|
||||
GX2_SURFACE_FORMAT_SINT_R16_G16_B16_A16 = 0x31f,
|
||||
GX2_SURFACE_FORMAT_SINT_R32 = 0x30d,
|
||||
GX2_SURFACE_FORMAT_SINT_R32_G32 = 0x31d,
|
||||
GX2_SURFACE_FORMAT_SINT_R32_G32_B32_A32 = 0x322,
|
||||
GX2_SURFACE_FORMAT_SINT_R10_G10_B10_A2 = 0x319,
|
||||
|
||||
GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8 = 0x41a,
|
||||
GX2_SURFACE_FORMAT_SRGB_BC1 = 0x431,
|
||||
GX2_SURFACE_FORMAT_SRGB_BC2 = 0x432,
|
||||
GX2_SURFACE_FORMAT_SRGB_BC3 = 0x433,
|
||||
|
||||
GX2_SURFACE_FORMAT_FLOAT_R32 = 0x80e,
|
||||
GX2_SURFACE_FORMAT_FLOAT_R32_G32 = 0x81e,
|
||||
GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32 = 0x823,
|
||||
GX2_SURFACE_FORMAT_FLOAT_R16 = 0x806,
|
||||
GX2_SURFACE_FORMAT_FLOAT_R16_G16 = 0x810,
|
||||
GX2_SURFACE_FORMAT_FLOAT_R16_G16_B16_A16 = 0x820,
|
||||
GX2_SURFACE_FORMAT_FLOAT_R11_G11_B10 = 0x816,
|
||||
GX2_SURFACE_FORMAT_FLOAT_D24_S8 = 0x811,
|
||||
GX2_SURFACE_FORMAT_FLOAT_X8_X24 = 0x81c,
|
||||
} GX2SurfaceFormat;
|
||||
|
||||
typedef enum GX2SurfaceUse
|
||||
{
|
||||
GX2_SURFACE_USE_TEXTURE = 1 << 0,
|
||||
GX2_SURFACE_USE_COLOR_BUFFER = 1 << 1,
|
||||
GX2_SURFACE_USE_DEPTH_BUFFER = 1 << 2,
|
||||
GX2_SURFACE_USE_SCAN_BUFFER = 1 << 3,
|
||||
GX2_SURFACE_USE_TV = 1 << 31,
|
||||
GX2_SURFACE_USE_TEXTURE_COLOR_BUFFER_TV = (GX2_SURFACE_USE_TEXTURE | GX2_SURFACE_USE_COLOR_BUFFER | GX2_SURFACE_USE_TV)
|
||||
} GX2SurfaceUse;
|
||||
|
||||
typedef enum GX2TessellationMode
|
||||
{
|
||||
GX2_TESSELLATION_MODE_DISCRETE = 0,
|
||||
GX2_TESSELLATION_MODE_CONTINUOUS = 1,
|
||||
GX2_TESSELLATION_MODE_ADAPTIVE = 2,
|
||||
} GX2TessellationMode;
|
||||
|
||||
typedef enum GX2TexBorderType
|
||||
{
|
||||
GX2_TEX_BORDER_TYPE_TRANSPARENT_BLACK = 0,
|
||||
GX2_TEX_BORDER_TYPE_BLACK = 1,
|
||||
GX2_TEX_BORDER_TYPE_WHITE = 2,
|
||||
GX2_TEX_BORDER_TYPE_VARIABLE = 3,
|
||||
} GX2TexBorderType;
|
||||
|
||||
typedef enum GX2TexClampMode
|
||||
{
|
||||
GX2_TEX_CLAMP_MODE_WRAP = 0,
|
||||
GX2_TEX_CLAMP_MODE_MIRROR = 1,
|
||||
GX2_TEX_CLAMP_MODE_CLAMP = 2,
|
||||
GX2_TEX_CLAMP_MODE_MIRROR_ONCE = 3,
|
||||
GX2_TEX_CLAMP_MODE_CLAMP_BORDER = 6,
|
||||
} GX2TexClampMode;
|
||||
|
||||
typedef enum GX2TexMipFilterMode
|
||||
{
|
||||
GX2_TEX_MIP_FILTER_MODE_NONE = 0,
|
||||
GX2_TEX_MIP_FILTER_MODE_POINT = 1,
|
||||
GX2_TEX_MIP_FILTER_MODE_LINEAR = 2,
|
||||
} GX2TexMipFilterMode;
|
||||
|
||||
typedef enum GX2TexMipPerfMode
|
||||
{
|
||||
GX2_TEX_MIP_PERF_MODE_DISABLE = 0,
|
||||
} GX2TexMipPerfMode;
|
||||
|
||||
typedef enum GX2TexXYFilterMode
|
||||
{
|
||||
GX2_TEX_XY_FILTER_MODE_POINT = 0,
|
||||
GX2_TEX_XY_FILTER_MODE_LINEAR = 1,
|
||||
} GX2TexXYFilterMode;
|
||||
|
||||
typedef enum GX2TexAnisoRatio
|
||||
{
|
||||
GX2_TEX_ANISO_RATIO_NONE = 0,
|
||||
} GX2TexAnisoRatio;
|
||||
|
||||
typedef enum GX2TexZFilterMode
|
||||
{
|
||||
GX2_TEX_Z_FILTER_MODE_NONE = 0,
|
||||
GX2_TEX_Z_FILTER_MODE_POINT = 1,
|
||||
GX2_TEX_Z_FILTER_MODE_LINEAR = 2,
|
||||
} GX2TexZFilterMode;
|
||||
|
||||
typedef enum GX2TexZPerfMode
|
||||
{
|
||||
GX2_TEX_Z_PERF_MODE_DISABLED = 0,
|
||||
} GX2TexZPerfMode;
|
||||
|
||||
typedef enum GX2TileMode
|
||||
{
|
||||
GX2_TILE_MODE_DEFAULT = 0,
|
||||
GX2_TILE_MODE_LINEAR_ALIGNED = 1,
|
||||
GX2_TILE_MODE_TILED_1D_THIN1 = 2,
|
||||
GX2_TILE_MODE_TILED_1D_THICK = 3,
|
||||
GX2_TILE_MODE_TILED_2D_THIN1 = 4,
|
||||
GX2_TILE_MODE_TILED_2D_THIN2 = 5,
|
||||
GX2_TILE_MODE_TILED_2D_THIN4 = 6,
|
||||
GX2_TILE_MODE_TILED_2D_THICK = 7,
|
||||
GX2_TILE_MODE_TILED_2B_THIN1 = 8,
|
||||
GX2_TILE_MODE_TILED_2B_THIN2 = 9,
|
||||
GX2_TILE_MODE_TILED_2B_THIN4 = 10,
|
||||
GX2_TILE_MODE_TILED_2B_THICK = 11,
|
||||
GX2_TILE_MODE_TILED_3D_THIN1 = 12,
|
||||
GX2_TILE_MODE_TILED_3D_THICK = 13,
|
||||
GX2_TILE_MODE_TILED_3B_THIN1 = 14,
|
||||
GX2_TILE_MODE_TILED_3B_THICK = 15,
|
||||
GX2_TILE_MODE_LINEAR_SPECIAL = 16,
|
||||
} GX2TileMode;
|
||||
|
||||
typedef enum GX2TVRenderMode
|
||||
{
|
||||
GX2_TV_RENDER_MODE_STANDARD_480P = 1,
|
||||
GX2_TV_RENDER_MODE_WIDE_480P = 2,
|
||||
GX2_TV_RENDER_MODE_WIDE_720P = 3,
|
||||
GX2_TV_RENDER_MODE_WIDE_1080P = 5,
|
||||
} GX2TVRenderMode;
|
||||
|
||||
typedef enum GX2TVScanMode
|
||||
{
|
||||
GX2_TV_SCAN_MODE_NONE = 0,
|
||||
GX2_TV_SCAN_MODE_480I = 1,
|
||||
GX2_TV_SCAN_MODE_480P = 2,
|
||||
GX2_TV_SCAN_MODE_720P = 3,
|
||||
GX2_TV_SCAN_MODE_1080I = 5,
|
||||
GX2_TV_SCAN_MODE_1080P = 6,
|
||||
} GX2TVScanMode;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include <wiiu/os/time.h>
|
||||
#include "enum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*GX2EventCallbackFunction)(GX2EventType, void *);
|
||||
|
||||
typedef struct GX2DisplayListOverrunData
|
||||
{
|
||||
void *oldList;
|
||||
uint32_t oldSize;
|
||||
void *newList;
|
||||
uint32_t newSize;
|
||||
uint32_t __unk[0x2];
|
||||
} GX2DisplayListOverrunData;
|
||||
|
||||
BOOL GX2DrawDone();
|
||||
void GX2WaitForVsync();
|
||||
void GX2WaitForFlip();
|
||||
void GX2SetEventCallback(GX2EventType type, GX2EventCallbackFunction func, void *userData);
|
||||
void GX2GetEventCallback(GX2EventType type, GX2EventCallbackFunction *funcOut, void **userDataOut);
|
||||
OSTime GX2GetRetiredTimeStamp();
|
||||
OSTime GX2GetLastSubmittedTimeStamp();
|
||||
BOOL GX2WaitTimeStamp(OSTime time);
|
||||
void GX2GetSwapStatus(uint32_t *swapCount, uint32_t *flipCount, OSTime *lastFlip, OSTime *lastVsync);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2Invalidate(GX2InvalidateMode mode, void *buffer, uint32_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,235 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
#include "surface.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_sc_aa_mask;
|
||||
} GX2AAMaskReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t sx_alpha_test_control;
|
||||
uint32_t sx_alpha_ref;
|
||||
} GX2AlphaTestReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t db_alpha_to_mask;
|
||||
} GX2AlphaToMaskReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GX2RenderTarget target;
|
||||
uint32_t cb_blend_control;
|
||||
} GX2BlendControlReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float red;
|
||||
float green;
|
||||
float blue;
|
||||
float alpha;
|
||||
} GX2BlendConstantColorReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t cb_color_control;
|
||||
} GX2ColorControlReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t db_depth_control;
|
||||
} GX2DepthStencilControlReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t db_stencilrefmask;
|
||||
uint32_t db_stencilrefmask_bf;
|
||||
} GX2StencilMaskReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_su_line_cntl;
|
||||
} GX2LineWidthReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_su_point_size;
|
||||
} GX2PointSizeReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_su_point_minmax;
|
||||
} GX2PointLimitsReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_su_sc_mode_cntl;
|
||||
} GX2PolygonControlReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_su_poly_offset_front_scale;
|
||||
uint32_t pa_su_poly_offset_front_offset;
|
||||
uint32_t pa_su_poly_offset_back_scale;
|
||||
uint32_t pa_su_poly_offset_back_offset;
|
||||
uint32_t pa_su_poly_offset_clamp;
|
||||
} GX2PolygonOffsetReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_sc_generic_scissor_tl;
|
||||
uint32_t pa_sc_generic_scissor_br;
|
||||
} GX2ScissorReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t cb_target_mask;
|
||||
} GX2TargetChannelMaskReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t pa_cl_vport_xscale;
|
||||
uint32_t pa_cl_vport_xoffset;
|
||||
uint32_t pa_cl_vport_yscale;
|
||||
uint32_t pa_cl_vport_yoffset;
|
||||
uint32_t pa_cl_vport_zscale;
|
||||
uint32_t pa_cl_vport_zoffset;
|
||||
uint32_t pa_cl_gb_vert_clip_adj;
|
||||
uint32_t pa_cl_gb_vert_disc_adj;
|
||||
uint32_t pa_cl_gb_horz_clip_adj;
|
||||
uint32_t pa_cl_gb_horz_disc_adj;
|
||||
uint32_t pa_sc_vport_zmin;
|
||||
uint32_t pa_sc_vport_zmax;
|
||||
} GX2ViewportReg;
|
||||
|
||||
void GX2SetAAMask(uint8_t upperLeft, uint8_t upperRight, uint8_t lowerLeft, uint8_t lowerRight);
|
||||
void GX2InitAAMaskReg(GX2AAMaskReg *reg, uint8_t upperLeft, uint8_t upperRight, uint8_t lowerLeft,
|
||||
uint8_t lowerRight);
|
||||
void GX2GetAAMaskReg(GX2AAMaskReg *reg, uint8_t *upperLeft, uint8_t *upperRight, uint8_t *lowerLeft,
|
||||
uint8_t *lowerRight);
|
||||
void GX2SetAAMaskReg(GX2AAMaskReg *reg);
|
||||
void GX2SetAlphaTest(BOOL alphaTest, GX2CompareFunction func, float ref);
|
||||
void GX2InitAlphaTestReg(GX2AlphaTestReg *reg, BOOL alphaTest, GX2CompareFunction func, float ref);
|
||||
void GX2GetAlphaTestReg(const GX2AlphaTestReg *reg, BOOL *alphaTest, GX2CompareFunction *func,
|
||||
float *ref);
|
||||
void GX2SetAlphaTestReg(GX2AlphaTestReg *reg);
|
||||
void GX2SetAlphaToMask(BOOL alphaToMask, GX2AlphaToMaskMode mode);
|
||||
void GX2InitAlphaToMaskReg(GX2AlphaToMaskReg *reg, BOOL alphaToMask, GX2AlphaToMaskMode mode);
|
||||
void GX2GetAlphaToMaskReg(const GX2AlphaToMaskReg *reg, BOOL *alphaToMask,
|
||||
GX2AlphaToMaskMode *mode);
|
||||
void GX2SetAlphaToMaskReg(GX2AlphaToMaskReg *reg);
|
||||
void GX2SetBlendConstantColor(float red, float green, float blue, float alpha);
|
||||
void GX2InitBlendConstantColorReg(GX2BlendConstantColorReg *reg, float red, float green, float blue,
|
||||
float alpha);
|
||||
void GX2GetBlendConstantColorReg(GX2BlendConstantColorReg *reg, float *red, float *green,
|
||||
float *blue, float *alpha);
|
||||
void GX2SetBlendConstantColorReg(GX2BlendConstantColorReg *reg);
|
||||
void GX2SetBlendControl(GX2RenderTarget target, GX2BlendMode colorSrcBlend,
|
||||
GX2BlendMode colorDstBlend, GX2BlendCombineMode colorCombine, BOOL useAlphaBlend,
|
||||
GX2BlendMode alphaSrcBlend, GX2BlendMode alphaDstBlend, GX2BlendCombineMode alphaCombine);
|
||||
void GX2InitBlendControlReg(GX2BlendControlReg *reg, GX2RenderTarget target,
|
||||
GX2BlendMode colorSrcBlend, GX2BlendMode colorDstBlend, GX2BlendCombineMode colorCombine,
|
||||
BOOL useAlphaBlend, GX2BlendMode alphaSrcBlend, GX2BlendMode alphaDstBlend,
|
||||
GX2BlendCombineMode alphaCombine);
|
||||
void GX2GetBlendControlReg(GX2BlendControlReg *reg, GX2RenderTarget *target,
|
||||
GX2BlendMode *colorSrcBlend, GX2BlendMode *colorDstBlend, GX2BlendCombineMode *colorCombine,
|
||||
BOOL *useAlphaBlend, GX2BlendMode *alphaSrcBlend, GX2BlendMode *alphaDstBlend,
|
||||
GX2BlendCombineMode *alphaCombine);
|
||||
void GX2SetBlendControlReg(GX2BlendControlReg *reg);
|
||||
void GX2SetColorControl(GX2LogicOp rop3, uint8_t targetBlendEnable, BOOL multiWriteEnable,
|
||||
BOOL colorWriteEnable);
|
||||
void GX2InitColorControlReg(GX2ColorControlReg *reg, GX2LogicOp rop3, uint8_t targetBlendEnable,
|
||||
BOOL multiWriteEnable, BOOL colorWriteEnable);
|
||||
void GX2GetColorControlReg(GX2ColorControlReg *reg, GX2LogicOp *rop3, uint8_t *targetBlendEnable,
|
||||
BOOL *multiWriteEnable, BOOL *colorWriteEnable);
|
||||
void GX2SetColorControlReg(GX2ColorControlReg *reg);
|
||||
void GX2SetDepthOnlyControl(BOOL depthTest, BOOL depthWrite, GX2CompareFunction depthCompare);
|
||||
void GX2SetDepthStencilControl(BOOL depthTest, BOOL depthWrite, GX2CompareFunction depthCompare,
|
||||
BOOL stencilTest, BOOL backfaceStencil, GX2CompareFunction frontStencilFunc,
|
||||
GX2StencilFunction frontStencilZPass, GX2StencilFunction frontStencilZFail,
|
||||
GX2StencilFunction frontStencilFail, GX2CompareFunction backStencilFunc,
|
||||
GX2StencilFunction backStencilZPass, GX2StencilFunction backStencilZFail,
|
||||
GX2StencilFunction backStencilFail);
|
||||
void GX2InitDepthStencilControlReg(GX2DepthStencilControlReg *reg, BOOL depthTest, BOOL depthWrite,
|
||||
GX2CompareFunction depthCompare, BOOL stencilTest, BOOL backfaceStencil,
|
||||
GX2CompareFunction frontStencilFunc, GX2StencilFunction frontStencilZPass,
|
||||
GX2StencilFunction frontStencilZFail, GX2StencilFunction frontStencilFail,
|
||||
GX2CompareFunction backStencilFunc, GX2StencilFunction backStencilZPass,
|
||||
GX2StencilFunction backStencilZFail, GX2StencilFunction backStencilFail);
|
||||
void GX2GetDepthStencilControlReg(GX2DepthStencilControlReg *reg, BOOL *depthTest, BOOL *depthWrite,
|
||||
GX2CompareFunction *depthCompare, BOOL *stencilTest, BOOL *backfaceStencil,
|
||||
GX2CompareFunction *frontStencilFunc, GX2StencilFunction *frontStencilZPass,
|
||||
GX2StencilFunction *frontStencilZFail, GX2StencilFunction *frontStencilFail,
|
||||
GX2CompareFunction *backStencilFunc, GX2StencilFunction *backStencilZPass,
|
||||
GX2StencilFunction *backStencilZFail, GX2StencilFunction *backStencilFail);
|
||||
void GX2SetDepthStencilControlReg(GX2DepthStencilControlReg *reg);
|
||||
void GX2SetStencilMask(uint8_t frontMask, uint8_t frontWriteMask, uint8_t frontRef,
|
||||
uint8_t backMask, uint8_t backWriteMask, uint8_t backRef);
|
||||
void GX2InitStencilMaskReg(GX2StencilMaskReg *reg, uint8_t frontMask, uint8_t frontWriteMask,
|
||||
uint8_t frontRef, uint8_t backMask, uint8_t backWriteMask, uint8_t backRef);
|
||||
void GX2GetStencilMaskReg(GX2StencilMaskReg *reg, uint8_t *frontMask, uint8_t *frontWriteMask,
|
||||
uint8_t *frontRef, uint8_t *backMask, uint8_t *backWriteMask, uint8_t *backRef);
|
||||
void GX2SetStencilMaskReg(GX2StencilMaskReg *reg);
|
||||
void GX2SetLineWidth(float width);
|
||||
void GX2InitLineWidthReg(GX2LineWidthReg *reg, float width);
|
||||
void GX2GetLineWidthReg(GX2LineWidthReg *reg, float *width);
|
||||
void GX2SetLineWidthReg(GX2LineWidthReg *reg);
|
||||
void GX2SetPointSize(float width, float height);
|
||||
void GX2InitPointSizeReg(GX2PointSizeReg *reg, float width, float height);
|
||||
void GX2GetPointSizeReg(GX2PointSizeReg *reg, float *width, float *height);
|
||||
void GX2SetPointSizeReg(GX2PointSizeReg *reg);
|
||||
void GX2SetPointLimits(float min, float max);
|
||||
void GX2InitPointLimitsReg(GX2PointLimitsReg *reg, float min, float max);
|
||||
void GX2GetPointLimitsReg(GX2PointLimitsReg *reg, float *min, float *max);
|
||||
void GX2SetPointLimitsReg(GX2PointLimitsReg *reg);
|
||||
void GX2SetCullOnlyControl(GX2FrontFace frontFace, BOOL cullFront, BOOL cullBack);
|
||||
void GX2SetPolygonControl(GX2FrontFace frontFace, BOOL cullFront, BOOL cullBack, BOOL polyMode,
|
||||
GX2PolygonMode polyModeFront, GX2PolygonMode polyModeBack, BOOL polyOffsetFrontEnable,
|
||||
BOOL polyOffsetBackEnable, BOOL polyOffsetParaEnable);
|
||||
void GX2InitPolygonControlReg(GX2PolygonControlReg *reg, GX2FrontFace frontFace, BOOL cullFront,
|
||||
BOOL cullBack, BOOL polyMode, GX2PolygonMode polyModeFront, GX2PolygonMode polyModeBack,
|
||||
BOOL polyOffsetFrontEnable, BOOL polyOffsetBackEnable, BOOL polyOffsetParaEnable);
|
||||
void GX2GetPolygonControlReg(GX2PolygonControlReg *reg, GX2FrontFace *frontFace, BOOL *cullFront,
|
||||
BOOL *cullBack, BOOL *polyMode, GX2PolygonMode *polyModeFront, GX2PolygonMode *polyModeBack,
|
||||
BOOL *polyOffsetFrontEnable, BOOL *polyOffsetBackEnable, BOOL *polyOffsetParaEnable);
|
||||
void GX2SetPolygonControlReg(GX2PolygonControlReg *reg);
|
||||
void GX2SetPolygonOffset(float frontOffset, float frontScale, float backOffset, float backScale,
|
||||
float clamp);
|
||||
void GX2InitPolygonOffsetReg(GX2PolygonOffsetReg *reg, float frontOffset, float frontScale,
|
||||
float backOffset, float backScale, float clamp);
|
||||
void GX2GetPolygonOffsetReg(GX2PolygonOffsetReg *reg, float *frontOffset, float *frontScale,
|
||||
float *backOffset, float *backScale, float *clamp);
|
||||
void GX2SetPolygonOffsetReg(GX2PolygonOffsetReg *reg);
|
||||
void GX2SetScissor(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
|
||||
void GX2InitScissorReg(GX2ScissorReg *reg, uint32_t x, uint32_t y, uint32_t width, uint32_t height);
|
||||
void GX2GetScissorReg(GX2ScissorReg *reg, uint32_t *x, uint32_t *y, uint32_t *width,
|
||||
uint32_t *height);
|
||||
void GX2SetScissorReg(GX2ScissorReg *reg);
|
||||
void GX2SetTargetChannelMasks(GX2ChannelMask mask0, GX2ChannelMask mask1, GX2ChannelMask mask2,
|
||||
GX2ChannelMask mask3, GX2ChannelMask mask4, GX2ChannelMask mask5, GX2ChannelMask mask6,
|
||||
GX2ChannelMask mask7);
|
||||
void GX2InitTargetChannelMasksReg(GX2TargetChannelMaskReg *reg, GX2ChannelMask mask0,
|
||||
GX2ChannelMask mask1, GX2ChannelMask mask2, GX2ChannelMask mask3, GX2ChannelMask mask4,
|
||||
GX2ChannelMask mask5, GX2ChannelMask mask6, GX2ChannelMask mask7);
|
||||
void GX2GetTargetChannelMasksReg(GX2TargetChannelMaskReg *reg, GX2ChannelMask *mask0,
|
||||
GX2ChannelMask *mask1, GX2ChannelMask *mask2, GX2ChannelMask *mask3, GX2ChannelMask *mask4,
|
||||
GX2ChannelMask *mask5, GX2ChannelMask *mask6, GX2ChannelMask *mask7);
|
||||
void GX2SetTargetChannelMasksReg(GX2TargetChannelMaskReg *reg);
|
||||
void GX2SetViewport(float x, float y, float width, float height, float nearZ, float farZ);
|
||||
void GX2InitViewportReg(GX2ViewportReg *reg, float x, float y, float width, float height,
|
||||
float nearZ, float farZ);
|
||||
void GX2GetViewportReg(GX2ViewportReg *reg, float *x, float *y, float *width, float *height,
|
||||
float *nearZ, float *farZ);
|
||||
void GX2SetViewportReg(GX2ViewportReg *reg);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct GX2Sampler
|
||||
{
|
||||
uint32_t regs[3];
|
||||
} GX2Sampler;
|
||||
|
||||
void GX2InitSampler(GX2Sampler *sampler, GX2TexClampMode clampMode,
|
||||
GX2TexXYFilterMode minMagFilterMode);
|
||||
void GX2InitSamplerBorderType(GX2Sampler *sampler, GX2TexBorderType borderType);
|
||||
void GX2InitSamplerClamping(GX2Sampler *sampler, GX2TexClampMode clampX, GX2TexClampMode clampY,
|
||||
GX2TexClampMode clampZ);
|
||||
void GX2InitSamplerDepthCompare(GX2Sampler *sampler, GX2CompareFunction depthCompare);
|
||||
void GX2InitSamplerFilterAdjust(GX2Sampler *sampler, BOOL highPrecision, GX2TexMipPerfMode perfMip,
|
||||
GX2TexZPerfMode perfZ);
|
||||
void GX2InitSamplerLOD(GX2Sampler *sampler, float lodMin, float lodMax, float lodBias);
|
||||
void GX2InitSamplerLODAdjust(GX2Sampler *sampler, float unk1, BOOL unk2);
|
||||
void GX2InitSamplerRoundingMode(GX2Sampler *sampler, GX2RoundingMode roundingMode);
|
||||
void GX2InitSamplerXYFilter(GX2Sampler *sampler, GX2TexXYFilterMode filterMag,
|
||||
GX2TexXYFilterMode filterMin, GX2TexAnisoRatio maxAniso);
|
||||
void GX2InitSamplerZMFilter(GX2Sampler *sampler, GX2TexZFilterMode filterZ,
|
||||
GX2TexMipFilterMode filterMip);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,255 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include <wiiu/gx2r/buffer.h>
|
||||
#include "enum.h"
|
||||
#include "sampler.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct GX2FetchShader
|
||||
{
|
||||
GX2FetchShaderType type;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32_t sq_pgm_resources_fs;
|
||||
} regs;
|
||||
|
||||
uint32_t size;
|
||||
uint8_t *program;
|
||||
uint32_t attribCount;
|
||||
uint32_t numDivisors;
|
||||
uint32_t divisors[2];
|
||||
} GX2FetchShader;
|
||||
|
||||
typedef struct GX2UniformBlock
|
||||
{
|
||||
const char *name;
|
||||
uint32_t offset;
|
||||
uint32_t size;
|
||||
} GX2UniformBlock;
|
||||
|
||||
typedef struct GX2UniformVar
|
||||
{
|
||||
const char *name;
|
||||
GX2ShaderVarType type;
|
||||
uint32_t count;
|
||||
uint32_t offset;
|
||||
int32_t block;
|
||||
} GX2UniformVar;
|
||||
|
||||
typedef struct GX2UniformInitialValue
|
||||
{
|
||||
float value[4];
|
||||
uint32_t offset;
|
||||
} GX2UniformInitialValue;
|
||||
|
||||
typedef struct GX2LoopVar
|
||||
{
|
||||
uint32_t offset;
|
||||
uint32_t value;
|
||||
} GX2LoopVar;
|
||||
|
||||
typedef struct GX2SamplerVar
|
||||
{
|
||||
const char *name;
|
||||
GX2SamplerVarType type;
|
||||
uint32_t location;
|
||||
} GX2SamplerVar;
|
||||
|
||||
typedef struct GX2AttribVar
|
||||
{
|
||||
const char *name;
|
||||
GX2ShaderVarType type;
|
||||
uint32_t count;
|
||||
uint32_t location;
|
||||
} GX2AttribVar;
|
||||
|
||||
typedef struct GX2VertexShader
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t sq_pgm_resources_vs;
|
||||
uint32_t vgt_primitiveid_en;
|
||||
uint32_t spi_vs_out_config;
|
||||
uint32_t num_spi_vs_out_id;
|
||||
uint32_t spi_vs_out_id[10];
|
||||
uint32_t pa_cl_vs_out_cntl;
|
||||
uint32_t sq_vtx_semantic_clear;
|
||||
uint32_t num_sq_vtx_semantic;
|
||||
uint32_t sq_vtx_semantic[32];
|
||||
uint32_t vgt_strmout_buffer_en;
|
||||
uint32_t vgt_vertex_reuse_block_cntl;
|
||||
uint32_t vgt_hos_reuse_depth;
|
||||
} regs;
|
||||
|
||||
uint32_t size;
|
||||
uint8_t *program;
|
||||
GX2ShaderMode mode;
|
||||
|
||||
uint32_t uniformBlockCount;
|
||||
GX2UniformBlock *uniformBlocks;
|
||||
|
||||
uint32_t uniformVarCount;
|
||||
GX2UniformVar *uniformVars;
|
||||
|
||||
uint32_t initialValueCount;
|
||||
GX2UniformInitialValue *initialValues;
|
||||
|
||||
uint32_t loopVarCount;
|
||||
GX2LoopVar *loopVars;
|
||||
|
||||
uint32_t samplerVarCount;
|
||||
GX2SamplerVar *samplerVars;
|
||||
|
||||
uint32_t attribVarCount;
|
||||
GX2AttribVar *attribVars;
|
||||
|
||||
uint32_t ringItemsize;
|
||||
|
||||
BOOL hasStreamOut;
|
||||
uint32_t streamOutStride[4];
|
||||
|
||||
GX2RBuffer gx2rBuffer;
|
||||
} GX2VertexShader;
|
||||
|
||||
typedef struct GX2PixelShader
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t sq_pgm_resources_ps;
|
||||
uint32_t sq_pgm_exports_ps;
|
||||
uint32_t spi_ps_in_control_0;
|
||||
uint32_t spi_ps_in_control_1;
|
||||
uint32_t num_spi_ps_input_cntl;
|
||||
uint32_t spi_ps_input_cntls[32];
|
||||
uint32_t cb_shader_mask;
|
||||
uint32_t cb_shader_control;
|
||||
uint32_t db_shader_control;
|
||||
uint32_t spi_input_z;
|
||||
} regs;
|
||||
|
||||
uint32_t size;
|
||||
uint8_t *program;
|
||||
GX2ShaderMode mode;
|
||||
|
||||
uint32_t uniformBlockCount;
|
||||
GX2UniformBlock *uniformBlocks;
|
||||
|
||||
uint32_t uniformVarCount;
|
||||
GX2UniformVar *uniformVars;
|
||||
|
||||
uint32_t initialValueCount;
|
||||
GX2UniformInitialValue *initialValues;
|
||||
|
||||
uint32_t loopVarCount;
|
||||
GX2LoopVar *loopVars;
|
||||
|
||||
uint32_t samplerVarCount;
|
||||
GX2SamplerVar *samplerVars;
|
||||
|
||||
GX2RBuffer gx2rBuffer;
|
||||
} GX2PixelShader;
|
||||
|
||||
typedef struct GX2GeometryShader
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t sq_pgm_resources_gs;
|
||||
uint32_t vgt_gs_out_prim_type;
|
||||
uint32_t vgt_gs_mode;
|
||||
uint32_t pa_cl_vs_out_cntl;
|
||||
uint32_t sq_pgm_resources_vs;
|
||||
uint32_t sq_gs_vert_itemsize;
|
||||
uint32_t spi_vs_out_config;
|
||||
uint32_t num_spi_vs_out_id;
|
||||
uint32_t spi_vs_out_id[10];
|
||||
uint32_t vgt_strmout_buffer_en;
|
||||
} regs;
|
||||
|
||||
uint32_t size;
|
||||
uint8_t *program;
|
||||
uint32_t vertexProgramSize;
|
||||
uint8_t *vertexProgram;
|
||||
GX2ShaderMode mode;
|
||||
|
||||
uint32_t uniformBlockCount;
|
||||
GX2UniformBlock *uniformBlocks;
|
||||
|
||||
uint32_t uniformVarCount;
|
||||
GX2UniformVar *uniformVars;
|
||||
|
||||
uint32_t initialValueCount;
|
||||
GX2UniformInitialValue *initialValues;
|
||||
|
||||
uint32_t loopVarCount;
|
||||
GX2LoopVar *loopVars;
|
||||
|
||||
uint32_t samplerVarCount;
|
||||
GX2SamplerVar *samplerVars;
|
||||
|
||||
uint32_t ringItemSize;
|
||||
BOOL hasStreamOut;
|
||||
uint32_t streamOutStride[4];
|
||||
|
||||
GX2RBuffer gx2rBuffer;
|
||||
} GX2GeometryShader;
|
||||
|
||||
typedef struct GX2AttribStream
|
||||
{
|
||||
uint32_t location;
|
||||
uint32_t buffer;
|
||||
uint32_t offset;
|
||||
GX2AttribFormat format;
|
||||
GX2AttribIndexType type;
|
||||
uint32_t aluDivisor;
|
||||
uint32_t mask;
|
||||
GX2EndianSwapMode endianSwap;
|
||||
} GX2AttribStream;
|
||||
|
||||
uint32_t GX2CalcGeometryShaderInputRingBufferSize(uint32_t ringItemSize);
|
||||
uint32_t GX2CalcGeometryShaderOutputRingBufferSize(uint32_t ringItemSize);
|
||||
|
||||
uint32_t GX2CalcFetchShaderSizeEx(uint32_t attribs, GX2FetchShaderType fetchShaderType,
|
||||
GX2TessellationMode tesellationMode);
|
||||
|
||||
void GX2InitFetchShaderEx(GX2FetchShader *fetchShader, uint8_t *buffer, uint32_t attribCount,
|
||||
GX2AttribStream *attribs, GX2FetchShaderType type, GX2TessellationMode tessMode);
|
||||
|
||||
void GX2SetFetchShader(GX2FetchShader *shader);
|
||||
void GX2SetVertexShader(GX2VertexShader *shader);
|
||||
void GX2SetPixelShader(GX2PixelShader *shader);
|
||||
void GX2SetGeometryShader(GX2GeometryShader *shader);
|
||||
|
||||
void GX2SetVertexSampler(GX2Sampler *sampler, uint32_t id);
|
||||
void GX2SetPixelSampler(GX2Sampler *sampler, uint32_t id);
|
||||
void GX2SetGeometrySampler(GX2Sampler *sampler, uint32_t id);
|
||||
void GX2SetVertexUniformReg(uint32_t offset, uint32_t count, uint32_t *data);
|
||||
void GX2SetPixelUniformReg(uint32_t offset, uint32_t count, uint32_t *data);
|
||||
void GX2SetVertexUniformBlock(uint32_t location, uint32_t size, const void *data);
|
||||
void GX2SetPixelUniformBlock(uint32_t location, uint32_t size, const void *data);
|
||||
void GX2SetGeometryUniformBlock(uint32_t location, uint32_t size, const void *data);
|
||||
|
||||
void GX2SetShaderModeEx(GX2ShaderMode mode,
|
||||
uint32_t numVsGpr, uint32_t numVsStackEntries,
|
||||
uint32_t numGsGpr, uint32_t numGsStackEntries,
|
||||
uint32_t numPsGpr, uint32_t numPsStackEntries);
|
||||
|
||||
void GX2SetStreamOutEnable(BOOL enable);
|
||||
void GX2SetGeometryShaderInputRingBuffer(void *buffer, uint32_t size);
|
||||
void GX2SetGeometryShaderOutputRingBuffer(void *buffer, uint32_t size);
|
||||
|
||||
uint32_t GX2GetPixelShaderGPRs(GX2PixelShader *shader);
|
||||
uint32_t GX2GetPixelShaderStackEntries(GX2PixelShader *shader);
|
||||
uint32_t GX2GetVertexShaderGPRs(GX2VertexShader *shader);
|
||||
uint32_t GX2GetVertexShaderStackEntries(GX2VertexShader *shader);
|
||||
uint32_t GX2GetGeometryShaderGPRs(GX2GeometryShader *shader);
|
||||
uint32_t GX2GetGeometryShaderStackEntries(GX2GeometryShader *shader);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2Init(uint32_t *attributes);
|
||||
void GX2Shutdown();
|
||||
void GX2Flush();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,78 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct GX2Surface
|
||||
{
|
||||
GX2SurfaceDim dim;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t depth;
|
||||
uint32_t mipLevels;
|
||||
GX2SurfaceFormat format;
|
||||
GX2AAMode aa;
|
||||
GX2SurfaceUse use;
|
||||
uint32_t imageSize;
|
||||
void *image;
|
||||
uint32_t mipmapSize;
|
||||
void *mipmaps;
|
||||
GX2TileMode tileMode;
|
||||
uint32_t swizzle;
|
||||
uint32_t alignment;
|
||||
uint32_t pitch;
|
||||
uint32_t mipLevelOffset[13];
|
||||
} GX2Surface;
|
||||
|
||||
typedef struct GX2DepthBuffer
|
||||
{
|
||||
GX2Surface surface;
|
||||
uint32_t viewMip;
|
||||
uint32_t viewFirstSlice;
|
||||
uint32_t viewNumSlices;
|
||||
void *hiZPtr;
|
||||
uint32_t hiZSize;
|
||||
float depthClear;
|
||||
uint32_t stencilClear;
|
||||
uint32_t regs[7];
|
||||
} GX2DepthBuffer;
|
||||
|
||||
typedef struct GX2ColorBuffer
|
||||
{
|
||||
GX2Surface surface;
|
||||
uint32_t viewMip;
|
||||
uint32_t viewFirstSlice;
|
||||
uint32_t viewNumSlices;
|
||||
void *aaBuffer;
|
||||
uint32_t aaSize;
|
||||
uint32_t regs[5];
|
||||
} GX2ColorBuffer;
|
||||
|
||||
void GX2CalcSurfaceSizeAndAlignment(GX2Surface *surface);
|
||||
void GX2CalcDepthBufferHiZInfo(GX2DepthBuffer *depthBuffer, uint32_t *outSize, uint32_t *outAlignment);
|
||||
void GX2CalcColorBufferAuxInfo(GX2ColorBuffer *surface, uint32_t *outSize, uint32_t *outAlignment);
|
||||
void GX2SetColorBuffer(GX2ColorBuffer *colorBuffer, GX2RenderTarget target);
|
||||
void GX2SetDepthBuffer(GX2DepthBuffer *depthBuffer);
|
||||
void GX2InitColorBufferRegs(GX2ColorBuffer *colorBuffer);
|
||||
void GX2InitDepthBufferRegs(GX2DepthBuffer *depthBuffer);
|
||||
void GX2InitDepthBufferHiZEnable(GX2DepthBuffer *depthBuffer, BOOL enable);
|
||||
|
||||
uint32_t GX2GetSurfaceSwizzle(GX2Surface *surface);
|
||||
void GX2SetSurfaceSwizzle(GX2Surface *surface, uint32_t swizzle);
|
||||
void GX2CopySurface(GX2Surface *src, uint32_t srcLevel, uint32_t srcDepth, GX2Surface *dst, uint32_t dstLevel,
|
||||
uint32_t dstDepth);
|
||||
void GX2ClearColor(GX2ColorBuffer *colorBuffer, float red, float green, float blue, float alpha);
|
||||
void GX2ClearDepthStencilEx(GX2DepthBuffer *depthBuffer, float depth, uint8_t stencil, GX2ClearFlags clearMode);
|
||||
void GX2ClearBuffersEx(GX2ColorBuffer *colorBuffer, GX2DepthBuffer *depthBuffer,
|
||||
float red, float green, float blue, float alpha, float depth,
|
||||
uint8_t stencil, GX2ClearFlags clearMode);
|
||||
void GX2SetClearDepth(GX2DepthBuffer *depthBuffer, float depth);
|
||||
void GX2SetClearStencil(GX2DepthBuffer *depthBuffer, uint8_t stencil);
|
||||
void GX2SetClearDepthStencil(GX2DepthBuffer *depthBuffer, float depth, uint8_t stencil);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
#include "surface.h"
|
||||
#include "texture.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2CopyColorBufferToScanBuffer(GX2ColorBuffer *buffer, GX2ScanTarget scanTarget);
|
||||
void GX2SwapScanBuffers();
|
||||
BOOL GX2GetLastFrame(GX2ScanTarget scanTarget, GX2Texture *texture);
|
||||
BOOL GX2GetLastFrameGamma(GX2ScanTarget scanTarget, float *gammaOut);
|
||||
uint32_t GX2GetSwapInterval();
|
||||
void GX2SetSwapInterval(uint32_t interval);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "enum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2SetTessellation(GX2TessellationMode tessellationMode, GX2PrimitiveMode primitiveMode, GX2IndexType indexType);
|
||||
void GX2SetMinTessellationLevel(float min);
|
||||
void GX2SetMaxTessellationLevel(float max);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "surface.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GX2Surface surface;
|
||||
uint32_t viewFirstMip;
|
||||
uint32_t viewNumMips;
|
||||
uint32_t viewFirstSlice;
|
||||
uint32_t viewNumSlices;
|
||||
uint32_t compMap;
|
||||
uint32_t regs[5];
|
||||
}GX2Texture;
|
||||
|
||||
void GX2InitTextureRegs(GX2Texture *texture);
|
||||
void GX2SetPixelTexture(GX2Texture *texture, uint32_t unit);
|
||||
void GX2SetVertexTexture(GX2Texture *texture, uint32_t unit);
|
||||
void GX2SetGeometryTexture(GX2Texture *texture, uint32_t unit);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <wiiu/gx2r/buffer.h>
|
||||
#include <wiiu/gx2r/displaylist.h>
|
||||
#include <wiiu/gx2r/draw.h>
|
||||
#include <wiiu/gx2r/mem.h>
|
||||
#include <wiiu/gx2r/resource.h>
|
||||
#include <wiiu/gx2r/surface.h>
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "resource.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GX2RResourceFlags flags;
|
||||
uint32_t elemSize;
|
||||
uint32_t elemCount;
|
||||
void *buffer;
|
||||
} GX2RBuffer;
|
||||
|
||||
BOOL X2RBufferExists(GX2RBuffer *buffer);
|
||||
BOOL X2RCreateBuffer(GX2RBuffer *buffer);
|
||||
BOOL GX2RCreateBufferUserMemory(GX2RBuffer *buffer, void *memory, uint32_t size);
|
||||
void GX2RDestroyBufferEx(GX2RBuffer *buffer, GX2RResourceFlags flags);
|
||||
uint32_t GX2RGetBufferAlignment(GX2RResourceFlags flags);
|
||||
uint32_t GX2RGetBufferAllocationSize(GX2RBuffer *buffer);
|
||||
void GX2RInvalidateBuffer(GX2RBuffer *buffer, GX2RResourceFlags flags);
|
||||
void *GX2RLockBufferEx(GX2RBuffer *buffer, GX2RResourceFlags flags);
|
||||
void GX2RUnlockBufferEx(GX2RBuffer *buffer, GX2RResourceFlags flags);
|
||||
void GX2RSetVertexUniformBlock(GX2RBuffer *buffer, uint32_t location, uint32_t offset);
|
||||
void GX2RSetPixelUniformBlock(GX2RBuffer *buffer, uint32_t location, uint32_t offset);
|
||||
void GX2RSetGeometryUniformBlock(GX2RBuffer *buffer, uint32_t location, uint32_t offset);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "resource.h"
|
||||
#include "buffer.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2RBeginDisplayListEx(GX2RBuffer *displayList, uint32_t unknown, GX2RResourceFlags flags);
|
||||
uint32_t GX2REndDisplayList(GX2RBuffer *displayList);
|
||||
void GX2RCallDisplayList(GX2RBuffer *displayList, uint32_t size);
|
||||
void GX2RDirectCallDisplayList(GX2RBuffer *displayList, uint32_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include <gx2/enum.h>
|
||||
#include "resource.h"
|
||||
#include "buffer.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void GX2RSetAttributeBuffer(GX2RBuffer *buffer, uint32_t index, uint32_t stride, uint32_t offset);
|
||||
void GX2RDrawIndexed(GX2PrimitiveMode mode, GX2RBuffer *buffer, GX2IndexType indexType, uint32_t count,
|
||||
uint32_t indexOffset, uint32_t vertexOffset, uint32_t numInstances);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "resource.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *(*GX2RAllocFunction)(GX2RResourceFlags, uint32_t, uint32_t);
|
||||
typedef void (*GX2RFreeFunction)(GX2RResourceFlags, void *);
|
||||
|
||||
void GX2RInvalidateMemory(GX2RResourceFlags flags, void *buffer, uint32_t size);
|
||||
BOOL GX2RIsUserMemory(GX2RResourceFlags flags);
|
||||
void GX2RSetAllocator(GX2RAllocFunction allocFn, GX2RFreeFunction freeFn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GX2R_RESOURCE_BIND_TEXTURE = 1 << 0,
|
||||
GX2R_RESOURCE_BIND_COLOR_BUFFER = 1 << 1,
|
||||
GX2R_RESOURCE_BIND_DEPTH_BUFFER = 1 << 2,
|
||||
GX2R_RESOURCE_BIND_SCAN_BUFFER = 1 << 3,
|
||||
GX2R_RESOURCE_BIND_VERTEX_BUFFER = 1 << 4,
|
||||
GX2R_RESOURCE_BIND_INDEX_BUFFER = 1 << 5,
|
||||
GX2R_RESOURCE_BIND_UNIFORM_BLOCK = 1 << 6,
|
||||
GX2R_RESOURCE_BIND_SHADER_PROGRAM = 1 << 7,
|
||||
GX2R_RESOURCE_BIND_STREAM_OUTPUT = 1 << 8,
|
||||
GX2R_RESOURCE_BIND_DISPLAY_LIST = 1 << 9,
|
||||
GX2R_RESOURCE_BIND_GS_RING_BUFFER = 1 << 10,
|
||||
|
||||
GX2R_RESOURCE_USAGE_CPU_READ = 1 << 11,
|
||||
GX2R_RESOURCE_USAGE_CPU_WRITE = 1 << 12,
|
||||
GX2R_RESOURCE_USAGE_GPU_READ = 1 << 13,
|
||||
GX2R_RESOURCE_USAGE_GPU_WRITE = 1 << 14,
|
||||
GX2R_RESOURCE_USAGE_DMA_READ = 1 << 15,
|
||||
GX2R_RESOURCE_USAGE_DMA_WRITE = 1 << 16,
|
||||
GX2R_RESOURCE_USAGE_FORCE_MEM1 = 1 << 17,
|
||||
GX2R_RESOURCE_USAGE_FORCE_MEM2 = 1 << 18,
|
||||
|
||||
GX2R_RESOURCE_DISABLE_CPU_INVALIDATE = 1 << 20,
|
||||
GX2R_RESOURCE_DISABLE_GPU_INVALIDATE = 1 << 21,
|
||||
|
||||
GX2R_RESOURCE_LOCKED_READ_ONLY = 1 << 22,
|
||||
GX2R_RESOURCE_USER_MEMORY = 1 << 29,
|
||||
GX2R_RESOURCE_LOCKED = 1 << 30,
|
||||
} GX2RResourceFlags;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include <gx2/surface.h>
|
||||
#include "resource.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool GX2RCreateSurface(GX2Surface *surface, GX2RResourceFlags flags);
|
||||
bool GX2RCreateSurfaceUserMemory(GX2Surface *surface, uint8_t *image, uint8_t *mipmap, GX2RResourceFlags flags);
|
||||
void GX2RDestroySurfaceEx(GX2Surface *surface, GX2RResourceFlags flags);
|
||||
void GX2RInvalidateSurface(GX2Surface *surface, int32_t level, GX2RResourceFlags flags);
|
||||
void *GX2RLockSurfaceEx(GX2Surface *surface, int32_t level, GX2RResourceFlags flags);
|
||||
void GX2RUnlockSurfaceEx(GX2Surface *surface, int32_t level, GX2RResourceFlags flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int IOS_Open(char *path, u32 mode);
|
||||
int IOS_Close(int fd);
|
||||
int IOS_Ioctl(int fd, u32 request, void *input_buffer, u32 input_buffer_len, void *output_buffer, u32 output_buffer_len);
|
||||
int IOS_IoctlAsync(int fd, u32 request, void *input_buffer, u32 input_buffer_len, void *output_buffer, u32 output_buffer_len, void *cb, void *cbarg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,59 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <wiiu/types.h>
|
||||
#include <wiiu/wpad.h>
|
||||
|
||||
typedef struct _KPADData
|
||||
{
|
||||
u32 btns_h;
|
||||
u32 btns_d;
|
||||
u32 btns_r;
|
||||
u32 unused_1[5];
|
||||
f32 pos_x;
|
||||
f32 pos_y;
|
||||
u32 unused_2[3];
|
||||
f32 angle_x;
|
||||
f32 angle_y;
|
||||
u32 unused_3[8];
|
||||
u8 device_type;
|
||||
u8 wpad_error;
|
||||
u8 pos_valid;
|
||||
u8 unused_4[1];
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
f32 stick_x;
|
||||
f32 stick_y;
|
||||
} nunchuck;
|
||||
|
||||
struct
|
||||
{
|
||||
u32 btns_h;
|
||||
u32 btns_d;
|
||||
u32 btns_r;
|
||||
f32 lstick_x;
|
||||
f32 lstick_y;
|
||||
f32 rstick_x;
|
||||
f32 rstick_y;
|
||||
f32 ltrigger;
|
||||
f32 rtrigger;
|
||||
} classic;
|
||||
|
||||
u32 unused_6[20];
|
||||
};
|
||||
u32 unused_7[16];
|
||||
} KPADData;
|
||||
|
||||
|
||||
void KPADInit (void);
|
||||
s32 KPADRead(s32 chan, void * data, u32 size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,61 @@
|
|||
#pragma once
|
||||
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum MCPInstallTarget
|
||||
{
|
||||
MCP_INSTALL_TARGET_MLC = 0,
|
||||
MCP_INSTALL_TARGET_USB = 1,
|
||||
} MCPInstallTarget;
|
||||
|
||||
typedef struct __attribute__((__packed__))
|
||||
{
|
||||
uint32_t inProgress;
|
||||
uint64_t tid;
|
||||
uint64_t sizeTotal;
|
||||
uint64_t sizeProgress;
|
||||
uint32_t contentsTotal;
|
||||
uint32_t contentsProgress;
|
||||
}MCPInstallProgress;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char buffer[0x27F];
|
||||
} MCPInstallInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char buffer[0x27F];
|
||||
}MCPInstallTitleInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[0x31B];
|
||||
}MCPDevice;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MCPDevice devices[32];
|
||||
}MCPDeviceList;
|
||||
|
||||
int MCP_Open();
|
||||
int MCP_Close(int handle);
|
||||
int MCP_InstallSetTargetDevice(int handle, MCPInstallTarget device);
|
||||
int MCP_InstallGetTargetDevice(int handle, MCPInstallTarget *deviceOut);
|
||||
int MCP_InstallSetTargetUsb(int handle, int usb);
|
||||
int MCP_InstallGetInfo(int handle, char *path, MCPInstallInfo *out);
|
||||
int MCP_InstallTitleAsync(int handle, char *path, MCPInstallTitleInfo *out);
|
||||
int MCP_InstallGetProgress(int handle, MCPInstallProgress *installProgressOut);
|
||||
int MCP_InstallTitleAbort(int handle);
|
||||
int MCP_UninstallTitleAsync(int handle, char *path, MCPInstallTitleInfo *out);
|
||||
int MCP_DeviceList(int handle, int *numDevices, MCPDeviceList *outDevices, uint32_t outBufferSize);
|
||||
int MCP_FullDeviceList(int handle, int *numDevices, MCPDeviceList *outDevices,
|
||||
uint32_t outBufferSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <wiiu/mem/baseheap.h>
|
||||
#include <wiiu/mem/blockheap.h>
|
||||
#include <wiiu/mem/expandedheap.h>
|
||||
#include <wiiu/mem/frameheap.h>
|
||||
#include <wiiu/mem/memheap.h>
|
||||
#include <wiiu/mem/memlist.h>
|
||||
#include <wiiu/mem/unitheap.h>
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *MEMHeapHandle;
|
||||
|
||||
typedef enum MEMBaseHeapType
|
||||
{
|
||||
MEM_BASE_HEAP_MEM1 = 0,
|
||||
MEM_BASE_HEAP_MEM2 = 1,
|
||||
MEM_BASE_HEAP_FG = 8,
|
||||
} MEMBaseHeapType;
|
||||
|
||||
MEMBaseHeapType MEMGetArena(MEMHeapHandle handle);
|
||||
MEMHeapHandle MEMGetBaseHeapHandle(MEMBaseHeapType type);
|
||||
MEMHeapHandle MEMSetBaseHeapHandle(MEMBaseHeapType type, MEMHeapHandle handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,74 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "memheap.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct MEMBlockHeapBlock MEMBlockHeapBlock;
|
||||
typedef struct MEMBlockHeapTracking MEMBlockHeapTracking;
|
||||
typedef struct MEMBlockHeap MEMBlockHeap;
|
||||
|
||||
typedef struct MEMBlockHeapTracking
|
||||
{
|
||||
uint32_t __unknown0;
|
||||
uint32_t __unknown1;
|
||||
MEMBlockHeapBlock *blocks;
|
||||
uint32_t blockCount;
|
||||
} MEMBlockHeapTracking;
|
||||
|
||||
typedef struct MEMBlockHeapBlock
|
||||
{
|
||||
void *start;
|
||||
void *end;
|
||||
BOOL isFree;
|
||||
MEMBlockHeapBlock *prev;
|
||||
MEMBlockHeapBlock *next;
|
||||
} MEMBlockHeapBlock;
|
||||
|
||||
typedef struct MEMBlockHeap
|
||||
{
|
||||
MEMHeapHeader header;
|
||||
MEMBlockHeapTracking defaultTrack;
|
||||
MEMBlockHeapBlock defaultBlock;
|
||||
MEMBlockHeapBlock *firstBlock;
|
||||
MEMBlockHeapBlock *lastBlock;
|
||||
MEMBlockHeapBlock *firstFreeBlock;
|
||||
uint32_t numFreeBlocks;
|
||||
} MEMBlockHeap;
|
||||
|
||||
MEMBlockHeap *MEMInitBlockHeap(MEMBlockHeap *heap,
|
||||
void *start,
|
||||
void *end,
|
||||
MEMBlockHeapTracking *blocks,
|
||||
uint32_t size,
|
||||
uint32_t flags);
|
||||
|
||||
void *MEMDestroyBlockHeap(MEMBlockHeap *heap);
|
||||
|
||||
int MEMAddBlockHeapTracking(MEMBlockHeap *heap,
|
||||
MEMBlockHeapTracking *tracking,
|
||||
uint32_t size);
|
||||
|
||||
void *MEMAllocFromBlockHeapAt(MEMBlockHeap *heap,
|
||||
void *addr,
|
||||
uint32_t size);
|
||||
|
||||
void *MEMAllocFromBlockHeapEx(MEMBlockHeap *heap,
|
||||
uint32_t size,
|
||||
int32_t align);
|
||||
|
||||
void MEMFreeToBlockHeap(MEMBlockHeap *heap,
|
||||
void *data);
|
||||
|
||||
uint32_t MEMGetAllocatableSizeForBlockHeapEx(MEMBlockHeap *heap,
|
||||
int32_t align);
|
||||
|
||||
uint32_t MEMGetTrackingLeftInBlockHeap(MEMBlockHeap *heap);
|
||||
|
||||
uint32_t MEMGetTotalFreeSizeForBlockHeap(MEMBlockHeap *heap);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,65 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "memheap.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum MEMExpandedHeapMode
|
||||
{
|
||||
MEM_EXP_HEAP_MODE_FIRST_FREE = 0,
|
||||
MEM_EXP_HEAP_MODE_NEAREST_SIZE = 1,
|
||||
} MEMExpandedHeapMode;
|
||||
|
||||
typedef enum MEMExpandedHeapDirection
|
||||
{
|
||||
MEM_EXP_HEAP_DIR_FROM_TOP = 0,
|
||||
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
|
||||
} MEMExpandedHeapDirection;
|
||||
|
||||
typedef struct MEMExpandedHeapBlock MEMExpandedHeapBlock;
|
||||
struct MEMExpandedHeapBlock
|
||||
{
|
||||
uint32_t attribs;
|
||||
uint32_t blockSize;
|
||||
MEMExpandedHeapBlock *prev;
|
||||
MEMExpandedHeapBlock *next;
|
||||
uint16_t tag;
|
||||
uint16_t __unknown;
|
||||
};
|
||||
|
||||
typedef struct MEMExpandedHeapBlockList
|
||||
{
|
||||
MEMExpandedHeapBlock *head;
|
||||
MEMExpandedHeapBlock *tail;
|
||||
}MEMExpandedHeapBlockList;
|
||||
|
||||
typedef struct MEMExpandedHeap
|
||||
{
|
||||
MEMHeapHeader header;
|
||||
MEMExpandedHeapBlockList freeList;
|
||||
MEMExpandedHeapBlockList usedList;
|
||||
uint16_t groupId;
|
||||
uint16_t attribs;
|
||||
}MEMExpandedHeap;
|
||||
|
||||
MEMExpandedHeap *MEMCreateExpHeapEx(MEMExpandedHeap *heap, uint32_t size, uint16_t flags);
|
||||
MEMExpandedHeap *MEMDestroyExpHeap(MEMExpandedHeap *heap);
|
||||
void *MEMAllocFromExpHeapEx(MEMExpandedHeap *heap, uint32_t size, int alignment);
|
||||
void MEMFreeToExpHeap(MEMExpandedHeap *heap, uint8_t *block);
|
||||
MEMExpandedHeapMode MEMSetAllocModeForExpHeap(MEMExpandedHeap *heap, MEMExpandedHeapMode mode);
|
||||
MEMExpandedHeapMode MEMGetAllocModeForExpHeap(MEMExpandedHeap *heap);
|
||||
uint32_t MEMAdjustExpHeap(MEMExpandedHeap *heap);
|
||||
uint32_t MEMResizeForMBlockExpHeap(MEMExpandedHeap *heap, uint8_t *address, uint32_t size);
|
||||
uint32_t MEMGetTotalFreeSizeForExpHeap(MEMExpandedHeap *heap);
|
||||
uint32_t MEMGetAllocatableSizeForExpHeapEx(MEMExpandedHeap *heap, int alignment);
|
||||
uint16_t MEMSetGroupIDForExpHeap(MEMExpandedHeap *heap, uint16_t id);
|
||||
uint16_t MEMGetGroupIDForExpHeap(MEMExpandedHeap *heap);
|
||||
uint32_t MEMGetSizeForMBlockExpHeap(uint8_t *addr);
|
||||
uint16_t MEMGetGroupIDForMBlockExpHeap(uint8_t *addr);
|
||||
MEMExpandedHeapDirection MEMGetAllocDirForMBlockExpHeap(uint8_t *addr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "memheap.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum MEMFrameHeapFreeMode
|
||||
{
|
||||
MEM_FRAME_HEAP_FREE_HEAD = 1 << 0,
|
||||
MEM_FRAME_HEAP_FREE_TAIL = 1 << 1,
|
||||
MEM_FRAME_HEAP_FREE_ALL = MEM_FRAME_HEAP_FREE_HEAD | MEM_FRAME_HEAP_FREE_TAIL,
|
||||
} MEMFrameHeapFreeMode;
|
||||
|
||||
typedef struct MEMFrameHeapState
|
||||
{
|
||||
uint32_t tag;
|
||||
void *head;
|
||||
void *tail;
|
||||
struct MEMFrameHeapState *previous;
|
||||
} MEMFrameHeapState;
|
||||
|
||||
typedef struct MEMFrameHeap
|
||||
{
|
||||
MEMHeapHeader header;
|
||||
void *head;
|
||||
void *tail;
|
||||
MEMFrameHeapState *previousState;
|
||||
} MEMFrameHeap;
|
||||
|
||||
MEMFrameHeap *MEMCreateFrmHeapEx(void *heap, uint32_t size, uint32_t flags);
|
||||
void *MEMDestroyFrmHeap(MEMFrameHeap *heap);
|
||||
void *MEMAllocFromFrmHeapEx(MEMFrameHeap *heap, uint32_t size, int alignment);
|
||||
void MEMFreeToFrmHeap(MEMFrameHeap *heap, MEMFrameHeapFreeMode mode);
|
||||
BOOL MEMRecordStateForFrmHeap(MEMFrameHeap *heap, uint32_t tag);
|
||||
BOOL MEMFreeByStateToFrmHeap(MEMFrameHeap *heap, uint32_t tag);
|
||||
uint32_t MEMAdjustFrmHeap(MEMFrameHeap *heap);
|
||||
uint32_t MEMResizeForMBlockFrmHeap(MEMFrameHeap *heap, uint32_t addr, uint32_t size);
|
||||
uint32_t MEMGetAllocatableSizeForFrmHeapEx(MEMFrameHeap *heap, int alignment);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,81 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include <wiiu/os/spinlock.h>
|
||||
#include "memlist.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum MEMHeapFillType
|
||||
{
|
||||
MEM_HEAP_FILL_TYPE_UNUSED = 0,
|
||||
MEM_HEAP_FILL_TYPE_ALLOCATED = 1,
|
||||
MEM_HEAP_FILL_TYPE_FREED = 2,
|
||||
} MEMHeapFillType;
|
||||
|
||||
typedef enum MEMHeapTag
|
||||
{
|
||||
MEM_BLOCK_HEAP_TAG = 0x424C4B48u,
|
||||
MEM_EXPANDED_HEAP_TAG = 0x45585048u,
|
||||
MEM_FRAME_HEAP_TAG = 0x46524D48u,
|
||||
MEM_UNIT_HEAP_TAG = 0x554E5448u,
|
||||
MEM_USER_HEAP_TAG = 0x55535248u,
|
||||
} MEMHeapTag;
|
||||
|
||||
typedef enum MEMHeapFlags
|
||||
{
|
||||
MEM_HEAP_FLAG_ZERO_ALLOCATED = 1 << 0,
|
||||
MEM_HEAP_FLAG_DEBUG_MODE = 1 << 1,
|
||||
MEM_HEAP_FLAG_USE_LOCK = 1 << 2,
|
||||
} MEMHeapFlags;
|
||||
|
||||
typedef struct MEMHeapHeader
|
||||
{
|
||||
//! Tag indicating which type of heap this is
|
||||
MEMHeapTag tag;
|
||||
|
||||
//! Link for list this heap is in
|
||||
MEMMemoryLink link;
|
||||
|
||||
//! List of all child heaps in this heap
|
||||
MEMMemoryList list;
|
||||
|
||||
//! Pointer to start of allocatable memory
|
||||
void *dataStart;
|
||||
|
||||
//! Pointer to end of allocatable memory
|
||||
void *dataEnd;
|
||||
|
||||
//! Lock used when MEM_HEAP_FLAG_USE_LOCK is set.
|
||||
OSSpinLock lock;
|
||||
|
||||
//! Flags set during heap creation.
|
||||
uint32_t flags;
|
||||
|
||||
uint32_t __unknown[0x3];
|
||||
} MEMHeapHeader;
|
||||
|
||||
/**
|
||||
* Print details about heap to COSWarn
|
||||
*/
|
||||
void MEMDumpHeap(MEMHeapHeader *heap);
|
||||
|
||||
/**
|
||||
* Find heap which contains a memory block.
|
||||
*/
|
||||
MEMHeapHeader *MEMFindContainHeap(void *block);
|
||||
|
||||
/**
|
||||
* Get the data fill value used when MEM_HEAP_FLAG_DEBUG_MODE is set.
|
||||
*/
|
||||
uint32_t MEMGetFillValForHeap(MEMHeapFillType type);
|
||||
|
||||
/**
|
||||
* Set the data fill value used when MEM_HEAP_FLAG_DEBUG_MODE is set.
|
||||
*/
|
||||
void MEMSetFillValForHeap(MEMHeapFillType type, uint32_t value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct MEMMemoryLink
|
||||
{
|
||||
void *prev;
|
||||
void *next;
|
||||
} MEMMemoryLink;
|
||||
|
||||
typedef struct MEMMemoryList
|
||||
{
|
||||
void *head;
|
||||
void *tail;
|
||||
uint16_t count;
|
||||
uint16_t offsetToMemoryLink;
|
||||
} MEMMemoryList;
|
||||
|
||||
void MEMInitList(MEMMemoryList *list, uint16_t offsetToMemoryLink);
|
||||
void MEMAppendListObject(MEMMemoryList *list, void *object);
|
||||
void MEMPrependListObject(MEMMemoryList *list, void *object);
|
||||
void MEMInsertListObject(MEMMemoryList *list, void *before, void *object);
|
||||
void MEMRemoveListObject(MEMMemoryList *list, void *object);
|
||||
void *MEMGetNextListObject(MEMMemoryList *list, void *object);
|
||||
void *MEMGetPrevListObject(MEMMemoryList *list, void *object);
|
||||
void *MEMGetNthListObject(MEMMemoryList *list, uint16_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "memheap.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct MEMUnitHeapFreeBlock
|
||||
{
|
||||
struct MEMUnitHeapFreeBlock *next;
|
||||
} MEMUnitHeapFreeBlock;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MEMHeapHeader header;
|
||||
MEMUnitHeapFreeBlock *freeBlocks;
|
||||
uint32_t blockSize;
|
||||
} MEMUnitHeap;
|
||||
|
||||
MEMUnitHeap *MEMCreateUnitHeapEx(MEMUnitHeap *heap, uint32_t size, uint32_t blockSize,
|
||||
int32_t alignment, uint16_t flags);
|
||||
void *MEMDestroyUnitHeap(MEMUnitHeap *heap);
|
||||
void *MEMAllocFromUnitHeap(MEMUnitHeap *heap);
|
||||
void MEMFreeToUnitHeap(MEMUnitHeap *heap, void *block);
|
||||
void MEMiDumpUnitHeap(MEMUnitHeap *heap);
|
||||
uint32_t MEMCountFreeBlockForUnitHeap(MEMUnitHeap *heap);
|
||||
uint32_t MEMCalcHeapSizeForUnitHeap(uint32_t blockSize, uint32_t count, int32_t alignment);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,111 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include <wiiu/os/time.h>
|
||||
#include <wiiu/os/spinlock.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MP_TASK_STATE_INITIALISED = 1 << 0,
|
||||
MP_TASK_STATE_READY = 1 << 1,
|
||||
MP_TASK_STATE_RUNNING = 1 << 2,
|
||||
MP_TASK_STATE_FINISHED = 1 << 3,
|
||||
} MPTaskState;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MP_TASK_QUEUE_STATE_INITIALISED = 1 << 0,
|
||||
MP_TASK_QUEUE_STATE_READY = 1 << 1,
|
||||
MP_TASK_QUEUE_STATE_STOPPING = 1 << 2,
|
||||
MP_TASK_QUEUE_STATE_STOPPED = 1 << 3,
|
||||
MP_TASK_QUEUE_STATE_FINISHED = 1 << 4,
|
||||
} MPTaskQueueState;
|
||||
|
||||
|
||||
typedef uint32_t (*MPTaskFunc)(uint32_t, uint32_t);
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct
|
||||
{
|
||||
MPTaskState state;
|
||||
uint32_t result;
|
||||
uint32_t coreID;
|
||||
OSTime duration;
|
||||
} MPTaskInfo;
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef struct MPTask MPTask;
|
||||
typedef struct MPTaskQueue MPTaskQueue;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct MPTask
|
||||
{
|
||||
MPTask *self;
|
||||
MPTaskQueue *queue;
|
||||
MPTaskState state;
|
||||
MPTaskFunc func;
|
||||
uint32_t userArg1;
|
||||
uint32_t userArg2;
|
||||
uint32_t result;
|
||||
uint32_t coreID;
|
||||
OSTime duration;
|
||||
void *userData;
|
||||
}MPTask;
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MPTaskQueueState state;
|
||||
uint32_t tasks;
|
||||
uint32_t tasksReady;
|
||||
uint32_t tasksRunning;
|
||||
uint32_t tasksFinished;
|
||||
}MPTaskQueueInfo;
|
||||
|
||||
typedef struct MPTaskQueue
|
||||
{
|
||||
MPTaskQueue *self;
|
||||
MPTaskQueueState state;
|
||||
uint32_t tasks;
|
||||
uint32_t tasksReady;
|
||||
uint32_t tasksRunning;
|
||||
uint32_t __unknown0;
|
||||
uint32_t tasksFinished;
|
||||
uint32_t __unknown1;
|
||||
uint32_t __unknown2;
|
||||
uint32_t queueIndex;
|
||||
uint32_t __unknown3;
|
||||
uint32_t __unknown4;
|
||||
uint32_t queueSize;
|
||||
uint32_t __unknown5;
|
||||
MPTask **queue;
|
||||
uint32_t queueMaxSize;
|
||||
OSSpinLock lock;
|
||||
}MPTaskQueue;
|
||||
|
||||
void MPInitTaskQ(MPTaskQueue *queue, MPTask **queueBuffer, uint32_t queueBufferLen);
|
||||
BOOL MPTermTaskQ(MPTaskQueue *queue);
|
||||
BOOL MPGetTaskQInfo(MPTaskQueue *queue, MPTaskQueueInfo *info);
|
||||
BOOL MPStartTaskQ(MPTaskQueue *queue);
|
||||
BOOL MPStopTaskQ(MPTaskQueue *queue);
|
||||
BOOL MPResetTaskQ(MPTaskQueue *queue);
|
||||
BOOL MPEnqueTask(MPTaskQueue *queue, MPTask *task);
|
||||
MPTask *MPDequeTask(MPTaskQueue *queue);
|
||||
uint32_t MPDequeTasks(MPTaskQueue *queue, MPTask **queueBuffer, uint32_t queueBufferLen);
|
||||
BOOL MPWaitTaskQ(MPTaskQueue *queue, MPTaskQueueState mask);
|
||||
BOOL MPWaitTaskQWithTimeout(MPTaskQueue *queue, MPTaskQueueState wmask, OSTime timeout);
|
||||
BOOL MPPrintTaskQStats(MPTaskQueue *queue, uint32_t unk);
|
||||
void MPInitTask(MPTask *task, MPTaskFunc func, uint32_t userArg1, uint32_t userArg2);
|
||||
BOOL MPTermTask(MPTask *task);
|
||||
BOOL MPGetTaskInfo(MPTask *task, MPTaskInfo *info);
|
||||
void *MPGetTaskUserData(MPTask *task);
|
||||
void MPSetTaskUserData(MPTask *task, void *userData);
|
||||
BOOL MPRunTasksFromTaskQ(MPTaskQueue *queue, uint32_t count);
|
||||
BOOL MPRunTask(MPTask *task);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <wiiu/os/alarm.h>
|
||||
#include <wiiu/os/atomic64.h>
|
||||
#include <wiiu/os/cache.h>
|
||||
#include <wiiu/os/condition.h>
|
||||
#include <wiiu/os/core.h>
|
||||
#include <wiiu/os/coroutine.h>
|
||||
#include <wiiu/os/debug.h>
|
||||
#include <wiiu/os/dynload.h>
|
||||
#include <wiiu/os/event.h>
|
||||
#include <wiiu/os/exception.h>
|
||||
#include <wiiu/os/fastcondition.h>
|
||||
#include <wiiu/os/fastmutex.h>
|
||||
#include <wiiu/os/foreground.h>
|
||||
#include <wiiu/os/messagequeue.h>
|
||||
#include <wiiu/os/mutex.h>
|
||||
#include <wiiu/os/memory.h>
|
||||
#include <wiiu/os/rendezvous.h>
|
||||
#include <wiiu/os/screen.h>
|
||||
#include <wiiu/os/semaphore.h>
|
||||
#include <wiiu/os/spinlock.h>
|
||||
#include <wiiu/os/systeminfo.h>
|
||||
#include <wiiu/os/thread.h>
|
||||
#include <wiiu/os/time.h>
|
||||
#include <wiiu/os/title.h>
|
|
@ -0,0 +1,66 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "thread.h"
|
||||
#include "time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSAlarm OSAlarm;
|
||||
|
||||
typedef void (*OSAlarmCallback)(OSAlarm *, OSContext *);
|
||||
|
||||
#define OS_ALARM_QUEUE_TAG 0x614C6D51u
|
||||
typedef struct
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown;
|
||||
OSThreadQueue threadQueue;
|
||||
OSAlarm *head;
|
||||
OSAlarm *tail;
|
||||
} OSAlarmQueue;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
OSAlarm *prev;
|
||||
OSAlarm *next;
|
||||
} OSAlarmLink;
|
||||
|
||||
#define OS_ALARM_TAG 0x614C724Du
|
||||
typedef struct OSAlarm
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown0;
|
||||
OSAlarmCallback callback;
|
||||
uint32_t group;
|
||||
uint32_t __unknown1;
|
||||
OSTime nextFire;
|
||||
OSAlarmLink link;
|
||||
OSTime period;
|
||||
OSTime start;
|
||||
void *userData;
|
||||
uint32_t state;
|
||||
OSThreadQueue threadQueue;
|
||||
OSAlarmQueue *alarmQueue;
|
||||
OSContext *context;
|
||||
} OSAlarm;
|
||||
|
||||
void OSCreateAlarm(OSAlarm *alarm);
|
||||
void OSCreateAlarmEx(OSAlarm *alarm, const char *name);
|
||||
void OSSetAlarmUserData(OSAlarm *alarm, void *data);
|
||||
void *OSGetAlarmUserData(OSAlarm *alarm);
|
||||
void OSInitAlarmQueue(OSAlarmQueue *queue);
|
||||
void OSInitAlarmQueueEx(OSAlarmQueue *queue, const char *name);
|
||||
BOOL OSSetAlarm(OSAlarm *alarm, OSTime time, OSAlarmCallback callback);
|
||||
BOOL OSSetPeriodicAlarm(OSAlarm *alarm, OSTime start, OSTime interval, OSAlarmCallback callback);
|
||||
void OSSetAlarmTag(OSAlarm *alarm, uint32_t group);
|
||||
BOOL OSCancelAlarm(OSAlarm *alarm);
|
||||
void OSCancelAlarms(uint32_t group);
|
||||
BOOL OSWaitAlarm(OSAlarm *alarm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint64_t OSGetAtomic64(uint64_t *ptr);
|
||||
uint64_t OSSetAtomic64(uint64_t *ptr, uint64_t value);
|
||||
BOOL OSCompareAndSwapAtomic64(uint64_t *ptr, uint64_t compare, uint64_t value);
|
||||
BOOL OSCompareAndSwapAtomicEx64(uint64_t *ptr, uint64_t compare, uint64_t value, uint64_t *old);
|
||||
uint64_t OSSwapAtomic64(uint64_t *ptr, uint64_t value);
|
||||
int64_t OSAddAtomic64(int64_t *ptr, int64_t value);
|
||||
uint64_t OSAndAtomic64(uint64_t *ptr, uint64_t value);
|
||||
uint64_t OSOrAtomic64(uint64_t *ptr, uint64_t value);
|
||||
uint64_t OSXorAtomic64(uint64_t *ptr, uint64_t value);
|
||||
BOOL OSTestAndClearAtomic64(uint64_t *ptr, uint32_t bit);
|
||||
BOOL OSTestAndSetAtomic64(uint64_t *ptr, uint32_t bit);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void DCInvalidateRange(void *addr, uint32_t size); /* Equivalent to dcbi instruction. */
|
||||
void DCFlushRange(void *addr, uint32_t size); /* Equivalent to dcbf, sync, eieio. */
|
||||
void DCStoreRange(void *addr, uint32_t size); /* Equivalent to dcbst, sync, eieio. */
|
||||
void DCFlushRangeNoSync(void *addr, uint32_t size); /* Equivalent to dcbf. Does not perform sync, eieio like DCFlushRange. */
|
||||
void DCStoreRangeNoSync(void *addr, uint32_t size); /* Equivalent to dcbst. Does not perform sync, eieio like DCStoreRange. */
|
||||
void DCZeroRange(void *addr, uint32_t size); /* Equivalent to dcbz instruction. */
|
||||
void DCTouchRange(void *addr, uint32_t size); /* Equivalent to dcbt instruction. */
|
||||
void ICInvalidateRange(void *addr, uint32_t size); /* Equivalent to icbi instruction. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "mutex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OS_CONDITION_TAG 0x634E6456u
|
||||
|
||||
typedef struct OSCondition
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown;
|
||||
OSThreadQueue queue;
|
||||
}OSCondition;
|
||||
|
||||
void OSInitCond(OSCondition *condition);
|
||||
void OSInitCondEx(OSCondition *condition, const char *name);
|
||||
void OSWaitCond(OSCondition *condition, OSMutex *mutex);
|
||||
void OSSignalCond(OSCondition *condition);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint32_t OSGetCoreCount();
|
||||
uint32_t OSGetCoreId();
|
||||
uint32_t OSGetMainCoreId();
|
||||
BOOL OSIsMainCore();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSCoroutine
|
||||
{
|
||||
uint32_t nia;
|
||||
uint32_t cr;
|
||||
uint32_t ugqr1;
|
||||
uint32_t stack;
|
||||
uint32_t sda2Base;
|
||||
uint32_t sdaBase;
|
||||
uint32_t gpr[18];
|
||||
double fpr[18];
|
||||
double psr[18];
|
||||
}OSCoroutine;
|
||||
|
||||
void OSInitCoroutine(OSCoroutine *coroutine, void *entry, void *stack);
|
||||
uint32_t OSLoadCoroutine(OSCoroutine *coroutine, uint32_t result);
|
||||
uint32_t OSSaveCoroutine(OSCoroutine *coroutine);
|
||||
void OSSwitchCoroutine(OSCoroutine *from, OSCoroutine *to);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
#include <stddef.h>
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void OSConsoleWrite(const char *msg, int size);
|
||||
void OSReport(const char *fmt, ...);
|
||||
void OSPanic(const char *file, int line, const char *fmt, ...);
|
||||
void OSFatal(const char *msg);
|
||||
|
||||
int __os_snprintf(char *buf, int n, const char *format, ... );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "thread.h"
|
||||
#include "time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *OSDynLoadModule;
|
||||
typedef int (*OSDynLoadAllocFn)(int size, int align, void **outAddr);
|
||||
typedef void (*OSDynLoadFreeFn)(void *addr);
|
||||
|
||||
int32_t OSDynLoad_SetAllocator(OSDynLoadAllocFn allocFn, OSDynLoadFreeFn freeFn);
|
||||
int32_t OSDynLoad_GetAllocator(OSDynLoadAllocFn *outAllocFn, OSDynLoadFreeFn *outFreeFn);
|
||||
int32_t OSDynLoad_Acquire(char const *name, OSDynLoadModule *outModule);
|
||||
int32_t OSDynLoad_FindExport(OSDynLoadModule module, int32_t isData, char const *name, void **outAddr);
|
||||
void OSDynLoad_Release(OSDynLoadModule module);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,36 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "thread.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum OSEventMode
|
||||
{
|
||||
OS_EVENT_MODE_MANUAL = 0,
|
||||
OS_EVENT_MODE_AUTO = 1,
|
||||
} OSEventMode;
|
||||
|
||||
#define OS_EVENT_TAG 0x65566E54u
|
||||
typedef struct
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown;
|
||||
BOOL value;
|
||||
OSThreadQueue queue;
|
||||
OSEventMode mode;
|
||||
} OSEvent;
|
||||
|
||||
void OSInitEvent(OSEvent *event, BOOL value, OSEventMode mode);
|
||||
void OSInitEventEx(OSEvent *event, BOOL value, OSEventMode mode, char *name);
|
||||
void OSSignalEvent(OSEvent *event);
|
||||
void OSSignalEventAll(OSEvent *event);
|
||||
void OSWaitEvent(OSEvent *event);
|
||||
void OSResetEvent(OSEvent *event);
|
||||
BOOL OSWaitEventWithTimeout(OSEvent *event, OSTime timeout);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,36 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef BOOL (*OSExceptionCallbackFn)(OSContext *context);
|
||||
|
||||
typedef enum OSExceptionType
|
||||
{
|
||||
OS_EXCEPTION_TYPE_SYSTEM_RESET = 0,
|
||||
OS_EXCEPTION_TYPE_MACHINE_CHECK = 1,
|
||||
OS_EXCEPTION_TYPE_DSI = 2,
|
||||
OS_EXCEPTION_TYPE_ISI = 3,
|
||||
OS_EXCEPTION_TYPE_EXTERNAL_INTERRUPT = 4,
|
||||
OS_EXCEPTION_TYPE_ALIGNMENT = 5,
|
||||
OS_EXCEPTION_TYPE_PROGRAM = 6,
|
||||
OS_EXCEPTION_TYPE_FLOATING_POINT = 7,
|
||||
OS_EXCEPTION_TYPE_DECREMENTER = 8,
|
||||
OS_EXCEPTION_TYPE_SYSTEM_CALL = 9,
|
||||
OS_EXCEPTION_TYPE_TRACE = 10,
|
||||
OS_EXCEPTION_TYPE_PERFORMANCE_MONITOR = 11,
|
||||
OS_EXCEPTION_TYPE_BREAKPOINT = 12,
|
||||
OS_EXCEPTION_TYPE_SYSTEM_INTERRUPT = 13,
|
||||
OS_EXCEPTION_TYPE_ICI = 14,
|
||||
} OSExceptionType;
|
||||
|
||||
OSExceptionCallbackFn OSSetExceptionCallback(OSExceptionType exceptionType,
|
||||
OSExceptionCallbackFn callback);
|
||||
OSExceptionCallbackFn OSSetExceptionCallbackEx(int unknown, OSExceptionType exceptionType,
|
||||
OSExceptionCallbackFn callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "fastmutex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OS_FAST_CONDITION_TAG 0x664E6456u
|
||||
|
||||
typedef struct OSFastCondition
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown;
|
||||
OSThreadQueue queue;
|
||||
}OSFastCondition;
|
||||
|
||||
void OSFastCond_Init(OSFastCondition *condition, const char *name);
|
||||
void OSFastCond_Wait(OSFastCondition *condition, OSFastMutex *mutex);
|
||||
void OSFastCond_Signal(OSFastCondition *condition);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSFastMutex OSFastMutex;
|
||||
typedef struct
|
||||
{
|
||||
OSFastMutex *next;
|
||||
OSFastMutex *prev;
|
||||
}OSFastMutexLink;
|
||||
|
||||
#define OS_FAST_MUTEX_TAG 0x664D7458u
|
||||
typedef struct OSFastMutex
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown0;
|
||||
OSThreadSimpleQueue queue;
|
||||
OSFastMutexLink link;
|
||||
uint32_t __unknown1[4];
|
||||
}OSFastMutex;
|
||||
|
||||
void OSFastMutex_Init(OSFastMutex *mutex, const char *name);
|
||||
void OSFastMutex_Lock(OSFastMutex *mutex);
|
||||
void OSFastMutex_Unlock(OSFastMutex *mutex);
|
||||
BOOL OSFastMutex_TryLock(OSFastMutex *mutex);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void OSEnableForegroundExit();
|
||||
void OSReleaseForeground();
|
||||
void OSSavesDone_ReadyToRelease();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void *OSBlockMove(void *dst, const void *src, uint32_t size, BOOL flush);
|
||||
void *OSBlockSet(void *dst, uint8_t val, uint32_t size);
|
||||
uint32_t OSEffectiveToPhysical(void *vaddr);
|
||||
void *OSAllocFromSystem(uint32_t size, int align);
|
||||
void OSFreeToSystem(void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum OSMessageFlags
|
||||
{
|
||||
OS_MESSAGE_QUEUE_BLOCKING = 1 << 0,
|
||||
OS_MESSAGE_QUEUE_HIGH_PRIORITY = 1 << 1,
|
||||
} OSMessageFlags;
|
||||
|
||||
typedef struct OSMessage
|
||||
{
|
||||
void *message;
|
||||
uint32_t args[3];
|
||||
} OSMessage;
|
||||
|
||||
#define OS_MESSAGE_QUEUE_TAG 0x6D536751u
|
||||
typedef struct OSMessageQueue
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown;
|
||||
OSThreadQueue sendQueue;
|
||||
OSThreadQueue recvQueue;
|
||||
OSMessage *messages;
|
||||
uint32_t size;
|
||||
uint32_t first;
|
||||
uint32_t used;
|
||||
} OSMessageQueue;
|
||||
|
||||
void OSInitMessageQueue(OSMessageQueue *queue, OSMessage *messages, int32_t size);
|
||||
void OSInitMessageQueueEx(OSMessageQueue *queue, OSMessage *messages, int32_t size, const char *name);
|
||||
BOOL OSSendMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags);
|
||||
BOOL OSReceiveMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags);
|
||||
BOOL OSPeekMessage(OSMessageQueue *queue, OSMessage *message);
|
||||
OSMessageQueue *OSGetSystemMessageQueue();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "thread.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSMutex OSMutex;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
OSMutex *next;
|
||||
OSMutex *prev;
|
||||
} OSMutexLink;
|
||||
|
||||
#define OS_MUTEX_TAG 0x6D557458u
|
||||
typedef struct OSMutex
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown;
|
||||
OSThreadQueue queue;
|
||||
OSThread *owner;
|
||||
int32_t count;
|
||||
OSMutexLink link;
|
||||
} OSMutex;
|
||||
|
||||
void OSInitMutex(OSMutex *mutex);
|
||||
void OSInitMutexEx(OSMutex *mutex, const char *name);
|
||||
void OSLockMutex(OSMutex *mutex);
|
||||
BOOL OSTryLockMutex(OSMutex *mutex);
|
||||
void OSUnlockMutex(OSMutex *mutex);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t core[3];
|
||||
uint32_t __unknown;
|
||||
} OSRendezvous;
|
||||
|
||||
void OSInitRendezvous(OSRendezvous *rendezvous);
|
||||
BOOL OSWaitRendezvous(OSRendezvous *rendezvous, uint32_t coreMask);
|
||||
BOOL OSWaitRendezvousWithTimeout(OSRendezvous *rendezvous, uint32_t coreMask, OSTime timeout);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum OSScreenID
|
||||
{
|
||||
SCREEN_TV = 0,
|
||||
SCREEN_DRC = 1,
|
||||
} OSScreenID;
|
||||
|
||||
void OSScreenInit();
|
||||
uint32_t OSScreenGetBufferSizeEx(OSScreenID screen);
|
||||
void OSScreenSetBufferEx(OSScreenID screen, void *addr);
|
||||
void OSScreenClearBufferEx(OSScreenID screen, uint32_t colour);
|
||||
void OSScreenFlipBuffersEx(OSScreenID screen);
|
||||
void OSScreenPutFontEx(OSScreenID screen, uint32_t row, uint32_t column, const char *buffer);
|
||||
void OSScreenPutPixelEx(OSScreenID screen, uint32_t x, uint32_t y, uint32_t colour);
|
||||
void OSScreenEnableEx(OSScreenID screen, BOOL enable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "thread.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OS_SEMAPHORE_TAG 0x73506852u
|
||||
typedef struct
|
||||
{
|
||||
uint32_t tag;
|
||||
const char *name;
|
||||
uint32_t __unknown;
|
||||
int32_t count;
|
||||
OSThreadQueue queue;
|
||||
}OSSemaphore;
|
||||
|
||||
void OSInitSemaphore(OSSemaphore *semaphore, int32_t count);
|
||||
void OSInitSemaphoreEx(OSSemaphore *semaphore, int32_t count, const char *name);
|
||||
int32_t OSGetSemaphoreCount(OSSemaphore *semaphore);
|
||||
int32_t OSSignalSemaphore(OSSemaphore *semaphore);
|
||||
int32_t OSWaitSemaphore(OSSemaphore *semaphore);
|
||||
int32_t OSTryWaitSemaphore(OSSemaphore *semaphore);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t owner;
|
||||
uint32_t __unknown0;
|
||||
uint32_t recursion;
|
||||
uint32_t __unknown1;
|
||||
} OSSpinLock;
|
||||
|
||||
void OSInitSpinLock(OSSpinLock *spinlock);
|
||||
BOOL OSAcquireSpinLock(OSSpinLock *spinlock);
|
||||
BOOL OSTryAcquireSpinLock(OSSpinLock *spinlock);
|
||||
BOOL OSTryAcquireSpinLockWithTimeout(OSSpinLock *spinlock, OSTime timeout);
|
||||
BOOL OSReleaseSpinLock(OSSpinLock *spinlock);
|
||||
BOOL OSUninterruptibleSpinLock_Acquire(OSSpinLock *spinlock);
|
||||
BOOL OSUninterruptibleSpinLock_TryAcquire(OSSpinLock *spinlock);
|
||||
BOOL OSUninterruptibleSpinLock_TryAcquireWithTimeout(OSSpinLock *spinlock, OSTime timeout);
|
||||
BOOL OSUninterruptibleSpinLock_Release(OSSpinLock *spinlock);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t clockSpeed;
|
||||
uint32_t __unknown0;
|
||||
OSTime baseTime;
|
||||
uint32_t __unknown[4];
|
||||
}OSSystemInfo;
|
||||
|
||||
OSSystemInfo *OSGetSystemInfo();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,278 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
#include "time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSThread OSThread;
|
||||
|
||||
typedef int (*OSThreadEntryPointFn)(int argc, const char **argv);
|
||||
typedef void (*OSThreadCleanupCallbackFn)(OSThread *thread, void *stack);
|
||||
typedef void (*OSThreadDeallocatorFn)(OSThread *thread, void *stack);
|
||||
|
||||
enum OS_THREAD_STATE
|
||||
{
|
||||
OS_THREAD_STATE_NONE = 0,
|
||||
|
||||
//! Thread is ready to run
|
||||
OS_THREAD_STATE_READY = 1 << 0,
|
||||
|
||||
//! Thread is running
|
||||
OS_THREAD_STATE_RUNNING = 1 << 1,
|
||||
|
||||
//! Thread is waiting, i.e. on a mutex
|
||||
OS_THREAD_STATE_WAITING = 1 << 2,
|
||||
|
||||
//! Thread is about to terminate
|
||||
OS_THREAD_STATE_MORIBUND = 1 << 3,
|
||||
};
|
||||
typedef uint8_t OSThreadState;
|
||||
|
||||
enum OS_THREAD_REQUEST
|
||||
{
|
||||
OS_THREAD_REQUEST_NONE = 0,
|
||||
OS_THREAD_REQUEST_SUSPEND = 1,
|
||||
OS_THREAD_REQUEST_CANCEL = 2,
|
||||
};
|
||||
typedef uint32_t OSThreadRequest;
|
||||
|
||||
enum OS_THREAD_ATTRIB
|
||||
{
|
||||
//! Allow the thread to run on CPU0.
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU0 = 1 << 0,
|
||||
|
||||
//! Allow the thread to run on CPU1.
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU1 = 1 << 1,
|
||||
|
||||
//! Allow the thread to run on CPU2.
|
||||
OS_THREAD_ATTRIB_AFFINITY_CPU2 = 1 << 2,
|
||||
|
||||
//! Allow the thread to run any CPU.
|
||||
OS_THREAD_ATTRIB_AFFINITY_ANY = ((1 << 0) | (1 << 1) | (1 << 2)),
|
||||
|
||||
//! Start the thread detached.
|
||||
OS_THREAD_ATTRIB_DETACHED = 1 << 3,
|
||||
|
||||
//! Enables tracking of stack usage.
|
||||
OS_THREAD_ATTRIB_STACK_USAGE = 1 << 5
|
||||
};
|
||||
typedef uint8_t OSThreadAttributes;
|
||||
|
||||
#define OS_CONTEXT_TAG 0x4F53436F6E747874ull
|
||||
|
||||
typedef struct OSContext
|
||||
{
|
||||
//! Should always be set to the value OS_CONTEXT_TAG.
|
||||
uint64_t tag;
|
||||
|
||||
uint32_t gpr[32];
|
||||
uint32_t cr;
|
||||
uint32_t lr;
|
||||
uint32_t ctr;
|
||||
uint32_t xer;
|
||||
uint32_t srr0;
|
||||
uint32_t srr1;
|
||||
uint32_t __unknown[0x5];
|
||||
uint32_t fpscr;
|
||||
double fpr[32];
|
||||
uint16_t spinLockCount;
|
||||
uint16_t state;
|
||||
uint32_t gqr[8];
|
||||
uint32_t __unknown0;
|
||||
double psf[32];
|
||||
uint64_t coretime[3];
|
||||
uint64_t starttime;
|
||||
uint32_t error;
|
||||
uint32_t __unknown1;
|
||||
uint32_t pmc1;
|
||||
uint32_t pmc2;
|
||||
uint32_t pmc3;
|
||||
uint32_t pmc4;
|
||||
uint32_t mmcr0;
|
||||
uint32_t mmcr1;
|
||||
} OSContext;
|
||||
|
||||
typedef struct OSMutex OSMutex;
|
||||
typedef struct OSFastMutex OSFastMutex;
|
||||
|
||||
typedef struct OSMutexQueue
|
||||
{
|
||||
OSMutex *head;
|
||||
OSMutex *tail;
|
||||
void *parent;
|
||||
uint32_t __unknown;
|
||||
} OSMutexQueue;
|
||||
|
||||
typedef struct OSFastMutexQueue
|
||||
{
|
||||
OSFastMutex *head;
|
||||
OSFastMutex *tail;
|
||||
} OSFastMutexQueue;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
OSThread *prev;
|
||||
OSThread *next;
|
||||
} OSThreadLink;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
OSThread *head;
|
||||
OSThread *tail;
|
||||
void *parent;
|
||||
uint32_t __unknown;
|
||||
} OSThreadQueue;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
OSThread *head;
|
||||
OSThread *tail;
|
||||
} OSThreadSimpleQueue;
|
||||
|
||||
#define OS_THREAD_TAG 0x74487244u
|
||||
#pragma pack(push, 1)
|
||||
typedef struct OSThread
|
||||
{
|
||||
OSContext context;
|
||||
|
||||
//! Should always be set to the value OS_THREAD_TAG.
|
||||
uint32_t tag;
|
||||
|
||||
//! Bitfield of OS_THREAD_STATE
|
||||
OSThreadState state;
|
||||
|
||||
//! Bitfield of OS_THREAD_ATTRIB
|
||||
OSThreadAttributes attr;
|
||||
|
||||
//! Unique thread ID
|
||||
uint16_t id;
|
||||
|
||||
//! Suspend count (increased by OSSuspendThread).
|
||||
int32_t suspendCounter;
|
||||
|
||||
//! Actual priority of thread.
|
||||
int32_t priority;
|
||||
|
||||
//! Base priority of thread, 0 is highest priority, 31 is lowest priority.
|
||||
int32_t basePriority;
|
||||
|
||||
//! Exit value
|
||||
int32_t exitValue;
|
||||
|
||||
uint32_t unknown0[0x9];
|
||||
|
||||
//! Queue the thread is currently waiting on
|
||||
OSThreadQueue *queue;
|
||||
|
||||
//! Link used for thread queue
|
||||
OSThreadLink link;
|
||||
|
||||
//! Queue of threads waiting to join this thread
|
||||
OSThreadQueue joinQueue;
|
||||
|
||||
//! Mutex this thread is waiting to lock
|
||||
OSMutex *mutex;
|
||||
|
||||
//! Queue of mutexes this thread owns
|
||||
OSMutexQueue mutexQueue;
|
||||
|
||||
//! Link for global active thread queue
|
||||
OSThreadLink activeLink;
|
||||
|
||||
//! Stack start (top, highest address)
|
||||
void *stackStart;
|
||||
|
||||
//! Stack end (bottom, lowest address)
|
||||
void *stackEnd;
|
||||
|
||||
//! Thread entry point
|
||||
OSThreadEntryPointFn entryPoint;
|
||||
|
||||
uint32_t unknown1[0x77];
|
||||
|
||||
//! Thread specific values, accessed with OSSetThreadSpecific and OSGetThreadSpecific.
|
||||
uint32_t specific[0x10];
|
||||
|
||||
uint32_t unknown2;
|
||||
|
||||
//! Thread name, accessed with OSSetThreadName and OSGetThreadName.
|
||||
const char *name;
|
||||
|
||||
uint32_t unknown3;
|
||||
|
||||
//! The stack pointer passed in OSCreateThread.
|
||||
void *userStackPointer;
|
||||
|
||||
//! Called just before thread is terminated, set with OSSetThreadCleanupCallback
|
||||
OSThreadCleanupCallbackFn cleanupCallback;
|
||||
|
||||
//! Called just after a thread is terminated, set with OSSetThreadDeallocator
|
||||
OSThreadDeallocatorFn deallocator;
|
||||
|
||||
//! If TRUE then a thread can be cancelled or suspended, set with OSSetThreadCancelState
|
||||
BOOL cancelState;
|
||||
|
||||
//! Current thread request, used for cancelleing and suspending the thread.
|
||||
OSThreadRequest requestFlag;
|
||||
|
||||
//! Pending suspend request count
|
||||
int32_t needSuspend;
|
||||
|
||||
//! Result of thread suspend
|
||||
int32_t suspendResult;
|
||||
|
||||
//! Queue of threads waiting for a thread to be suspended.
|
||||
OSThreadQueue suspendQueue;
|
||||
|
||||
uint32_t unknown4[0x2A];
|
||||
} OSThread;
|
||||
#pragma pack(pop)
|
||||
|
||||
void
|
||||
OSCancelThread(OSThread *thread);
|
||||
int32_t OSCheckActiveThreads();
|
||||
int32_t OSCheckThreadStackUsage(OSThread *thread);
|
||||
void OSClearThreadStackUsage(OSThread *thread);
|
||||
void OSContinueThread(OSThread *thread);
|
||||
BOOL OSCreateThread(OSThread *thread, OSThreadEntryPointFn entry, int32_t argc, char *argv,
|
||||
void *stack, uint32_t stackSize, int32_t priority, OSThreadAttributes attributes);
|
||||
void OSDetachThread(OSThread *thread);
|
||||
void OSExitThread(int32_t result);
|
||||
void OSGetActiveThreadLink(OSThread *thread, OSThreadLink *link);
|
||||
OSThread *OSGetCurrentThread();
|
||||
OSThread *OSGetDefaultThread(uint32_t coreID);
|
||||
uint32_t OSGetStackPointer();
|
||||
uint32_t OSGetThreadAffinity(OSThread *thread);
|
||||
const char *OSGetThreadName(OSThread *thread);
|
||||
int32_t OSGetThreadPriority(OSThread *thread);
|
||||
uint32_t OSGetThreadSpecific(uint32_t id);
|
||||
BOOL OSIsThreadSuspended(OSThread *thread);
|
||||
BOOL OSIsThreadTerminated(OSThread *thread);
|
||||
BOOL OSJoinThread(OSThread *thread, int *threadResult);
|
||||
int32_t OSResumeThread(OSThread *thread);
|
||||
BOOL OSRunThread(OSThread *thread, OSThreadEntryPointFn entry, int argc, const char **argv);
|
||||
BOOL OSSetThreadAffinity(OSThread *thread, uint32_t affinity);
|
||||
BOOL OSSetThreadCancelState(BOOL state);
|
||||
OSThreadCleanupCallbackFn OSSetThreadCleanupCallback(OSThread *thread,
|
||||
OSThreadCleanupCallbackFn callback);
|
||||
OSThreadDeallocatorFn OSSetThreadDeallocator(OSThread *thread, OSThreadDeallocatorFn deallocator);
|
||||
void OSSetThreadName(OSThread *thread, const char *name);
|
||||
BOOL OSSetThreadPriority(OSThread *thread, int32_t priority);
|
||||
BOOL OSSetThreadRunQuantum(OSThread *thread, uint32_t quantum);
|
||||
void OSSetThreadSpecific(uint32_t id, uint32_t value);
|
||||
BOOL OSSetThreadStackUsage(OSThread *thread);
|
||||
void OSSleepThread(OSThreadQueue *queue);
|
||||
void OSSleepTicks(OSTime ticks);
|
||||
uint32_t OSSuspendThread(OSThread *thread);
|
||||
void OSTestThreadCancel();
|
||||
void OSWakeupThread(OSThreadQueue *queue);
|
||||
void OSYieldThread();
|
||||
void OSInitThreadQueue(OSThreadQueue *queue);
|
||||
void OSInitThreadQueueEx(OSThreadQueue *queue, void *parent);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -1,5 +1,14 @@
|
|||
#ifndef WIIU_H
|
||||
#define WIIU_H
|
||||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OSOneSecond ((OSGetSystemInfo()->clockSpeed) / 4)
|
||||
#define OSMilliseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000ull)
|
||||
#define OSMicroseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000000ull)
|
||||
#define OSNanoseconds(val) ((((uint64_t)(val)) * (uint64_t)(OSOneSecond)) / 1000000000ull)
|
||||
|
||||
#define wiiu_bus_clock (17 * 13 * 5*5*5 * 5*5*5 * 3*3 * 2*2*2) // 248.625000 Mhz
|
||||
#define wiiu_cpu_clock (17 * 13 * 5*5*5 * 5*5*5 * 5 * 3*3 * 2*2*2) // 1243.125000 Mhz
|
||||
|
@ -15,4 +24,27 @@
|
|||
#define ticks_to_us(ticks) (((uint64_t)(ticks) * (2*2 * 2*2*2)) / (17 * 13 * 3*3))
|
||||
#define ticks_to_ns(ticks) (((uint64_t)(ticks) * (2*2 * 2*2*2 * 2*2*2 * 5*5*5)) / (17 * 13 * 3*3))
|
||||
|
||||
#endif // WIIU_H
|
||||
typedef int32_t OSTick;
|
||||
typedef int64_t OSTime;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t tm_sec;
|
||||
int32_t tm_min;
|
||||
int32_t tm_hour;
|
||||
int32_t tm_mday;
|
||||
int32_t tm_mon;
|
||||
int32_t tm_year;
|
||||
}OSCalendarTime;
|
||||
|
||||
|
||||
OSTime OSGetTime();
|
||||
OSTime OSGetSystemTime();
|
||||
OSTick OSGetTick();
|
||||
OSTick OSGetSystemTick();
|
||||
OSTime OSCalendarTimeToTicks(OSCalendarTime *calendarTime);
|
||||
void OSTicksToCalendarTime(OSTime time, OSCalendarTime *calendarTime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
u64 OSGetTitleID(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*ProcUISaveCallback)(void);
|
||||
typedef uint32_t (*ProcUISaveCallbackEx)(void *);
|
||||
typedef uint32_t (*ProcUICallback)(void *);
|
||||
|
||||
typedef enum ProcUIStatus
|
||||
{
|
||||
PROCUI_STATUS_IN_FOREGROUND,
|
||||
PROCUI_STATUS_IN_BACKGROUND,
|
||||
PROCUI_STATUS_RELEASE_FOREGROUND,
|
||||
PROCUI_STATUS_EXITING,
|
||||
} ProcUIStatus;
|
||||
|
||||
uint32_t ProcUICalcMemorySize(uint32_t unk);
|
||||
void ProcUIClearCallbacks();
|
||||
void ProcUIDrawDoneRelease();
|
||||
BOOL ProcUIInForeground();
|
||||
BOOL ProcUIInShutdown();
|
||||
void ProcUIInit(ProcUISaveCallback saveCallback);
|
||||
void ProcUIInitEx(ProcUISaveCallbackEx saveCallback, void *arg);
|
||||
BOOL ProcUIIsRunning();
|
||||
ProcUIStatus ProcUIProcessMessages(BOOL block);
|
||||
void ProcUISetSaveCallback(ProcUISaveCallbackEx saveCallback, void *arg);
|
||||
void ProcUIShutdown();
|
||||
ProcUIStatus ProcUISubProcessMessages(BOOL block);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct sysapp_input_struct sysapp_input_struct;
|
||||
|
||||
void SYSSwitchToSyncControllerOnHBM();
|
||||
void SYSSwitchToEManual();
|
||||
void SYSSwitchToEShop();
|
||||
void _SYSSwitchToMainApp();
|
||||
void SYSSwitchToBrowserForViewer(sysapp_input_struct *);
|
||||
|
||||
void SYSRelaunchTitle(uint32_t argc, char *pa_Argv[]);
|
||||
void SYSLaunchMenu();
|
||||
void SYSLaunchTitle(uint64_t TitleId);
|
||||
void _SYSLaunchMiiStudio();
|
||||
void _SYSLaunchSettings();
|
||||
void _SYSLaunchParental();
|
||||
void _SYSLaunchNotifications();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
typedef int BOOL;
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
|
||||
typedef int8_t s8;
|
||||
typedef int16_t s16;
|
||||
typedef int32_t s32;
|
||||
typedef int64_t s64;
|
||||
|
||||
typedef volatile u8 vu8;
|
||||
typedef volatile u16 vu16;
|
||||
typedef volatile u32 vu32;
|
||||
typedef volatile u64 vu64;
|
||||
|
||||
typedef volatile s8 vs8;
|
||||
typedef volatile s16 vs16;
|
||||
typedef volatile s32 vs32;
|
||||
typedef volatile s64 vs64;
|
||||
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
|
||||
typedef volatile float vf32;
|
||||
typedef volatile double vf64;
|
|
@ -0,0 +1,132 @@
|
|||
#pragma once
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum VPADButtons
|
||||
{
|
||||
VPAD_BUTTON_SYNC = 0x00000001,
|
||||
VPAD_BUTTON_HOME = 0x00000002,
|
||||
VPAD_BUTTON_MINUS = 0x00000004,
|
||||
VPAD_BUTTON_PLUS = 0x00000008,
|
||||
VPAD_BUTTON_R = 0x00000010,
|
||||
VPAD_BUTTON_L = 0x00000020,
|
||||
VPAD_BUTTON_ZR = 0x00000040,
|
||||
VPAD_BUTTON_ZL = 0x00000080,
|
||||
VPAD_BUTTON_DOWN = 0x00000100,
|
||||
VPAD_BUTTON_UP = 0x00000200,
|
||||
VPAD_BUTTON_RIGHT = 0x00000400,
|
||||
VPAD_BUTTON_LEFT = 0x00000800,
|
||||
VPAD_BUTTON_Y = 0x00001000,
|
||||
VPAD_BUTTON_X = 0x00002000,
|
||||
VPAD_BUTTON_B = 0x00004000,
|
||||
VPAD_BUTTON_A = 0x00008000,
|
||||
VPAD_BUTTON_TV = 0x00010000,
|
||||
VPAD_BUTTON_STICK_R = 0x00020000,
|
||||
VPAD_BUTTON_STICK_L = 0x00040000,
|
||||
} VPADButtons;
|
||||
|
||||
typedef enum VPADTouchPadValidity
|
||||
{
|
||||
//! Both X and Y touchpad positions are accurate
|
||||
VPAD_VALID = 0x0,
|
||||
|
||||
//! X position is inaccurate
|
||||
VPAD_INVALID_X = 0x1,
|
||||
|
||||
//! Y position is inaccurate
|
||||
VPAD_INVALID_Y = 0x2,
|
||||
} VPADTouchPadValidity;
|
||||
|
||||
|
||||
typedef enum VPADReadError
|
||||
{
|
||||
VPAD_READ_SUCCESS = 0,
|
||||
VPAD_READ_NO_SAMPLES = -1,
|
||||
VPAD_READ_INVALID_CONTROLLER = -2,
|
||||
} VPADReadError;
|
||||
|
||||
typedef struct VPADVec2D
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
}VPADVec2D;
|
||||
|
||||
typedef struct VPADVec3D
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
}VPADVec3D;
|
||||
|
||||
typedef struct VPADTouchData
|
||||
{
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
uint16_t touched;
|
||||
uint16_t validity;
|
||||
}VPADTouchData;
|
||||
|
||||
typedef struct VPADAccStatus
|
||||
{
|
||||
float unk1;
|
||||
float unk2;
|
||||
float unk3;
|
||||
float unk4;
|
||||
float unk5;
|
||||
VPADVec2D vertical;
|
||||
}VPADAccStatus;
|
||||
|
||||
typedef struct VPADGyroStatus
|
||||
{
|
||||
float unk1;
|
||||
float unk2;
|
||||
float unk3;
|
||||
float unk4;
|
||||
float unk5;
|
||||
float unk6;
|
||||
}VPADGyroStatus;
|
||||
|
||||
typedef struct VPADStatus
|
||||
{
|
||||
uint32_t hold;
|
||||
uint32_t trigger;
|
||||
uint32_t release;
|
||||
|
||||
VPADVec2D leftStick;
|
||||
VPADVec2D rightStick;
|
||||
VPADAccStatus accelorometer;
|
||||
VPADGyroStatus gyro;
|
||||
|
||||
uint16_t __unknown0;
|
||||
|
||||
//! Current touch position on DRC
|
||||
VPADTouchData tpNormal;
|
||||
|
||||
//! Filtered touch position, first level of smoothing
|
||||
VPADTouchData tpFiltered1;
|
||||
|
||||
//! Filtered touch position, second level of smoothing
|
||||
VPADTouchData tpFiltered2;
|
||||
|
||||
uint32_t __unknown1[0xA];
|
||||
|
||||
VPADVec3D mag;
|
||||
uint8_t slideVolume;
|
||||
uint8_t battery;
|
||||
uint8_t micStatus;
|
||||
uint8_t slideVolumeEx;
|
||||
uint32_t __unknown2[0x2];
|
||||
}VPADStatus;
|
||||
|
||||
//! Deprecated
|
||||
void VPADInit();
|
||||
|
||||
int32_t VPADRead(uint32_t chan, VPADStatus *buffers, uint32_t count, VPADReadError *error);
|
||||
void VPADGetTPCalibratedPoint(uint32_t chan, VPADTouchData *calibratedData, VPADTouchData *uncalibratedData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <wiiu/types.h>
|
||||
|
||||
#define WPAD_BUTTON_LEFT 0x0001
|
||||
#define WPAD_BUTTON_RIGHT 0x0002
|
||||
#define WPAD_BUTTON_DOWN 0x0004
|
||||
#define WPAD_BUTTON_UP 0x0008
|
||||
#define WPAD_BUTTON_PLUS 0x0010
|
||||
#define WPAD_BUTTON_2 0x0100
|
||||
#define WPAD_BUTTON_1 0x0200
|
||||
#define WPAD_BUTTON_B 0x0400
|
||||
#define WPAD_BUTTON_A 0x0800
|
||||
#define WPAD_BUTTON_MINUS 0x1000
|
||||
#define WPAD_BUTTON_Z 0x2000
|
||||
#define WPAD_BUTTON_C 0x4000
|
||||
#define WPAD_BUTTON_HOME 0x8000
|
||||
|
||||
#define WPAD_CLASSIC_BUTTON_UP 0x0001
|
||||
#define WPAD_CLASSIC_BUTTON_LEFT 0x0002
|
||||
#define WPAD_CLASSIC_BUTTON_ZR 0x0004
|
||||
#define WPAD_CLASSIC_BUTTON_X 0x0008
|
||||
#define WPAD_CLASSIC_BUTTON_A 0x0010
|
||||
#define WPAD_CLASSIC_BUTTON_Y 0x0020
|
||||
#define WPAD_CLASSIC_BUTTON_B 0x0040
|
||||
#define WPAD_CLASSIC_BUTTON_ZL 0x0080
|
||||
#define WPAD_CLASSIC_BUTTON_R 0x0200
|
||||
#define WPAD_CLASSIC_BUTTON_PLUS 0x0400
|
||||
#define WPAD_CLASSIC_BUTTON_HOME 0x0800
|
||||
#define WPAD_CLASSIC_BUTTON_MINUS 0x1000
|
||||
#define WPAD_CLASSIC_BUTTON_L 0x2000
|
||||
#define WPAD_CLASSIC_BUTTON_DOWN 0x4000
|
||||
#define WPAD_CLASSIC_BUTTON_RIGHT 0x8000
|
||||
|
||||
#define WPAD_PRO_BUTTON_STICK_R 0x10000
|
||||
#define WPAD_PRO_BUTTON_STICK_L 0x20000
|
||||
|
||||
typedef void (* wpad_connect_callback_t)(s32 chan, s32 status);
|
||||
|
||||
s32 WPADProbe (s32 chan, u32 * pad_type);
|
||||
s32 WPADSetDataFormat(s32 chan, s32 format);
|
||||
void WPADEnableURCC(s32 enable);
|
||||
void WPADEnableWiiRemote(s32 enable);
|
||||
void WPADRead(s32 chan, void * data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
10
wiiu/ios.h
10
wiiu/ios.h
|
@ -1,10 +0,0 @@
|
|||
|
||||
#ifndef _IOS_H_
|
||||
#define _IOS_H_
|
||||
|
||||
int IOS_Open(char *path, unsigned int mode);
|
||||
int IOS_Close(int fd);
|
||||
int IOS_Ioctl(int fd, unsigned int request, void *input_buffer, unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
|
||||
int IOS_IoctlAsync(int fd, unsigned int request, void *input_buffer, unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len, void *cb, void *cbarg);
|
||||
|
||||
#endif
|
126
wiiu/padscore.h
126
wiiu/padscore.h
|
@ -1,126 +0,0 @@
|
|||
/****************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __PAD_SCORE_FUNCTIONS_H_
|
||||
#define __PAD_SCORE_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <wut_types.h>
|
||||
|
||||
#define WPAD_BUTTON_LEFT 0x0001
|
||||
#define WPAD_BUTTON_RIGHT 0x0002
|
||||
#define WPAD_BUTTON_DOWN 0x0004
|
||||
#define WPAD_BUTTON_UP 0x0008
|
||||
#define WPAD_BUTTON_PLUS 0x0010
|
||||
#define WPAD_BUTTON_2 0x0100
|
||||
#define WPAD_BUTTON_1 0x0200
|
||||
#define WPAD_BUTTON_B 0x0400
|
||||
#define WPAD_BUTTON_A 0x0800
|
||||
#define WPAD_BUTTON_MINUS 0x1000
|
||||
#define WPAD_BUTTON_Z 0x2000
|
||||
#define WPAD_BUTTON_C 0x4000
|
||||
#define WPAD_BUTTON_HOME 0x8000
|
||||
|
||||
#define WPAD_CLASSIC_BUTTON_UP 0x0001
|
||||
#define WPAD_CLASSIC_BUTTON_LEFT 0x0002
|
||||
#define WPAD_CLASSIC_BUTTON_ZR 0x0004
|
||||
#define WPAD_CLASSIC_BUTTON_X 0x0008
|
||||
#define WPAD_CLASSIC_BUTTON_A 0x0010
|
||||
#define WPAD_CLASSIC_BUTTON_Y 0x0020
|
||||
#define WPAD_CLASSIC_BUTTON_B 0x0040
|
||||
#define WPAD_CLASSIC_BUTTON_ZL 0x0080
|
||||
#define WPAD_CLASSIC_BUTTON_R 0x0200
|
||||
#define WPAD_CLASSIC_BUTTON_PLUS 0x0400
|
||||
#define WPAD_CLASSIC_BUTTON_HOME 0x0800
|
||||
#define WPAD_CLASSIC_BUTTON_MINUS 0x1000
|
||||
#define WPAD_CLASSIC_BUTTON_L 0x2000
|
||||
#define WPAD_CLASSIC_BUTTON_DOWN 0x4000
|
||||
#define WPAD_CLASSIC_BUTTON_RIGHT 0x8000
|
||||
|
||||
#define WPAD_PRO_BUTTON_STICK_R 0x10000
|
||||
#define WPAD_PRO_BUTTON_STICK_L 0x20000
|
||||
|
||||
void InitPadScoreFunctionPointers(void);
|
||||
|
||||
|
||||
typedef struct _KPADData
|
||||
{
|
||||
u32 btns_h;
|
||||
u32 btns_d;
|
||||
u32 btns_r;
|
||||
u32 unused_1[5];
|
||||
f32 pos_x;
|
||||
f32 pos_y;
|
||||
u32 unused_2[3];
|
||||
f32 angle_x;
|
||||
f32 angle_y;
|
||||
u32 unused_3[8];
|
||||
u8 device_type;
|
||||
u8 wpad_error;
|
||||
u8 pos_valid;
|
||||
u8 unused_4[1];
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
f32 stick_x;
|
||||
f32 stick_y;
|
||||
} nunchuck;
|
||||
|
||||
struct
|
||||
{
|
||||
u32 btns_h;
|
||||
u32 btns_d;
|
||||
u32 btns_r;
|
||||
f32 lstick_x;
|
||||
f32 lstick_y;
|
||||
f32 rstick_x;
|
||||
f32 rstick_y;
|
||||
f32 ltrigger;
|
||||
f32 rtrigger;
|
||||
} classic;
|
||||
|
||||
u32 unused_6[20];
|
||||
};
|
||||
u32 unused_7[16];
|
||||
} KPADData;
|
||||
|
||||
typedef void (* wpad_connect_callback_t)(s32 chan, s32 status);
|
||||
|
||||
void KPADInit (void);
|
||||
s32 WPADProbe (s32 chan, u32 * pad_type);
|
||||
s32 WPADSetDataFormat(s32 chan, s32 format);
|
||||
void WPADEnableURCC(s32 enable);
|
||||
void WPADEnableWiiRemote(s32 enable);
|
||||
void WPADRead(s32 chan, void * data);
|
||||
s32 KPADRead(s32 chan, void * data, u32 size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __PAD_SCORE_FUNCTIONS_H_
|
|
@ -1,5 +1,5 @@
|
|||
#include <coreinit/dynload.h>
|
||||
#include <coreinit/debug.h>
|
||||
#include <wiiu/os/dynload.h>
|
||||
#include <wiiu/os/debug.h>
|
||||
|
||||
#define IMPORT(name) void* addr_##name
|
||||
#define IMPORT_BEGIN(lib)
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
/* source: https://github.com/QuarkTheAwesome/URetro */
|
||||
|
||||
#include <coreinit/thread.h>
|
||||
#include <coreinit/exception.h>
|
||||
#include <coreinit/debug.h>
|
||||
#include <coreinit/dynload.h>
|
||||
#include <coreinit/internal.h>
|
||||
#include <wiiu/os.h>
|
||||
|
||||
#ifndef __EXCEPTION_H__
|
||||
#define __EXCEPTION_H__
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <coreinit/thread.h>
|
||||
#include <coreinit/exception.h>
|
||||
#include <coreinit/debug.h>
|
||||
#include <coreinit/internal.h>
|
||||
#include <wiiu/os.h>
|
||||
#include "exception_handler.h"
|
||||
#include "wiiu_dbg.h"
|
||||
|
||||
|
|
|
@ -17,10 +17,7 @@
|
|||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "memory.h"
|
||||
#include <coreinit/memory.h>
|
||||
#include <coreinit/baseheap.h>
|
||||
#include <coreinit/frameheap.h>
|
||||
#include <coreinit/expandedheap.h>
|
||||
#include <wiiu/mem.h>
|
||||
|
||||
static MEMExpandedHeap* mem1_heap;
|
||||
static MEMExpandedHeap* bucket_heap;
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
|
||||
#ifndef TEX_SHADER_H
|
||||
#define TEX_SHADER_H
|
||||
#include <gx2.h>
|
||||
#include "system/memory.h"
|
||||
#include <wiiu/gx2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define WIIU_DBG_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <wut_types.h>
|
||||
#include <wiiu/types.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
TARGET := elf2rpl
|
||||
|
||||
CXX := g++
|
||||
LD := g++
|
||||
|
||||
OBJS := main.o
|
||||
INCLUDES := -I.
|
||||
|
||||
CFLAGS := -O2 -Wall --std=c++14
|
||||
LDFLAGS := -lz
|
||||
|
||||
ifneq ($(findstring Linux,$(shell uname -a)),)
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
else
|
||||
TARGET := $(TARGET).exe
|
||||
endif
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
@rm -rf $(TARGET) $(OBJS)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c -o $@ $< $(CFLAGS) $(INCLUDES)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(LD) $(OBJS) $(CFLAGS) $(LDFLAGS) -o $@
|
|
@ -0,0 +1,72 @@
|
|||
#pragma once
|
||||
#include <ostream>
|
||||
#include <type_traits>
|
||||
#include "utils.h"
|
||||
|
||||
template<typename Type>
|
||||
class be_val
|
||||
{
|
||||
public:
|
||||
static_assert(!std::is_array<Type>::value, "be_val invalid type: array");
|
||||
static_assert(!std::is_pointer<Type>::value, "be_val invalid type: pointer");
|
||||
static_assert(sizeof(Type) == 1 || sizeof(Type) == 2 || sizeof(Type) == 4 || sizeof(Type) == 8, "be_val invalid type size");
|
||||
|
||||
be_val()
|
||||
{
|
||||
}
|
||||
|
||||
be_val(Type value)
|
||||
{
|
||||
*this = value;
|
||||
}
|
||||
|
||||
Type value() const
|
||||
{
|
||||
return byte_swap(mValue);
|
||||
}
|
||||
|
||||
operator Type() const
|
||||
{
|
||||
return value();
|
||||
}
|
||||
|
||||
template<typename Other> std::enable_if_t<std::is_assignable<Type&, Other>::value, be_val&>
|
||||
operator =(const Other &rhs)
|
||||
{
|
||||
mValue = byte_swap(static_cast<Type>(rhs));
|
||||
return *this;
|
||||
}
|
||||
|
||||
be_val &operator++() { *this = value() + 1; return *this; }
|
||||
be_val &operator--() { *this = value() - 1; return *this; }
|
||||
be_val operator--(int) { auto old = *this; *this = value() - 1; return old; }
|
||||
be_val operator++(int) { auto old = *this; *this = value() + 1; return old; }
|
||||
|
||||
template<typename Other> bool operator == (const Other &rhs) const { return value() == static_cast<Type>(rhs); }
|
||||
template<typename Other> bool operator != (const Other &rhs) const { return value() != static_cast<Type>(rhs); }
|
||||
template<typename Other> bool operator >= (const Other &rhs) const { return value() >= static_cast<Type>(rhs); }
|
||||
template<typename Other> bool operator <= (const Other &rhs) const { return value() <= static_cast<Type>(rhs); }
|
||||
template<typename Other> bool operator > (const Other &rhs) const { return value() > static_cast<Type>(rhs); }
|
||||
template<typename Other> bool operator < (const Other &rhs) const { return value() < static_cast<Type>(rhs); }
|
||||
|
||||
template<typename Other> be_val &operator+=(const Other &rhs) { *this = static_cast<Type>(value() + rhs); return *this; }
|
||||
template<typename Other> be_val &operator-=(const Other &rhs) { *this = static_cast<Type>(value() - rhs); return *this; }
|
||||
template<typename Other> be_val &operator*=(const Other &rhs) { *this = static_cast<Type>(value() * rhs); return *this; }
|
||||
template<typename Other> be_val &operator/=(const Other &rhs) { *this = static_cast<Type>(value() / rhs); return *this; }
|
||||
template<typename Other> be_val &operator%=(const Other &rhs) { *this = static_cast<Type>(value() % rhs); return *this; }
|
||||
template<typename Other> be_val &operator|=(const Other &rhs) { *this = static_cast<Type>(value() | rhs); return *this; }
|
||||
template<typename Other> be_val &operator&=(const Other &rhs) { *this = static_cast<Type>(value() & rhs); return *this; }
|
||||
template<typename Other> be_val &operator^=(const Other &rhs) { *this = static_cast<Type>(value() ^ rhs); return *this; }
|
||||
|
||||
template<typename Other> Type operator+(const Other &rhs) const { return static_cast<Type>(value() + rhs); }
|
||||
template<typename Other> Type operator-(const Other &rhs) const { return static_cast<Type>(value() - rhs); }
|
||||
template<typename Other> Type operator*(const Other &rhs) const { return static_cast<Type>(value() * rhs); }
|
||||
template<typename Other> Type operator/(const Other &rhs) const { return static_cast<Type>(value() / rhs); }
|
||||
template<typename Other> Type operator%(const Other &rhs) const { return static_cast<Type>(value() % rhs); }
|
||||
template<typename Other> Type operator|(const Other &rhs) const { return static_cast<Type>(value() | rhs); }
|
||||
template<typename Other> Type operator&(const Other &rhs) const { return static_cast<Type>(value() & rhs); }
|
||||
template<typename Other> Type operator^(const Other &rhs) const { return static_cast<Type>(value() ^ rhs); }
|
||||
|
||||
protected:
|
||||
Type mValue {};
|
||||
};
|
|
@ -0,0 +1,314 @@
|
|||
#pragma once
|
||||
#include <cstdint>
|
||||
#include "be_val.h"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
namespace elf
|
||||
{
|
||||
|
||||
enum Machine : uint32_t // e_machine
|
||||
{
|
||||
EM_PPC = 20 // PowerPC
|
||||
};
|
||||
|
||||
enum Encoding : uint32_t // e_encoding
|
||||
{
|
||||
ELFDATANONE = 0,
|
||||
ELFDATA2LSB = 1,
|
||||
ELFDATA2MSB = 2
|
||||
};
|
||||
|
||||
enum Class : uint32_t // e_class
|
||||
{
|
||||
ELFCLASSNONE = 0,
|
||||
ELFCLASS32 = 1,
|
||||
ELFCLASS64 = 2
|
||||
};
|
||||
|
||||
enum Version : uint32_t // e_elf_version
|
||||
{
|
||||
EV_NONE = 0,
|
||||
EV_CURRENT = 1,
|
||||
};
|
||||
|
||||
enum FileType : uint32_t // e_type
|
||||
{
|
||||
ET_NONE = 0, // No file type
|
||||
ET_REL = 1, // Relocatable file
|
||||
ET_EXEC = 2, // Executable file
|
||||
ET_DYN = 3, // Shared object file
|
||||
ET_CORE = 4, // Core file
|
||||
ET_LOPROC = 0xff00, // Beginning of processor-specific codes
|
||||
ET_CAFE_RPL = 0xff01, // Cafe RPL file
|
||||
ET_HIPROC = 0xffff // Processor-specific
|
||||
};
|
||||
|
||||
enum EABI : uint32_t // e_abi
|
||||
{
|
||||
EABI_CAFE = 0xcafe // WiiU CafeOS
|
||||
};
|
||||
|
||||
enum SectionFlags : uint32_t // sh_flags
|
||||
{
|
||||
SHF_WRITE = 0x1,
|
||||
SHF_ALLOC = 0x2,
|
||||
SHF_EXECINSTR = 0x4,
|
||||
SHF_DEFLATED = 0x08000000,
|
||||
SHF_MASKPROC = 0xF0000000,
|
||||
};
|
||||
|
||||
enum SectionType : uint32_t // sh_type
|
||||
{
|
||||
SHT_NULL = 0, // No associated section (inactive entry).
|
||||
SHT_PROGBITS = 1, // Program-defined contents.
|
||||
SHT_SYMTAB = 2, // Symbol table.
|
||||
SHT_STRTAB = 3, // String table.
|
||||
SHT_RELA = 4, // Relocation entries; explicit addends.
|
||||
SHT_HASH = 5, // Symbol hash table.
|
||||
SHT_DYNAMIC = 6, // Information for dynamic linking.
|
||||
SHT_NOTE = 7, // Information about the file.
|
||||
SHT_NOBITS = 8, // Data occupies no space in the file.
|
||||
SHT_REL = 9, // Relocation entries; no explicit addends.
|
||||
SHT_SHLIB = 10, // Reserved.
|
||||
SHT_DYNSYM = 11, // Symbol table.
|
||||
SHT_INIT_ARRAY = 14, // Pointers to initialization functions.
|
||||
SHT_FINI_ARRAY = 15, // Pointers to termination functions.
|
||||
SHT_PREINIT_ARRAY = 16, // Pointers to pre-init functions.
|
||||
SHT_GROUP = 17, // Section group.
|
||||
SHT_SYMTAB_SHNDX = 18, // Indices for SHN_XINDEX entries.
|
||||
SHT_LOPROC = 0x70000000, // Lowest processor arch-specific type.
|
||||
SHT_HIPROC = 0x7fffffff, // Highest processor arch-specific type.
|
||||
SHT_LOUSER = 0x80000000, // Lowest type reserved for applications.
|
||||
SHT_RPL_EXPORTS = 0x80000001, // RPL Exports
|
||||
SHT_RPL_IMPORTS = 0x80000002, // RPL Imports
|
||||
SHT_RPL_CRCS = 0x80000003, // RPL CRCs
|
||||
SHT_RPL_FILEINFO = 0x80000004,// RPL FileInfo
|
||||
SHT_HIUSER = 0xffffffff // Highest type reserved for applications.
|
||||
};
|
||||
|
||||
enum SymbolBinding : uint32_t // st_info >> 4
|
||||
{
|
||||
STB_LOCAL = 0, // Local symbol, not visible outside obj file containing def
|
||||
STB_GLOBAL = 1, // Global symbol, visible to all object files being combined
|
||||
STB_WEAK = 2, // Weak symbol, like global but lower-precedence
|
||||
STB_GNU_UNIQUE = 10,
|
||||
STB_LOOS = 10, // Lowest operating system-specific binding type
|
||||
STB_HIOS = 12, // Highest operating system-specific binding type
|
||||
STB_LOPROC = 13, // Lowest processor-specific binding type
|
||||
STB_HIPROC = 15 // Highest processor-specific binding type
|
||||
};
|
||||
|
||||
enum SymbolType : uint32_t // st_info & f
|
||||
{
|
||||
STT_NOTYPE = 0, // Symbol's type is not specified
|
||||
STT_OBJECT = 1, // Symbol is a data object (variable, array, etc.)
|
||||
STT_FUNC = 2, // Symbol is executable code (function, etc.)
|
||||
STT_SECTION = 3, // Symbol refers to a section
|
||||
STT_FILE = 4, // Local, absolute symbol that refers to a file
|
||||
STT_COMMON = 5, // An uninitialized common block
|
||||
STT_TLS = 6, // Thread local data object
|
||||
STT_LOOS = 7, // Lowest operating system-specific symbol type
|
||||
STT_HIOS = 8, // Highest operating system-specific symbol type
|
||||
STT_GNU_IFUNC = 10, // GNU indirect function
|
||||
STT_LOPROC = 13, // Lowest processor-specific symbol type
|
||||
STT_HIPROC = 15 // Highest processor-specific symbol type
|
||||
};
|
||||
|
||||
enum SectionIndex : uint16_t // st_shndx
|
||||
{
|
||||
SHN_UNDEF = 0, // Undefined
|
||||
SHN_LORESERVE = 0xff00, // Reserved range
|
||||
SHN_ABS = 0xfff1, // Absolute symbols
|
||||
SHN_COMMON = 0xfff2, // Common symbols
|
||||
SHN_XINDEX = 0xffff, // Escape -- index stored elsewhere
|
||||
SHN_HIRESERVE = 0xffff
|
||||
};
|
||||
|
||||
enum RelocationType : uint32_t // r_info & 0xff
|
||||
{
|
||||
R_PPC_NONE = 0,
|
||||
R_PPC_ADDR32 = 1,
|
||||
R_PPC_ADDR24 = 2,
|
||||
R_PPC_ADDR16 = 3,
|
||||
R_PPC_ADDR16_LO = 4,
|
||||
R_PPC_ADDR16_HI = 5,
|
||||
R_PPC_ADDR16_HA = 6,
|
||||
R_PPC_ADDR14 = 7,
|
||||
R_PPC_ADDR14_BRTAKEN = 8,
|
||||
R_PPC_ADDR14_BRNTAKEN = 9,
|
||||
R_PPC_REL24 = 10,
|
||||
R_PPC_REL14 = 11,
|
||||
R_PPC_REL14_BRTAKEN = 12,
|
||||
R_PPC_REL14_BRNTAKEN = 13,
|
||||
R_PPC_GOT16 = 14,
|
||||
R_PPC_GOT16_LO = 15,
|
||||
R_PPC_GOT16_HI = 16,
|
||||
R_PPC_GOT16_HA = 17,
|
||||
R_PPC_PLTREL24 = 18,
|
||||
R_PPC_JMP_SLOT = 21,
|
||||
R_PPC_RELATIVE = 22,
|
||||
R_PPC_LOCAL24PC = 23,
|
||||
R_PPC_REL32 = 26,
|
||||
R_PPC_TLS = 67,
|
||||
R_PPC_DTPMOD32 = 68,
|
||||
R_PPC_TPREL16 = 69,
|
||||
R_PPC_TPREL16_LO = 70,
|
||||
R_PPC_TPREL16_HI = 71,
|
||||
R_PPC_TPREL16_HA = 72,
|
||||
R_PPC_TPREL32 = 73,
|
||||
R_PPC_DTPREL16 = 74,
|
||||
R_PPC_DTPREL16_LO = 75,
|
||||
R_PPC_DTPREL16_HI = 76,
|
||||
R_PPC_DTPREL16_HA = 77,
|
||||
R_PPC_DTPREL32 = 78,
|
||||
R_PPC_GOT_TLSGD16 = 79,
|
||||
R_PPC_GOT_TLSGD16_LO = 80,
|
||||
R_PPC_GOT_TLSGD16_HI = 81,
|
||||
R_PPC_GOT_TLSGD16_HA = 82,
|
||||
R_PPC_GOT_TLSLD16 = 83,
|
||||
R_PPC_GOT_TLSLD16_LO = 84,
|
||||
R_PPC_GOT_TLSLD16_HI = 85,
|
||||
R_PPC_GOT_TLSLD16_HA = 86,
|
||||
R_PPC_GOT_TPREL16 = 87,
|
||||
R_PPC_GOT_TPREL16_LO = 88,
|
||||
R_PPC_GOT_TPREL16_HI = 89,
|
||||
R_PPC_GOT_TPREL16_HA = 90,
|
||||
R_PPC_GOT_DTPREL16 = 91,
|
||||
R_PPC_GOT_DTPREL16_LO = 92,
|
||||
R_PPC_GOT_DTPREL16_HI = 93,
|
||||
R_PPC_GOT_DTPREL16_HA = 94,
|
||||
R_PPC_TLSGD = 95,
|
||||
R_PPC_TLSLD = 96,
|
||||
R_PPC_EMB_SDA21 = 109,
|
||||
R_PPC_REL16 = 249,
|
||||
R_PPC_REL16_LO = 250,
|
||||
R_PPC_REL16_HI = 251,
|
||||
R_PPC_REL16_HA = 252,
|
||||
};
|
||||
|
||||
enum RplFileInfoFlag : uint32_t
|
||||
{
|
||||
RPL_IS_RPX = 0x2,
|
||||
};
|
||||
|
||||
static const unsigned HeaderMagic = 0x7f454c46;
|
||||
|
||||
struct Header
|
||||
{
|
||||
be_val<uint32_t> magic; // File identification.
|
||||
be_val<uint8_t> fileClass; // File class.
|
||||
be_val<uint8_t> encoding; // Data encoding.
|
||||
be_val<uint8_t> elfVersion; // File version.
|
||||
be_val<uint16_t> abi; // OS/ABI identification. (EABI_*)
|
||||
be_val<uint8_t> pad[7];
|
||||
|
||||
be_val<uint16_t> type; // Type of file (ET_*)
|
||||
be_val<uint16_t> machine; // Required architecture for this file (EM_*)
|
||||
be_val<uint32_t> version; // Must be equal to 1
|
||||
be_val<uint32_t> entry; // Address to jump to in order to start program
|
||||
be_val<uint32_t> phoff; // Program header table's file offset, in bytes
|
||||
be_val<uint32_t> shoff; // Section header table's file offset, in bytes
|
||||
be_val<uint32_t> flags; // Processor-specific flags
|
||||
be_val<uint16_t> ehsize; // Size of ELF header, in bytes
|
||||
be_val<uint16_t> phentsize; // Size of an entry in the program header table
|
||||
be_val<uint16_t> phnum; // Number of entries in the program header table
|
||||
be_val<uint16_t> shentsize; // Size of an entry in the section header table
|
||||
be_val<uint16_t> shnum; // Number of entries in the section header table
|
||||
be_val<uint16_t> shstrndx; // Sect hdr table index of sect name string table
|
||||
};
|
||||
CHECK_SIZE(Header, 0x34);
|
||||
|
||||
struct SectionHeader
|
||||
{
|
||||
be_val<uint32_t> name; // Section name (index into string table)
|
||||
be_val<uint32_t> type; // Section type (SHT_*)
|
||||
be_val<uint32_t> flags; // Section flags (SHF_*)
|
||||
be_val<uint32_t> addr; // Address where section is to be loaded
|
||||
be_val<uint32_t> offset; // File offset of section data, in bytes
|
||||
be_val<uint32_t> size; // Size of section, in bytes
|
||||
be_val<uint32_t> link; // Section type-specific header table index link
|
||||
be_val<uint32_t> info; // Section type-specific extra information
|
||||
be_val<uint32_t> addralign; // Section address alignment
|
||||
be_val<uint32_t> entsize; // Size of records contained within the section
|
||||
};
|
||||
CHECK_SIZE(SectionHeader, 0x28);
|
||||
|
||||
struct Symbol
|
||||
{
|
||||
be_val<uint32_t> name; // Symbol name (index into string table)
|
||||
be_val<uint32_t> value; // Value or address associated with the symbol
|
||||
be_val<uint32_t> size; // Size of the symbol
|
||||
be_val<uint8_t> info; // Symbol's type and binding attributes
|
||||
be_val<uint8_t> other; // Must be zero; reserved
|
||||
be_val<uint16_t> shndx; // Which section (header table index) it's defined in (SHN_*)
|
||||
};
|
||||
CHECK_SIZE(Symbol, 0x10);
|
||||
|
||||
struct Rela
|
||||
{
|
||||
be_val<uint32_t> offset;
|
||||
be_val<uint32_t> info;
|
||||
be_val<int32_t> addend;
|
||||
};
|
||||
CHECK_SIZE(Rela, 0x0C);
|
||||
|
||||
struct RplImport
|
||||
{
|
||||
be_val<uint32_t> count;
|
||||
be_val<uint32_t> signature;
|
||||
char name[1];
|
||||
};
|
||||
|
||||
struct RplExport
|
||||
{
|
||||
struct Export
|
||||
{
|
||||
be_val<uint32_t> value;
|
||||
be_val<uint32_t> name;
|
||||
};
|
||||
|
||||
be_val<uint32_t> count;
|
||||
be_val<uint32_t> signature;
|
||||
Export exports[1];
|
||||
};
|
||||
|
||||
struct RplCrc
|
||||
{
|
||||
be_val<uint32_t> crc;
|
||||
};
|
||||
CHECK_SIZE(RplCrc, 0x04);
|
||||
|
||||
struct RplFileInfo
|
||||
{
|
||||
be_val<uint32_t> version;
|
||||
be_val<uint32_t> textSize;
|
||||
be_val<uint32_t> textAlign;
|
||||
be_val<uint32_t> dataSize;
|
||||
be_val<uint32_t> dataAlign;
|
||||
be_val<uint32_t> loadSize;
|
||||
be_val<uint32_t> loadAlign;
|
||||
be_val<uint32_t> tempSize;
|
||||
be_val<uint32_t> trampAdjust;
|
||||
be_val<uint32_t> sdaBase;
|
||||
be_val<uint32_t> sda2Base;
|
||||
be_val<uint32_t> stackSize;
|
||||
be_val<uint32_t> filename;
|
||||
be_val<uint32_t> flags;
|
||||
be_val<uint32_t> heapSize;
|
||||
be_val<uint32_t> tagOffset;
|
||||
be_val<uint32_t> minVersion;
|
||||
be_val<int32_t> compressionLevel;
|
||||
be_val<uint32_t> trampAddition;
|
||||
be_val<uint32_t> fileInfoPad;
|
||||
be_val<uint32_t> cafeSdkVersion;
|
||||
be_val<uint32_t> cafeSdkRevision;
|
||||
be_val<uint16_t> tlsModuleIndex;
|
||||
be_val<uint16_t> tlsAlignShift;
|
||||
be_val<uint32_t> runtimeFileInfoSize;
|
||||
};
|
||||
CHECK_SIZE(RplFileInfo, 0x60);
|
||||
|
||||
} // namespace elf
|
||||
|
||||
#pragma pack(pop)
|
|
@ -0,0 +1,172 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F6442B08-9323-4D98-ABA6-8856467B148B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>elf2rpl</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\</OutDir>
|
||||
<IncludePath>$(SolutionDir)\ext\zlib;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\</OutDir>
|
||||
<IncludePath>$(SolutionDir)\ext\zlib;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\</OutDir>
|
||||
<IncludePath>$(SolutionDir)\ext\zlib;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\</OutDir>
|
||||
<IncludePath>$(SolutionDir)\ext\zlib;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\ext\zlib\crc32.c" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\common\be_val.h" />
|
||||
<ClInclude Include="..\common\elf.h" />
|
||||
<ClInclude Include="..\common\utils.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\ext">
|
||||
<UniqueIdentifier>{36d55ffd-f33d-437b-abc1-6e26a832efb3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\ext\zlib\crc32.c">
|
||||
<Filter>Source Files\ext</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\common\be_val.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\common\elf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\common\utils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue