mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
commit
d4eba0ab96
@ -1,16 +1,23 @@
|
||||
TARGET := retroarch_wiiu
|
||||
RPX_BUILD = 0
|
||||
DEBUG = 0
|
||||
GRIFFIN_BUILD = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
|
||||
OBJ :=
|
||||
OBJ += wiiu/system/memory.o
|
||||
OBJ += wiiu/system/exception_handler.o
|
||||
OBJ += wiiu/fs/sd_fat_devoptab.o
|
||||
OBJ += wiiu/fs/fs_utils.o
|
||||
OBJ += wiiu/system/dynamic.o
|
||||
OBJ += wiiu/system/dyn_stubs.o
|
||||
OBJ += wiiu/tex_shader.o
|
||||
PC_DEVELOPMENT_IP_ADDRESS =
|
||||
PC_DEVELOPMENT_TCP_PORT =
|
||||
|
||||
OBJ :=
|
||||
OBJ += wiiu/system/memory.o
|
||||
OBJ += wiiu/system/exception_handler.o
|
||||
OBJ += wiiu/fs/sd_fat_devoptab.o
|
||||
OBJ += wiiu/fs/fs_utils.o
|
||||
OBJ += wiiu/tex_shader.o
|
||||
|
||||
ifneq ($(RPX_BUILD), 1)
|
||||
OBJ += wiiu/system/dynamic.o
|
||||
OBJ += wiiu/system/dyn_stubs.o
|
||||
endif
|
||||
|
||||
DEFINES :=
|
||||
|
||||
@ -93,6 +100,7 @@ STRIP := $(PREFIX)strip
|
||||
NM := $(PREFIX)nm
|
||||
LD := $(CXX)
|
||||
|
||||
ELF2RPL := $(WUT_ROOT)/tools/bin/elf2rpl
|
||||
|
||||
INCDIRS := -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include -Iwiiu -I$(WUT_ROOT)/include
|
||||
LIBDIRS := -L.
|
||||
@ -101,9 +109,9 @@ CFLAGS := -mrvl -mcpu=750 -meabi -mhard-float
|
||||
LDFLAGS :=
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
LDFLAGS := $(CFLAGS)
|
||||
|
||||
@ -118,24 +126,42 @@ CFLAGS += -DHAVE_MAIN
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE -DSINC_LOWEST_QUALITY
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
||||
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"'
|
||||
endif
|
||||
|
||||
ifneq ($(PC_DEVELOPMENT_TCP_PORT),)
|
||||
CFLAGS += -DPC_DEVELOPMENT_TCP_PORT=$(PC_DEVELOPMENT_TCP_PORT)
|
||||
endif
|
||||
|
||||
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_START := -Wl,--whole-archive
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
|
||||
LDFLAGS += -nostartfiles -Wl,-Map,$(notdir $@).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc
|
||||
ifeq ($(RPX_BUILD), 1)
|
||||
CFLAGS += -fno-builtin -ffreestanding -DRPX_BUILD
|
||||
LIBDIRS += -L$(WUT_ROOT)/lib -L$(DEVKITPPC)/lib
|
||||
LDFLAGS += -T $(WUT_ROOT)/rules/rpl.ld -pie -fPIE -z common-page-size=64 -z max-page-size=64
|
||||
LDFLAGS += -lcoreinit -lgx2 -lnsysnet -lproc_ui -lsndcore2 -lsysapp -lvpad
|
||||
else
|
||||
LDFLAGS += -n -T wiiu/link_ra.ld
|
||||
endif
|
||||
|
||||
LDFLAGS += -nostartfiles -Wl,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc
|
||||
LDFLAGS += -Wl,-wrap,malloc_usable_size,-wrap,_malloc_r,-wrap,_free_r,-wrap,_realloc_r,-wrap,_calloc_r,-wrap,_memalign_r
|
||||
LDFLAGS += -Wl,-wrap,_malloc_usable_size_r,-wrap,valloc,-wrap,_valloc_r,-wrap,_pvalloc_r,--gc-sections
|
||||
LDFLAGS += -Wl,-wrap,_malloc_usable_size_r,-wrap,valloc,-wrap,_valloc_r,-wrap,_pvalloc_r,-wrap,__eabi,--gc-sections
|
||||
|
||||
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(TARGET).elf
|
||||
|
||||
ifeq ($(RPX_BUILD), 1)
|
||||
all: $(TARGET).elf $(TARGET).rpx
|
||||
else
|
||||
all: $(TARGET).elf
|
||||
endif
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
|
||||
@ -153,10 +179,14 @@ $(TARGET): $(TARGET).elf
|
||||
$(AR) -rc $@ $^
|
||||
|
||||
$(TARGET).elf: $(OBJ) libretro_wiiu.a wiiu/link_ra.ld
|
||||
$(LD) -n -T wiiu/link_ra.ld $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
%.rpx: %.elf
|
||||
@$(ELF2RPL) $(notdir $<) $@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ)
|
||||
rm -f $(TARGET).elf
|
||||
rm -f $(TARGET).rpx
|
||||
|
||||
.PHONY: $(BUILD) clean all
|
||||
.PHONY: clean all
|
||||
|
@ -106,14 +106,14 @@ static void* ax_audio_init(const char* device, unsigned rate, unsigned latency)
|
||||
ax->offsets_l.data = ax->buffer_l;
|
||||
ax->offsets_l.currentOffset = 0;
|
||||
ax->offsets_l.loopOffset = 0;
|
||||
ax->offsets_l.endOffset = AX_AUDIO_COUNT;
|
||||
ax->offsets_l.endOffset = AX_AUDIO_COUNT - 1;
|
||||
ax->offsets_l.loopingEnabled = AX_VOICE_LOOP_ENABLED;
|
||||
ax->offsets_l.dataType = AX_VOICE_FORMAT_LPCM16;
|
||||
|
||||
ax->offsets_r.data = ax->buffer_r;
|
||||
ax->offsets_r.currentOffset = 0;
|
||||
ax->offsets_r.loopOffset = 0;
|
||||
ax->offsets_r.endOffset = AX_AUDIO_COUNT;
|
||||
ax->offsets_r.endOffset = AX_AUDIO_COUNT - 1;
|
||||
ax->offsets_r.loopingEnabled = AX_VOICE_LOOP_ENABLED;
|
||||
ax->offsets_r.dataType = AX_VOICE_FORMAT_LPCM16;
|
||||
|
||||
@ -124,7 +124,7 @@ static void* ax_audio_init(const char* device, unsigned rate, unsigned latency)
|
||||
AXSetVoiceSrcType(ax->voice_r, AX_VOICE_SRC_TYPE_NONE);
|
||||
AXSetVoiceSrcRatio(ax->voice_l, 1.0f);
|
||||
AXSetVoiceSrcRatio(ax->voice_r, 1.0f);
|
||||
AXVoiceVeData ve = {0x4000, 0};
|
||||
AXVoiceVeData ve = {0x8000, 0};
|
||||
AXSetVoiceVe(ax->voice_l, &ve);
|
||||
AXSetVoiceVe(ax->voice_r, &ve);
|
||||
u32 mix[24]= {0};
|
||||
@ -248,7 +248,7 @@ static bool ax_audio_start(void* data)
|
||||
|
||||
if(!ax->playing)
|
||||
{
|
||||
AXVoiceVeData ve = {0x4000, 0};
|
||||
AXVoiceVeData ve = {0x8000, 0};
|
||||
AXSetVoiceVe(ax->voice_l, &ve);
|
||||
AXSetVoiceVe(ax->voice_r, &ve);
|
||||
|
||||
|
@ -45,7 +45,8 @@
|
||||
#include "system/exception.h"
|
||||
#include <sys/iosupport.h>
|
||||
|
||||
#include <coreinit/screen.h>
|
||||
#include <coreinit/foreground.h>
|
||||
#include <proc_ui/procui.h>
|
||||
#include <vpad/input.h>
|
||||
|
||||
#include "wiiu_dbg.h"
|
||||
@ -54,8 +55,11 @@
|
||||
#include "../../menu/menu_driver.h"
|
||||
#endif
|
||||
|
||||
//#define WIIU_SD_PATH "/vol/external01/"
|
||||
#define WIIU_SD_PATH "sd:/"
|
||||
|
||||
static enum frontend_fork wiiu_fork_mode = FRONTEND_FORK_NONE;
|
||||
static const char* elf_path_cst = "sd:/retroarch/retroarch.elf";
|
||||
static const char* elf_path_cst = WIIU_SD_PATH "retroarch/retroarch.elf";
|
||||
|
||||
static void frontend_wiiu_get_environment_settings(int *argc, char *argv[],
|
||||
void *args, void *params_data)
|
||||
@ -134,7 +138,7 @@ static int frontend_wiiu_parse_drive_list(void *data)
|
||||
return -1;
|
||||
|
||||
menu_entries_append_enum(list,
|
||||
"sd:/", "", MSG_UNKNOWN, FILE_TYPE_DIRECTORY, 0, 0);
|
||||
WIIU_SD_PATH, "", MSG_UNKNOWN, FILE_TYPE_DIRECTORY, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -169,7 +173,7 @@ frontend_ctx_driver_t frontend_ctx_wiiu = {
|
||||
static int log_socket = -1;
|
||||
static volatile int log_lock = 0;
|
||||
|
||||
void log_init(const char * ipString)
|
||||
void log_init(const char * ipString, int port)
|
||||
{
|
||||
log_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (log_socket < 0)
|
||||
@ -178,7 +182,7 @@ void log_init(const char * ipString)
|
||||
struct sockaddr_in connect_addr;
|
||||
memset(&connect_addr, 0, sizeof(connect_addr));
|
||||
connect_addr.sin_family = AF_INET;
|
||||
connect_addr.sin_port = 4405;
|
||||
connect_addr.sin_port = port;
|
||||
inet_aton(ipString, &connect_addr.sin_addr);
|
||||
|
||||
if(connect(log_socket, (struct sockaddr*)&connect_addr, sizeof(connect_addr)) < 0)
|
||||
@ -237,19 +241,44 @@ static devoptab_t dotab_stdout = {
|
||||
NULL, // device close
|
||||
log_write, // device write
|
||||
NULL,
|
||||
/* ... */
|
||||
};
|
||||
|
||||
#ifdef RPX_BUILD
|
||||
void __wrap___eabi(void)
|
||||
{
|
||||
}
|
||||
void __init(void)
|
||||
{
|
||||
}
|
||||
int main(int argc, char **argv);
|
||||
void SaveCallback()
|
||||
{
|
||||
OSSavesDone_ReadyToRelease(); // Required
|
||||
}
|
||||
__attribute__((noreturn))
|
||||
void _start(int argc, char **argv)
|
||||
{
|
||||
ProcUIInit(&SaveCallback);
|
||||
int ret = main(argc, argv);
|
||||
ProcUIShutdown();
|
||||
exit(ret);
|
||||
}
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#else
|
||||
int __entry_menu(int argc, char **argv)
|
||||
{
|
||||
InitFunctionPointers();
|
||||
#endif
|
||||
#if 1
|
||||
setup_os_exceptions();
|
||||
#else
|
||||
InstallExceptionHandler();
|
||||
#endif
|
||||
socket_lib_init();
|
||||
#if 0
|
||||
log_init("10.42.0.1");
|
||||
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
|
||||
log_init(PC_DEVELOPMENT_IP_ADDRESS, PC_DEVELOPMENT_TCP_PORT);
|
||||
#endif
|
||||
devoptab_list[STD_OUT] = &dotab_stdout;
|
||||
devoptab_list[STD_ERR] = &dotab_stdout;
|
||||
@ -263,8 +292,8 @@ int __entry_menu(int argc, char **argv)
|
||||
DEBUG_STR(argv[1]);
|
||||
#if 0
|
||||
int argc_ = 2;
|
||||
// char* argv_[] = {"sd:/retroarch/retroarch.elf", "sd:/rom.nes", NULL};
|
||||
char* argv_[] = {"sd:/retroarch/retroarch.elf", "sd:/rom.sfc", NULL};
|
||||
// char* argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.nes", NULL};
|
||||
char* argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.sfc", NULL};
|
||||
|
||||
rarch_main(argc_, argv_, NULL);
|
||||
#else
|
||||
@ -290,7 +319,9 @@ int __entry_menu(int argc, char **argv)
|
||||
memoryRelease();
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
|
||||
log_deinit();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <coreinit/cache.h>
|
||||
#include "gx2.h"
|
||||
#include "system/memory.h"
|
||||
#include "system/wiiu.h"
|
||||
#include "tex_shader.h"
|
||||
|
||||
#include "wiiu_dbg.h"
|
||||
@ -87,8 +88,8 @@ typedef struct
|
||||
|
||||
wiiu_render_mode_t render_mode;
|
||||
int frames;
|
||||
bool noblock;
|
||||
int syncframes;
|
||||
OSTime last_vsync;
|
||||
bool vsync;
|
||||
} wiiu_video_t;
|
||||
|
||||
static const wiiu_render_mode_t wiiu_render_mode_map[] =
|
||||
@ -206,7 +207,7 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2SetScissor(0, 0, wiiu->color_buffer.surface.width, wiiu->color_buffer.surface.height);
|
||||
GX2SetDepthOnlyControl(GX2_DISABLE, GX2_DISABLE, GX2_COMPARE_FUNC_ALWAYS);
|
||||
GX2SetColorControl(GX2_LOGIC_OP_COPY, 1, GX2_DISABLE, GX2_ENABLE);
|
||||
#if 0
|
||||
#if 1
|
||||
GX2SetBlendControl(GX2_RENDER_TARGET_0, GX2_BLEND_MODE_SRC_ALPHA, GX2_BLEND_MODE_INV_SRC_ALPHA,
|
||||
GX2_BLEND_COMBINE_MODE_ADD,
|
||||
GX2_ENABLE, GX2_BLEND_MODE_SRC_ALPHA, GX2_BLEND_MODE_INV_SRC_ALPHA, GX2_BLEND_COMBINE_MODE_ADD);
|
||||
@ -215,7 +216,6 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2_DISABLE, GX2_BLEND_MODE_ONE, GX2_BLEND_MODE_ZERO, GX2_BLEND_COMBINE_MODE_ADD);
|
||||
#endif
|
||||
GX2SetCullOnlyControl(GX2_FRONT_FACE_CCW, GX2_DISABLE, GX2_DISABLE);
|
||||
GX2SetSwapInterval(1);
|
||||
|
||||
/* init shader */
|
||||
// wiiu->shader = MEM2_alloc(sizeof(*wiiu->shader), GX2_VERTEX_BUFFER_ALIGNMENT);
|
||||
@ -325,8 +325,8 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2SetTVEnable(GX2_ENABLE);
|
||||
GX2SetDRCEnable(GX2_ENABLE);
|
||||
|
||||
wiiu->noblock = false;
|
||||
wiiu->syncframes = 60;
|
||||
wiiu->vsync = video->vsync;
|
||||
GX2SetSwapInterval(!!video->vsync);
|
||||
|
||||
return wiiu;
|
||||
}
|
||||
@ -384,29 +384,62 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
unsigned width, unsigned height, uint64_t frame_count,
|
||||
unsigned pitch, const char* msg)
|
||||
{
|
||||
(void)frame;
|
||||
(void)width;
|
||||
(void)height;
|
||||
(void)pitch;
|
||||
(void)msg;
|
||||
int i;
|
||||
|
||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||
if(wiiu->menu.enable || wiiu->noblock == false)
|
||||
wiiu->syncframes = 60;
|
||||
else if(wiiu->syncframes > 0)
|
||||
wiiu->syncframes--;
|
||||
GX2ClearColor(&wiiu->color_buffer, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
// GX2ClearColor(&wiiu->color_buffer, 0.0f, 0.3f, 0.8f, 1.0f);
|
||||
/* can't call GX2ClearColor after GX2SetContextState for whatever reason */
|
||||
GX2SetContextState(wiiu->ctx_state);
|
||||
|
||||
if (!width || !height)
|
||||
{
|
||||
GX2WaitForVsync();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(wiiu->vsync)
|
||||
{
|
||||
uint32_t swap_count;
|
||||
uint32_t flip_count;
|
||||
OSTime last_flip;
|
||||
OSTime last_vsync;
|
||||
|
||||
GX2GetSwapStatus(&swap_count, &flip_count, &last_flip, &last_vsync);
|
||||
|
||||
if(wiiu->last_vsync >= last_vsync)
|
||||
{
|
||||
GX2WaitForVsync();
|
||||
wiiu->last_vsync = last_vsync + ms_to_ticks(17);
|
||||
}
|
||||
else
|
||||
wiiu->last_vsync = last_vsync;
|
||||
}
|
||||
GX2WaitForFlip();
|
||||
|
||||
static u32 lastTick , currentTick;
|
||||
currentTick = OSGetSystemTick();
|
||||
u32 diff = currentTick - lastTick;
|
||||
static float fps;
|
||||
static u32 frames;
|
||||
frames++;
|
||||
if(diff > wiiu_timer_clock)
|
||||
{
|
||||
fps = (float)frames * ((float) wiiu_timer_clock / (float) diff);
|
||||
lastTick = currentTick;
|
||||
frames = 0;
|
||||
}
|
||||
#if 0
|
||||
static u32 last_frame_tick;
|
||||
if (!(wiiu->menu.enable))
|
||||
printf("\r frame time : %10.6f ms \n", (float)(currentTick - last_frame_tick) * 1000.0f / (float)wiiu_timer_clock);
|
||||
last_frame_tick = currentTick;
|
||||
#endif
|
||||
printf("\rfps: %8.8f frames : %5i", fps, wiiu->frames++);
|
||||
fflush(stdout);
|
||||
|
||||
GX2ClearColor(&wiiu->color_buffer, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
/* can't call GX2ClearColor after GX2SetContextState for whatever reason */
|
||||
GX2SetContextState(wiiu->ctx_state);
|
||||
|
||||
|
||||
if(frame)
|
||||
{
|
||||
if (width > wiiu->texture.surface.width)
|
||||
@ -423,7 +456,6 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
// memcpy(dst, src, width * sizeof(uint16_t));
|
||||
int j;
|
||||
for(j = 0; j < width; j++)
|
||||
dst[j] = __builtin_bswap16(src[j]);
|
||||
@ -460,10 +492,6 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||
|
||||
GX2SwapScanBuffers();
|
||||
GX2Flush();
|
||||
if(wiiu->syncframes)
|
||||
GX2WaitForVsync();
|
||||
printf("\rframe : %5i", wiiu->frames++);
|
||||
fflush(stdout);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -475,7 +503,8 @@ static void wiiu_gfx_set_nonblock_state(void* data, bool toggle)
|
||||
if (!wiiu)
|
||||
return;
|
||||
|
||||
wiiu->noblock = toggle;
|
||||
wiiu->vsync = !toggle;
|
||||
GX2SetSwapInterval(!toggle); /* do we need this ? */
|
||||
}
|
||||
|
||||
static bool wiiu_gfx_alive(void* data)
|
||||
|
@ -129,6 +129,9 @@ static void wiiu_joypad_poll(void)
|
||||
VPADReadError vpadError;
|
||||
VPADRead(0, &vpad, 1, &vpadError);
|
||||
|
||||
if(vpadError)
|
||||
return;
|
||||
|
||||
pad_state = 0;
|
||||
pad_state |= (vpad.hold & VPAD_BUTTON_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
pad_state |= (vpad.hold & VPAD_BUTTON_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
@ -154,7 +157,8 @@ static void wiiu_joypad_poll(void)
|
||||
|
||||
BIT64_CLEAR(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
|
||||
if((vpad.tpNormal.touched) && (vpad.tpNormal.x > 200) && (vpad.tpNormal.validity) == 0)
|
||||
if(((vpad.tpNormal.touched) && (vpad.tpNormal.x > 200) && (vpad.tpNormal.validity) == 0) ||
|
||||
(vpad.trigger & VPAD_BUTTON_HOME))
|
||||
BIT64_SET(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
|
||||
/* panic button */
|
||||
|
@ -299,7 +299,9 @@ static ssize_t sd_fat_write_r (struct _reent *r, int fd, const char *ptr, size_t
|
||||
memcpy(tmpBuf, ptr + done, write_size);
|
||||
|
||||
int result = FSWriteFile(file->dev->pClient, file->dev->pCmd, tmpBuf, 0x01, write_size, file->fd, 0, -1);
|
||||
#if 0
|
||||
FSFlushFile(file->dev->pClient, file->dev->pCmd, file->fd, -1);
|
||||
#endif
|
||||
if(result < 0)
|
||||
{
|
||||
r->_errno = result;
|
||||
|
@ -1,9 +0,0 @@
|
||||
export WIILOAD=tcp:$1
|
||||
rm $2.stripped -rf
|
||||
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
|
14
wiiu/net_listen.sh
Executable file
14
wiiu/net_listen.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z $1 ] ; then
|
||||
echo
|
||||
echo "usage: $0 <WiiU-ip>"
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
interrupt_count=0
|
||||
|
||||
trap 'if [ $interrupt_count -eq 20 ]; then exit 0; else interrupt_count=$(($interrupt_count + 1)); fi' INT
|
||||
|
||||
while true; do echo; echo ========= `date` =========; echo; netcat -p 4405 -l $1; done
|
13
wiiu/net_send.sh
Executable file
13
wiiu/net_send.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z $1 ] ; then
|
||||
echo
|
||||
echo "usage: $0 <WiiU-ip> <elf>"
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export WIILOAD=tcp:$1
|
||||
rm $2.stripped -rf
|
||||
powerpc-eabi-strip $2 -o $2.stripped
|
||||
wiiload $2.stripped
|
@ -2,5 +2,5 @@
|
||||
EXPORT_BEGIN(gx2.rpl);
|
||||
|
||||
#include "../rpl/libgx2/exports.h"
|
||||
|
||||
EXPORT(GX2GetSwapStatus);
|
||||
EXPORT_END();
|
||||
|
@ -13,7 +13,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
//#define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0)
|
||||
#define DEBUG_LINE() do{printf("%s:%d.\n",__FUNCTION__, __LINE__);fflush(stdout);}while(0)
|
||||
#define DEBUG_LINE() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);}while(0)
|
||||
#define DEBUG_STR(X) printf( "%s: %s\n", #X, (char*)(X))
|
||||
#define DEBUG_VAR(X) printf( "%-20s: 0x%08X\n", #X, (u32)(X))
|
||||
#define DEBUG_VAR2(X) printf( "%-20s: 0x%08X (%i)\n", #X, (u32)(X), (int)(X))
|
||||
|
Loading…
x
Reference in New Issue
Block a user