1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-01 07:54:27 +00:00

(WIIU) misc.

This commit is contained in:
aliaspider 2016-11-02 22:06:15 +01:00
parent 1b9d92554d
commit 176dd79f33
20 changed files with 278 additions and 258 deletions

View File

@ -79,10 +79,7 @@ $(error "Please set WUT_ROOT in your environment. export WUT_ROOT=<path to>WUT")
endif
export PATH := $(PATH):$(DEVKITPPC)/bin:$(PORTLIBS)/bin
export LIBOGC_INC := $(DEVKITPRO)/libogc/include
export LIBOGC_LIB := $(DEVKITPRO)/libogc/lib/wii
export PORTLIBS := $(DEVKITPRO)/portlibs/ppc
export PATH := $(PATH):$(DEVKITPPC)/bin
PREFIX := powerpc-eabi-
@ -96,7 +93,7 @@ NM := $(PREFIX)nm
LD := $(CXX)
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -I$(WUT_ROOT)/include -I$(LIBOGC_INC)
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -I$(WUT_ROOT)/include
LIBDIRS := -L.
CFLAGS := -mrvl -mcpu=750 -meabi -mhard-float
@ -138,7 +135,6 @@ all: $(TARGET)
$(TARGET): $(TARGET).elf
$(TARGET).elf: $(OBJ) libretro_wiiu.a wiiu/link.ld
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
@ -155,9 +151,8 @@ $(TARGET).elf: $(OBJ) libretro_wiiu.a wiiu/link.ld
%.a:
$(AR) -rc $@ $^
$(TARGET).elf: wiiu/link.ld $(OBJ)
# $(LD) -T wiiu/link.ld $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
$(LD) -n -T wiiu/link.ld $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
$(TARGET).elf: $(OBJ) libretro_wiiu.a wiiu/link_ra.ld
$(LD) -n -T wiiu/link_ra.ld $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
clean:
rm -f $(OBJ)

View File

