Merge branch 'fail0verflow-master'

This commit is contained in:
Dr-Crow 2021-03-02 23:54:11 -05:00
commit 837776c0e2
30 changed files with 129 additions and 123 deletions

View File

@ -25,7 +25,7 @@ Wii, only under Dolphin (yes, this release runs under Dolphin).
## Build instructions ## Build instructions
You need DevkitPPC and libogc installed, and the DEVKITPRO/DEVKITPPC environment You need devkitPPC and libogc installed, and the DEVKITPRO/DEVKITPPC environment
variables correctly set. Use the latest available versions. Make sure you have variables correctly set. Use the latest available versions. Make sure you have
libogc/libfat, and also install the following 3rd party libraries: libogc/libfat, and also install the following 3rd party libraries:
@ -34,8 +34,10 @@ libogc/libfat, and also install the following 3rd party libraries:
* mxml * mxml
* freetype * freetype
You can download binaries of those You can obtain binaries of those with
[here](https://sourceforge.net/projects/devkitpro/files/portlibs/ppc/). [devkitPro pacman](https://devkitpro.org/wiki/devkitPro_pacman). Simply use
sudo (dkp-)pacman -S ppc-zlib ppc-libpng ppc-mxml ppc-freetype
Additionally, you'll need the following packages on your host machine: Additionally, you'll need the following packages on your host machine:

View File

@ -5,9 +5,9 @@ PREFIX = $(DEVKITPPC)/bin/powerpc-eabi-
CC = $(PREFIX)gcc CC = $(PREFIX)gcc
AS = $(PREFIX)as AS = $(PREFIX)as
OBJCOPY = $(PREFIX)objcopy OBJCOPY = $(PREFIX)objcopy
ELF2DOL =$(DEVKITPPC)/bin/elf2dol ELF2DOL =$(DEVKITPRO)/tools/bin/elf2dol
GDB = $(PREFIX)gdb GDB = $(PREFIX)gdb
BIN2S = $(DEVKITPPC)/bin/bin2s BIN2S = $(DEVKITPRO)/tools/bin/bin2s
TARGET_STUB = stub TARGET_STUB = stub
TARGET_APP = channelapp TARGET_APP = channelapp
TARGET_CHAN = channelapp-channel TARGET_CHAN = channelapp-channel
@ -111,11 +111,11 @@ $(TARGET_APP)_nopax.elf: $(FILES_SRC_OBJ) newrvl.ld
@$(CC) $(FILES_SRC_OBJ) $(LDFLAGS_APP) -o $@ @$(CC) $(FILES_SRC_OBJ) $(LDFLAGS_APP) -o $@
$(TARGET_APP).elf: $(TARGET_APP)_nopax.elf $(TARGET_APP).elf: $(TARGET_APP)_nopax.elf
@$(WIIPAX) -s devkitfail $< $@ @$(WIIPAX) -s devkitppc $< $@
$(TARGET_CHAN).elf: $(TARGET_APP)_nopax.elf $(TARGET_CHAN).elf: $(TARGET_APP)_nopax.elf
@echo $(@F) @echo $(@F)
@$(WIIPAX) -s dkfailchannel $< $@ @$(WIIPAX) -s dkppcchannel $< $@
$(TARGET_CHAN).dol: $(TARGET_CHAN).elf $(ELF2DOL) $(TARGET_CHAN).dol: $(TARGET_CHAN).elf $(ELF2DOL)
@echo $(@F) @echo $(@F)

View File

@ -530,14 +530,14 @@ void app_entry_init(void) {
res = LWP_MutexInit (&ta_ae.cmutex, false); res = LWP_MutexInit (&ta_ae.cmutex, false);
if (res) { if (res) {
gprintf ("error creating cmutex: %ld\n", res); gprintf ("error creating cmutex: %d\n", res);
return; return;
} }
res = LWP_CondInit (&ta_ae.cond); res = LWP_CondInit (&ta_ae.cond);
if (res) { if (res) {
gprintf ("error creating cond: %ld\n", res); gprintf ("error creating cond: %d\n", res);
return; return;
} }
@ -546,7 +546,7 @@ void app_entry_init(void) {
APPENTRY_THREAD_STACKSIZE, APPENTRY_THREAD_PRIO); APPENTRY_THREAD_STACKSIZE, APPENTRY_THREAD_PRIO);
if (res) { if (res) {
gprintf("error creating thread: %ld\n", res); gprintf("error creating thread: %d\n", res);
} }
} }

View File

@ -47,7 +47,7 @@ void *blob_alloc(size_t size)
SYS_SetArena2Hi((void*)addr); SYS_SetArena2Hi((void*)addr);
_CPU_ISR_Restore(level); _CPU_ISR_Restore(level);
gprintf("allocated blob size %d at 0x%08lx\n", size, addr); gprintf("allocated blob size %d at 0x%08x\n", size, addr);
return (void*)addr; return (void*)addr;
} }

View File

@ -320,7 +320,7 @@ font_glyph *font_get_char(font_id id, int codepoint)
glyph->valid = 1; glyph->valid = 1;
//gprintf("FONT: Rendered and cached glyph %d (%s) at pos %d size %dx%d\n", codepoint, utf8(codepoint), glyph-font->glyphs, cw, ch); //gprintf("FONT: Rendered and cached glyph %d (%s) at pos %d size %dx%d\n", codepoint, utf8(codepoint), glyph-font->glyphs, cw, ch);
//gprintf("Free MEM1: %ld MEM2: %ld\n", SYS_GetArena1Size(), SYS_GetArena2Size()); //gprintf("Free MEM1: %d MEM2: %d\n", SYS_GetArena1Size(), SYS_GetArena2Size());
return glyph; return glyph;
} }
@ -332,7 +332,7 @@ void font_kern(font_id id, int left, int right, FT_Pos *dx, FT_Pos *dy)
} }
if (FT_Get_Kerning(fonts[id]->face, left, right, FT_KERNING_UNFITTED, &delta)) if (FT_Get_Kerning(fonts[id]->face, left, right, FT_KERNING_UNFITTED, &delta))
return; return;
//gprintf("Kern font %d for glyphs %d,%d is %ld,%ld\n", id, left, right, delta.x, delta.y); //gprintf("Kern font %d for glyphs %d,%d is %d,%d\n", id, left, right, delta.x, delta.y);
*dx += delta.x; *dx += delta.x;
*dy += delta.y; *dy += delta.y;
} }

