Homebrew Wii64 and GenPlusGX & co. USB2.0/3rd Party Controller Mods

Status
Not open for further replies.

xander150

Well-Known Member
OP
Member
Joined
Oct 12, 2009
Messages
112
Trophies
0
Website
Visit site
XP
162
Country
Gambia, The
<img src="http://upload.wikimedia.org/wikipedia/de/thumb/0/0b/USB-HighSpeed-certified-Logo.svg/400px-USB-HighSpeed-certified-Logo.svg.png" border="0" class="linked-image" />
<!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->Wii64 1.1 non-official mod with USB2.0 support and 3rd party Classic Controller support<!--sizec--></span><!--/sizec-->
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Not supported by the Wii64 team or me.<!--colorc--></span><!--/colorc-->
Please don't bug the Wii64 team with bugs if you use this build, <a href="http://code.google.com/p/mupen64gc/downloads/list" target="_blank">use the official build instead.</a>
This is not official, keep that in mind. All credit goes to the Wii64 team and Tantric.
Download: <a href="http://www.megaupload.com/?d=DBBW0SWM" target="_blank">http://www.megaupload.com/?d=DBBW0SWM</a>
Diff:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->diff -crB src/Makefile.menu2_wii wii64USB2/Makefile.menu2_wii
*** src/Makefile.menu2_wiiÂÂÂÂ2010-02-23 19:36:38.000000000 +0100
--- wii64USB2/Makefile.menu2_wiiÂÂÂÂ2010-04-19 20:44:59.000000000 +0200
***************
*** 1,8 ****
ÂÂ#Makefile MUPEN64 for glN64 + MenuV2 + Wii
ÂÂ
! CCÂÂÂÂÂÂÂÂ=powerpc-eabi-gcc
! CXXÂÂÂÂÂÂÂÂ=powerpc-eabi-g++
! ASÂÂÂÂÂÂÂÂ=powerpc-eabi-as
ÂÂ
ÂÂCFLAGSÂÂ= -g -O3 -Wall $(MACHDEP) $(INCLUDE) \
ÂÂÂÂÂÂÂÂ-DCPU_SHUTDOWN -DSPC700_SHUTDOWN -DVAR_CYCLES -DSOUND \
--- 1,8 ----
ÂÂ#Makefile MUPEN64 for glN64 + MenuV2 + Wii
ÂÂ
! CCÂÂÂÂÂÂÂÂ=/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc
! CXXÂÂÂÂÂÂÂÂ=/opt/devkitpro/devkitPPC/bin/powerpc-eabi-g++
! ASÂÂÂÂÂÂÂÂ=/opt/devkitpro/devkitPPC/bin/powerpc-eabi-as
ÂÂ
ÂÂCFLAGSÂÂ= -g -O3 -Wall $(MACHDEP) $(INCLUDE) \
ÂÂÂÂÂÂÂÂ-DCPU_SHUTDOWN -DSPC700_SHUTDOWN -DVAR_CYCLES -DSOUND \
***************
*** 23,29 ****
ÂÂ
ÂÂ#GL_PATHÂÂÂÂÂÂÂÂ=-I/usr/X11R6/include
ÂÂ
! OBJÂÂÂÂÂÂÂÂ=main/rom_gc.o \
ÂÂÂÂÂÂÂÂÂÂmain/main_gc-menu2.o \
ÂÂÂÂÂÂÂÂÂÂmain/gc_dvd.o \
ÂÂÂÂÂÂÂÂÂÂmain/ROM-Cache-MEM2.o \
--- 23,32 ----
ÂÂ
ÂÂ#GL_PATHÂÂÂÂÂÂÂÂ=-I/usr/X11R6/include
ÂÂ
! OBJÂÂÂÂÂÂÂÂ=main/rom_gc.o \
! ÂÂÂÂÂÂÂÂutils/ehcmodule.elf.o \
! ÂÂÂÂÂÂÂÂutils/mload.o \
! ÂÂÂÂÂÂÂÂutils/usb2storage.o \
ÂÂÂÂÂÂÂÂÂÂmain/main_gc-menu2.o \
ÂÂÂÂÂÂÂÂÂÂmain/gc_dvd.o \
ÂÂÂÂÂÂÂÂÂÂmain/ROM-Cache-MEM2.o \
***************
*** 163,169 ****
ÂÂÂÂÂÂÂÂÂÂr4300/recomp.h \
ÂÂÂÂÂÂÂÂÂÂgc_memory/pif.h
ÂÂ
! LIBÂÂÂÂÂÂÂÂ=ÂÂÂÂ-ldi -lm -lfat -ldb -lwiiuse -lbte -logc -lz
ÂÂ
ÂÂifeq ($(strip mupen64_GX_gfx/main.cpp),)
ÂÂÂÂÂÂexport LDÂÂÂÂ:=ÂÂÂÂ$(CC)
--- 166,172 ----
ÂÂÂÂÂÂÂÂÂÂr4300/recomp.h \
ÂÂÂÂÂÂÂÂÂÂgc_memory/pif.h
ÂÂ
! LIBÂÂÂÂÂÂÂÂ=ÂÂÂÂ-ldi -lm -lfat -lwiiuse -lbte -logc -lz
ÂÂ
ÂÂifeq ($(strip mupen64_GX_gfx/main.cpp),)
ÂÂÂÂÂÂexport LDÂÂÂÂ:=ÂÂÂÂ$(CC)
***************
*** 280,286 ****
ÂÂ
ÂÂwii64-glN64.elf:ÂÂÂÂ$(OBJ) $(OBJ_INPUT) $(OBJ_GLN64_GX) $(OBJ_AUDIO) $(OBJ_RSPHLE) $(OBJ_PPC)
ÂÂÂÂÂÂÂÂÂÂ$(LD) $^ $(LDFLAGS) $(LIBPATHS) $(LIB) -Wl -o $@
! ÂÂÂÂÂÂÂÂelf2dol wii64-glN64.elf wii64-glN64.dol
ÂÂ
ÂÂinstall:
ÂÂÂÂÂÂcp mupen64 "$(PREFIX)bin"
--- 283,289 ----
ÂÂ
ÂÂwii64-glN64.elf:ÂÂÂÂ$(OBJ) $(OBJ_INPUT) $(OBJ_GLN64_GX) $(OBJ_AUDIO) $(OBJ_RSPHLE) $(OBJ_PPC)
ÂÂÂÂÂÂÂÂÂÂ$(LD) $^ $(LDFLAGS) $(LIBPATHS) $(LIB) -Wl -o $@
! ÂÂÂÂÂÂÂÂ/opt/devkitpro/devkitPPC/bin/elf2dol wii64-glN64.elf wii64-glN64.dol
ÂÂ
ÂÂinstall:
ÂÂÂÂÂÂcp mupen64 "$(PREFIX)bin"
diff -crB src/main/main_gc-menu2.cpp wii64USB2/main/main_gc-menu2.cpp
*** src/main/main_gc-menu2.cppÂÂÂÂ2010-02-23 09:28:26.000000000 +0100
--- wii64USB2/main/main_gc-menu2.cppÂÂÂÂ2010-04-18 14:46:36.000000000 +0200
***************
*** 35,40 ****
--- 35,42 ----
ÂÂ#endif
ÂÂ
ÂÂ#include <gccore.h>
+ #include "../utils/usb2storage.h"
+ #include "../utils/mload.h"
ÂÂ#include "../menu/MenuContext.h"
ÂÂ#include "../libgui/MessageBox.h"
ÂÂ//#include "../gui/gui_GX-menu.h"
***************
*** 181,190 ****
ÂÂ// Read PAD format from Classic if available
ÂÂu16 readWPAD(void);
ÂÂ
ÂÂint main(int argc, char* argv[]){
ÂÂÂÂÂÂ/* INITIALIZE */
ÂÂ#ifdef HW_RVL
!ÂÂ DI_Init();ÂÂÂÂ// first
ÂÂ#endif
ÂÂ
ÂÂ#ifdef DEBUGON
--- 183,242 ----
ÂÂ// Read PAD format from Classic if available
ÂÂu16 readWPAD(void);
ÂÂ
+ /****************************************************************************
+ÂÂ* IOS 202
+ÂÂ***************************************************************************/
+ #ifdef HW_RVL
+ static bool FindIOS(u32 ios)
+ {
+ ÂÂÂÂs32 ret;
+ ÂÂÂÂu32 n;
+ ÂÂÂÂ
+ ÂÂÂÂu64 *titles = NULL;
+ ÂÂÂÂu32 num_titles=0;
+ ÂÂÂÂ
+ ÂÂÂÂret = ES_GetNumTitles(&num_titles);
+ ÂÂÂÂif (ret < 0)
+ ÂÂÂÂÂÂÂÂreturn false;
+ ÂÂÂÂ
+ ÂÂÂÂif(num_titles < 1)
+ ÂÂÂÂÂÂÂÂreturn false;
+ ÂÂÂÂ
+ ÂÂÂÂtitles = (u64 *)memalign(32, num_titles * sizeof(u64) + 32);
+ ÂÂÂÂif (!titles)
+ ÂÂÂÂÂÂÂÂreturn false;
+ ÂÂÂÂ
+ ÂÂÂÂret = ES_GetTitles(titles, num_titles);
+ ÂÂÂÂif (ret < 0)
+ ÂÂÂÂ{
+ ÂÂÂÂÂÂÂÂfree(titles);
+ ÂÂÂÂÂÂÂÂreturn false;
+ ÂÂÂÂ}
+ ÂÂÂÂ
+ ÂÂÂÂfor(n=0; n < num_titles; n++)
+ ÂÂÂÂ{
+ ÂÂÂÂÂÂÂÂif((titles[n] & 0xFFFFFFFF)==ios)
+ ÂÂÂÂÂÂÂÂ{
+ ÂÂÂÂÂÂÂÂÂÂÂÂfree(titles);
+ ÂÂÂÂÂÂÂÂÂÂÂÂreturn true;
+ ÂÂÂÂÂÂÂÂ}
+ ÂÂÂÂ}
+ÂÂÂÂ free(titles);
+ ÂÂÂÂreturn false;
+ }
+ #endif
+
ÂÂint main(int argc, char* argv[]){
ÂÂÂÂÂÂ/* INITIALIZE */
ÂÂ#ifdef HW_RVL
! ÂÂÂÂif(IOS_GetVersion() != 202 && FindIOS(202))
! ÂÂÂÂÂÂÂÂIOS_ReloadIOS(202);
! ÂÂÂÂ
! ÂÂÂÂDI_LoadDVDX(false);
! ÂÂÂÂDI_Init();ÂÂÂÂ// first
! ÂÂÂÂ
! ÂÂÂÂif(mload_init() >= 0 && load_ehci_module())
! ÂÂÂÂÂÂÂÂUSB2Enable(true);
ÂÂ#endif
ÂÂ
ÂÂ#ifdef DEBUGON
Only in wii64USB2/: utils
Only in wii64USB2/: utils/ehcmodule_elf.h
Only in wii64USB2/: utils/ehcmodule_elf.o
Only in wii64USB2/: utils/mload.c
Only in wii64USB2/: utils/mload.h
Only in wii64USB2/: utils/usb2storage.c
Only in wii64USB2/: utils/usb2storage.h<!--c2--></div><!--ec2-->
Loads every game in 1-3 seconds, ingame loading of big games is very short now (Rayman 2 for example), saving on USB takes now not even a second. Tested with a few dozens games (which is easy as it loads so fast <img src="style_emoticons/<#EMO_DIR#>/tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />).

<!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->GenPlusGX r439 non-official mod with USB2.0 support and 3rd party Classic Controller support<!--sizec--></span><!--/sizec-->
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Not supported by the GenPlusGX team or me.<!--colorc--></span><!--/colorc-->
Download: <a href="http://www.megaupload.com/?d=QQGL5HWN" target="_blank">http://www.megaupload.com/?d=QQGL5HWN</a>
Please don't bug the GenPlusGX team with bugs if you use this build, <a href="http://code.google.com/p/genplus-gx/downloads/list" target="_blank">use the official build instead.</a>
This is not official, keep that in mind. All credit goes to the GenPlusGX team and Tantric.
Diff:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Index: source/gx/main.c
===================================================================
--- source/gx/main.cÂÂÂÂ(Revision 439)
+++ source/gx/main.cÂÂÂÂ(Arbeitskopie)
@@ -28,6 +28,8 @@
#include "history.h"
#include "aram.h"
#include "dvd.h"
+#include "usb2storage.h"
+#include "mload.h"

#include <fat.h>
#include <ogc/cast.h>
@@ -167,12 +169,66 @@
u32 fat_enabled = 0;
u32 frameticker = 0;

+/****************************************************************************
+ * IOS 202
+ ***************************************************************************/
+#ifdef HW_RVL
+static bool FindIOS(u32 ios)
+{
+ÂÂÂÂs32 ret;
+ÂÂÂÂu32 n;
+ÂÂÂÂ
+ÂÂÂÂu64 *titles = NULL;
+ÂÂÂÂu32 num_titles=0;
+ÂÂÂÂ
+ÂÂÂÂret = ES_GetNumTitles(&num_titles);
+ÂÂÂÂif (ret < 0)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂif(num_titles < 1)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂtitles = (u64 *)memalign(32, num_titles * sizeof(u64) + 32);
+ÂÂÂÂif (!titles)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂret = ES_GetTitles(titles, num_titles);
+ÂÂÂÂif (ret < 0)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂfree(titles);
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ}
+ÂÂÂÂ
+ÂÂÂÂfor(n=0; n < num_titles; n++)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂif((titles[n] & 0xFFFFFFFF)==ios)
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂfree(titles);
+ÂÂÂÂÂÂÂÂÂÂÂÂreturn true;
+ÂÂÂÂÂÂÂÂ}
+ÂÂÂÂ}
+ÂÂÂÂfree(titles);
+ÂÂÂÂreturn false;
+}
+#endif
+
int main (int argc, char *argv[])
{
#ifdef HW_RVL
-ÂÂ/* initialize DVDX */
-ÂÂDI_Init();
-#endif
+ÂÂÂÂ// try to load IOS 202
+ÂÂÂÂif(IOS_GetVersion() != 202 && FindIOS(202))
+ÂÂÂÂÂÂÂÂIOS_ReloadIOS(202);
+ÂÂÂÂ
+ÂÂÂÂif(IOS_GetVersion() == 202)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂDI_LoadDVDX(false);
+ÂÂÂÂÂÂÂÂDI_Init();
+ÂÂÂÂÂÂÂÂ
+ÂÂÂÂÂÂÂÂ// load usb2 driver
+ÂÂÂÂÂÂÂÂif(mload_init() >= 0 && load_ehci_module())
+ÂÂÂÂÂÂÂÂÂÂÂÂUSB2Enable(true);
+ÂÂÂÂ}
+ÂÂÂÂ#endif

