<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:
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="" 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:
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:
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:
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="" border="0" alt="tongue.gif" />
<!--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-->
*** 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-->
<!--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-->
===================================================================
--- 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-->
<!--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
===================================================================
--- 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-->
===================================================================
--- 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-->
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="" border="0" alt="tongue.gif" />