View File

@ -140,7 +140,7 @@ static void * http_func (void *arg) {
r += sprintf (r, "Host: %s\r\n", ta->host); r += sprintf (r, "Host: %s\r\n", ta->host);
r += sprintf (r, "Cache-Control: no-cache\r\n"); r += sprintf (r, "Cache-Control: no-cache\r\n");
r += sprintf (r, "User-Agent: TheHomebrewChannel/%s Wii/%08lx" r += sprintf (r, "User-Agent: TheHomebrewChannel/%s Wii/%08lx"
" (%lu; %u; %s-%s)\r\n", CHANNEL_VERSION_STR, " (%u; %u; %s-%s)\r\n", CHANNEL_VERSION_STR,
ng_id, ms_id, ta->sysmenu_version, ta->region, ng_id, ms_id, ta->sysmenu_version, ta->region,
ta->area); ta->area);
@ -177,8 +177,8 @@ static void * http_func (void *arg) {
break; break;
} }
sscanf (line, "HTTP/1.%*u %lu", &ta->http_status); sscanf (line, "HTTP/1.%*u %u", &ta->http_status);
sscanf (line, "Content-Length: %lu", &ta->content_length); sscanf (line, "Content-Length: %u", &ta->content_length);
free (line); free (line);
@ -335,21 +335,21 @@ void http_init (void) {
res = LWP_MutexInit (&ta_http.mutex, false); res = LWP_MutexInit (&ta_http.mutex, false);
if (res) { if (res) {
gprintf ("error creating mutex: %ld\n", res); gprintf ("error creating mutex: %d\n", res);
return; return;
} }
res = LWP_MutexInit (&ta_http.cmutex, false); res = LWP_MutexInit (&ta_http.cmutex, false);
if (res) { if (res) {
gprintf ("error creating cmutex: %ld\n", res); gprintf ("error creating cmutex: %d\n", res);
return; return;
} }
res = LWP_CondInit (&ta_http.cond); res = LWP_CondInit (&ta_http.cond);
if (res) { if (res) {
gprintf ("error creating cond: %ld\n", res); gprintf ("error creating cond: %d\n", res);
return; return;
} }
@ -360,7 +360,7 @@ void http_init (void) {
gprintf("created http thread\n"); gprintf("created http thread\n");
if (res) { if (res) {
gprintf ("error creating thread: %ld\n", res); gprintf ("error creating thread: %d\n", res);
} }
} }

View File

@ -49,12 +49,12 @@ void i18n_set_mo(const void *mo_file) {
mo.hash_size = SWAB32(mo.hash_size); mo.hash_size = SWAB32(mo.hash_size);
mo.hashes = (void*)SWAB32((u32)mo.magic); mo.hashes = (void*)SWAB32((u32)mo.magic);
} else if(mo.magic != MAGIC) { } else if(mo.magic != MAGIC) {
gprintf("i18n: bad mo file magic 0x%08lx\n",mo.magic); gprintf("i18n: bad mo file magic 0x%08x\n",mo.magic);
return; return;
} }
if(mo.revision != 0) if(mo.revision != 0)
gprintf("i18n: bad mo file revision 0x%08lx\n",mo.revision); gprintf("i18n: bad mo file revision 0x%08x\n",mo.revision);
mo_data = (char*)mo_file; mo_data = (char*)mo_file;
mo.source = (struct mo_entry*)(mo_data + (u32)mo.source); mo.source = (struct mo_entry*)(mo_data + (u32)mo.source);

View File