ÂÂ /* initialize hardware */
ÂÂ gx_video_Init();
Index: Makefile.wii
===================================================================
--- Makefile.wiiÂÂÂÂ(Revision 439)
+++ Makefile.wiiÂÂÂÂ(Arbeitskopie)
@@ -19,7 +19,7 @@
BUILDÂÂÂÂÂÂÂÂ:=ÂÂÂÂbuild_wii
SOURCESÂÂÂÂÂÂÂÂ:=ÂÂÂÂsource source/m68k source/z80 source/sound source/ntsc source/cart_hw source/cart_hw/svp \
ÂÂÂÂÂÂÂÂÂÂÂÂsource/gx source/gx/gui source/gx/fileio source/gx/images source/gx/sounds
-INCLUDESÂÂÂÂ:=ÂÂÂÂsource source/m68k source/z80 source/sound source/ntsc source/cart_hw source/cart_hw/svp \
+INCLUDESÂÂÂÂ:=ÂÂÂÂsource source/m68k source/z80 source/sound source/ntsc source/cart_hw source/utils source/cart_hw/svp \
ÂÂÂÂÂÂÂÂÂÂÂÂbuild_wii source/gx source/gx/gui source/gx/fileio source/gx/images source/gx/sounds

#---------------------------------------------------------------------------------
@@ -80,7 +80,8 @@
export OFILESÂÂÂÂ:=ÂÂÂÂ$(addsuffix .o,$(BINFILES)) \
ÂÂÂÂÂÂÂÂÂÂÂÂ$(PNGFILES:.png=.png.o) $(PCMFILES:.pcm=.pcm.o) $(OGGFILES:.ogg=.ogg.o) \
ÂÂÂÂÂÂÂÂÂÂÂÂ$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
-ÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o)
+ÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o) \
+ÂÂÂÂÂÂÂÂÂÂÂÂ$(CURDIR)/source/ehcmodule.elf.o

#---------------------------------------------------------------------------------
# build a list of include paths<!--c2--></div><!--ec2-->
I don't think USB2.0 is important for this Emulator as the rom files are very small and I only tested it with Sonic 1 yet, I just started using it.

<!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->WiiSX beta1 mod3 non-official mod with USB2.0 support and 3rd party Classic Controller support<!--sizec--></span><!--/sizec-->
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Not supported by the WiiSX team or me.<!--colorc--></span><!--/colorc-->
Please don't bug the WiiSX team with bugs if you use this build, <a href="http://filetrip.net/file.php?id=9881" target="_blank">use the official build or mod3 instead.</a>
This is not official, keep that in mind. All credit goes to the WiiSX team, Jacobeian and Tantric.
Download: <a href="http://www.megaupload.com/?d=8L68SZHM" target="_blank">http://www.megaupload.com/?d=8L68SZHM</a>
Diff:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Index: PsxInterpreter.c
===================================================================
--- PsxInterpreter.cÂÂÂÂ(Revision 64)
+++ PsxInterpreter.cÂÂÂÂ(Arbeitskopie)
@@ -22,6 +22,7 @@
* PSX assembly interpreter.
*/

+#include <gccore.h>
#include "PsxCommon.h"
#include "R3000A.h"
#include "Gte.h"
@@ -801,7 +802,25 @@
ÂÂ
ÂÂÂÂpsxRegs.pc+= 4; psxRegs.cycle++;
ÂÂÂÂpsxBSC[psxRegs.code >> 26]();
-ÂÂÂÂif(stop) exit(0);
+ÂÂÂÂif(stop)
+ÂÂ{
+#ifdef HW_RVL
+ÂÂÂÂchar * sig = (char *)0x80001804;
+ÂÂÂÂif(sig[0] == 'S' && sig[1] == 'T' && sig[2] == 'U' && sig[3] == 'B' &&
+ÂÂÂÂÂÂ sig[4] == 'H' && sig[5] == 'A' && sig[6] == 'X' && sig[7] == 'X')
+ÂÂÂÂ{
+ÂÂÂÂÂÂ/* return to HBC */
+ÂÂÂÂÂÂexit(0);
+ÂÂÂÂ}
+ÂÂÂÂelse
+ÂÂÂÂ{
+ÂÂÂÂÂÂ/* return to System Menu */
+ÂÂÂÂÂÂSYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
+ÂÂÂÂ}
+#else
+ÂÂÂÂexit(0);
+#endif
+ÂÂ}
}

/* debugger version */
Index: ppc/pR3000A.c
===================================================================
--- ppc/pR3000A.cÂÂÂÂ(Revision 64)
+++ ppc/pR3000A.cÂÂÂÂ(Arbeitskopie)
@@ -1138,7 +1138,25 @@
ÂÂÂÂÂÂÂÂrecRecompile();
ÂÂÂÂ}
ÂÂÂÂrecRun(*recFunc, (u32)&psxRegs, (u32)&psxM);
-ÂÂÂÂif(stop) exit(0);
+ÂÂÂÂif(stop)
+ÂÂ{
+#ifdef HW_RVL
+ÂÂÂÂchar * sig = (char *)0x80001804;
+ÂÂÂÂif(sig[0] == 'S' && sig[1] == 'T' && sig[2] == 'U' && sig[3] == 'B' &&
+ÂÂÂÂÂÂ sig[4] == 'H' && sig[5] == 'A' && sig[6] == 'X' && sig[7] == 'X')
+ÂÂÂÂ{
+ÂÂÂÂÂÂ/* return to HBC */
+ÂÂÂÂÂÂexit(0);
+ÂÂÂÂ}
+ÂÂÂÂelse
+ÂÂÂÂ{
+ÂÂÂÂÂÂ/* return to System Menu */
+ÂÂÂÂÂÂSYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
+ÂÂÂÂ}
+#else
+ÂÂÂÂexit(0);
+#endif
+ÂÂ}
}

