diff --git a/README.md b/README.md index 524ba62..762f719 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Wii, only under Dolphin (yes, this release runs under Dolphin). ## 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 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 * freetype -You can download binaries of those -[here](https://sourceforge.net/projects/devkitpro/files/portlibs/ppc/). +You can obtain binaries of those with +[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: diff --git a/channel/channelapp/Makefile b/channel/channelapp/Makefile index 7490a39..a6157fe 100644 --- a/channel/channelapp/Makefile +++ b/channel/channelapp/Makefile @@ -5,9 +5,9 @@ PREFIX = $(DEVKITPPC)/bin/powerpc-eabi- CC = $(PREFIX)gcc AS = $(PREFIX)as OBJCOPY = $(PREFIX)objcopy -ELF2DOL =$(DEVKITPPC)/bin/elf2dol +ELF2DOL =$(DEVKITPRO)/tools/bin/elf2dol GDB = $(PREFIX)gdb -BIN2S = $(DEVKITPPC)/bin/bin2s +BIN2S = $(DEVKITPRO)/tools/bin/bin2s TARGET_STUB = stub TARGET_APP = channelapp TARGET_CHAN = channelapp-channel @@ -111,11 +111,11 @@ $(TARGET_APP)_nopax.elf: $(FILES_SRC_OBJ) newrvl.ld @$(CC) $(FILES_SRC_OBJ) $(LDFLAGS_APP) -o $@ $(TARGET_APP).elf: $(TARGET_APP)_nopax.elf - @$(WIIPAX) -s devkitfail $< $@ + @$(WIIPAX) -s devkitppc $< $@ $(TARGET_CHAN).elf: $(TARGET_APP)_nopax.elf @echo $(@F) - @$(WIIPAX) -s dkfailchannel $< $@ + @$(WIIPAX) -s dkppcchannel $< $@ $(TARGET_CHAN).dol: $(TARGET_CHAN).elf $(ELF2DOL) @echo $(@F) diff --git a/channel/channelapp/source/appentry.c b/channel/channelapp/source/appentry.c index 73b49e5..7885fc0 100644 --- a/channel/channelapp/source/appentry.c +++ b/channel/channelapp/source/appentry.c @@ -530,14 +530,14 @@ void app_entry_init(void) { res = LWP_MutexInit (&ta_ae.cmutex, false); if (res) { - gprintf ("error creating cmutex: %ld\n", res); + gprintf ("error creating cmutex: %d\n", res); return; } res = LWP_CondInit (&ta_ae.cond); if (res) { - gprintf ("error creating cond: %ld\n", res); + gprintf ("error creating cond: %d\n", res); return; } @@ -546,7 +546,7 @@ void app_entry_init(void) { APPENTRY_THREAD_STACKSIZE, APPENTRY_THREAD_PRIO); if (res) { - gprintf("error creating thread: %ld\n", res); + gprintf("error creating thread: %d\n", res); } } diff --git a/channel/channelapp/source/blob.c b/channel/channelapp/source/blob.c index 8d2fbdf..83c24f3 100644 --- a/channel/channelapp/source/blob.c +++ b/channel/channelapp/source/blob.c @@ -47,7 +47,7 @@ void *blob_alloc(size_t size) SYS_SetArena2Hi((void*)addr); _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; } diff --git a/channel/channelapp/source/font.c b/channel/channelapp/source/font.c index c425d06..3bce410 100644 --- a/channel/channelapp/source/font.c +++ b/channel/channelapp/source/font.c @@ -320,7 +320,7 @@ font_glyph *font_get_char(font_id id, int codepoint) 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("Free MEM1: %ld MEM2: %ld\n", SYS_GetArena1Size(), SYS_GetArena2Size()); + //gprintf("Free MEM1: %d MEM2: %d\n", SYS_GetArena1Size(), SYS_GetArena2Size()); 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)) 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; *dy += delta.y; } diff --git a/channel/channelapp/source/http.c b/channel/channelapp/source/http.c index 73175e5..b03af13 100644 --- a/channel/channelapp/source/http.c +++ b/channel/channelapp/source/http.c @@ -140,7 +140,7 @@ static void * http_func (void *arg) { r += sprintf (r, "Host: %s\r\n", ta->host); r += sprintf (r, "Cache-Control: no-cache\r\n"); 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, ta->area); @@ -177,8 +177,8 @@ static void * http_func (void *arg) { break; } - sscanf (line, "HTTP/1.%*u %lu", &ta->http_status); - sscanf (line, "Content-Length: %lu", &ta->content_length); + sscanf (line, "HTTP/1.%*u %u", &ta->http_status); + sscanf (line, "Content-Length: %u", &ta->content_length); free (line); @@ -335,21 +335,21 @@ void http_init (void) { res = LWP_MutexInit (&ta_http.mutex, false); if (res) { - gprintf ("error creating mutex: %ld\n", res); + gprintf ("error creating mutex: %d\n", res); return; } res = LWP_MutexInit (&ta_http.cmutex, false); if (res) { - gprintf ("error creating cmutex: %ld\n", res); + gprintf ("error creating cmutex: %d\n", res); return; } res = LWP_CondInit (&ta_http.cond); if (res) { - gprintf ("error creating cond: %ld\n", res); + gprintf ("error creating cond: %d\n", res); return; } @@ -360,7 +360,7 @@ void http_init (void) { gprintf("created http thread\n"); if (res) { - gprintf ("error creating thread: %ld\n", res); + gprintf ("error creating thread: %d\n", res); } } diff --git a/channel/channelapp/source/i18n.c b/channel/channelapp/source/i18n.c index bed731c..a6e27e7 100644 --- a/channel/channelapp/source/i18n.c +++ b/channel/channelapp/source/i18n.c @@ -49,12 +49,12 @@ void i18n_set_mo(const void *mo_file) { mo.hash_size = SWAB32(mo.hash_size); mo.hashes = (void*)SWAB32((u32)mo.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; } 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.source = (struct mo_entry*)(mo_data + (u32)mo.source); diff --git a/channel/channelapp/source/isfs.c b/channel/channelapp/source/isfs.c index aa951f9..00ec311 100644 --- a/channel/channelapp/source/isfs.c +++ b/channel/channelapp/source/isfs.c @@ -18,10 +18,10 @@ s32 isfs_get(const char *path, u8 **buf, u32 expected, u32 maxsize, bool use_blo s32 fd; 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); if (ret < 0) { - gprintf("ISFS_Open failed (%ld)\n", ret); + gprintf("ISFS_Open failed (%d)\n", 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); if (ret < 0) { - gprintf("ISFS_GetFileStats failed (%ld)\n", ret); + gprintf("ISFS_GetFileStats failed (%d)\n", ret); return ret; } 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) || (maxsize && (__st.file_length > maxsize)) || (expected && (__st.file_length != expected))) { - gprintf("invalid size: %lu\n", __st.file_length); + gprintf("invalid size: %u\n", __st.file_length); ISFS_Close(fd); 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)); } - gprintf("reading %lu bytes\n", __st.file_length); + gprintf("reading %u bytes\n", __st.file_length); ret = ISFS_Read(fd, __buf, __st.file_length); if (ret < 0) { - gprintf("ISFS_Read failed (%ld)\n", ret); + gprintf("ISFS_Read failed (%d)\n", ret); free(__buf); ISFS_Close(fd); 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; if (ret != __st.file_length) { - gprintf("ISFS_Read short read (%ld)\n", ret); + gprintf("ISFS_Read short read (%d)\n", ret); free(__buf); ISFS_Close(fd); 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); if (ret < 0) { - gprintf("ISFS_Close failed (%ld)\n", ret); + gprintf("ISFS_Close failed (%d)\n", ret); free(__buf); return ret; } @@ -84,16 +84,16 @@ s32 isfs_put(const char *path, const void *buf, u32 len) { 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); if (ret < 0) { - gprintf("ISFS_CreateFile failed (%ld)\n", ret); + gprintf("ISFS_CreateFile failed (%d)\n", ret); return ret; } ret = ISFS_Open(path, 3); if (ret < 0) { - gprintf("ISFS_Open failed (%ld)\n", ret); + gprintf("ISFS_Open failed (%d)\n", ret); ISFS_Delete(path); return ret; } @@ -104,14 +104,14 @@ s32 isfs_put(const char *path, const void *buf, u32 len) { ret = ISFS_Write(fd, buf, len); if (ret < 0) { - gprintf("ISFS_Write failed (%ld)\n", ret); + gprintf("ISFS_Write failed (%d)\n", ret); ISFS_Close(fd); ISFS_Delete(path); return ret; } if (ret != len) { - gprintf("ISFS_Write short write (%ld)\n", ret); + gprintf("ISFS_Write short write (%d)\n", ret); ISFS_Close(fd); ISFS_Delete(path); return -1; @@ -119,7 +119,7 @@ s32 isfs_put(const char *path, const void *buf, u32 len) { ret = ISFS_Close(fd); if (ret < 0) { - gprintf("ISFS_Close failed (%ld)\n", ret); + gprintf("ISFS_Close failed (%d)\n", ret); ISFS_Delete(path); return ret; } diff --git a/channel/channelapp/source/loader.c b/channel/channelapp/source/loader.c index 4ca4044..652917c 100644 --- a/channel/channelapp/source/loader.c +++ b/channel/channelapp/source/loader.c @@ -211,7 +211,7 @@ static void * ld_tcp_func (void *arg) { res = net_init_async(NULL, NULL); if (res) { - gprintf("net_init_async failed: %ld\n", res); + gprintf("net_init_async failed: %d\n", res); break; } @@ -228,7 +228,7 @@ static void * ld_tcp_func (void *arg) { } if ((res == -EAGAIN) || (res == -ETIMEDOUT)) { - gprintf ("net_init failed: %ld, trying again...\n", res); + gprintf ("net_init failed: %d, trying again...\n", res); retries--; usleep(50 * 1000); continue; @@ -238,12 +238,12 @@ static void * ld_tcp_func (void *arg) { } if (res < 0) { - gprintf ("net_init failed: %ld\n", res); + gprintf ("net_init failed: %d\n", res); ta->state = LDTCPS_UNINITIALIZED; continue; } - gprintf ("net_init success: %ld\n", res); + gprintf ("net_init success: %d\n", res); mask = net_gethostip () & 0xffff0000; @@ -296,7 +296,7 @@ static void * ld_tcp_func (void *arg) { } 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); continue; } @@ -333,12 +333,12 @@ static void * ld_tcp_func (void *arg) { gprintf ("net_shutdown\n"); res = net_shutdown (s, 2); if (res) - gprintf ("net_shutdown failed: %ld\n", res); + gprintf ("net_shutdown failed: %d\n", res); gprintf ("net_close\n"); res = net_close (s); if (res) - gprintf ("net_close failed: %ld\n", res); + gprintf ("net_close failed: %d\n", res); } gprintf ("tcp thread deiniting\n"); @@ -588,7 +588,7 @@ static void * ld_load_func (void *arg) { block = read (ta->fd, d, block); if (block < 0) { - gprintf ("read failed: %ld\n", block); + gprintf ("read failed: %d\n", block); close (ta->fd); LWP_MutexLock (ta->mutex); @@ -683,7 +683,7 @@ static void * ld_load_func (void *arg) { } if (len != ta->data_len_un) { - gprintf("short uncompress: %lu\n", (u32) len); + gprintf("short uncompress: %u\n", (u32) len); LWP_MutexLock (ta->mutex); 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); if (res) { - gprintf ("error creating mutex: %ld\n", res); + gprintf ("error creating mutex: %d\n", res); blob_free (ta.data); blob_free (ta.data_un); 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); if (res) { - gprintf ("error creating thread: %ld\n", res); + gprintf ("error creating thread: %d\n", res); blob_free (ta.data); blob_free (ta.data_un); if (ta.cmd == LDC_TCP) @@ -973,7 +973,7 @@ bool loader_handle_zip_app(loader_result *result, view *sub_view) { sprintf(buf2, "%.02f MB", (float)(result->bytes) / (float)(1024 * 1024)); else - sprintf(buf2, "%lu KB", result->bytes / 1024u); + sprintf(buf2, "%u KB", result->bytes / 1024u); sprintf(buf, text_extract_zip, buf2); if (!app_entry_get_path(buf2)) { diff --git a/channel/channelapp/source/loader_reloc.c b/channel/channelapp/source/loader_reloc.c index d43ef40..5e02554 100644 --- a/channel/channelapp/source/loader_reloc.c +++ b/channel/channelapp/source/loader_reloc.c @@ -82,7 +82,7 @@ static bool reloc_dol (entry_point *ep, const u8 *addr, u32 size, if (!dolfile->text_size[i]) 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]); 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]) 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]); 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;ie_phnum;i++) { 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 { phdrs[i].p_paddr &= 0x3FFFFFFF; 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_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"); 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); memmove ((void *) phdrs[i].p_paddr, (const void *) image, phdrs[i].p_filesz); diff --git a/channel/channelapp/source/m_main.c b/channel/channelapp/source/m_main.c index 534065c..93c888a 100644 --- a/channel/channelapp/source/m_main.c +++ b/channel/channelapp/source/m_main.c @@ -112,7 +112,7 @@ void m_main_theme_reinit(void) { CHANNEL_VERSION_STR, view_width / 3 - 32, FA_RIGHT, 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()); widget_label (&v_m_main->widgets[6], view_width / 3 * 2 - 16, diff --git a/channel/channelapp/source/main.c b/channel/channelapp/source/main.c index 4fa3bf6..889cc2d 100644 --- a/channel/channelapp/source/main.c +++ b/channel/channelapp/source/main.c @@ -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 gdb = true; #else @@ -178,12 +178,12 @@ void config_language(void) { break; default: - gprintf("unsupported language %ld, defaulting to English\n", + gprintf("unsupported language %d, defaulting to English\n", language); 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); } @@ -210,7 +210,7 @@ static void main_pre(void) { title_init(); SYS_SetPowerCallback(power_cb); - gprintf("installing stub (%lu)\n", stub_bin_size); + gprintf("installing stub (%u)\n", stub_bin_size); #ifdef DEBUG_APP if (stub_bin_size > 0x1800) @@ -223,7 +223,7 @@ static void main_pre(void) { *conf_magic = 0; 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()); ISFS_Initialize(); @@ -795,7 +795,7 @@ void main_real(void) { 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); if (ahb_access) { diff --git a/channel/channelapp/source/manage.c b/channel/channelapp/source/manage.c index 58dc412..74f6728 100644 --- a/channel/channelapp/source/manage.c +++ b/channel/channelapp/source/manage.c @@ -247,7 +247,7 @@ bool manage_check_zip_theme(u8 *data, u32 data_len) { unz_global_info gi; 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; } @@ -489,7 +489,7 @@ bool manage_run(view *sub_view, const char *dirname, res = LWP_MutexInit(&ta.mutex, false); if (res) { - gprintf ("error creating mutex: %ld\n", res); + gprintf ("error creating mutex: %d\n", res); return false; } @@ -507,7 +507,7 @@ bool manage_run(view *sub_view, const char *dirname, MANAGE_THREAD_STACKSIZE, MANAGE_THREAD_PRIO); if (res) { - gprintf ("error creating thread: %ld\n", res); + gprintf ("error creating thread: %d\n", res); LWP_CloseQueue(manage_queue); return false; } diff --git a/channel/channelapp/source/playtime.c b/channel/channelapp/source/playtime.c index 84c64ad..607406a 100644 --- a/channel/channelapp/source/playtime.c +++ b/channel/channelapp/source/playtime.c @@ -21,7 +21,7 @@ void playtime_destroy(void) { pt_fd = IOS_Open(_playtime_path, IPC_OPEN_RW); if(pt_fd < 0) { - gprintf("playtime open failed: %ld\n", pt_fd); + gprintf("playtime open failed: %d\n", pt_fd); return; } @@ -30,7 +30,7 @@ void playtime_destroy(void) { res = IOS_Write(pt_fd, &pt_buf, sizeof(pt_buf)); if (res != sizeof(pt_buf)) { IOS_Close(pt_fd); - gprintf("error destroying playtime (%ld)\n", res); + gprintf("error destroying playtime (%d)\n", res); return; } diff --git a/channel/channelapp/source/tcp.c b/channel/channelapp/source/tcp.c index a9eae7d..4c6d1ba 100644 --- a/channel/channelapp/source/tcp.c +++ b/channel/channelapp/source/tcp.c @@ -22,7 +22,7 @@ s32 tcp_socket (void) { s = net_socket (PF_INET, SOCK_STREAM, 0); if (s < 0) { - gprintf ("net_socket failed: %ld\n", s); + gprintf ("net_socket failed: %d\n", s); return s; } @@ -31,14 +31,14 @@ s32 tcp_socket (void) { res = net_fcntl (s, F_GETFL, 0); if (res < 0) { - gprintf ("F_GETFL failed: %ld\n", res); + gprintf ("F_GETFL failed: %d\n", res); net_close (s); return res; } res = net_fcntl (s, F_SETFL, res | 4); if (res < 0) { - gprintf ("F_SETFL failed: %ld\n", res); + gprintf ("F_SETFL failed: %d\n", res); net_close (s); return res; } @@ -91,7 +91,7 @@ s32 tcp_connect (char *host, u16 port) { continue; } - gprintf ("net_connect failed: %ld\n", res); + gprintf ("net_connect failed: %d\n", res); net_close (s); return res; @@ -119,14 +119,14 @@ s32 tcp_listen (u16 port, s32 backlog) { res = net_bind (s, (struct sockaddr *) &sa, sizeof (struct sockaddr_in)); if (res < 0) { - gprintf ("net_bind failed: %ld\n", res); + gprintf ("net_bind failed: %d\n", res); net_close (s); return res; } res = net_listen (s, backlog); if (res < 0) { - gprintf ("net_listen failed: %ld\n", res); + gprintf ("net_listen failed: %d\n", res); net_close (s); return res; } @@ -157,7 +157,7 @@ char * tcp_readln (s32 s, u16 max_length, s64 start_time, u16 timeout) { } if (res < 0) { - gprintf ("tcp_readln failed: %ld\n", res); + gprintf ("tcp_readln failed: %d\n", res); break; } @@ -215,7 +215,7 @@ bool tcp_read (s32 s, u8 *buffer, u32 length, const mutex_t *mutex, u32 *progres } if (res < 0) { - gprintf ("net_read failed: %ld\n", res); + gprintf ("net_read failed: %d\n", res); break; } @@ -272,7 +272,7 @@ bool tcp_write (s32 s, const u8 *buffer, u32 length, const mutex_t *mutex, } if (res < 0) { - gprintf ("net_write failed: %ld\n", res); + gprintf ("net_write failed: %d\n", res); break; } diff --git a/channel/channelapp/source/tex.c b/channel/channelapp/source/tex.c index 838edbf..4bb62e6 100644 --- a/channel/channelapp/source/tex.c +++ b/channel/channelapp/source/tex.c @@ -12,7 +12,7 @@ #include "tex.h" #include "panic.h" -#define SCREENSHOT_FILENAME "/hbc-%03lu.png" +#define SCREENSHOT_FILENAME "/hbc-%03u.png" static u32 screenshot_index = 0; diff --git a/channel/channelapp/source/theme.c b/channel/channelapp/source/theme.c index 21f5c08..b1f33d2 100644 --- a/channel/channelapp/source/theme.c +++ b/channel/channelapp/source/theme.c @@ -299,7 +299,7 @@ static void theme_load(u8 *data, u32 data_len) { } else { 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); 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); if (res > 0) { 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); } } @@ -387,10 +387,10 @@ void theme_init(u8 *data, u32 data_len) { } gprintf("theme.description=%s\n", theme.description); - gprintf("theme.progress ul=0x%08lx\n", theme.progress.ul); - gprintf("theme.progress ur=0x%08lx\n", theme.progress.ur); - gprintf("theme.progress lr=0x%08lx\n", theme.progress.lr); - gprintf("theme.progress ll=0x%08lx\n", theme.progress.ll); + gprintf("theme.progress ul=0x%08x\n", theme.progress.ul); + gprintf("theme.progress ur=0x%08x\n", theme.progress.ur); + gprintf("theme.progress lr=0x%08x\n", theme.progress.lr); + gprintf("theme.progress ll=0x%08x\n", theme.progress.ll); gprintf("theme.langs=0x%x\n", theme.langs); for (i = 0; i < THEME_LAST; ++i) { diff --git a/channel/channelapp/source/title.c b/channel/channelapp/source/title.c index e1f4966..f012475 100644 --- a/channel/channelapp/source/title.c +++ b/channel/channelapp/source/title.c @@ -19,7 +19,7 @@ static void title_get_ngid(void) { res = ES_GetDeviceID(&ng_id); 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 ret = ES_GetDeviceCert(buf); if (ret < 0) { - gprintf("ES_GetDeviceCert failed: %ld\n", ret); + gprintf("ES_GetDeviceCert failed: %d\n", ret); return; } @@ -40,7 +40,7 @@ static void title_get_msid(void) { } else if (ms_id == 2) { gprintf("We're on retail\n"); } 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); if (res < 0) { - gprintf("ES_GetTitleID failed: %ld\n", res); + gprintf("ES_GetTitleID failed: %d\n", res); return; } res = ES_GetDataDir(title_id, title_path); if (res < 0) { - gprintf("ES_GetDataDir failed: %ld\n", res); + gprintf("ES_GetDataDir failed: %d\n", res); return; } diff --git a/channel/channelapp/source/update.c b/channel/channelapp/source/update.c index bf36480..235218b 100644 --- a/channel/channelapp/source/update.c +++ b/channel/channelapp/source/update.c @@ -150,7 +150,7 @@ bool update_busy(bool *update_available) { UPDATE_THREAD_PRIO); if (res) { - gprintf("error creating thread: %ld\n", res); + gprintf("error creating thread: %d\n", res); LWP_CloseQueue(update_queue); free(update_data); return false; diff --git a/channel/channelapp/source/xml.c b/channel/channelapp/source/xml.c index 4634965..aac232c 100644 --- a/channel/channelapp/source/xml.c +++ b/channel/channelapp/source/xml.c @@ -405,7 +405,7 @@ bool settings_load(void) { buf = NULL; res = isfs_get(fn, &buf, banner_bin_size, 0, false); if (res < 0) { - gprintf("deleting banner: %ld\n", res); + gprintf("deleting banner: %d\n", res); ISFS_Delete(fn); } else if (memcmp(buf, banner_bin, banner_bin_size)) { gprintf("banner.bin mismatch, deleting\n"); @@ -422,7 +422,7 @@ bool settings_load(void) { sprintf(fn, "%s/" FN_SETTINGS, titlepath); res = isfs_get(fn, &buf, 0, MAX_SETTINGS_XML_SIZE, false); if (res < 0) { - gprintf("isfs_get failed: %ld\n", res); + gprintf("isfs_get failed: %d\n", res); return false; } @@ -513,7 +513,7 @@ bool settings_save(void) { sprintf(fn, "%s/" FN_BANNER, titlepath); res = isfs_put(fn, banner_bin, banner_bin_size); if ((res < 0) && (res != -105)) { - gprintf("isfs_put banner failed: %ld\n", res); + gprintf("isfs_put banner failed: %d\n", res); free(x); return false; } @@ -523,7 +523,7 @@ bool settings_save(void) { res = isfs_put(fn, x, strlen(x)); if (res < 0) { - gprintf("isfs_put xml failed: %ld\n", res); + gprintf("isfs_put xml failed: %d\n", res); free(x); sprintf(fn, "%s/" FN_BANNER, titlepath); ISFS_Delete(fn); diff --git a/common.mk b/common.mk index cd9fdcb..d9d79ac 100644 --- a/common.mk +++ b/common.mk @@ -7,7 +7,7 @@ OBJCOPY = $(PREFIX)objcopy RANLIB = $(PREFIX)ranlib STRIP = $(PREFIX)strip -BIN2S = $(DEVKITPPC)/bin/bin2s +BIN2S = $(DEVKITPRO)/tools/bin/bin2s ifeq ($(NOMAPFILE),) LDFLAGS += -Wl,-Map,$(TARGET).map diff --git a/wiipax/client/Makefile b/wiipax/client/Makefile index 21b526b..99931ae 100644 --- a/wiipax/client/Makefile +++ b/wiipax/client/Makefile @@ -2,8 +2,8 @@ CFLAGS = -Wall -W -Os -g TARGET = wiipax OBJS = LzFind.o LzmaEnc.o LzmaDec.o lzma.o main.o OBJS += stub_mini.o stub_mini_debug.o -OBJS += stub_dkf.o stub_dkf_debug.o -OBJS += stub_dkfc.o stub_dkfc_debug.o +OBJS += stub_dkp.o stub_dkp_debug.o +OBJS += stub_dkpc.o stub_dkpc_debug.o NOMAPFILE = 1 diff --git a/wiipax/client/main.c b/wiipax/client/main.c index 1ab7ed9..6223f1f 100644 --- a/wiipax/client/main.c +++ b/wiipax/client/main.c @@ -18,14 +18,14 @@ extern int stub_mini_elf_len; extern char stub_mini_elf[]; extern int stub_mini_debug_elf_len; extern char stub_mini_debug_elf[]; -extern int stub_dkf_elf_len; -extern char stub_dkf_elf[]; -extern int stub_dkf_debug_elf_len; -extern char stub_dkf_debug_elf[]; -extern int stub_dkfc_elf_len; -extern char stub_dkfc_elf[]; -extern int stub_dkfc_debug_elf_len; -extern char stub_dkfc_debug_elf[]; +extern int stub_dkp_elf_len; +extern char stub_dkp_elf[]; +extern int stub_dkp_debug_elf_len; +extern char stub_dkp_debug_elf[]; +extern int stub_dkpc_elf_len; +extern char stub_dkpc_elf[]; +extern int stub_dkpc_debug_elf_len; +extern char stub_dkpc_debug_elf[]; typedef struct { const char *name; @@ -36,10 +36,10 @@ typedef struct { static const stub_t stubs[] = { { "mini", &stub_mini_elf_len, (u8 *) stub_mini_elf }, { "mini_debug", &stub_mini_debug_elf_len, (u8 *) stub_mini_debug_elf }, - { "devkitfail", &stub_dkf_elf_len, (u8 *) stub_dkf_elf }, - { "devkitfail_debug", &stub_dkf_debug_elf_len, (u8 *) stub_dkf_debug_elf }, - { "dkfailchannel", &stub_dkfc_elf_len, (u8 *) stub_dkfc_elf }, - { "dkfailchannel_debug", &stub_dkfc_debug_elf_len, (u8 *) stub_dkfc_debug_elf }, + { "devkitppc", &stub_dkp_elf_len, (u8 *) stub_dkp_elf }, + { "devkitppc_debug", &stub_dkp_debug_elf_len, (u8 *) stub_dkp_debug_elf }, + { "dkppcchannel", &stub_dkpc_elf_len, (u8 *) stub_dkpc_elf }, + { "dkppcchannel_debug", &stub_dkpc_debug_elf_len, (u8 *) stub_dkpc_debug_elf }, { NULL, NULL, NULL } }; diff --git a/wiipax/client/stub_dkp.c b/wiipax/client/stub_dkp.c new file mode 120000 index 0000000..121f9dd --- /dev/null +++ b/wiipax/client/stub_dkp.c @@ -0,0 +1 @@ +../stub/stub_dkp.c \ No newline at end of file diff --git a/wiipax/client/stub_dkp_debug.c b/wiipax/client/stub_dkp_debug.c new file mode 120000 index 0000000..31195b8 --- /dev/null +++ b/wiipax/client/stub_dkp_debug.c @@ -0,0 +1 @@ +../stub/stub_dkp_debug.c \ No newline at end of file diff --git a/wiipax/client/stub_dkpc.c b/wiipax/client/stub_dkpc.c new file mode 120000 index 0000000..1a6cbf6 --- /dev/null +++ b/wiipax/client/stub_dkpc.c @@ -0,0 +1 @@ +../stub/stub_dkpc.c \ No newline at end of file diff --git a/wiipax/client/stub_dkpc_debug.c b/wiipax/client/stub_dkpc_debug.c new file mode 120000 index 0000000..241cdb1 --- /dev/null +++ b/wiipax/client/stub_dkpc_debug.c @@ -0,0 +1 @@ +../stub/stub_dkpc_debug.c \ No newline at end of file diff --git a/wiipax/stub/Makefile b/wiipax/stub/Makefile index fdad228..b0f97a4 100644 --- a/wiipax/stub/Makefile +++ b/wiipax/stub/Makefile @@ -8,17 +8,17 @@ LDFLAGS += -nostartfiles -nodefaultlibs OBJS_COMMON = crt0.o main.o string.o sync.o elf.o time.o LzmaDec.o TARGET_ID = -ifeq ($(DEVKITFAIL),1) -DEFINES += -DDEVKITFAIL +ifeq ($(DKPPC),1) +DEFINES += -DDKPPC OBJS = $(OBJS_COMMON) -LDSCRIPT = devkitfail.ld -TARGET_ID = _dkf +LDSCRIPT = devkitppc.ld +TARGET_ID = _dkp else -ifeq ($(DKFAILCHANNEL),1) -DEFINES += -DDEVKITFAIL +ifeq ($(DKPPCCHANNEL),1) +DEFINES += -DDKPPC OBJS = realmode.o $(OBJS_COMMON) LDSCRIPT = channel.ld -TARGET_ID = _dkfc +TARGET_ID = _dkpc else OBJS = realmode.o plunge.o $(OBJS_COMMON) LDSCRIPT = realmode.ld @@ -54,14 +54,14 @@ release: $(Q)$(MAKE) clean $(Q)$(MAKE) NDEBUG=1 $(Q)$(MAKE) NDEBUG=1 clean - $(Q)$(MAKE) DEVKITFAIL=1 - $(Q)$(MAKE) DEVKITFAIL=1 clean - $(Q)$(MAKE) DEVKITFAIL=1 NDEBUG=1 - $(Q)$(MAKE) DEVKITFAIL=1 NDEBUG=1 clean - $(Q)$(MAKE) DKFAILCHANNEL=1 - $(Q)$(MAKE) DKFAILCHANNEL=1 clean - $(Q)$(MAKE) DKFAILCHANNEL=1 NDEBUG=1 - $(Q)$(MAKE) DKFAILCHANNEL=1 NDEBUG=1 clean + $(Q)$(MAKE) DKPPC=1 + $(Q)$(MAKE) DKPPC=1 clean + $(Q)$(MAKE) DKPPC=1 NDEBUG=1 + $(Q)$(MAKE) DKPPC=1 NDEBUG=1 clean + $(Q)$(MAKE) DKPPCCHANNEL=1 + $(Q)$(MAKE) DKPPCCHANNEL=1 clean + $(Q)$(MAKE) DKPPCCHANNEL=1 NDEBUG=1 + $(Q)$(MAKE) DKPPCCHANNEL=1 NDEBUG=1 clean .PHONY: release diff --git a/wiipax/stub/devkitfail.ld b/wiipax/stub/devkitppc.ld similarity index 100% rename from wiipax/stub/devkitfail.ld rename to wiipax/stub/devkitppc.ld diff --git a/wiipax/stub/main.c b/wiipax/stub/main.c index d7f2cf4..5a001ae 100644 --- a/wiipax/stub/main.c +++ b/wiipax/stub/main.c @@ -68,7 +68,7 @@ void stubmain(void) { write32(0x0c003004, 0); #ifndef NDEBUG -#ifndef DEVKITFAIL +#ifndef DKPPC udelay(500 * 1000); // wait for mini - avoid EXI battle #endif gecko_init(); @@ -86,7 +86,7 @@ void stubmain(void) { write32(0x0c003000, 0xffffffff); printf("Branching to 0x%08x\n", entry); -#ifndef DEVKITFAIL +#ifndef DKPPC // detect failkit apps packed with the mini stub if (entry & 0xc0000000) { void (*ep)() = (void (*)()) entry;