@ -18,10 +18,10 @@ s32 isfs_get(const char *path, u8 **buf, u32 expected, u32 maxsize, bool use_blo
s32 fd; s32 fd;
u8 *__buf; u8 *__buf;
gprintf("reading %s (expecting %lu bytes)\n", path, expected); gprintf("reading %s (expecting %u bytes)\n", path, expected);
ret = ISFS_Open(path, ISFS_OPEN_READ); ret = ISFS_Open(path, ISFS_OPEN_READ);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_Open failed (%ld)\n", ret); gprintf("ISFS_Open failed (%d)\n", ret);
return ret; return ret;
} }
@ -29,7 +29,7 @@ s32 isfs_get(const char *path, u8 **buf, u32 expected, u32 maxsize, bool use_blo
ret = ISFS_GetFileStats(fd, &__st); ret = ISFS_GetFileStats(fd, &__st);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_GetFileStats failed (%ld)\n", ret); gprintf("ISFS_GetFileStats failed (%d)\n", ret);
return ret; return ret;
} }
DCInvalidateRange(&__st, sizeof(__st)); DCInvalidateRange(&__st, sizeof(__st));
@ -37,7 +37,7 @@ s32 isfs_get(const char *path, u8 **buf, u32 expected, u32 maxsize, bool use_blo
if ((__st.file_length == 0) || if ((__st.file_length == 0) ||
(maxsize && (__st.file_length > maxsize)) || (maxsize && (__st.file_length > maxsize)) ||
(expected && (__st.file_length != expected))) { (expected && (__st.file_length != expected))) {
gprintf("invalid size: %lu\n", __st.file_length); gprintf("invalid size: %u\n", __st.file_length);
ISFS_Close(fd); ISFS_Close(fd);
return -1; return -1;
} }
@ -50,10 +50,10 @@ s32 isfs_get(const char *path, u8 **buf, u32 expected, u32 maxsize, bool use_blo
__buf = pmemalign(32, ROUNDUP32B(__st.file_length + 1)); __buf = pmemalign(32, ROUNDUP32B(__st.file_length + 1));
} }
gprintf("reading %lu bytes\n", __st.file_length); gprintf("reading %u bytes\n", __st.file_length);
ret = ISFS_Read(fd, __buf, __st.file_length); ret = ISFS_Read(fd, __buf, __st.file_length);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_Read failed (%ld)\n", ret); gprintf("ISFS_Read failed (%d)\n", ret);
free(__buf); free(__buf);
ISFS_Close(fd); ISFS_Close(fd);
return ret; return ret;
@ -62,7 +62,7 @@ s32 isfs_get(const char *path, u8 **buf, u32 expected, u32 maxsize, bool use_blo
__buf[__st.file_length] = 0; __buf[__st.file_length] = 0;
if (ret != __st.file_length) { if (ret != __st.file_length) {
gprintf("ISFS_Read short read (%ld)\n", ret); gprintf("ISFS_Read short read (%d)\n", ret);
free(__buf); free(__buf);
ISFS_Close(fd); ISFS_Close(fd);
return -1; return -1;
@ -70,7 +70,7 @@ s32 isfs_get(const char *path, u8 **buf, u32 expected, u32 maxsize, bool use_blo
ret = ISFS_Close(fd); ret = ISFS_Close(fd);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_Close failed (%ld)\n", ret); gprintf("ISFS_Close failed (%d)\n", ret);
free(__buf); free(__buf);
return ret; return ret;
} }
@ -84,16 +84,16 @@ s32 isfs_put(const char *path, const void *buf, u32 len) {
ISFS_Delete(path); ISFS_Delete(path);
gprintf("writing %s (%lu bytes)\n", path, len); gprintf("writing %s (%u bytes)\n", path, len);
ret = ISFS_CreateFile(path, 0, 3, 3, 0); ret = ISFS_CreateFile(path, 0, 3, 3, 0);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_CreateFile failed (%ld)\n", ret); gprintf("ISFS_CreateFile failed (%d)\n", ret);
return ret; return ret;
} }
ret = ISFS_Open(path, 3); ret = ISFS_Open(path, 3);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_Open failed (%ld)\n", ret); gprintf("ISFS_Open failed (%d)\n", ret);
ISFS_Delete(path); ISFS_Delete(path);
return ret; return ret;
} }
@ -104,14 +104,14 @@ s32 isfs_put(const char *path, const void *buf, u32 len) {
ret = ISFS_Write(fd, buf, len); ret = ISFS_Write(fd, buf, len);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_Write failed (%ld)\n", ret); gprintf("ISFS_Write failed (%d)\n", ret);
ISFS_Close(fd); ISFS_Close(fd);
ISFS_Delete(path); ISFS_Delete(path);
return ret; return ret;
} }
if (ret != len) { if (ret != len) {
gprintf("ISFS_Write short write (%ld)\n", ret); gprintf("ISFS_Write short write (%d)\n", ret);
ISFS_Close(fd); ISFS_Close(fd);
ISFS_Delete(path); ISFS_Delete(path);
return -1; return -1;
@ -119,7 +119,7 @@ s32 isfs_put(const char *path, const void *buf, u32 len) {
ret = ISFS_Close(fd); ret = ISFS_Close(fd);
if (ret < 0) { if (ret < 0) {
gprintf("ISFS_Close failed (%ld)\n", ret); gprintf("ISFS_Close failed (%d)\n", ret);
ISFS_Delete(path); ISFS_Delete(path);
return ret; return ret;
} }

View File

@ -211,7 +211,7 @@ static void * ld_tcp_func (void *arg) {
res = net_init_async(NULL, NULL); res = net_init_async(NULL, NULL);
if (res) { if (res) {
gprintf("net_init_async failed: %ld\n", res); gprintf("net_init_async failed: %d\n", res);
break; break;
} }
@ -228,7 +228,7 @@ static void * ld_tcp_func (void *arg) {
} }
if ((res == -EAGAIN) || (res == -ETIMEDOUT)) { if ((res == -EAGAIN) || (res == -ETIMEDOUT)) {
gprintf ("net_init failed: %ld, trying again...\n", res); gprintf ("net_init failed: %d, trying again...\n", res);
retries--; retries--;
usleep(50 * 1000); usleep(50 * 1000);
continue; continue;
@ -238,12 +238,12 @@ static void * ld_tcp_func (void *arg) {
} }
if (res < 0) { if (res < 0) {
gprintf ("net_init failed: %ld\n", res); gprintf ("net_init failed: %d\n", res);
ta->state = LDTCPS_UNINITIALIZED; ta->state = LDTCPS_UNINITIALIZED;
continue; continue;
} }
gprintf ("net_init success: %ld\n", res); gprintf ("net_init success: %d\n", res);
mask = net_gethostip () & 0xffff0000; mask = net_gethostip () & 0xffff0000;
@ -296,7 +296,7 @@ static void * ld_tcp_func (void *arg) {
} }
if ((sa.sin_addr.s_addr & 0xffff0000) != mask) { if ((sa.sin_addr.s_addr & 0xffff0000) != mask) {
gprintf ("non local ip (%lx)\n", sa.sin_addr.s_addr); gprintf ("non local ip (%x)\n", sa.sin_addr.s_addr);
net_close (sn); net_close (sn);
continue; continue;
} }
@ -333,12 +333,12 @@ static void * ld_tcp_func (void *arg) {
gprintf ("net_shutdown\n"); gprintf ("net_shutdown\n");
res = net_shutdown (s, 2); res = net_shutdown (s, 2);
if (res) if (res)
gprintf ("net_shutdown failed: %ld\n", res); gprintf ("net_shutdown failed: %d\n", res);
gprintf ("net_close\n"); gprintf ("net_close\n");
res = net_close (s); res = net_close (s);
if (res) if (res)
gprintf ("net_close failed: %ld\n", res); gprintf ("net_close failed: %d\n", res);
} }
gprintf ("tcp thread deiniting\n"); gprintf ("tcp thread deiniting\n");
@ -588,7 +588,7 @@ static void * ld_load_func (void *arg) {
block = read (ta->fd, d, block); block = read (ta->fd, d, block);
if (block < 0) { if (block < 0) {
gprintf ("read failed: %ld\n", block); gprintf ("read failed: %d\n", block);
close (ta->fd); close (ta->fd);
LWP_MutexLock (ta->mutex); LWP_MutexLock (ta->mutex);
@ -683,7 +683,7 @@ static void * ld_load_func (void *arg) {
} }
if (len != ta->data_len_un) { if (len != ta->data_len_un) {
gprintf("short uncompress: %lu\n", (u32) len); gprintf("short uncompress: %u\n", (u32) len);
LWP_MutexLock (ta->mutex); LWP_MutexLock (ta->mutex);
ta->state = LDS_ERR_UNCOMPRESS; ta->state = LDS_ERR_UNCOMPRESS;
@ -812,7 +812,7 @@ void loader_load(loader_result *result, view *sub_view, app_entry *entry) {
res = LWP_MutexInit (&ta.mutex, false); res = LWP_MutexInit (&ta.mutex, false);
if (res) { if (res) {
gprintf ("error creating mutex: %ld\n", res); gprintf ("error creating mutex: %d\n", res);
blob_free (ta.data); blob_free (ta.data);
blob_free (ta.data_un); blob_free (ta.data_un);
if (ta.cmd == LDC_TCP) if (ta.cmd == LDC_TCP)
@ -826,7 +826,7 @@ void loader_load(loader_result *result, view *sub_view, app_entry *entry) {
LD_THREAD_STACKSIZE, LD_THREAD_PRIO); LD_THREAD_STACKSIZE, LD_THREAD_PRIO);
if (res) { if (res) {
gprintf ("error creating thread: %ld\n", res); gprintf ("error creating thread: %d\n", res);
blob_free (ta.data); blob_free (ta.data);
blob_free (ta.data_un); blob_free (ta.data_un);
if (ta.cmd == LDC_TCP) if (ta.cmd == LDC_TCP)
@ -973,7 +973,7 @@ bool loader_handle_zip_app(loader_result *result, view *sub_view) {
sprintf(buf2, "%.02f MB", sprintf(buf2, "%.02f MB",
(float)(result->bytes) / (float)(1024 * 1024)); (float)(result->bytes) / (float)(1024 * 1024));
else else
sprintf(buf2, "%lu KB", result->bytes / 1024u); sprintf(buf2, "%u KB", result->bytes / 1024u);
sprintf(buf, text_extract_zip, buf2); sprintf(buf, text_extract_zip, buf2);
if (!app_entry_get_path(buf2)) { if (!app_entry_get_path(buf2)) {

View File

@ -82,7 +82,7 @@ static bool reloc_dol (entry_point *ep, const u8 *addr, u32 size,
if (!dolfile->text_size[i]) if (!dolfile->text_size[i])
continue; continue;
gprintf ("loading text section %lu @ 0x%08lx (0x%08lx bytes)\n", i, gprintf ("loading text section %u @ 0x%08x (0x%08x bytes)\n", i,
dolfile->text_start[i], dolfile->text_size[i]); dolfile->text_start[i], dolfile->text_size[i]);
if (dolfile->text_pos[i] + dolfile->text_size[i] > size) if (dolfile->text_pos[i] + dolfile->text_size[i] > size)
@ -106,7 +106,7 @@ static bool reloc_dol (entry_point *ep, const u8 *addr, u32 size,
if (!dolfile->data_size[i]) if (!dolfile->data_size[i])
continue; continue;
gprintf ("loading data section %lu @ 0x%08lx (0x%08lx bytes)\n", i, gprintf ("loading data section %u @ 0x%08x (0x%08x bytes)\n", i,
dolfile->data_start[i], dolfile->data_size[i]); dolfile->data_start[i], dolfile->data_size[i]);
if (dolfile->data_pos[i] + dolfile->data_size[i] > size) if (dolfile->data_pos[i] + dolfile->data_size[i] > size)
@ -176,12 +176,12 @@ static bool reloc_elf (entry_point *ep, const u8 *addr, u32 size,
for(i=0;i<ehdr->e_phnum;i++) { for(i=0;i<ehdr->e_phnum;i++) {
if(phdrs[i].p_type != PT_LOAD) { if(phdrs[i].p_type != PT_LOAD) {
gprintf("skip PHDR %d of type %ld\n", i, phdrs[i].p_type); gprintf("skip PHDR %d of type %d\n", i, phdrs[i].p_type);
} else { } else {
phdrs[i].p_paddr &= 0x3FFFFFFF; phdrs[i].p_paddr &= 0x3FFFFFFF;
phdrs[i].p_paddr |= 0x80000000; phdrs[i].p_paddr |= 0x80000000;
gprintf ("PHDR %d 0x%08lx [0x%lx] -> 0x%08lx [0x%lx] <", i, gprintf ("PHDR %d 0x%08x [0x%x] -> 0x%08x [0x%x] <", i,
phdrs[i].p_offset, phdrs[i].p_filesz, phdrs[i].p_offset, phdrs[i].p_filesz,
phdrs[i].p_paddr, phdrs[i].p_memsz); phdrs[i].p_paddr, phdrs[i].p_memsz);
@ -204,7 +204,7 @@ static bool reloc_elf (entry_point *ep, const u8 *addr, u32 size,
gprintf ("-> failed overlap check\n"); gprintf ("-> failed overlap check\n");
return false; return false;
} }
gprintf ("-> load 0x%lx\n", phdrs[i].p_filesz); gprintf ("-> load 0x%x\n", phdrs[i].p_filesz);
image = (u8 *) (addr + phdrs[i].p_offset); image = (u8 *) (addr + phdrs[i].p_offset);
memmove ((void *) phdrs[i].p_paddr, (const void *) image, memmove ((void *) phdrs[i].p_paddr, (const void *) image,
phdrs[i].p_filesz); phdrs[i].p_filesz);

View File

@ -112,7 +112,7 @@ void m_main_theme_reinit(void) {
CHANNEL_VERSION_STR, view_width / 3 - 32, FA_RIGHT, CHANNEL_VERSION_STR, view_width / 3 - 32, FA_RIGHT,
FA_ASCENDER, FONT_LABEL); FA_ASCENDER, FONT_LABEL);
sprintf(buffer, "IOS%ld v%ld.%ld", IOS_GetVersion(), IOS_GetRevisionMajor(), sprintf(buffer, "IOS%d v%d.%d", IOS_GetVersion(), IOS_GetRevisionMajor(),
IOS_GetRevisionMinor()); IOS_GetRevisionMinor());
widget_label (&v_m_main->widgets[6], view_width / 3 * 2 - 16, widget_label (&v_m_main->widgets[6], view_width / 3 * 2 - 16,

View File

@ -111,7 +111,7 @@ static int patch_ahbprot_reset(void)
} }
} }
static void reset_cb(void) { static void reset_cb(u32 irq, void *ctx) {
#ifdef GDBSTUB #ifdef GDBSTUB
gdb = true; gdb = true;
#else #else
@ -178,12 +178,12 @@ void config_language(void) {
break; break;
default: default:
gprintf("unsupported language %ld, defaulting to English\n", gprintf("unsupported language %d, defaulting to English\n",
language); language);
language = CONF_LANG_ENGLISH; language = CONF_LANG_ENGLISH;
} }
gprintf("configuring language: %ld with mo file at %p\n", language, mo); gprintf("configuring language: %d with mo file at %p\n", language, mo);
i18n_set_mo(mo); i18n_set_mo(mo);
} }
@ -210,7 +210,7 @@ static void main_pre(void) {
title_init(); title_init();
SYS_SetPowerCallback(power_cb); SYS_SetPowerCallback(power_cb);
gprintf("installing stub (%lu)\n", stub_bin_size); gprintf("installing stub (%u)\n", stub_bin_size);
#ifdef DEBUG_APP #ifdef DEBUG_APP
if (stub_bin_size > 0x1800) if (stub_bin_size > 0x1800)
@ -223,7 +223,7 @@ static void main_pre(void) {
*conf_magic = 0; *conf_magic = 0;
gprintf ("startup\n"); gprintf ("startup\n");
gprintf("IOS Version: IOS%ld %ld.%ld\n", gprintf("IOS Version: IOS%d %d.%d\n",
IOS_GetVersion(), IOS_GetRevisionMajor(), IOS_GetRevisionMinor()); IOS_GetVersion(), IOS_GetRevisionMajor(), IOS_GetRevisionMinor());
ISFS_Initialize(); ISFS_Initialize();
@ -795,7 +795,7 @@ void main_real(void) {
gprintf ("patch failed (%d)\n", res); gprintf ("patch failed (%d)\n", res);
} }
gprintf ("reloading to IOS%ld...\n", APPS_IOS_VERSION); gprintf ("reloading to IOS%d...\n", APPS_IOS_VERSION);
__IOS_LaunchNewIOS(APPS_IOS_VERSION); __IOS_LaunchNewIOS(APPS_IOS_VERSION);
if (ahb_access) { if (ahb_access) {

View File

@ -247,7 +247,7 @@ bool manage_check_zip_theme(u8 *data, u32 data_len) {
unz_global_info gi; unz_global_info gi;
if (data_len > MAX_THEME_ZIP_SIZE) { if (data_len > MAX_THEME_ZIP_SIZE) {
gprintf("theme size too big: %lu\n", data_len); gprintf("theme size too big: %u\n", data_len);
return false; return false;
} }
@ -489,7 +489,7 @@ bool manage_run(view *sub_view, const char *dirname,
res = LWP_MutexInit(&ta.mutex, false); res = LWP_MutexInit(&ta.mutex, false);
if (res) { if (res) {
gprintf ("error creating mutex: %ld\n", res); gprintf ("error creating mutex: %d\n", res);
return false; return false;
} }
@ -507,7 +507,7 @@ bool manage_run(view *sub_view, const char *dirname,
MANAGE_THREAD_STACKSIZE, MANAGE_THREAD_PRIO); MANAGE_THREAD_STACKSIZE, MANAGE_THREAD_PRIO);
if (res) { if (res) {
gprintf ("error creating thread: %ld\n", res); gprintf ("error creating thread: %d\n", res);
LWP_CloseQueue(manage_queue); LWP_CloseQueue(manage_queue);
return false; return false;
} }

View File

@ -21,7 +21,7 @@ void playtime_destroy(void) {
pt_fd = IOS_Open(_playtime_path, IPC_OPEN_RW); pt_fd = IOS_Open(_playtime_path, IPC_OPEN_RW);
if(pt_fd < 0) { if(pt_fd < 0) {
gprintf("playtime open failed: %ld\n", pt_fd); gprintf("playtime open failed: %d\n", pt_fd);
return; return;
} }
@ -30,7 +30,7 @@ void playtime_destroy(void) {
res = IOS_Write(pt_fd, &pt_buf, sizeof(pt_buf)); res = IOS_Write(pt_fd, &pt_buf, sizeof(pt_buf));
if (res != sizeof(pt_buf)) { if (res != sizeof(pt_buf)) {
IOS_Close(pt_fd); IOS_Close(pt_fd);
gprintf("error destroying playtime (%ld)\n", res); gprintf("error destroying playtime (%d)\n", res);
return; return;
} }

View File

@ -22,7 +22,7 @@ s32 tcp_socket (void) {
s = net_socket (PF_INET, SOCK_STREAM, 0); s = net_socket (PF_INET, SOCK_STREAM, 0);
if (s < 0) { if (s < 0) {
gprintf ("net_socket failed: %ld\n", s); gprintf ("net_socket failed: %d\n", s);
return s; return s;
} }
@ -31,14 +31,14 @@ s32 tcp_socket (void) {
res = net_fcntl (s, F_GETFL, 0); res = net_fcntl (s, F_GETFL, 0);
if (res < 0) { if (res < 0) {
gprintf ("F_GETFL failed: %ld\n", res); gprintf ("F_GETFL failed: %d\n", res);
net_close (s); net_close (s);
return res; return res;
} }
res = net_fcntl (s, F_SETFL, res | 4); res = net_fcntl (s, F_SETFL, res | 4);
if (res < 0) { if (res < 0) {
gprintf ("F_SETFL failed: %ld\n", res); gprintf ("F_SETFL failed: %d\n", res);
net_close (s); net_close (s);
return res; return res;
} }
@ -91,7 +91,7 @@ s32 tcp_connect (char *host, u16 port) {
continue; continue;
} }
gprintf ("net_connect failed: %ld\n", res); gprintf ("net_connect failed: %d\n", res);
net_close (s); net_close (s);
return res; return res;
@ -119,14 +119,14 @@ s32 tcp_listen (u16 port, s32 backlog) {
res = net_bind (s, (struct sockaddr *) &sa, sizeof (struct sockaddr_in)); res = net_bind (s, (struct sockaddr *) &sa, sizeof (struct sockaddr_in));
if (res < 0) { if (res < 0) {
gprintf ("net_bind failed: %ld\n", res); gprintf ("net_bind failed: %d\n", res);
net_close (s); net_close (s);
return res; return res;
} }
res = net_listen (s, backlog); res = net_listen (s, backlog);
if (res < 0) { if (res < 0) {
gprintf ("net_listen failed: %ld\n", res); gprintf ("net_listen failed: %d\n", res);
net_close (s); net_close (s);
return res; return res;
} }
@ -157,7 +157,7 @@ char * tcp_readln (s32 s, u16 max_length, s64 start_time, u16 timeout) {
} }
if (res < 0) { if (res < 0) {
gprintf ("tcp_readln failed: %ld\n", res); gprintf ("tcp_readln failed: %d\n", res);
break; break;
} }
@ -215,7 +215,7 @@ bool tcp_read (s32 s, u8 *buffer, u32 length, const mutex_t *mutex, u32 *progres
} }
if (res < 0) { if (res < 0) {
gprintf ("net_read failed: %ld\n", res); gprintf ("net_read failed: %d\n", res);
break; break;
} }
@ -272,7 +272,7 @@ bool tcp_write (s32 s, const u8 *buffer, u32 length, const mutex_t *mutex,
} }
if (res < 0) { if (res < 0) {
gprintf ("net_write failed: %ld\n", res); gprintf ("net_write failed: %d\n", res);
break; break;
} }

View File

@ -12,7 +12,7 @@
#include "tex.h" #include "tex.h"
#include "panic.h" #include "panic.h"
#define SCREENSHOT_FILENAME "/hbc-%03lu.png" #define SCREENSHOT_FILENAME "/hbc-%03u.png"
static u32 screenshot_index = 0; static u32 screenshot_index = 0;

View File

@ -299,7 +299,7 @@ static void theme_load(u8 *data, u32 data_len) {
} else { } else {
u16 w, h; u16 w, h;
gprintf("loading from theme: %s (%lu @%lu)\n", filename, gprintf("loading from theme: %s (%u @%u)\n", filename,
(u32) fi.uncompressed_size, index); (u32) fi.uncompressed_size, index);
if (ws) { if (ws) {
@ -374,7 +374,7 @@ void theme_init(u8 *data, u32 data_len) {
res = isfs_get(fn, &data, 0, MAX_THEME_ZIP_SIZE, true); res = isfs_get(fn, &data, 0, MAX_THEME_ZIP_SIZE, true);
if (res > 0) { if (res > 0) {
data_len = res; data_len = res;
gprintf("theme loaded from nand (%lu bytes)\n", data_len); gprintf("theme loaded from nand (%u bytes)\n", data_len);
theme_load(data, data_len); theme_load(data, data_len);
} }
} }
@ -387,10 +387,10 @@ void theme_init(u8 *data, u32 data_len) {
} }
gprintf("theme.description=%s\n", theme.description); gprintf("theme.description=%s\n", theme.description);
gprintf("theme.progress ul=0x%08lx\n", theme.progress.ul); gprintf("theme.progress ul=0x%08x\n", theme.progress.ul);
gprintf("theme.progress ur=0x%08lx\n", theme.progress.ur); gprintf("theme.progress ur=0x%08x\n", theme.progress.ur);
gprintf("theme.progress lr=0x%08lx\n", theme.progress.lr); gprintf("theme.progress lr=0x%08x\n", theme.progress.lr);
gprintf("theme.progress ll=0x%08lx\n", theme.progress.ll); gprintf("theme.progress ll=0x%08x\n", theme.progress.ll);
gprintf("theme.langs=0x%x\n", theme.langs); gprintf("theme.langs=0x%x\n", theme.langs);
for (i = 0; i < THEME_LAST; ++i) { for (i = 0; i < THEME_LAST; ++i) {

View File

@ -19,7 +19,7 @@ static void title_get_ngid(void) {
res = ES_GetDeviceID(&ng_id); res = ES_GetDeviceID(&ng_id);
if (res < 0) { if (res < 0) {
gprintf("ES_GetDeviceID failed: %ld\n", res); gprintf("ES_GetDeviceID failed: %d\n", res);
} }
} }
@ -29,7 +29,7 @@ static void title_get_msid(void) {
// check for dpki // check for dpki
ret = ES_GetDeviceCert(buf); ret = ES_GetDeviceCert(buf);
if (ret < 0) { if (ret < 0) {
gprintf("ES_GetDeviceCert failed: %ld\n", ret); gprintf("ES_GetDeviceCert failed: %d\n", ret);
return; return;
} }
@ -40,7 +40,7 @@ static void title_get_msid(void) {
} else if (ms_id == 2) { } else if (ms_id == 2) {
gprintf("We're on retail\n"); gprintf("We're on retail\n");
} else { } else {
gprintf("Unknown ms-id %ld?\n", ms_id); gprintf("Unknown ms-id %d?\n", ms_id);
} }
} }
@ -49,13 +49,13 @@ static void title_get_title_path(void) {
res = ES_GetTitleID(&title_id); res = ES_GetTitleID(&title_id);
if (res < 0) { if (res < 0) {
gprintf("ES_GetTitleID failed: %ld\n", res); gprintf("ES_GetTitleID failed: %d\n", res);
return; return;
} }
res = ES_GetDataDir(title_id, title_path); res = ES_GetDataDir(title_id, title_path);
if (res < 0) { if (res < 0) {
gprintf("ES_GetDataDir failed: %ld\n", res); gprintf("ES_GetDataDir failed: %d\n", res);
return; return;
} }

View File

@ -150,7 +150,7 @@ bool update_busy(bool *update_available) {
UPDATE_THREAD_PRIO); UPDATE_THREAD_PRIO);
if (res) { if (res) {
gprintf("error creating thread: %ld\n", res); gprintf("error creating thread: %d\n", res);
LWP_CloseQueue(update_queue); LWP_CloseQueue(update_queue);
free(update_data); free(update_data);
return false; return false;

View File

@ -405,7 +405,7 @@ bool settings_load(void) {
buf = NULL; buf = NULL;
res = isfs_get(fn, &buf, banner_bin_size, 0, false); res = isfs_get(fn, &buf, banner_bin_size, 0, false);
if (res < 0) { if (res < 0) {
gprintf("deleting banner: %ld\n", res); gprintf("deleting banner: %d\n", res);
ISFS_Delete(fn); ISFS_Delete(fn);
} else if (memcmp(buf, banner_bin, banner_bin_size)) { } else if (memcmp(buf, banner_bin, banner_bin_size)) {
gprintf("banner.bin mismatch, deleting\n"); gprintf("banner.bin mismatch, deleting\n");
@ -422,7 +422,7 @@ bool settings_load(void) {
sprintf(fn, "%s/" FN_SETTINGS, titlepath); sprintf(fn, "%s/" FN_SETTINGS, titlepath);
res = isfs_get(fn, &buf, 0, MAX_SETTINGS_XML_SIZE, false); res = isfs_get(fn, &buf, 0, MAX_SETTINGS_XML_SIZE, false);
if (res < 0) { if (res < 0) {
gprintf("isfs_get failed: %ld\n", res); gprintf("isfs_get failed: %d\n", res);
return false; return false;
} }
@ -513,7 +513,7 @@ bool settings_save(void) {
sprintf(fn, "%s/" FN_BANNER, titlepath); sprintf(fn, "%s/" FN_BANNER, titlepath);
res = isfs_put(fn, banner_bin, banner_bin_size); res = isfs_put(fn, banner_bin, banner_bin_size);
if ((res < 0) && (res != -105)) { if ((res < 0) && (res != -105)) {
gprintf("isfs_put banner failed: %ld\n", res); gprintf("isfs_put banner failed: %d\n", res);
free(x); free(x);
return false; return false;
} }
@ -523,7 +523,7 @@ bool settings_save(void) {
res = isfs_put(fn, x, strlen(x)); res = isfs_put(fn, x, strlen(x));
if (res < 0) { if (res < 0) {
gprintf("isfs_put xml failed: %ld\n", res); gprintf("isfs_put xml failed: %d\n", res);
free(x); free(x);
sprintf(fn, "%s/" FN_BANNER, titlepath); sprintf(fn, "%s/" FN_BANNER, titlepath);
ISFS_Delete(fn); ISFS_Delete(fn);

View File

@ -7,7 +7,7 @@ OBJCOPY = $(PREFIX)objcopy
RANLIB = $(PREFIX)ranlib RANLIB = $(PREFIX)ranlib
STRIP = $(PREFIX)strip STRIP = $(PREFIX)strip
BIN2S = $(DEVKITPPC)/bin/bin2s BIN2S = $(DEVKITPRO)/tools/bin/bin2s
ifeq ($(NOMAPFILE),) ifeq ($(NOMAPFILE),)
LDFLAGS += -Wl,-Map,$(TARGET).map LDFLAGS += -Wl,-Map,$(TARGET).map

View File

@ -2,8 +2,8 @@ CFLAGS = -Wall -W -Os -g
TARGET = wiipax TARGET = wiipax
OBJS = LzFind.o LzmaEnc.o LzmaDec.o lzma.o main.o OBJS = LzFind.o LzmaEnc.o LzmaDec.o lzma.o main.o
OBJS += stub_mini.o stub_mini_debug.o OBJS += stub_mini.o stub_mini_debug.o
OBJS += stub_dkf.o stub_dkf_debug.o OBJS += stub_dkp.o stub_dkp_debug.o
OBJS += stub_dkfc.o stub_dkfc_debug.o OBJS += stub_dkpc.o stub_dkpc_debug.o
NOMAPFILE = 1 NOMAPFILE = 1

View File

@ -18,14 +18,14 @@ extern int stub_mini_elf_len;
extern char stub_mini_elf[]; extern char stub_mini_elf[];
extern int stub_mini_debug_elf_len; extern int stub_mini_debug_elf_len;
extern char stub_mini_debug_elf[]; extern char stub_mini_debug_elf[];
extern int stub_dkf_elf_len; extern int stub_dkp_elf_len;
extern char stub_dkf_elf[]; extern char stub_dkp_elf[];
extern int stub_dkf_debug_elf_len; extern int stub_dkp_debug_elf_len;
extern char stub_dkf_debug_elf[]; extern char stub_dkp_debug_elf[];
extern int stub_dkfc_elf_len; extern int stub_dkpc_elf_len;
extern char stub_dkfc_elf[]; extern char stub_dkpc_elf[];
extern int stub_dkfc_debug_elf_len; extern int stub_dkpc_debug_elf_len;
extern char stub_dkfc_debug_elf[]; extern char stub_dkpc_debug_elf[];
typedef struct { typedef struct {
const char *name; const char *name;
@ -36,10 +36,10 @@ typedef struct {
static const stub_t stubs[] = { static const stub_t stubs[] = {
{ "mini", &stub_mini_elf_len, (u8 *) stub_mini_elf }, { "mini", &stub_mini_elf_len, (u8 *) stub_mini_elf },
{ "mini_debug", &stub_mini_debug_elf_len, (u8 *) stub_mini_debug_elf }, { "mini_debug", &stub_mini_debug_elf_len, (u8 *) stub_mini_debug_elf },
{ "devkitfail", &stub_dkf_elf_len, (u8 *) stub_dkf_elf }, { "devkitppc", &stub_dkp_elf_len, (u8 *) stub_dkp_elf },
{ "devkitfail_debug", &stub_dkf_debug_elf_len, (u8 *) stub_dkf_debug_elf }, { "devkitppc_debug", &stub_dkp_debug_elf_len, (u8 *) stub_dkp_debug_elf },
{ "dkfailchannel", &stub_dkfc_elf_len, (u8 *) stub_dkfc_elf }, { "dkppcchannel", &stub_dkpc_elf_len, (u8 *) stub_dkpc_elf },
{ "dkfailchannel_debug", &stub_dkfc_debug_elf_len, (u8 *) stub_dkfc_debug_elf }, { "dkppcchannel_debug", &stub_dkpc_debug_elf_len, (u8 *) stub_dkpc_debug_elf },
{ NULL, NULL, NULL } { NULL, NULL, NULL }
}; };

1
wiipax/client/stub_dkp.c Symbolic link
View File

@ -0,0 +1 @@
../stub/stub_dkp.c

View File

@ -0,0 +1 @@
../stub/stub_dkp_debug.c

1
wiipax/client/stub_dkpc.c Symbolic link
View File

@ -0,0 +1 @@
../stub/stub_dkpc.c

View File

@ -0,0 +1 @@
../stub/stub_dkpc_debug.c

View File

@ -8,17 +8,17 @@ LDFLAGS += -nostartfiles -nodefaultlibs
OBJS_COMMON = crt0.o main.o string.o sync.o elf.o time.o LzmaDec.o OBJS_COMMON = crt0.o main.o string.o sync.o elf.o time.o LzmaDec.o
TARGET_ID = TARGET_ID =
ifeq ($(DEVKITFAIL),1) ifeq ($(DKPPC),1)
DEFINES += -DDEVKITFAIL DEFINES += -DDKPPC
OBJS = $(OBJS_COMMON) OBJS = $(OBJS_COMMON)
LDSCRIPT = devkitfail.ld LDSCRIPT = devkitppc.ld
TARGET_ID = _dkf TARGET_ID = _dkp
else else
ifeq ($(DKFAILCHANNEL),1) ifeq ($(DKPPCCHANNEL),1)
DEFINES += -DDEVKITFAIL DEFINES += -DDKPPC
OBJS = realmode.o $(OBJS_COMMON) OBJS = realmode.o $(OBJS_COMMON)
LDSCRIPT = channel.ld LDSCRIPT = channel.ld
TARGET_ID = _dkfc TARGET_ID = _dkpc
else else
OBJS = realmode.o plunge.o $(OBJS_COMMON) OBJS = realmode.o plunge.o $(OBJS_COMMON)
LDSCRIPT = realmode.ld LDSCRIPT = realmode.ld
@ -54,14 +54,14 @@ release:
$(Q)$(MAKE) clean $(Q)$(MAKE) clean
$(Q)$(MAKE) NDEBUG=1 $(Q)$(MAKE) NDEBUG=1
$(Q)$(MAKE) NDEBUG=1 clean $(Q)$(MAKE) NDEBUG=1 clean
$(Q)$(MAKE) DEVKITFAIL=1 $(Q)$(MAKE) DKPPC=1
$(Q)$(MAKE) DEVKITFAIL=1 clean $(Q)$(MAKE) DKPPC=1 clean
$(Q)$(MAKE) DEVKITFAIL=1 NDEBUG=1 $(Q)$(MAKE) DKPPC=1 NDEBUG=1
$(Q)$(MAKE) DEVKITFAIL=1 NDEBUG=1 clean $(Q)$(MAKE) DKPPC=1 NDEBUG=1 clean
$(Q)$(MAKE) DKFAILCHANNEL=1 $(Q)$(MAKE) DKPPCCHANNEL=1
$(Q)$(MAKE) DKFAILCHANNEL=1 clean $(Q)$(MAKE) DKPPCCHANNEL=1 clean
$(Q)$(MAKE) DKFAILCHANNEL=1 NDEBUG=1 $(Q)$(MAKE) DKPPCCHANNEL=1 NDEBUG=1
$(Q)$(MAKE) DKFAILCHANNEL=1 NDEBUG=1 clean $(Q)$(MAKE) DKPPCCHANNEL=1 NDEBUG=1 clean
.PHONY: release .PHONY: release

View File

@ -68,7 +68,7 @@ void stubmain(void) {
write32(0x0c003004, 0); write32(0x0c003004, 0);
#ifndef NDEBUG #ifndef NDEBUG
#ifndef DEVKITFAIL #ifndef DKPPC
udelay(500 * 1000); // wait for mini - avoid EXI battle udelay(500 * 1000); // wait for mini - avoid EXI battle
#endif #endif
gecko_init(); gecko_init();
@ -86,7 +86,7 @@ void stubmain(void) {
write32(0x0c003000, 0xffffffff); write32(0x0c003000, 0xffffffff);
printf("Branching to 0x%08x\n", entry); printf("Branching to 0x%08x\n", entry);
#ifndef DEVKITFAIL #ifndef DKPPC
// detect failkit apps packed with the mini stub // detect failkit apps packed with the mini stub
if (entry & 0xc0000000) { if (entry & 0xc0000000) {
void (*ep)() = (void (*)()) entry; void (*ep)() = (void (*)()) entry;