static void recExecute() {
Index: PeopsSoftGPU/cfg.c
===================================================================
--- PeopsSoftGPU/cfg.cÂÂÂÂ(Revision 64)
+++ PeopsSoftGPU/cfg.cÂÂÂÂ(Arbeitskopie)
@@ -1635,7 +1635,7 @@
ÂÂiColDepth=16;
ÂÂiWindowMode=1;
ÂÂiUseScanLines=0;
- UseFrameLimit=0;
+ UseFrameLimit=1;
ÂÂUseFrameSkip=0;
ÂÂiFrameLimit=2;
ÂÂfFrameRate=200.0f;
Index: PeopsSoftGPU/drawGX.c
===================================================================
--- PeopsSoftGPU/drawGX.cÂÂÂÂ(Revision 64)
+++ PeopsSoftGPU/drawGX.cÂÂÂÂ(Arbeitskopie)
@@ -161,22 +161,23 @@
//ÂÂÂÂprintf("DoClearFrontBuffer\n");

ÂÂÂÂ//Write menu/debug text on screen
-ÂÂÂÂGXColor fontColor = {150,255,150,255};
-ÂÂÂÂwrite_font_init_GX(fontColor);
-ÂÂÂÂif(ulKeybits&KEY_SHOWFPS)
+ÂÂÂÂif(ulKeybits&KEY_SHOWFPS)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂGXColor fontColor = {150,255,150,255};
+ÂÂÂÂÂÂÂÂwrite_font_init_GX(fontColor);
ÂÂÂÂÂÂÂÂwrite_font(10,35,szDispBuf, 1.0);

-ÂÂÂÂint i = 0;
-ÂÂÂÂDEBUG_update();
-ÂÂÂÂfor (i=0;i<DEBUG_TEXT_HEIGHT;i++)
-ÂÂÂÂÂÂÂÂwrite_font(10,(10*i+60),text, 0.5);
+ÂÂÂÂÂÂÂÂint i = 0;
+ÂÂÂÂÂÂÂÂDEBUG_update();
+ÂÂÂÂÂÂÂÂfor (i=0;i<DEBUG_TEXT_HEIGHT;i++)
+ÂÂÂÂÂÂÂÂÂÂÂÂwrite_font(10,(10*i+60),text, 0.5);
ÂÂÂÂÂÂÂÂ
-ÂÂ //reset swap table from GUI/DEBUG
-ÂÂÂÂGX_SetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
-ÂÂÂÂGX_SetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0);
+ÂÂÂÂÂÂÂÂ//reset swap table from GUI/DEBUG
+ÂÂÂÂÂÂÂÂGX_SetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
+ÂÂÂÂÂÂÂÂGX_SetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0);
+ÂÂÂÂÂÂÂÂGX_DrawDone();
+ÂÂÂÂ}

-ÂÂÂÂGX_DrawDone();
-
ÂÂÂÂwhichfb ^= 1;
ÂÂÂÂGX_CopyDisp(xfb[0], GX_TRUE);
ÂÂÂÂGX_DrawDone();
@@ -284,7 +285,6 @@
ÂÂif(PSXDisplay.RGB24)
ÂÂ {
ÂÂÂÂunsigned char * pD;unsigned int startxy;
-ÂÂ DEBUG_print("BlitScreenNSGX: RGB24",DBG_GPU1+1);

ÂÂÂÂsurf+=PreviousPSXDisplay.Range.x0<<1;
#ifdef USE_DGA2
@@ -310,7 +310,6 @@
ÂÂ {
ÂÂÂÂunsigned long * SRCPtr = (unsigned long *)(psxVuw +
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(y<<10) + x);
-ÂÂ DEBUG_print("BlitScreenNSGX: Not RGB24",DBG_GPU1+1);

ÂÂÂÂunsigned long * DSTPtr =
ÂÂÂÂ ((unsigned long *)surf)+(PreviousPSXDisplay.Range.x0>>1);
@@ -466,19 +465,21 @@
ÂÂÂÂGX_End();

ÂÂÂÂ//Write menu/debug text on screen
-ÂÂÂÂGXColor fontColor = {150,255,150,255};
-ÂÂÂÂwrite_font_init_GX(fontColor);
ÂÂÂÂif(ulKeybits&KEY_SHOWFPS)
-ÂÂÂÂÂÂÂÂwrite_font(10,35,szDispBuf, 1.0);
+ÂÂÂÂ{
+ÂÂÂÂGXColor fontColor = {150,255,150,255};
+ÂÂÂÂwrite_font_init_GX(fontColor);
+ÂÂÂÂwrite_font(10,35,szDispBuf, 1.0);

-ÂÂÂÂint i = 0;
-ÂÂÂÂDEBUG_update();
-ÂÂÂÂfor (i=0;i<DEBUG_TEXT_HEIGHT;i++)
-ÂÂÂÂÂÂÂÂwrite_font(10,(10*i+60),text, 0.5);
+ÂÂÂÂÂÂint i = 0;
+ÂÂÂÂÂÂDEBUG_update();
+ÂÂÂÂÂÂfor (i=0;i<DEBUG_TEXT_HEIGHT;i++)
+ÂÂÂÂÂÂÂÂÂÂwrite_font(10,(10*i+60),text, 0.5);
ÂÂÂÂÂÂÂÂ
-ÂÂ //reset swap table from GUI/DEBUG
-ÂÂÂÂGX_SetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
-ÂÂÂÂGX_SetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0);
+ÂÂÂÂ //reset swap table from GUI/DEBUG
+ÂÂÂÂGX_SetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
+ÂÂÂÂGX_SetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0);
+ÂÂ}

ÂÂÂÂGX_DrawDone();

Index: Gamecube/Makefile_Wii
===================================================================
--- Gamecube/Makefile_WiiÂÂÂÂ(Revision 64)
+++ Gamecube/Makefile_WiiÂÂÂÂ(Arbeitskopie)
@@ -17,7 +17,7 @@
#---------------------------------------------------------------------------------
TARGETÂÂÂÂÂÂÂÂ:=ÂÂÂÂWiiSX
BUILDÂÂÂÂÂÂÂÂ:=ÂÂÂÂbuild
-SOURCESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ. .. ../ppc/ ../PeopsSoftGPU/ ../PeopsSpu109/
+SOURCESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ. .. ../ppc/ ../PeopsSoftGPU/ ../PeopsSpu109/ ../utils/ ./utils/
DATAÂÂÂÂÂÂÂÂ:=ÂÂÂÂdataÂÂ
INCLUDESÂÂÂÂ:=ÂÂÂÂ.. ../ppc/ ../PeopsSpu109/

@@ -26,7 +26,7 @@
#---------------------------------------------------------------------------------

CFLAGSÂÂÂÂ= -g -O2 -Wall $(MACHDEP) $(INCLUDE) -D__GAMECUBE__ -D__ppc__ \
-ÂÂÂÂÂÂÂÂÂÂ-D__GX__ -D_SDL -DSHOW_DEBUG -DEMBEDDED_FONTS -DNOTHREADLIB \
+ÂÂÂÂÂÂÂÂÂÂ-D__GX__ -D_SDL -DEMBEDDED_FONTS -DNOTHREADLIB \
ÂÂÂÂÂÂÂÂÂÂ-DTHREADED_AUDIO
ÂÂÂÂÂÂÂÂÂÂ
CXXFLAGSÂÂÂÂ=ÂÂÂÂ$(CFLAGS)
@@ -36,7 +36,7 @@
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
-LIBSÂÂÂÂ:=ÂÂÂÂ-lm -lfat -logc
+LIBSÂÂÂÂ:=ÂÂÂÂ-lfat -lwiiuse -lbte -logc -lm

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
@@ -78,7 +78,8 @@

export OFILESÂÂÂÂ:=ÂÂÂÂ$(addsuffix .o,$(BINFILES)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o)
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o) \
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(CURDIR)/../utils/ehcmodule.elf.o

#---------------------------------------------------------------------------------
# build a list of include paths
Index: Gamecube/GamecubeMain.c
===================================================================
--- Gamecube/GamecubeMain.cÂÂÂÂ(Revision 64)
+++ Gamecube/GamecubeMain.cÂÂÂÂ(Arbeitskopie)
@@ -26,10 +26,16 @@
#include <string.h>
#include <time.h>
#include <fat.h>
+#include "utils/usb2storage.h"
+#include "utils/mload.h"
#include "PsxCommon.h"
#include "PlugCD.h"
#include "DEBUG.h"

+#ifdef HW_RVL
+#include <wiiuse/wpad.h>
+#endif
+
/* function prototypes */
int SysInit();
void SysReset();
@@ -47,11 +53,29 @@
int whichfb = 0;ÂÂÂÂÂÂÂÂ/*** Frame buffer toggle ***/
GXRModeObj *vmode;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ/*** Graphics Mode Object ***/
#define DEFAULT_FIFO_SIZE ( 256 * 1024 )
+#define KEY_SHOWFPSÂÂÂÂÂÂ 2
extern int controllerType;
+extern int UseFrameLimit;
+extern unsigned longÂÂulKeybits;

int stop = 0;
+extern int stop;