@ -226,43 +226,34 @@ void net_print(const char* str)
log_write(NULL, 0, str, strlen(str));
}
void net_print_exp(const char* str)
{
send(log_socket, str, strlen(str), 0);
}
static devoptab_t dotab_stdout = {
"stdout", // device name
0, // size of file structure
NULL, // device open
NULL, // device close
log_write, // device write
NULL, // device read
NULL, // device seek
NULL, // device fstat
NULL, // device stat
NULL, // device link
NULL, // device unlink
NULL, // device chdir
NULL, // device rename
NULL, // device mkdir
0, // dirStateSize
NULL, // device diropen_r
NULL, // device dirreset_r
NULL, // device dirnext_r
NULL, // device dirclose_r
NULL, // device statvfs_r
NULL, // device ftrunctate_r
NULL, // device fsync_r
NULL, // deviceData;
"stdout_net", // device name
0, // size of file structure
NULL, // device open
NULL, // device close
log_write, // device write
NULL,
};
int __entry_menu(int argc, char **argv)
{
InitFunctionPointers();
#if 1
setup_os_exceptions();
#else
InstallExceptionHandler();
#endif
socket_lib_init();
log_init("10.42.0.1");
devoptab_list[STD_OUT] = &dotab_stdout;
devoptab_list[STD_ERR] = &dotab_stdout;
memoryInitialize();
mount_sd_fat("sd");
setup_os_exceptions();
// InstallExceptionHandler();
VPADInit();
OSScreenInit();
@ -294,11 +285,10 @@ int __entry_menu(int argc, char **argv)
main_exit(NULL);
printf("Unmount SD\n");
unmount_sd_fat("sd");
printf("Release memory\n");
memoryRelease();
fflush(stdout);
fflush(stderr);
log_deinit();
return 0;

View File

@ -53,9 +53,18 @@ static int16_t wiiu_input_state(void *data, const struct retro_keybind **binds,
{
wiiu_input_t *wiiu = (wiiu_input_t*)data;
if(!wiiu)
return 0;
if (port > 0)
return 0;
if(!binds)
return 0;
if(!binds[port])
return 0;
switch (device)
{
case RETRO_DEVICE_JOYPAD:

View File

@ -177,7 +177,7 @@ static int sd_fat_open_r (struct _reent *r, void *fileStruct, const char *path,
return -1;
}
int result = FSOpenFile(dev->pClient, dev->pCmd, real_path, mode_str, &fd, -1);
int result = FSOpenFile(dev->pClient, dev->pCmd, real_path, mode_str, (FSFileHandle*)&fd, -1);
free(real_path);
@ -740,7 +740,7 @@ static DIR_ITER *sd_fat_diropen_r (struct _reent *r, DIR_ITER *dirState, const c
int dirHandle;
int result = FSOpenDir(dev->pClient, dev->pCmd, real_path, &dirHandle, -1);
int result = FSOpenDir(dev->pClient, dev->pCmd, real_path, (FSDirectoryHandle*)&dirHandle, -1);
free(real_path);

View File

@ -9,6 +9,7 @@ SECTIONS {
.rodata : {
*(.rodata*);
}
. = 0x10000000;
.data : {
*(.data*);

View File

@ -1,4 +1,8 @@
export WIILOAD=tcp:$1
powerpc-eabi-strip retroarch_wiiu.elf -o retroarch_wiiu_stripped.elf
wiiload retroarch_wiiu_stripped.elf
netcat -p 4405 -l $1
powerpc-eabi-strip $2 -o $2.stripped
wiiload $2.stripped
#netcat -p 4405 -l $1
# calling netcat directly after wiiload is unreliable, better use something like :
# for i in {1..20}; do echo; echo == $i ==; echo; netcat -p 4405 -l <wiiu ip>; done
# from a different terminal to continuously listen for incoming connections

View File

@ -13,15 +13,13 @@
ori %r11, %r11, addr_##name@l; \
lwz %r11, 0(%r11); \
mtctr %r11; \
bctr;
bctr
#define EXPORT_BEGIN(lib)
#define EXPORT_END()
.align 2;
.section ".text";
#include "../rpl/libcoreinit/exports.h"
#include "../rpl/libnsysnet/exports.h"
#include "../rpl/libgx2/exports.h"
#include "../rpl/libproc_ui/exports.h"
#include "../rpl/libsndcore2/exports.h"
#include "../rpl/libsysapp/exports.h"
#include "../rpl/libvpad/exports.h"
#include "exports/all.h"

View File

@ -2,16 +2,17 @@
#include <coreinit/debug.h>
#define EXPORT(name) void* addr_##name
#include "../rpl/libcoreinit/exports.h"
#include "../rpl/libnsysnet/exports.h"
#include "../rpl/libgx2/exports.h"
#include "../rpl/libproc_ui/exports.h"
#include "../rpl/libsndcore2/exports.h"
#include "../rpl/libsysapp/exports.h"
#include "../rpl/libvpad/exports.h"
#define EXPORT_BEGIN(lib)
#define EXPORT_END()
#include "exports/all.h"
#undef EXPORT
#define EXPORT(name) do{if(OSDynLoad_FindExport(handle, 0, #name, &addr_##name) < 0)OSFatal("Function " # name " is NULL");} while(0)
#undef EXPORT_BEGIN
#undef EXPORT_END
#define EXPORT(name) do{if(OSDynLoad_FindExport(handle, 0, #name, &addr_##name) < 0)OSFatal("Function " # name " is NULL");} while(0)
#define EXPORT_BEGIN(lib) OSDynLoad_Acquire(#lib, &handle)
#define EXPORT_END() OSDynLoad_Release(handle)
void InitFunctionPointers(void)
{
@ -19,33 +20,6 @@ void InitFunctionPointers(void)
addr_OSDynLoad_Acquire = *(void**)0x00801500;
addr_OSDynLoad_FindExport = *(void**)0x00801504;
OSDynLoad_Acquire("coreinit.rpl", &handle);
OSDynLoad_FindExport(handle, 0, "OSFatal", &addr_OSFatal);
#include "../rpl/libcoreinit/exports.h"
OSDynLoad_Release(handle);
OSDynLoad_Acquire("nsysnet.rpl", &handle);
#include "../rpl/libnsysnet/exports.h"
OSDynLoad_Release(handle);
OSDynLoad_Acquire("gx2.rpl", &handle);
#include "../rpl/libgx2/exports.h"
OSDynLoad_Release(handle);
OSDynLoad_Acquire("proc_ui.rpl", &handle);
#include "../rpl/libproc_ui/exports.h"
OSDynLoad_Release(handle);
OSDynLoad_Acquire("sndcore2.rpl", &handle);
#include "../rpl/libsndcore2/exports.h"
OSDynLoad_Release(handle);
OSDynLoad_Acquire("sysapp.rpl", &handle);
#include "../rpl/libsysapp/exports.h"
OSDynLoad_Release(handle);
OSDynLoad_Acquire("vpad.rpl", &handle);
#include "../rpl/libvpad/exports.h"
OSDynLoad_Release(handle);
#include "exports/all.h"
}

View File

@ -1,5 +1,6 @@
/* source: https://github.com/QuarkTheAwesome/URetro */
#include <coreinit/thread.h>
#include <coreinit/exception.h>
#include <coreinit/debug.h>
#include <coreinit/dynload.h>
@ -39,8 +40,10 @@ unsigned char exception_handler(void* contextIn) {
DisassemblePPCRange((void*)context[38]-0x18, (void*)context[38]+0x4, (void*)exception_disassembly_helper, 0, 0);
char buf[2048];
__os_snprintf(buf, 2048, "SP:%08X LR:%08X PC:%08X CR:%08X CTR:%08X\nXER:%08X SR0:%08X SR1:%08X EX0:%08X EX1:%08X\nr0:%08X r2:%08X r3:%08X r4:%08X r5:%08X\nr6:%08X r7:%08X r8:%08X r9:%08X r10:%08X\nr11:%08X r12:%08X r13:%08X r14:%08X r15:%08X\nr16:%08X r17:%08X r18:%08X r19:%08X r20:%08X\nr21:%08X r22:%08X r23:%08X r24:%08X r25:%08X\nr26:%08X r27:%08X r28:%08X r29:%08X r30:%08X\nr31:%08X\n%s", context[3], context[35], context[38], context[34], context[36], context[37], context[38], context[39], context[40], context[41], context[2], context[4], context[5], context[6], context[7], context[8], context[9], context[10], context[11], context[12], context[13], context[14], context[15], context[16], context[17], context[18], context[19], context[20], context[21], context[22], context[23], context[24], context[25], context[26], context[27], context[28], context[29], context[30], context[31], context[32], context[33], buf2);
void net_print(const char* str);
net_print(buf);
void net_print_exp(const char* str);
void log_deinit(void);
net_print_exp(buf);
log_deinit();
OSFatal(buf);
return 0;

View File

@ -2,8 +2,9 @@
#include <coreinit/thread.h>
#include <coreinit/exception.h>
#include <coreinit/debug.h>
#include <coreinit/internal.h>
#include "exception_handler.h"
#include "wiiu/wiiu_dbg.h"
#include "wiiu_dbg.h"
#define OS_EXCEPTION_MODE_GLOBAL_ALL_CORES 4
@ -14,160 +15,197 @@
/* Exceptions */
typedef struct OSContext_
{
/* OSContext identifier */
uint32_t tag1;
uint32_t tag2;
/* OSContext identifier */
uint32_t tag1;
uint32_t tag2;
/* GPRs */
uint32_t gpr[32];
/* GPRs */
uint32_t gpr[32];
/* Special registers */
uint32_t cr;
uint32_t lr;
uint32_t ctr;
uint32_t xer;
/* Special registers */
uint32_t cr;
uint32_t lr;
uint32_t ctr;
uint32_t xer;
/* Initial PC and MSR */
uint32_t srr0;
uint32_t srr1;
/* Initial PC and MSR */
uint32_t srr0;
uint32_t srr1;
/* Only valid during DSI exception */
uint32_t exception_specific0;
uint32_t exception_specific1;
/* Only valid during DSI exception */
uint32_t exception_specific0;
uint32_t exception_specific1;
/* There is actually a lot more here but we don't need the rest*/
/* There is actually a lot more here but we don't need the rest*/
} OSContext_;
#define CPU_STACK_TRACE_DEPTH 10
#define __stringify(rn) #rn
#define CPU_STACK_TRACE_DEPTH 10
#define __stringify(rn) #rn
#define mfspr(_rn) \
({ register uint32_t _rval = 0; \
asm volatile("mfspr %0," __stringify(_rn) \
: "=r" (_rval));\
_rval; \
({ register uint32_t _rval = 0; \
asm volatile("mfspr %0," __stringify(_rn) \
: "=r" (_rval));\
_rval; \
})
typedef struct _framerec {
struct _framerec *up;
void *lr;
typedef struct _framerec
{
struct _framerec* up;
void* lr;
} frame_rec, *frame_rec_t;
static const char *exception_names[] = {
"DSI",
"ISI",
"PROGRAM"
static const char* exception_names[] =
{
"DSI",
"ISI",
"PROGRAM"
};
static const char exception_print_formats[18][45] = {
"Exception type %s occurred!\n", // 0
"GPR00 %08X GPR08 %08X GPR16 %08X GPR24 %08X\n", // 1
"GPR01 %08X GPR09 %08X GPR17 %08X GPR25 %08X\n", // 2
"GPR02 %08X GPR10 %08X GPR18 %08X GPR26 %08X\n", // 3
"GPR03 %08X GPR11 %08X GPR19 %08X GPR27 %08X\n", // 4
"GPR04 %08X GPR12 %08X GPR20 %08X GPR28 %08X\n", // 5
"GPR05 %08X GPR13 %08X GPR21 %08X GPR29 %08X\n", // 6
"GPR06 %08X GPR14 %08X GPR22 %08X GPR30 %08X\n", // 7
"GPR07 %08X GPR15 %08X GPR23 %08X GPR31 %08X\n", // 8
"LR %08X SRR0 %08x SRR1 %08x\n", // 9
"DAR %08X DSISR %08X\n", // 10
"STACK DUMP:", // 11
" --> ", // 12
" -->\n", // 13
"\n", // 14
"%p", // 15
"\nCODE DUMP:\n", // 16
"%p: %08X %08X %08X %08X\n", // 17
static const char exception_print_formats[18][45] =
{
"Exception type %s occurred!\n", // 0
"GPR00 %08X GPR08 %08X GPR16 %08X GPR24 %08X\n", // 1
"GPR01 %08X GPR09 %08X GPR17 %08X GPR25 %08X\n", // 2
"GPR02 %08X GPR10 %08X GPR18 %08X GPR26 %08X\n", // 3
"GPR03 %08X GPR11 %08X GPR19 %08X GPR27 %08X\n", // 4
"GPR04 %08X GPR12 %08X GPR20 %08X GPR28 %08X\n", // 5
"GPR05 %08X GPR13 %08X GPR21 %08X GPR29 %08X\n", // 6
"GPR06 %08X GPR14 %08X GPR22 %08X GPR30 %08X\n", // 7
"GPR07 %08X GPR15 %08X GPR23 %08X GPR31 %08X\n", // 8
"LR %08X SRR0 %08x SRR1 %08x\n", // 9
"DAR %08X DSISR %08X\n", // 10
"STACK DUMP:", // 11
" --> ", // 12
" -->\n", // 13
"\n", // 14
"%p", // 15
"\nCODE DUMP:\n", // 16
"%p: %08X %08X %08X %08X\n", // 17
};
void net_print_exp(const char* str);
void log_deinit(void);
static unsigned char exception_cb(void * c, unsigned char exception_type) {
char buf[4096];
int pos = 0;
static unsigned char exception_cb(void* c, unsigned char exception_type)
{
char gdb_buf[512];
char* gdb_buf_ptr = gdb_buf;
char buf[4096];
int pos = 0;
OSContext_ *context = (OSContext_ *) c;
/*
* This part is mostly from libogc. Thanks to the devs over there.
*/
pos += sprintf(buf + pos, exception_print_formats[0], exception_names[exception_type]);
pos += sprintf(buf + pos, exception_print_formats[1], context->gpr[0], context->gpr[8], context->gpr[16], context->gpr[24]);
pos += sprintf(buf + pos, exception_print_formats[2], context->gpr[1], context->gpr[9], context->gpr[17], context->gpr[25]);
pos += sprintf(buf + pos, exception_print_formats[3], context->gpr[2], context->gpr[10], context->gpr[18], context->gpr[26]);
pos += sprintf(buf + pos, exception_print_formats[4], context->gpr[3], context->gpr[11], context->gpr[19], context->gpr[27]);
pos += sprintf(buf + pos, exception_print_formats[5], context->gpr[4], context->gpr[12], context->gpr[20], context->gpr[28]);
pos += sprintf(buf + pos, exception_print_formats[6], context->gpr[5], context->gpr[13], context->gpr[21], context->gpr[29]);
pos += sprintf(buf + pos, exception_print_formats[7], context->gpr[6], context->gpr[14], context->gpr[22], context->gpr[30]);
pos += sprintf(buf + pos, exception_print_formats[8], context->gpr[7], context->gpr[15], context->gpr[23], context->gpr[31]);
pos += sprintf(buf + pos, exception_print_formats[9], context->lr, context->srr0, context->srr1);
OSContext_ *context = (OSContext_*) c;
/*
* This part is mostly from libogc. Thanks to the devs over there.
*/
pos += sprintf(buf + pos, exception_print_formats[0], exception_names[exception_type]);
pos += sprintf(buf + pos, exception_print_formats[1], context->gpr[0], context->gpr[8], context->gpr[16],
context->gpr[24]);
pos += sprintf(buf + pos, exception_print_formats[2], context->gpr[1], context->gpr[9], context->gpr[17],
context->gpr[25]);
pos += sprintf(buf + pos, exception_print_formats[3], context->gpr[2], context->gpr[10], context->gpr[18],
context->gpr[26]);
pos += sprintf(buf + pos, exception_print_formats[4], context->gpr[3], context->gpr[11], context->gpr[19],
context->gpr[27]);
pos += sprintf(buf + pos, exception_print_formats[5], context->gpr[4], context->gpr[12], context->gpr[20],
context->gpr[28]);
pos += sprintf(buf + pos, exception_print_formats[6], context->gpr[5], context->gpr[13], context->gpr[21],
context->gpr[29]);
pos += sprintf(buf + pos, exception_print_formats[7], context->gpr[6], context->gpr[14], context->gpr[22],
context->gpr[30]);
pos += sprintf(buf + pos, exception_print_formats[8], context->gpr[7], context->gpr[15], context->gpr[23],
context->gpr[31]);
pos += sprintf(buf + pos, exception_print_formats[9], context->lr, context->srr0, context->srr1);
//if(exception_type == OS_EXCEPTION_DSI) {
pos += sprintf(buf + pos, exception_print_formats[10], context->exception_specific1, context->exception_specific0); // this freezes
//}
//if(exception_type == OS_EXCEPTION_DSI) {
pos += sprintf(buf + pos, exception_print_formats[10], context->exception_specific1,
context->exception_specific0); // this freezes
//}
void *pc = (void*)context->srr0;
void *lr = (void*)context->lr;
void *r1 = (void*)context->gpr[1];
register uint32_t i = 0;
register frame_rec_t l,p = (frame_rec_t)lr;
void* pc = (void*)context->srr0;
void* lr = (void*)context->lr;
void* r1 = (void*)context->gpr[1];
register uint32_t i = 0;
register frame_rec_t l, p = (frame_rec_t)lr;
l = p;
p = r1;
if(!p)
asm volatile("mr %0,%%r1" : "=r"(p));
l = p;
p = r1;
pos += sprintf(buf + pos, exception_print_formats[11]);
if (!p)
asm volatile("mr %0,%%r1" : "=r"(p));
for(i = 0; i < CPU_STACK_TRACE_DEPTH-1 && p->up; p = p->up, i++) {
if(i % 4)
pos += sprintf(buf + pos, exception_print_formats[12]);
else {
if(i > 0)
pos += sprintf(buf + pos, exception_print_formats[13]);
else
pos += sprintf(buf + pos, exception_print_formats[14]);
}
pos += sprintf(buf + pos, exception_print_formats[11]);
switch(i) {
case 0:
if(pc)
pos += sprintf(buf + pos, exception_print_formats[15],pc);
break;
case 1:
if(!l)
l = (frame_rec_t)mfspr(8);
pos += sprintf(buf + pos, exception_print_formats[15],(void*)l);
break;
default:
pos += sprintf(buf + pos, exception_print_formats[15],(void*)(p->up->lr));
break;
}
}
for (i = 0; i < CPU_STACK_TRACE_DEPTH - 1 && p->up; p = p->up, i++)
{
if (i % 4)
pos += sprintf(buf + pos, exception_print_formats[12]);
else
{
if (i > 0)
pos += sprintf(buf + pos, exception_print_formats[13]);
else
pos += sprintf(buf + pos, exception_print_formats[14]);
}
//if(exception_type == OS_EXCEPTION_DSI) {
uint32_t *pAdd = (uint32_t*)context->srr0;
pos += sprintf(buf + pos, exception_print_formats[16]);
// TODO by Dimok: this was actually be 3 instead of 2 lines in libogc .... but there is just no more space anymore on the screen
for (i = 0; i < 8; i += 4)
pos += sprintf(buf + pos, exception_print_formats[17], &(pAdd[i]),pAdd[i], pAdd[i+1], pAdd[i+2], pAdd[i+3]);
//}
void net_print(const char* str);
switch (i)
{
case 0:
if (pc)
{
pos += sprintf(buf + pos, exception_print_formats[15], pc);
gdb_buf_ptr += __os_snprintf(gdb_buf_ptr, &gdb_buf[sizeof(gdb_buf)] - gdb_buf_ptr, "info line *0x%08X\n", pc);
net_print(buf);
OSFatal(buf);
return 1;
}
break;
case 1:
if (!l)
l = (frame_rec_t)mfspr(8);
pos += sprintf(buf + pos, exception_print_formats[15], (void*)l);
gdb_buf_ptr += __os_snprintf(gdb_buf_ptr, &gdb_buf[sizeof(gdb_buf)] - gdb_buf_ptr, "info line *0x%08X\n", l);
break;
default:
pos += sprintf(buf + pos, exception_print_formats[15], (void*)(p->up->lr));
gdb_buf_ptr += __os_snprintf(gdb_buf_ptr, &gdb_buf[sizeof(gdb_buf)] - gdb_buf_ptr, "info line *0x%08X\n", p->up->lr);
break;
}
}
//if(exception_type == OS_EXCEPTION_DSI) {
uint32_t* pAdd = (uint32_t*)context->srr0;
pos += sprintf(buf + pos, exception_print_formats[16]);
// TODO by Dimok: this was actually be 3 instead of 2 lines in libogc .... but there is just no more space anymore on the screen
for (i = 0; i < 8; i += 4)
pos += sprintf(buf + pos, exception_print_formats[17], &(pAdd[i]), pAdd[i], pAdd[i + 1], pAdd[i + 2], pAdd[i + 3]);
//}
net_print_exp(gdb_buf);
// net_print_exp(buf);
log_deinit();
OSFatal(buf);
return 1;
}
static unsigned char dsi_exception_cb(void * context) {
return exception_cb(context, 0);
static unsigned char dsi_exception_cb(void* context)
{
return exception_cb(context, 0);
}
static unsigned char isi_exception_cb(void * context) {
return exception_cb(context, 1);
static unsigned char isi_exception_cb(void* context)
{
return exception_cb(context, 1);
}
static unsigned char program_exception_cb(void * context) {
return exception_cb(context, 2);
static unsigned char program_exception_cb(void* context)
{
return exception_cb(context, 2);
}
void setup_os_exceptions(void) {
OSSetExceptionCallback(OS_EXCEPTION_DSI, (OSExceptionCallbackFn)&dsi_exception_cb);
OSSetExceptionCallback(OS_EXCEPTION_ISI, (OSExceptionCallbackFn)&isi_exception_cb);
OSSetExceptionCallback(OS_EXCEPTION_PROGRAM, (OSExceptionCallbackFn)&program_exception_cb);
void setup_os_exceptions(void)
{
OSSetExceptionCallback(OS_EXCEPTION_DSI, (OSExceptionCallbackFn)&dsi_exception_cb);
OSSetExceptionCallback(OS_EXCEPTION_ISI, (OSExceptionCallbackFn)&isi_exception_cb);
OSSetExceptionCallback(OS_EXCEPTION_PROGRAM, (OSExceptionCallbackFn)&program_exception_cb);
}

View File

@ -0,0 +1,8 @@
#include "libcoreinit.h"
#include "libnsysnet.h"
#include "libgx2.h"
#include "libproc_ui.h"
#include "libsndcore2.h"
#include "libsysapp.h"
#include "libvpad.h"

View File

@ -0,0 +1,7 @@
EXPORT_BEGIN(coreinit.rpl);
/* OSFatal should preferably be put first in the list */
#include "../rpl/libcoreinit/exports.h"
EXPORT_END();

View File

@ -0,0 +1,6 @@
EXPORT_BEGIN(gx2.rpl);
#include "../rpl/libgx2/exports.h"
EXPORT_END();

View File

@ -0,0 +1,6 @@
EXPORT_BEGIN(nsysnet.rpl);
#include "../rpl/libnsysnet/exports.h"
EXPORT_END();

View File

@ -0,0 +1,6 @@
EXPORT_BEGIN(proc_ui.rpl);
#include "../rpl/libproc_ui/exports.h"
EXPORT_END();

View File

@ -0,0 +1,6 @@
EXPORT_BEGIN(sndcore2.rpl);
#include "../rpl/libsndcore2/exports.h"
EXPORT_END();

View File

@ -0,0 +1,6 @@
EXPORT_BEGIN(sysapp.rpl);
#include "../rpl/libsysapp/exports.h"
EXPORT_END();

View File

@ -0,0 +1,6 @@
EXPORT_BEGIN(vpad.rpl);
#include "../rpl/libvpad/exports.h"
EXPORT_END();

View File

@ -1,43 +0,0 @@
#!/usr/bin/python
import os, sys, zlib, socket, struct
#ip = os.getenv("WIILOAD")
ip = "tcp:10.42.0.170"
assert ip.startswith("tcp:")
wii_ip = (ip[4:], 4299)
filename = sys.argv[1]
WIILOAD_VERSION_MAJOR=0
WIILOAD_VERSION_MINOR=5
len_uncompressed = os.path.getsize(filename)
c_data = zlib.compress(open(filename).read(), 6)
chunk_size = 1024*128
chunks = [c_data[i:i+chunk_size] for i in range(0, len(c_data), chunk_size)]
args = [os.path.basename(filename)]+sys.argv[2:]
args = "\x00".join(args) + "\x00"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(wii_ip)
s.send("HAXX")
s.send(struct.pack("B", WIILOAD_VERSION_MAJOR)) # one byte, unsigned
s.send(struct.pack("B", WIILOAD_VERSION_MINOR)) # one byte, unsigned
s.send(struct.pack(">H",len(args))) # bigendian, 2 bytes, unsigned
s.send(struct.pack(">L",len(c_data))) # bigendian, 4 bytes, unsigned
s.send(struct.pack(">L",len_uncompressed)) # bigendian, 4 bytes, unsigned
print len(chunks),"chunks to send"
for piece in chunks:
s.send(piece)
sys.stdout.write("."); sys.stdout.flush()
sys.stdout.write("\n")
s.send(args)
s.close()
print "done"

View File

@ -20,7 +20,7 @@ extern "C" {
#define DEBUG_VAR64(X) printf( #X"\r\t\t\t\t : 0x%016llX\n", (u64)(X))
//#define DEBUG_ERROR(X) do{if(X)dump_result_value(X);}while(0)
#define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H"
#define PRINTFPOS_STR(X,Y) "\x1b["X";"Y"H"
#define PRINTF_LINE(X) "\x1b["X";0H"
#define PRINTFPOS_STR(X,Y) "\x1b[" X ";" Y "H"
#define PRINTF_LINE(X) "\x1b[" X ";0H"
#endif // WIIU_DBG_H