From 95745a23cb7bbb64784c0310d58e2014f5d560ef Mon Sep 17 00:00:00 2001 From: giantpune Date: Thu, 16 Sep 2010 11:54:18 +0000 Subject: [PATCH] * robbed homebrewboot stuff from wiixplorer --- HBC/META.XML | 4 ++-- Makefile | 7 ++++++- source/homebrewboot/BootHomebrew.h | 19 +++++++------------ source/homebrewboot/HomebrewBrowse.cpp | 3 +++ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/HBC/META.XML b/HBC/META.XML index 3fba8986..f33de9b1 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r941 - 201009160837 + 1.0 r942 + 201009161115 Loads games from USB-devices USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller. diff --git a/Makefile b/Makefile index b060e306..1982c83e 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,7 @@ TTFFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ttf))) PNGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.png))) OGGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ogg))) PCMFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.pcm))) +DOLFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.dol))) MP3FILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.mp3))) #--------------------------------------------------------------------------------- @@ -110,7 +111,7 @@ endif export OFILES := $(addsuffix .o,$(BINFILES)) \ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ $(sFILES:.s=.o) $(SFILES:.S=.o) \ - $(TTFFILES:.ttf=.ttf.o) $(PNGFILES:.png=.png.o) \ + $(TTFFILES:.ttf=.ttf.o) $(PNGFILES:.png=.png.o) $(addsuffix .o,$(DOLFILES))\ $(OGGFILES:.ogg=.ogg.o) $(PCMFILES:.pcm=.pcm.o) $(MP3FILES:.mp3=.mp3.o) \ $(addsuffix .o,$(ELFFILES)) @@ -198,6 +199,10 @@ language: $(wildcard $(PROJECTDIR)/Languages/*.lang) @echo $(notdir $<) $(bin2o) +%.dol.o : %.dol + @echo $(notdir $<) + @bin2s -a 32 $< | $(AS) -o $(@) + %.ttf.o : %.ttf @echo $(notdir $<) $(bin2o) diff --git a/source/homebrewboot/BootHomebrew.h b/source/homebrewboot/BootHomebrew.h index 2fd179eb..60f64427 100644 --- a/source/homebrewboot/BootHomebrew.h +++ b/source/homebrewboot/BootHomebrew.h @@ -1,18 +1,13 @@ #ifndef _BOOTHOMEBREW_H_ #define _BOOTHOMEBREW_H_ -#ifdef __cplusplus -extern "C" { -#endif - int BootHomebrew(char * path); - int BootHomebrewFromMem(); - void CopyHomebrewMemory(u32 read, u8 *temp, u32 len); - int AllocHomebrewMemory(u32 filesize); - void FreeHomebrewBuffer(); - -#ifdef __cplusplus -} -#endif +int BootHomebrew(char * path); +int BootHomebrewFromMem(); +void CopyHomebrewMemory(u32 read, u8 *temp, u32 len); +int AllocHomebrewMemory(u32 filesize); +void FreeHomebrewBuffer(); +void AddBootArgument(const char * argv); +extern u32 homebrewsize; #endif diff --git a/source/homebrewboot/HomebrewBrowse.cpp b/source/homebrewboot/HomebrewBrowse.cpp index 4791a517..a78b965c 100644 --- a/source/homebrewboot/HomebrewBrowse.cpp +++ b/source/homebrewboot/HomebrewBrowse.cpp @@ -879,6 +879,7 @@ int MenuHomebrewBrowse() { uLongf f = uncfilesize; error = uncompress(unc, &f, temp, infilesize) != Z_OK; uncfilesize = f; + homebrewsize = uncfilesize; free(temp); temp = unc; @@ -887,6 +888,7 @@ int MenuHomebrewBrowse() { if (!error && strstr(filename,".zip") == NULL) { innetbuffer = temp; + } } @@ -899,6 +901,7 @@ int MenuHomebrewBrowse() { if (strstr(filename,".dol") || strstr(filename,".DOL") || strstr(filename,".elf") || strstr(filename,".ELF")) { boothomebrew = 2; + AddBootArgument( filename ); menu = MENU_EXIT; CloseConnection(); break;