void ScanPADSandReset() {
+#ifdef HW_RVL
+ÂÂWPAD_ScanPads();
+ÂÂif (WPAD_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_HOME)
+ÂÂ{
+ÂÂÂÂ/* Key Combos */
+ÂÂÂÂu32 p = WPAD_ButtonsDown(0);
+ÂÂÂÂif (p & WPAD_CLASSIC_BUTTON_FULL_L)
+ÂÂÂÂÂÂulKeybits^=KEY_SHOWFPS; // FPS display
+ÂÂÂÂelse if (p & WPAD_CLASSIC_BUTTON_FULL_R)
+ÂÂÂÂÂÂUseFrameLimit^=1;ÂÂÂÂÂÂ // Frame Limiter
+ÂÂÂÂelse if (p & WPAD_CLASSIC_BUTTON_PLUS)
+ÂÂÂÂÂÂstop = 1;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ //exit will be called
+ÂÂ}
+#endif
ÂÂ PAD_ScanPads();
ÂÂ if(!((*(u32*)0xCC003000)>>16))
ÂÂÂÂ stop=1;ÂÂ//exit will be called
@@ -62,6 +86,7 @@
ÂÂ PAD_Init();
ÂÂ PAD_Reset(0xf0000000);
#ifdef HW_RVL
+ÂÂWPAD_Init();
ÂÂ CONF_Init();
#endif

@@ -134,7 +159,66 @@

long LoadCdBios;

+/****************************************************************************
+ * IOS 202
+ ***************************************************************************/
+#ifdef HW_RVL
+static bool FindIOS(u32 ios)
+{
+ÂÂÂÂs32 ret;
+ÂÂÂÂu32 n;
+ÂÂÂÂ
+ÂÂÂÂu64 *titles = NULL;
+ÂÂÂÂu32 num_titles=0;
+ÂÂÂÂ
+ÂÂÂÂret = ES_GetNumTitles(&num_titles);
+ÂÂÂÂif (ret < 0)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂif(num_titles < 1)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂtitles = (u64 *)memalign(32, num_titles * sizeof(u64) + 32);
+ÂÂÂÂif (!titles)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂret = ES_GetTitles(titles, num_titles);
+ÂÂÂÂif (ret < 0)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂfree(titles);
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ}
+ÂÂÂÂ
+ÂÂÂÂfor(n=0; n < num_titles; n++)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂif((titles[n] & 0xFFFFFFFF)==ios)
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂfree(titles);
+ÂÂÂÂÂÂÂÂÂÂÂÂreturn true;
+ÂÂÂÂÂÂÂÂ}
+ÂÂÂÂ}
+ÂÂÂÂfree(titles);
+ÂÂÂÂreturn false;
+}
+#endif
+
+
int main(int argc, char *argv[]) {
+ÂÂÂÂ
+#ifdef HW_RVL
+ÂÂÂÂ// try to load IOS 202
+ÂÂÂÂif(IOS_GetVersion() != 202 && FindIOS(202))
+ÂÂÂÂÂÂÂÂIOS_ReloadIOS(202);
+ÂÂÂÂ
+ÂÂÂÂif(IOS_GetVersion() == 202)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂ
+ÂÂÂÂÂÂÂÂ// load usb2 driver
+ÂÂÂÂÂÂÂÂif(mload_init() >= 0 && load_ehci_module())
+ÂÂÂÂÂÂÂÂÂÂÂÂUSB2Enable(true);
+ÂÂÂÂ}
+#endif
+ÂÂÂÂ

ÂÂÂÂInitialise();
ÂÂÂÂfatInitDefault();
@@ -147,29 +231,49 @@
#elif HW_DOL
ÂÂ printf("\n\nCubeSX beta 1\n\n");
#endif
-ÂÂ
+
ÂÂ u16 butns=0;
ÂÂ printf("Select Controller Type:\n(A) Standard : (B) Analog\n");
-ÂÂdo{butns = PAD_ButtonsDown(0);}while(!((butns & PAD_BUTTON_A) || (butns & PAD_BUTTON_B)));
+ÂÂdo
+ÂÂ{
+ÂÂÂÂbutns = PAD_ButtonsDown(0);
+#ifdef HW_RVL
+ÂÂÂÂif (WPAD_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A) butns |= PAD_BUTTON_A;
+ÂÂÂÂif (WPAD_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_B) butns |= PAD_BUTTON_B;
+#endif
+ÂÂ}
+ÂÂwhile(!((butns & PAD_BUTTON_A) || (butns & PAD_BUTTON_B)));
ÂÂ if(butns & PAD_BUTTON_A)ÂÂcontrollerType=0;
ÂÂ elseÂÂcontrollerType=1;
ÂÂ printf("%s selected\n",controllerType ? "Analog":"Standard");
-ÂÂÂÂ
-ÂÂdo{butns = PAD_ButtonsDown(0);}while(((butns & PAD_BUTTON_A) || (butns & PAD_BUTTON_B)));
-ÂÂ
+
ÂÂ printf("Select Core Type:\n(X) Dynarec : (Y) Interpreter\n");
-ÂÂdo{butns = PAD_ButtonsDown(0);}while(!((butns & PAD_BUTTON_X) || (butns & PAD_BUTTON_Y)));
+ÂÂdo
+ÂÂ{
+ÂÂÂÂbutns = PAD_ButtonsDown(0);
+#ifdef HW_RVL
+ÂÂÂÂif (WPAD_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_X) butns |= PAD_BUTTON_X;
+ÂÂÂÂif (WPAD_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_Y) butns |= PAD_BUTTON_Y;
+#endif
+ÂÂ}
+ÂÂwhile(!((butns & PAD_BUTTON_X) || (butns & PAD_BUTTON_Y)));
ÂÂ if(butns & PAD_BUTTON_X)ÂÂConfig.Cpu=0;
ÂÂ elseÂÂConfig.Cpu=1;
ÂÂ printf("%s selected\n",Config.Cpu ? "Interpreter":"Dynarec");
-ÂÂ
-ÂÂdo{butns = PAD_ButtonsDown(0);}while(((butns & PAD_BUTTON_X) || (butns & PAD_BUTTON_Y)));
-ÂÂ
+
ÂÂ printf("Press A\n");
-ÂÂwhile(!(PAD_ButtonsDown(0) & PAD_BUTTON_A));
-ÂÂwhile((PAD_ButtonsDown(0) & PAD_BUTTON_A));
-ÂÂ
+#ifdef HW_RVL
+ÂÂ while(!(PAD_ButtonsDown(0) & PAD_BUTTON_A) && !(WPAD_ButtonsDown(0) & WPAD_CLASSIC_BUTTON_A));
+#else
+ÂÂ while(!(PAD_ButtonsDown(0) & PAD_BUTTON_A));
+#endif

+ÂÂwhile(PAD_ButtonsDown(0));
+#ifdef HW_RVL
+ÂÂwhile(WPAD_ButtonsDown(0));
+#endif
+
+
ÂÂÂÂstrcpy(Config.Bios, "SCPH1001.BIN"); // Use actual BIOS
ÂÂÂÂstrcpy(Config.BiosDir, "/PSXISOS/");
ÂÂÂÂstrcpy(Config.Net,"Disabled");
Index: Gamecube/textFileBrowser.c
===================================================================
--- Gamecube/textFileBrowser.cÂÂÂÂ(Revision 64)
+++ Gamecube/textFileBrowser.cÂÂÂÂ(Arbeitskopie)
@@ -23,38 +23,42 @@
#define CLEAR() printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
#endif

-static char buffer[96];
+#ifdef HW_RVL
+#include <wiiuse/wpad.h>
+#endif
+
typedef struct {
ÂÂÂÂchar name[MAXPATHLEN];
ÂÂÂÂintÂÂsize;
ÂÂÂÂintÂÂattr;
} dir_ent;

+static dir_ent* dir;
+
char* textFileBrowser(char* directory){
ÂÂÂÂ// Set everything up to read
ÂÂÂÂDIR_ITER* dp = diropen(directory);
ÂÂÂÂif(!dp){ return NULL; }
ÂÂÂÂstruct stat fstat;
ÂÂÂÂchar filename[MAXPATHLEN];
-ÂÂÂÂint num_entries = 2, i = 0;
-ÂÂÂÂdir_ent* dir = malloc( num_entries * sizeof(dir_ent) );
+ÂÂÂÂchar buffer[96];
+ÂÂÂÂint num_entries = 0;
+
ÂÂÂÂ// Read each entry of the directory
ÂÂÂÂwhile( dirnext(dp, filename, &fstat) == 0 ){
ÂÂÂÂÂÂÂÂ// Make sure we have room for this one
-ÂÂÂÂÂÂÂÂif(i == num_entries){
-ÂÂÂÂÂÂÂÂÂÂÂÂ++num_entries;
-ÂÂÂÂÂÂÂÂÂÂÂÂdir = realloc( dir, num_entries * sizeof(dir_ent) );
-ÂÂÂÂÂÂÂÂ}
-ÂÂÂÂÂÂÂÂstrcpy(dir.name, filename);
-ÂÂÂÂÂÂÂÂdir.sizeÂÂ = fstat.st_size;
-ÂÂÂÂÂÂÂÂdir.attrÂÂ = fstat.st_mode;
-ÂÂÂÂÂÂÂÂ++i;
+ÂÂÂÂÂÂÂÂdir = realloc( dir, (num_entries + 1) * sizeof(dir_ent) );
+ÂÂÂÂÂÂÂÂstrcpy(dir[num_entries].name, filename);
+ÂÂÂÂÂÂÂÂdir[num_entries].sizeÂÂ = fstat.st_size;
+ÂÂÂÂÂÂÂÂdir[num_entries].attrÂÂ = fstat.st_mode;
+ÂÂÂÂÂÂÂÂ++num_entries;
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂdirclose(dp);
ÂÂÂÂ
ÂÂÂÂint currentSelection = (num_entries > 2) ? 2 : 1;
-ÂÂÂÂwhile(1){
+ÂÂÂÂint p = 0;
+while(1){
ÂÂÂÂÂÂÂÂCLEAR();
ÂÂÂÂÂÂÂÂsprintf(buffer, "browsing %s:\n\n", directory);
ÂÂÂÂÂÂÂÂPRINT(buffer);
@@ -63,39 +67,62 @@
ÂÂÂÂÂÂÂÂfor(; i<max; ++i){
ÂÂÂÂÂÂÂÂÂÂÂÂif(i == currentSelection)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(buffer, "*");
-ÂÂÂÂÂÂÂÂÂÂÂÂelseÂÂÂÂsprintf(buffer, " ");
-ÂÂÂÂÂÂÂÂÂÂÂÂsprintf(buffer, "%s\t%-32s\t%s\n", buffer,
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdir.name, (dir.attr&S_IFDIR) ? "DIR" : "");
+ÂÂÂÂÂÂÂÂÂÂÂÂelseÂÂÂÂsprintf(buffer, " ");
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(buffer, "%s\t%-32s\t%s\n", buffer,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdir.name, (dir.attr&S_IFDIR) ? "DIR" : "");
ÂÂÂÂÂÂÂÂÂÂÂÂPRINT(buffer);
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂ/*** Wait for A/up/down press ***/
-ÂÂÂÂÂÂÂÂwhile (!(PAD_ButtonsHeld(0) & PAD_BUTTON_A) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_UP) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_DOWN));
-ÂÂÂÂÂÂÂÂif(PAD_ButtonsHeld(0) & PAD_BUTTON_UP)ÂÂ currentSelection = (--currentSelection < 0) ? num_entries-1 : currentSelection;
-ÂÂÂÂÂÂÂÂif(PAD_ButtonsHeld(0) & PAD_BUTTON_DOWN) currentSelection = (currentSelection + 1) % num_entries;
-ÂÂÂÂÂÂÂÂif(PAD_ButtonsHeld(0) & PAD_BUTTON_A){
+ÂÂÂÂÂÂÂÂp = PAD_ButtonsHeld(0);
+ÂÂÂÂÂÂÂÂwhile (!(p & PAD_BUTTON_A) && !(p & PAD_BUTTON_UP) && !(p & PAD_BUTTON_DOWN))
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂp = PAD_ButtonsHeld(0);
+#ifdef HW_RVL
+ÂÂÂÂÂÂÂÂÂÂÂÂif(WPAD_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_UP) p |= PAD_BUTTON_UP;
+ÂÂÂÂÂÂÂÂÂÂÂÂelse if(WPAD_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_DOWN) p |= PAD_BUTTON_DOWN;
+ÂÂÂÂÂÂÂÂÂÂÂÂif(WPAD_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_A) p |= PAD_BUTTON_A;
+#endif
+ÂÂÂÂÂÂÂÂ}
+
+ÂÂÂÂÂÂÂÂif(p & PAD_BUTTON_UP)ÂÂ currentSelection = (--currentSelection < 0) ? num_entries-1 : currentSelection;
+ÂÂÂÂÂÂÂÂelse if(p & PAD_BUTTON_DOWN) currentSelection = (currentSelection + 1) % num_entries;
+ÂÂÂÂÂÂÂÂif(p & PAD_BUTTON_A){
ÂÂÂÂÂÂÂÂÂÂÂÂif(dir[currentSelection].attr & S_IFDIR){
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂchar newDir[MAXPATHLEN];
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(newDir, "%s/%s", directory, dir[currentSelection].name);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfree(dir);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdir = NULL;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂCLEAR();
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(buffer,"MOVING TO %s.\nPress B to continue.\n",newDir);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂPRINT(buffer);
+#ifdef HW_RVL
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂwhile (!(PAD_ButtonsHeld(0) & PAD_BUTTON_B) && !(WPAD_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_B));
+#else
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂwhile (!(PAD_ButtonsHeld(0) & PAD_BUTTON_B));
+#endif
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn textFileBrowser(newDir);
ÂÂÂÂÂÂÂÂÂÂÂÂ} else {
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂchar* newDir = malloc(MAXPATHLEN);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂchar *newDir = malloc(MAXPATHLEN);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(newDir, "%s/%s", directory, dir[currentSelection].name);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfree(dir);
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdir = NULL;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂCLEAR();
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(buffer,"SELECTING %s.\nPress B to continue.\n",newDir);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂPRINT(buffer);
+#ifdef HW_RVL
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂwhile (!(PAD_ButtonsHeld(0) & PAD_BUTTON_B) && !(WPAD_ButtonsHeld(0) & WPAD_CLASSIC_BUTTON_B));
+#else
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂwhile (!(PAD_ButtonsHeld(0) & PAD_BUTTON_B));
+#endif
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn newDir;
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂ}
-ÂÂÂÂÂÂÂÂ/*** Wait for up/down button release ***/
-ÂÂÂÂÂÂÂÂwhile (!(!(PAD_ButtonsHeld(0) & PAD_BUTTON_A) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_UP) && !(PAD_ButtonsHeld(0) & PAD_BUTTON_DOWN)));
+ÂÂÂÂÂÂÂÂ/*** Wait for button release ***/
+ÂÂÂÂÂÂÂÂwhile (PAD_ButtonsHeld(0));
+#ifdef HW_RVL
+ÂÂÂÂÂÂÂÂwhile (WPAD_ButtonsHeld(0));
+#endif
ÂÂÂÂ}
}

Index: Gamecube/PlugPAD.c
===================================================================
--- Gamecube/PlugPAD.cÂÂÂÂ(Revision 64)
+++ Gamecube/PlugPAD.cÂÂÂÂ(Arbeitskopie)
@@ -20,6 +20,10 @@
#include "PsxCommon.h"
#include "PSEmu_Plugin_Defs.h"

+#ifdef HW_RVL
+#include <wiiuse/wpad.h>
+#endif
+
extern void SysPrintf(char *fmt, ...);

/* Button Bits */
@@ -38,6 +42,62 @@
#define PSX_BUTTON_DDOWNÂÂÂÂ~(1 << 6)
#define PSX_BUTTON_DLEFTÂÂÂÂ~(1 << 7)

+
+#ifdef HW_RVL
+/****************************************************************************
+ * WPAD_StickÂÂ(taken from Snes9XGX)
+ *
+ * Get X/Y value from Wii Joystick (classic, nunchuk) input
+ ***************************************************************************/
+s8 WPAD_Stick(u8 chan, u8 right, int axis)
+{
+ÂÂÂÂfloat mag = 0.0;
+ÂÂÂÂfloat ang = 0.0;
+ÂÂÂÂWPADData *data = WPAD_Data(chan);
+
+ÂÂÂÂswitch (data->exp.type)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂcase WPAD_EXP_NUNCHUK:
+ÂÂÂÂÂÂÂÂcase WPAD_EXP_GUITARHERO3:
+ÂÂÂÂÂÂÂÂÂÂÂÂif (right == 0)
+ÂÂÂÂÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmag = data->exp.nunchuk.js.mag;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂang = data->exp.nunchuk.js.ang;
+ÂÂÂÂÂÂÂÂÂÂÂÂ}
+ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
+
+ÂÂÂÂÂÂÂÂcase WPAD_EXP_CLASSIC:
+ÂÂÂÂÂÂÂÂÂÂÂÂif (right == 0)
+ÂÂÂÂÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmag = data->exp.classic.ljs.mag;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂang = data->exp.classic.ljs.ang;
+ÂÂÂÂÂÂÂÂÂÂÂÂ}
+ÂÂÂÂÂÂÂÂÂÂÂÂelse
+ÂÂÂÂÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmag = data->exp.classic.rjs.mag;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂang = data->exp.classic.rjs.ang;
+ÂÂÂÂÂÂÂÂÂÂÂÂ}
+ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
+
+ÂÂÂÂÂÂÂÂdefault:
+ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
+ÂÂÂÂ}
+
+ÂÂÂÂ/* calculate x/y value (angle need to be converted into radian) */
+ÂÂÂÂif (mag > 1.0) mag = 1.0;
+ÂÂÂÂelse if (mag < -1.0) mag = -1.0;
+ÂÂÂÂdouble val;
+
+ÂÂÂÂif(axis == 0) // x-axis
+ÂÂÂÂÂÂÂÂval = mag * sin((M_PI * ang)/180.0f);
+ÂÂÂÂelse // y-axis
+ÂÂÂÂÂÂÂÂval = mag * cos((M_PI * ang)/180.0f);
+
+ÂÂÂÂreturn (s8)(val * 128.0f);
+}
+
+#endif
+
/* Controller type, later do this by a Variable in the GUI */
int controllerType = 0; // 0 = standard, 1 = analog (analog fails on old games)

@@ -89,11 +149,11 @@
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_TRIANGLE;
ÂÂÂÂif (b & PAD_BUTTON_UP)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DUP;
-ÂÂÂÂif (b & PAD_BUTTON_DOWN)
+ÂÂÂÂelse if (b & PAD_BUTTON_DOWN)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DDOWN;
ÂÂÂÂif (b & PAD_BUTTON_LEFT)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DLEFT;
-ÂÂÂÂif (b & PAD_BUTTON_RIGHT)
+ÂÂÂÂelse if (b & PAD_BUTTON_RIGHT)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DRIGHT;
ÂÂÂÂ/* Shoulder Buttons, L1 = L, R1 = R, L2 = L+Z, R2 = R+Z */
ÂÂÂÂif ((b & PAD_TRIGGER_Z) && (b & PAD_TRIGGER_R))
@@ -105,6 +165,40 @@
ÂÂÂÂif ((!(b & PAD_TRIGGER_Z)) && (b & PAD_TRIGGER_L))
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_L1;

+#ifdef HW_RVL
+ÂÂint h = WPAD_ButtonsHeld(0);
+ÂÂÂÂ/* PAD Buttons */
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_PLUS)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_START;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_MINUS)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_SELECT;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_B)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_CROSS;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_Y)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_SQUARE;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_A)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_CIRCLE;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_X)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_TRIANGLE;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_UP)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DUP;
+ÂÂÂÂelse if (h & WPAD_CLASSIC_BUTTON_DOWN)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DDOWN;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_LEFT)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DLEFT;
+ÂÂÂÂelse if (h & WPAD_CLASSIC_BUTTON_RIGHT)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DRIGHT;
+ÂÂÂÂ/* Shoulder Buttons */
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_FULL_R)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_R2;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_FULL_L)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_L2;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_ZR)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_R1;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_ZL)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_L1;
+#endif
+
ÂÂ if(!controllerType) {
ÂÂÂÂ //allow GC analog pad to be used for digital
ÂÂÂÂ if(PAD_StickX(0) < -50)
@@ -115,18 +209,36 @@
ÂÂÂÂÂÂ pad_status &= PSX_BUTTON_DDOWN;
ÂÂÂÂ else if(PAD_StickY(0) > 50)
ÂÂÂÂÂÂ pad_status &= PSX_BUTTON_DUP;
+#ifdef HW_RVL
+ÂÂÂÂ//allow Classic Controller analog pad to be used for digital
+ÂÂÂÂif(WPAD_Stick(0,0,0) < -50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DLEFT;
+ÂÂÂÂelse if(WPAD_Stick(0,0,0) > 50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DRIGHT;
+ÂÂÂÂif(WPAD_Stick(0,0,1) < -50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DDOWN;
+ÂÂÂÂelse if(WPAD_Stick(0,0,1) > 50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DUP;
+#endif
+ÂÂÂÂÂÂpad->controllerType = PSE_PAD_TYPE_STANDARD; ÂÂÂÂ// Standard Pad
ÂÂ }

-ÂÂif(controllerType==1) {
+ÂÂelse if(controllerType==1) {
ÂÂ ÂÂÂÂ//adjust values by 128 cause psx values in range 0-255 where 128 is center position
+#ifndef HW_RVL
ÂÂ ÂÂÂÂpad->leftJoyXÂÂ= (u8)(PAD_StickX(0)+127) & 0xFF;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//analog stick
ÂÂ ÂÂÂÂpad->leftJoyYÂÂ= (u8)(-PAD_StickY(0)+127) & 0xFF;
ÂÂ ÂÂÂÂpad->rightJoyX = (u8)(PAD_SubStickX(0)+127) & 0xFF;ÂÂÂÂÂÂÂÂÂÂÂÂ//C-stick (Left JoyStick)
ÂÂ ÂÂÂÂpad->rightJoyY = (u8)(PAD_SubStickY(0)+127) & 0xFF;
-ÂÂÂÂÂÂpad->controllerType = PSE_PAD_TYPE_ANALOGPAD; ÂÂÂÂ// Analog PadÂÂ(Right JoyStick)
-ÂÂÂÂ}
-ÂÂelse if(!controllerType)
-ÂÂÂÂÂÂpad->controllerType = PSE_PAD_TYPE_STANDARD; ÂÂÂÂ// Standard Pad
+#else
+ÂÂÂÂÂÂpad->leftJoyXÂÂ= ((u8)(PAD_StickX(0)+127) + (u8)(WPAD_Stick(0,0,0)+127)) & 0xFF;
+ÂÂÂÂÂÂpad->leftJoyYÂÂ= ((u8)(-PAD_StickY(0)+127) + (u8)(-WPAD_Stick(0,0,1)+127)) & 0xFF;
+ÂÂÂÂÂÂpad->rightJoyX = ((u8)(PAD_SubStickX(0)+127) + (u8)(WPAD_Stick(0,1,0)+127)) & 0xFF;
+ÂÂÂÂÂÂpad->rightJoyY = ((u8)(PAD_SubStickY(0)+127) + (u8)(WPAD_Stick(0,1,1)+127)) & 0xFF;
+#endif
+ÂÂÂÂpad->controllerType = PSE_PAD_TYPE_ANALOGPAD; ÂÂÂÂ// Analog PadÂÂ(Right JoyStick)
+ÂÂ}
+
ÂÂÂÂpad->buttonStatus = pad_status;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//Copy Buttons
ÂÂÂÂreturn PSE_PAD_ERR_SUCCESS;
}
@@ -134,6 +246,7 @@
long PAD__readPort2(PadDataS* pad) {

ÂÂÂÂint b = PAD_ButtonsHeld(1);
+
ÂÂÂÂuint16_t pad_status = 0xFFFF;ÂÂÂÂ//bit pointless why is this done this way?

ÂÂÂÂ/* PAD Buttons, Start = Start, Select = Start+Z, Cross = A, Square = B, Triangle = Y, Circle = X */
@@ -151,11 +264,11 @@
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_TRIANGLE;
ÂÂÂÂif (b & PAD_BUTTON_UP)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DUP;
-ÂÂÂÂif (b & PAD_BUTTON_DOWN)
+ÂÂÂÂelse if (b & PAD_BUTTON_DOWN)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DDOWN;
ÂÂÂÂif (b & PAD_BUTTON_LEFT)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DLEFT;
-ÂÂÂÂif (b & PAD_BUTTON_RIGHT)
+ÂÂÂÂelse if (b & PAD_BUTTON_RIGHT)
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DRIGHT;
ÂÂÂÂ/* Shoulder Buttons, L1 = L, R1 = R, L2 = L+Z, R2 = R+Z */
ÂÂÂÂif ((b & PAD_TRIGGER_Z) && (b & PAD_TRIGGER_R))
@@ -167,7 +280,43 @@
ÂÂÂÂif ((!(b & PAD_TRIGGER_Z)) && (b & PAD_TRIGGER_L))
ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_L1;

+#ifdef HW_RVL
+ÂÂint h = WPAD_ButtonsHeld(1);
+ÂÂÂÂ/* PAD Buttons */
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_PLUS)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_START;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_MINUS)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_SELECT;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_B)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_CROSS;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_Y)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_SQUARE;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_A)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_CIRCLE;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_X)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_TRIANGLE;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_UP)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DUP;
+ÂÂÂÂelse if (h & WPAD_CLASSIC_BUTTON_DOWN)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DDOWN;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_LEFT)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DLEFT;
+ÂÂÂÂelse if (h & WPAD_CLASSIC_BUTTON_RIGHT)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_DRIGHT;
+ÂÂÂÂ/* Shoulder Buttons */
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_FULL_R)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_R2;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_FULL_L)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_L2;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_ZR)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_R1;
+ÂÂÂÂif (h & WPAD_CLASSIC_BUTTON_ZL)
+ÂÂÂÂÂÂÂÂpad_status &= PSX_BUTTON_L1;
+#endif
+
ÂÂÂÂif(!controllerType) {
+ÂÂÂÂ// Standard Pad
+ÂÂÂÂpad->controllerType = PSE_PAD_TYPE_STANDARD;
ÂÂÂÂ //allow GC analog pad to be used for digital
ÂÂÂÂ if(PAD_StickX(1) < -50)
ÂÂÂÂÂÂ pad_status &= PSX_BUTTON_DLEFT;
@@ -177,18 +326,34 @@
ÂÂÂÂÂÂ pad_status &= PSX_BUTTON_DDOWN;
ÂÂÂÂ else if(PAD_StickY(1) > 50)
ÂÂÂÂÂÂ pad_status &= PSX_BUTTON_DUP;
+#ifdef HW_RVL
+ÂÂÂÂ//allow Classic Controller analog pad to be used for digital
+ÂÂÂÂif(WPAD_Stick(1,0,0) < -50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DLEFT;
+ÂÂÂÂelse if(WPAD_Stick(1,0,0) > 50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DRIGHT;
+ÂÂÂÂif(WPAD_Stick(1,0,1) < -50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DDOWN;
+ÂÂÂÂelse if(WPAD_Stick(1,0,1) > 50)
+ÂÂÂÂÂÂpad_status &= PSX_BUTTON_DUP;
+#endif
ÂÂ }

-ÂÂif(controllerType==1) {
+ÂÂelse if(controllerType==1) {
ÂÂ ÂÂÂÂ//adjust values by 128 cause psx values in range 0-255 where 128 is center position
+#ifndef HW_RVL
ÂÂ ÂÂÂÂpad->leftJoyXÂÂ= (u8)(PAD_StickX(1)+127) & 0xFF;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//analog stick
ÂÂ ÂÂÂÂpad->leftJoyYÂÂ= (u8)(-PAD_StickY(1)+127) & 0xFF;
ÂÂ ÂÂÂÂpad->rightJoyX = (u8)(PAD_SubStickX(1)+127) & 0xFF;ÂÂÂÂÂÂÂÂÂÂÂÂ//C-stick (Left JoyStick)
ÂÂ ÂÂÂÂpad->rightJoyY = (u8)(PAD_SubStickY(1)+127) & 0xFF;
+#else
+ÂÂÂÂÂÂpad->leftJoyXÂÂ= ((u8)(PAD_StickX(1)+127) + (u8)(WPAD_Stick(1,0,0)+127)) & 0xFF;
+ÂÂÂÂÂÂpad->leftJoyYÂÂ= ((u8)(-PAD_StickY(1)+127) + (u8)(-WPAD_Stick(1,0,1)+127)) & 0xFF;
+ÂÂÂÂÂÂpad->rightJoyX = ((u8)(PAD_SubStickX(1)+127) + (u8)(WPAD_Stick(1,1,0)+127)) & 0xFF;
+ÂÂÂÂÂÂpad->rightJoyY = ((u8)(PAD_SubStickY(1)+127) + (u8)(WPAD_Stick(1,1,1)+127)) & 0xFF;
+#endif
ÂÂ ÂÂÂÂpad->controllerType = PSE_PAD_TYPE_ANALOGPAD; ÂÂÂÂ// Analog PadÂÂ(Right JoyStick)
ÂÂÂÂ}
-ÂÂelse if(!controllerType)
-ÂÂÂÂÂÂpad->controllerType = PSE_PAD_TYPE_STANDARD; ÂÂÂÂ// Standard Pad

ÂÂÂÂpad->buttonStatus = pad_status;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//Copy Buttons
ÂÂÂÂreturn PSE_PAD_ERR_SUCCESS;
Index: Gamecube/Makefile
===================================================================
--- Gamecube/MakefileÂÂÂÂ(Revision 64)
+++ Gamecube/MakefileÂÂÂÂ(Arbeitskopie)
@@ -26,7 +26,7 @@
#---------------------------------------------------------------------------------

CFLAGSÂÂÂÂ= -g -O2 -Wall $(MACHDEP) $(INCLUDE) -D__GAMECUBE__ -D__ppc__ \
-ÂÂÂÂÂÂÂÂÂÂ-D__GX__ -DHW_DOL -D_SDL -DSHOW_DEBUG -DEMBEDDED_FONTS -DNOTHREADLIB \
+ÂÂÂÂÂÂÂÂÂÂ-D__GX__ -DHW_DOL -D_SDL -DEMBEDDED_FONTS -DNOTHREADLIB \
ÂÂÂÂÂÂÂÂÂÂ-DTHREADED_AUDIO
ÂÂÂÂÂÂÂÂÂÂ
CXXFLAGSÂÂÂÂ=ÂÂÂÂ$(CFLAGS)<!--c2--></div><!--ec2-->This diff includes mod3 changes, so it's a diff from clean SVN to mod3+USB2

Can't say if games really load faster as the mod3 didn't detect my HDD but with the USB2.0 mod it does. Can't tell if it's faster than SD, too.

<!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->pcsx-revolution r83 non-official mod with USB2.0 support and 3rd party Classic Controller support<!--sizec--></span><!--/sizec-->
<!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->Not needed anymore, was integrated into SVN rev 84<!--sizec--></span><!--/sizec-->
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->Not supported by the pcsx-revolution team or me.<!--colorc--></span><!--/colorc-->
Please don't bug the pcsx-revolution team with bugs if you use this build, <a href="http://code.google.com/p/pcsx-revolution/downloads/list" target="_blank">use the official build instead.</a>
This is not official, keep that in mind. All credit goes to the pcsx-revolution and Tantric.
Download: <a href="http://www.megaupload.com/?d=XY3X0JQC" target="_blank">http://www.megaupload.com/?d=XY3X0JQC</a>
Diff:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Index: Gamecube/GamecubeMain.c
===================================================================
--- Gamecube/GamecubeMain.cÂÂÂÂ(Revision 83)
+++ Gamecube/GamecubeMain.cÂÂÂÂ(Arbeitskopie)
@@ -25,6 +25,8 @@
#include <errno.h>
#include <string.h>
#include <math.h>
+#include "utils/usb2storage.h"
+#include "utils/mload.h"
#include "system.h"
#include "DEBUG.h"

@@ -162,8 +164,65 @@

long LoadCdBios;

+/****************************************************************************
+ * IOS 202
+ ***************************************************************************/
+#ifdef HW_RVL
+static bool FindIOS(u32 ios)
+{
+ÂÂÂÂs32 ret;
+ÂÂÂÂu32 n;
+ÂÂÂÂ
+ÂÂÂÂu64 *titles = NULL;
+ÂÂÂÂu32 num_titles=0;
+ÂÂÂÂ
+ÂÂÂÂret = ES_GetNumTitles(&num_titles);
+ÂÂÂÂif (ret < 0)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂif(num_titles < 1)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂtitles = (u64 *)memalign(32, num_titles * sizeof(u64) + 32);
+ÂÂÂÂif (!titles)
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ
+ÂÂÂÂret = ES_GetTitles(titles, num_titles);
+ÂÂÂÂif (ret < 0)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂfree(titles);
+ÂÂÂÂÂÂÂÂreturn false;
+ÂÂÂÂ}
+ÂÂÂÂ
+ÂÂÂÂfor(n=0; n < num_titles; n++)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂif((titles[n] & 0xFFFFFFFF)==ios)
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂfree(titles);
+ÂÂÂÂÂÂÂÂÂÂÂÂreturn true;
+ÂÂÂÂÂÂÂÂ}
+ÂÂÂÂ}
+ÂÂÂÂfree(titles);
+ÂÂÂÂreturn false;
+}
+#endif
+
+
int main(int argc, char *argv[]) {

+#ifdef HW_RVL
+ÂÂÂÂ// try to load IOS 202
+ÂÂÂÂif(IOS_GetVersion() != 202 && FindIOS(202))
+ÂÂÂÂÂÂÂÂIOS_ReloadIOS(202);
+ÂÂÂÂ
+ÂÂÂÂif(IOS_GetVersion() == 202)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂ
+ÂÂÂÂÂÂÂÂ// load usb2 driver
+ÂÂÂÂÂÂÂÂif(mload_init() >= 0 && load_ehci_module())
+ÂÂÂÂÂÂÂÂÂÂÂÂUSB2Enable(true);
+ÂÂÂÂ}
+#endif
ÂÂÂÂInitialise();

ÂÂÂÂ/* Configure pcsx */
Index: Gamecube/Makefile.Wii
===================================================================
--- Gamecube/Makefile.WiiÂÂÂÂ(Revision 83)
+++ Gamecube/Makefile.WiiÂÂÂÂ(Arbeitskopie)
@@ -17,7 +17,7 @@
#---------------------------------------------------------------------------------
TARGETÂÂÂÂÂÂÂÂ:=ÂÂÂÂpcsx
BUILDÂÂÂÂÂÂÂÂ:=ÂÂÂÂbuild
-SOURCESÂÂÂÂÂÂÂÂ:=ÂÂÂÂsource . ./ui ./storage ./GPU/ ./SPU/ ./PAD/ ../libpcsxcore/ ../libpcsxcore/R3000A/ ../libpcsxcore/R3000A/ppc/
+SOURCESÂÂÂÂÂÂÂÂ:=ÂÂÂÂsource . ./ui ./storage ./GPU/ ./SPU/ ./PAD/ ../libpcsxcore/ ../libpcsxcore/R3000A/ ../libpcsxcore/R3000A/ppc/ ../utils/ ./utils/
DATAÂÂÂÂÂÂÂÂ:=ÂÂÂÂdataÂÂ
INCLUDESÂÂÂÂ:=ÂÂÂÂ./ ../libpcsxcore/

@@ -83,7 +83,8 @@

export OFILESÂÂÂÂ:=ÂÂÂÂ$(addsuffix .o,$(BINFILES)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o)
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o) \
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(CURDIR)/../utils/ehcmodule.elf.o

#---------------------------------------------------------------------------------
# build a list of include paths<!--c2--></div><!--ec2-->
Can't say if games really load faster as the original didn't detect my HDD but with the USB2.0 mod it does. Can't tell if it's faster than SD, too.

You need IOS202 to run these apps, they probably start without it but you won't get USB2.0 speed (there is a check if IOS202 exists, if it does USB gets enhanced to USB2.0). The 3rd party Controller supported was not tested by me due to missing hardware (only Nintendo Classic Controller). Please confirm. USB2.0 support is confirmed working in both by me. <b>DVD support was not tested.</b> Please confirm.
To build them yourself make the changes from the diffs and use the utils folder from snes9xgx.
I made these builds just for me because I use my Wii without SD card, only USB and I don't want to wait a minute just to load Super Mario 64, so don't expect that much support, I hope it has the same compatibility as mplayer_ce or Snes9xGX but I can't promise.
<span style="text-decoration: line-through;">I also tried this with the latest WiiSX mod but it just code dumped me, this and </span>ScummVM will be my next project if there are no requests. Maybe also a USB2.0 Homebrew launcher as HBC is incredibly slow from USB, Loadmii on IOS202 with libwiigui similar to HBC would be a nice long-term goal <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

Everything is compiled with this modified <a href="http://www.megaupload.com/?d=DEO8GSW7" target="_blank">libog 1.8.3 </a>

Stupid me, my WiiSX mod didn't work as I had no PSXISOS folder on my HDD but just on my SD <img src="style_emoticons/<#EMO_DIR#>/tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />
 

Skater4599

Well-Known Member
Member
Joined
May 29, 2008
Messages
965
Trophies
1
Location
United States
XP
1,554
Country
United States
Awesome! Thanks for these
smile.gif
I have screenshot pics for all my Sega Gen Games and they load with slight delay with SD and HUGE delay with USB, now USB 2.0 should fix that problem
biggrin.gif


Does this make the apps run under IOS202 now? I was curious what they run under normally lol
 

xander150

Well-Known Member
OP
Member
Joined
Oct 12, 2009
Messages
112
Trophies
0
Website
Visit site
XP
162
Country
Gambia, The
Skater4599 said:
Does this make the apps run under IOS202 now? I was curious what they run under normally lolQUOTE(xander150 @ Apr 19 2010, 09:00 PM) You need IOS202 to run these apps, they probably start without it but you won't get USB2.0 speed (there is a check if IOS202 exists, if it does USB gets enhanced to USB2.0).
Normally they run under the IOS which your Homebrew launcher uses (mostly HBC), so they use the IOS HBC shows if they don't reload into another IOS.
 

r3dfaction

Well-Known Member
Member
Joined
May 17, 2009
Messages
198
Trophies
0
Website
phyzorg.wordpress.com
XP
74
Country
United States
I understand that you have made a build off the svn repositories and added some code, but you must change the app's name to avoid confusion with 'regular' versions and a legal stance from both the Wii64 Team and eke-eke...
 

xander150

Well-Known Member
OP
Member
Joined
Oct 12, 2009
Messages
112
Trophies
0
Website
Visit site
XP
162
Country
Gambia, The
r3dfaction said:
I understand that you have made a build off the svn repositories and added some code, but you must change the app's name to avoid confusion with 'regular' versions and a legal stance from both the Wii64 Team and eke-eke...
That's what these texts are for: QUOTE(xander150 @ Apr 19 2010, 09:00 PM) Not supported by the Wii64 team or me.
Please don't bug the Wii64 team with bugs if you use this build, use the official build instead.
This is not official, keep that in mind. All credit goes to the Wii64 team and Tantric.
I also added "Mods" to the thread title which tells people who are able to read that these are mods. And as you can see in my quote I also wrote that these are not official and they shouldn't bug the Wii64 team or ekeeke about them. How can there be any confusion that these are "regular" versions? Please tell me.
I'll change the headings (or titles) for you as you think that "Wii64 1.1 with USB2.0 support and 3rd party Classic Controller support" is the same as "Wii64".
I also wonder how this legal stance would look like here
tongue.gif
I don't think Jacobeian was sued because of his WiiSX mod
tongue.gif
 

r3dfaction

Well-Known Member
Member
Joined
May 17, 2009
Messages
198
Trophies
0
Website
phyzorg.wordpress.com
XP
74
Country
United States
xander150 said:
r3dfaction said:
I understand that you have made a build off the svn repositories and added some code, but you must change the app's name to avoid confusion with 'regular' versions and a legal stance from both the Wii64 Team and eke-eke...
That's what these texts are for: QUOTE(xander150 @ Apr 19 2010, 09:00 PM) Not supported by the Wii64 team or me.
Please don't bug the Wii64 team with bugs if you use this build, use the official build instead.
This is not official, keep that in mind. All credit goes to the Wii64 team and Tantric.
I also added "Mods" to the thread title which tells people who are able to read that these are mods. And as you can see in my quote I also wrote that these are not official and they shouldn't bug the Wii64 team or ekeeke about them. How can there be any confusion that these are "regular" versions? Please tell me.
I'll change the headings (or titles) for you as you think that "Wii64 1.1 with USB2.0 support and 3rd party Classic Controller support" is the same as "Wii64".
I also wonder how this legal stance would look like here
tongue.gif
I don't think Jacobeian was sued because of his WiiSX mod
tongue.gif
:scoffs: perhaps I went a little far, well I'm out
hate2.gif
 

Jacobeian

Well-Known Member
Member
Joined
May 15, 2008
Messages
1,893
Trophies
0
XP
387
Country
Cuba
This is great, I'm sure that if you send patches to the guys responsible for these projects (through the googlecode issue page), they will give it a look and eventually integrate it in "official" release, you should try at least...

about the naming scheme, really nobody cares as long as it stays here and is not advertised by stupid "news" website as official ones. You did the right thing by clearly explaining 99% of the work is not yours and you just copied Tantric's code into other emus so don't bother with that.

EDIT: just looking at the patches, I think you should still call DI_Init when IOS202 is not found, to keep DVD support working on systems that do not need USB2 or cIOS
 

xander150

Well-Known Member
OP
Member
Joined
Oct 12, 2009
Messages
112
Trophies
0
Website
Visit site
XP
162
Country
Gambia, The
Jacobeian said:
This is great, I'm sure that if you send patches to the guys responsible for these projects (through the googlecode issue page), they will give it a look and eventually integrate it in "official" release, you should try at least...I sent the patches to pcsx-revolution, genplus-gx and Wii64 authors (as WiiSX doesn't have USB support I don't see the need for an issue there and if they include it in Wii64 they'll maybe do so with WiiSX).

EDIT: ekeeke accepted the issue and he'll have a look at it.
EDIT2: He added it 4 hours ago
QUOTE(Jacobeian @ Apr 20 2010, 10:06 AM) just looking at the patches, I think you should still call DI_Init when IOS202 is not found, to keep DVD support working on systems that do not need USB2 or cIOS
Now as I think about it I see your point. I just copied the code from snes9gx (and removed the DVD part for WiiSX), tried to understand it but didn't think much about it. This is maybe worth an issue on the snes9gx site, as you are the expert I'll leave this to you
wink.gif

I hope that the emu authors just see Tantrics code because of my issues and that they'll adapt it for their needs and not blindly use my diff file so I don't think that these POCs here need rebuilds with a "always DI_init". All in all they're are mostly for my personal use (and I don't use DVDs with them) and they should show that these emus are possible with USB2, I know that my Makefile changes are everything but clean and that I just added as less code as needed
tongue.gif
 

Skater4599

Well-Known Member
Member
Joined
May 29, 2008
Messages
965
Trophies
1
Location
United States
XP
1,554
Country
United States
Hey xander150, ive been using your mods here for GenesisGX and Wii64 the loading is amazingly fast and works great but for some reason i cannot get Wii64 to remember the changes ive made to the settings, i click save to USB and it says success etc. can load/play games with speed from USB but when i exit and go back in, all settings are back to default again, Its immediately noticeable as i change the resolution to 16:9 for my TV, wondering how you have your setup?

GenplusGX only issue i found is it will not display ANY of the snaps i have from USB anymore, It used to display them (albeit, VERY SLOOOOWLY) but now it loads all games and everything just fine just wont load snaps, not huge deal just thought id let anyone reading this know ^^
 

Jacobeian

Well-Known Member
Member
Joined
May 15, 2008
Messages
1,893
Trophies
0
XP
387
Country
Cuba
Skater4599 said:
GenplusGX only issue i found is it will not display ANY of the snaps i have from USB anymore, It used to display them (albeit, VERY SLOOOOWLY) but now it loads all games and everything just fine just wont load snaps, not huge deal just thought id let anyone reading this know ^^

maybe not your issue but I once noticed that if you have a SDCARD inserted on startup, it will apparently try to load snaps from that by default and USB will be ignored, I think it's due to how libfat works
 

xander150

Well-Known Member
OP
Member
Joined
Oct 12, 2009
Messages
112
Trophies
0
Website
Visit site
XP
162
Country
Gambia, The
Skater4599 said:
Hey xander150, ive been using your mods here for GenesisGX and Wii64 the loading is amazingly fast and works great but for some reason i cannot get Wii64 to remember the changes ive made to the settings, i click save to USB and it says success etc. can load/play games with speed from USB but when i exit and go back in, all settings are back to default again, Its immediately noticeable as i change the resolution to 16:9 for my TV, wondering how you have your setup?

GenplusGX only issue i found is it will not display ANY of the snaps i have from USB anymore, It used to display them (albeit, VERY SLOOOOWLY) but now it loads all games and everything just fine just wont load snaps, not huge deal just thought id let anyone reading this know ^^
Wii64 never remembered the video settings for me. I read on the emulatemii.com page that it also does not for others so this seems to be not implemented in wii64. It just saves the other settings for me and always loads them fine on startup (savegame settings). You start Wii64 from USB, load a game and it loads the savegame from USB without problems. Normal Wii64 didn't even recognize my disk if it wasn't safely removed.

I can't help you with GenPlus-GX as I never used it before. Ekeeke wrote that he'll look into the patch and I guess if he adds it it will be better tested
wink.gif


QUOTE(DjoeN @ Apr 23 2010, 09:09 AM) Some mediafire links would be nice, seems i have trouble downloading from megaupload.
ThX
These are just POCs and I would like to keep them on one host. Just try it again or use JDownloader it will get them as soon as they are available. Megaupload sometimes has problems but never deleted any of my files (several hundreds of Gigabytes). If you still can't get them you know where to get the source and the diffs are here in plain text in the spoilers. Just get the source, use patch and compile using devkitpro/devkitppc.
 

VashTS

Beat it, son
Member
Joined
Mar 14, 2009
Messages
4,308
Trophies
1
Age
39
Location
Upstate NY
XP
3,755
Country
United States
yes very nice work. the usb 2.0 difference in genplus is really noticeable. it has locked up on me a few times. but its all good, the speed makes up for any bugs big time.
 

trigger_ftu

The FantomPhox
Member
Joined
Nov 23, 2008
Messages
209
Trophies
0
Location
Germany
XP
345
Country
United States
regrettably. genplus had usb2.0 support since the rev 300 and up as well as a fix up of it as of rev 441. wii64 has always had usb2.0 sense the ver before 1.1 honey, and as for snesgx and fceu they have had usb2.0 since devkit pro rev 20 (last year) and libogc 1.8.2 if i remember all these are are compiled and release unofficial.
 

xander150

Well-Known Member
OP
Member
Joined
Oct 12, 2009
Messages
112
Trophies
0
Website
Visit site
XP
162
Country
Gambia, The
trigger_ftu said:
regretably. genplus had usb2.0 support sence the rev 300 as well as a fic up of it as of rev 441. wii64 has always had usb2.0 sence the ver before 1.1 honey, and as for snesgx and fecu they have had usb2.0 sence libogc rev 18 (last year) all these are are compiled and release unofficials.No, they had not. USB2 is back compatible to USB 1.1, so that 1.1 devices (or software) can use USB2.0 devices (in this case Wii/Emus: USB 1.1, HDD: USB2). And please work on your grammar, I can only understand half of the bullshit you are trying to write.

trigger_ftu said:
genplus had usb2.0 support sence the rev 300Yeah, that's why rev 441's change log looks like this (note, 441 was later than 300):
Code:
Log message

added USB2 support through Hermes IOS202 (mload)
Ok, this change log is missing "Thanks to Tantric for the original code" or "Thanks to xander150 for the hint/implementation" but who cares (as we see it on firnis SVN for pcsx-r), fact is, it has USB2 support since r441/442/this mod.

trigger_ftu said:
as well as a fic up of it as of rev 441I don't know what a fic up is but rev441 was made AFTER I SENT THE CHANGES TO Ekeeke.
By the way the change log to your rev 300 looks like this:CODELog message

clear-up some memory
There were only minor changes but nothing USB related.

QUOTE(trigger_ftu @ May 6 2010, 03:48 PM)
snesgx and fecu they have had usb2.0 sence libogc rev 18 (last year) all these are are compiled and release unofficials.
I don't now if they had a sence for USB2 but libogc never had or has USB2 support, not even since rev18, it's provided by IOS202 and the EHCI module. I didn't even post any version of Snes9xGX or fceuGX (never heard of fecu) because I got the USB2.0 code from there.
Yes, these are unofficially compiled releases (if this is what you were trying to say with your crappy kind-of-English), this is also what is stated really big on the first page, but they include changes (which you can find in the spoilers) to support USB2 speed and better USB compatibility.
 

trigger_ftu

The FantomPhox
Member
Joined
Nov 23, 2008
Messages
209
Trophies
0
Location
Germany
XP
345
Country
United States
thats uncalled for. next time you want to rant best take into of the state the person is in during the time of post. you don't know me and never will. take into consideration of multiple possibilities for everyone. when i had mentioned i typo-ed on the word FIX (something a so called European cannot see) as for my not knowing anything i know a lot more than you can imagine. but as it seems your to lazy to do any research on the facts. and as for your builds changing a few functions and libs for EHCI isn't really much, starting fresh is something great. i post my copies of genpluse because 9 times outta 10 the emulator works fine, unless i have to add a fix of my own. sooo STFU and don't say anything at all, or have manners for people that make simple little mistakes in spelling in a semi-conscious state.

btw Xander i know the difference between USB 1.1/2.0/3 and how it works.
 

xander150

Well-Known Member
OP
Member
Joined
Oct 12, 2009
Messages
112
Trophies
0
Website
Visit site
XP
162
Country
Gambia, The
Still doesn't change the fact that your post was completly wrong and the emus you named never had USB2 support. And I think I proved this good with facts from the official SVNs. You on the other site have no facts at all besides strange sentences again. Now it's your turn to provide your proves and facts.
About the class thing. Even if I still had to visit school: Ever heard of time-zones?
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    rvtr @ rvtr: Spam bots again.