Hacking Unoffical -- USBloader_GX(S)

  • Thread starter Thread starter Sketter
  • Start date Start date
  • Views Views 68,143
  • Replies Replies 321
Yeah, I can't imagine there'd be anything more I'd want than what this already does, personally. Of course, I wouldn't know for sure because I gave up after an hour of trying to get it to work, but that's okay.
laugh.gif
 
Just change the latest sneek in the way that it loads the game files not from USB but from NAND (which is USB in UNEEK), this should be mostly it.
 
if you want to do it yourself, it is really easy.

get sneek's fs-usb module from r72
do a DIF of that one and mine
this will give you probably 25 lines of code or less that are different
either make a patch or manually add those few lines into the current sneek SVN
do the same for the ES module.

Then just use this di module. You may not actually have to do anything with the ES module. I think I only added 1 or 2 lines in it which might not even be needed.
 
Wait, so, just to be clear and prevent me from needing to trawl this thread (If OP is still around the first post REALLY should get updated to reflect a bit more detail
tongue.gif
) - Does this install on top of SNEEK/UNEEK/SNEEK+DI, or is this a branch of SNEEK+DI? I'm a bit too tired to want to trawl D:
I guess I waited a bit too long to jump on SNEEK, etc.
 
For the interested here are the diff files for es and fs-usb module.
es
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Index: ES.c
===================================================================
--- ES.cÂÂÂÂ(Revision 72)
+++ ES.cÂÂÂÂ(Arbeitskopie)
@@ -695,7 +695,12 @@
ÂÂÂÂ_sprintf( path, "/title/%08x/%08x/data", *(u32*)(tmd+0x18C), *(u32*)(tmd+0x190) );

ÂÂÂÂ//Create data and content dir if neccessary
-ÂÂÂÂr = ISFS_GetUsage( path, NULL, NULL );
+
+ÂÂÂÂu32 *fix = malloca(sizeof(u32), 32 ), *fix2= malloca(sizeof(u32), 32 );
+ÂÂÂÂr = ISFS_GetUsage( path, fix, fix2 );
+ÂÂÂÂfree( fix );
+ÂÂÂÂfree( fix2 );
+ÂÂÂÂ//r = ISFS_GetUsage( path, NULL, NULL );
ÂÂÂÂswitch( r )
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂcase FS_ENOENT2:
@@ -1411,6 +1416,7 @@
ÂÂÂÂu32 LoadDI=0;

ÂÂÂÂ_sprintf( path, "/di.bin" );
+
ÂÂÂÂu8 *difile = NANDLoadFile( path, size );
ÂÂÂÂif( difile != NULL )
ÂÂÂÂ{
@@ -1428,8 +1434,8 @@
ÂÂÂÂÂÂÂÂÂÂÂÂcontinue;

ÂÂÂÂÂÂÂÂ//Skip SD module
-ÂÂÂÂÂÂÂÂif( 4 == *(u16*)(TMD_Data+0x1E8+0x24*i) )
-ÂÂÂÂÂÂÂÂÂÂÂÂcontinue;
+ÂÂÂÂÂÂÂÂ//if( 4 == *(u16*)(TMD_Data+0x1E8+0x24*i) )
+ÂÂÂÂÂÂÂÂ//ÂÂÂÂcontinue;

ÂÂÂÂÂÂÂÂ//Load special DI module
ÂÂÂÂÂÂÂÂif( 1 == *(u16*)(TMD_Data+0x1E8+0x24*i) && LoadDI )
@@ -1649,4 +1655,4 @@
ÂÂÂÂfree( path );

ÂÂÂÂreturn 0;
-}
\ No newline at end of file
+}
Index: DI.c
===================================================================
--- DI.cÂÂÂÂ(Revision 72)
+++ DI.cÂÂÂÂ(Arbeitskopie)
@@ -111,6 +111,7 @@
ÂÂÂÂreturn r;
}

+
s32 DVDSelectGame( u32 SlotID )
{
ÂÂÂÂs32 fd = IOS_Open("/dev/di", 0 );
Index: syscalls.h
===================================================================
--- syscalls.hÂÂÂÂ(Revision 72)
+++ syscalls.hÂÂÂÂ(Arbeitskopie)
@@ -54,8 +54,10 @@

#define timer_destroy(a) syscall_14(a)
void syscall_14(int timer);
-void syscall_15(void);

+#define TimerNow(a) syscall_15(a)
+int syscall_15(int TimerID);
+
#define heap_create(a, b) syscall_16(a, b)
int syscall_16(void *ptr, int len);

Index: vsprintf.c
===================================================================
--- vsprintf.cÂÂÂÂ(Revision 72)
+++ vsprintf.cÂÂÂÂ(Arbeitskopie)
@@ -290,7 +290,7 @@
}

static char buffer[1024] ALIGNED(32);
-int dbgprintf( const char *fmt, ...)
+/*int dbgprintf( const char *fmt, ...)
{
ÂÂÂÂif ( (*(vu32*)(0xd800070) & 1) == 0)
ÂÂÂÂÂÂÂÂreturn 0;
@@ -315,6 +315,31 @@
ÂÂÂÂsvc_write(buffer);

ÂÂÂÂreturn i;
+}*/
+#define SET_DI_COLORÂÂÂÂ0x1b, 1, 32, 48
+#define RESET_DI_COLORÂÂÂÂ0x1b, 0, 30, 48
+
+static char buffer[1024] ALIGNED(32);
+int dbgprintf( const char *fmt, ...)
+{
+ÂÂÂÂif ( (*(vu32*)(0xd800070) & 1) == 0)
+ÂÂÂÂÂÂÂÂreturn 0;
+
+ÂÂÂÂva_list args;
+ÂÂÂÂint i;
+
+ÂÂÂÂva_start(args, fmt);
+ÂÂÂÂi = vsprintf(buffer, fmt, args);
+ÂÂÂÂva_end(args);
+
+ÂÂÂÂchar clrCommand[10];
+ÂÂÂÂ_sprintf(clrCommand, "%c[%d;%d;%dm",SET_DI_COLOR);
+ÂÂÂÂsvc_write( clrCommand );
+ÂÂÂÂsvc_write( buffer );
+ÂÂÂÂ_sprintf(clrCommand, "%c[%d;%d;%dm",RESET_DI_COLOR);
+ÂÂÂÂsvc_write( clrCommand );
+
+ÂÂÂÂreturn i;
}
void fatal(const char *fmt, ...)
{
Index: main.c
===================================================================
--- main.cÂÂÂÂ(Revision 72)
+++ main.cÂÂÂÂ(Arbeitskopie)
@@ -1830,12 +1830,12 @@
ÂÂÂÂif( ret < 0 )
ÂÂÂÂÂÂÂÂreturn ret;
ÂÂÂÂ
-ÂÂÂÂret = device_register("/dev/sdio", queueid );
+/*ÂÂÂÂret = device_register("/dev/sdio", queueid );
#ifdef DEBUG
ÂÂÂÂdbgprintf("ES:DeviceRegister(\"/dev/sdio\"):%d QueueID:%d\n", ret, queueid );
#endif
ÂÂÂÂif( ret < 0 )
-ÂÂÂÂÂÂÂÂreturn ret;
+ÂÂÂÂÂÂÂÂreturn ret;*/

ÂÂÂÂreturn queueid;
}
@@ -1892,13 +1892,13 @@
ÂÂÂÂES_BootSystem( &TitleID, &KernelVersion );

ÂÂÂÂdbgprintf("ES:looping!\n");
-
+/*
ÂÂÂÂSDStatus = malloca( sizeof(u32), 0x40 );
ÂÂÂÂ*SDStatus = 0x00000002;

ÂÂÂÂHCR = malloca( sizeof(u32)*0x30, 0x40 );
ÂÂÂÂmemset32( HCR, 0, sizeof(u32)*0x30 );
-
+*/
ÂÂÂÂ//WiiShop always swimming mario
ÂÂÂÂ//if( *(u32*)0x0001CCC0 == 0x4082007C )
ÂÂÂÂ//ÂÂÂÂ*(u32*)0x0001CCC0 = 0x38000063;
@@ -1906,8 +1906,8 @@
ÂÂÂÂif( TitleID == 0x0000000100000002LL )
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂ//Disable SD for system menu
-ÂÂÂÂÂÂÂÂif( *SDStatus == 1 )
-ÂÂÂÂÂÂÂÂÂÂÂÂ*SDStatus = 2;
+//ÂÂÂÂÂÂÂÂif( *SDStatus == 1 )
+//ÂÂÂÂÂÂÂÂÂÂÂÂ*SDStatus = 2;

ÂÂÂÂÂÂÂÂ//Region free 4.2EUR
ÂÂÂÂÂÂÂÂ//*(u32*)0x0137DC90 = 0x4800001C;
@@ -1920,7 +1920,43 @@
ÂÂÂÂÂÂÂÂ//thread_continue( id );

ÂÂÂÂ}
+ÂÂÂÂ/*u8 *timebuf = malloca( 512, 32 );

+ÂÂÂÂÂÂÂÂchar *path = (char*)malloca( 0x40, 32 );
+ÂÂÂÂÂÂÂÂ_sprintf( path, "/tmp/test.bin" );
+
+ÂÂÂÂÂÂÂÂret = ISFS_CreateFile(path, 0, 3, 3, 3 );
+ÂÂÂÂÂÂÂÂdbgprintf("ISFS_CreateFile(%s):%d\n", path, ret );
+ÂÂÂÂÂÂÂÂs32 fd = IOS_Open(path, 1|2 );
+ÂÂÂÂÂÂÂÂdbgprintf("IOS_Open(%s):%d\n", path, fd );
+
+ÂÂÂÂÂÂÂÂu32 now = TimerNow( Timer );
+ÂÂÂÂÂÂÂÂint i;
+ÂÂÂÂÂÂÂÂfor( i=0; i<20480; ++i )
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂIOS_Write( fd, timebuf, 512 );
+ÂÂÂÂÂÂÂÂ}
+ÂÂÂÂÂÂÂÂu32 write = TimerNow( Timer ) - now;
+
+ÂÂÂÂÂÂÂÂIOS_Seek( fd, 0, 0 );
+
+ÂÂÂÂÂÂÂÂnow = TimerNow( Timer );
+ÂÂÂÂÂÂÂÂfor( i=0; i<20480; ++i )
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂIOS_Read( fd, timebuf, 512 );
+ÂÂÂÂÂÂÂÂ}
+
+ÂÂÂÂÂÂÂÂu32 read = TimerNow( Timer ) - now;
+
+ÂÂÂÂÂÂÂÂdbgprintf("write:%d\n", write );
+ÂÂÂÂÂÂÂÂdbgprintf("read:%d\n", read );
+
+ÂÂÂÂÂÂÂÂISFS_Delete( path );
+
+ÂÂÂÂÂÂÂÂfree( path );
+ÂÂÂÂÂÂÂÂfree( timebuf );*/
+
+
ÂÂÂÂwhile (1)
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂret = mqueue_recv( queueid, (void *)&message, 0);
@@ -1941,9 +1977,9 @@
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif( strncmp( message->open.device, "/dev/es", 7 ) == 0 )
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂret = ES_FD;
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ} else if( strncmp( message->open.device, "/dev/sdio", 9 ) == 0) {
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ} /*else if( strncmp( message->open.device, "/dev/sdio", 9 ) == 0) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂret = SD_FD;
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ} elseÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}*/ elseÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂret = FS_ENOENT;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
@@ -1956,7 +1992,8 @@
#ifdef DEBUG
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdbgprintf("ES:IOS_Close(%d)\n", message->fd );
#endif
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif( message->fd == ES_FD || message->fd == SD_FDÂÂ)
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//if( message->fd == ES_FD || message->fd == SD_FDÂÂ)
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif( message->fd == ES_FD )
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmqueue_ack( (void *)message, ES_SUCCESS);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂbreak;
@@ -1974,9 +2011,9 @@
ÂÂÂÂÂÂÂÂÂÂÂÂ} break;
ÂÂÂÂÂÂÂÂÂÂÂÂcase IOS_IOCTL:
ÂÂÂÂÂÂÂÂÂÂÂÂ{
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif( message->fd == SD_FD )
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂSD_Ioctl( message );
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂelse
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//if( message->fd == SD_FD )
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//ÂÂÂÂSD_Ioctl( message );
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//else
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmqueue_ack( (void *)message, FS_EINVAL );

ÂÂÂÂÂÂÂÂÂÂÂÂ} break;
@@ -1984,8 +2021,8 @@
ÂÂÂÂÂÂÂÂÂÂÂÂcase IOS_IOCTLV:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif( message->fd == ES_FD )
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂES_Ioctlv( message );
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂelse if( message->fd == SD_FD )
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂSD_Ioctlv( message );
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//else if( message->fd == SD_FD )
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//ÂÂÂÂSD_Ioctlv( message );
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmqueue_ack( (void *)message, FS_EINVAL );
ÂÂÂÂÂÂÂÂÂÂÂÂbreak;<!--c2--></div><!--ec2-->

fs-usb
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Index: alloc.h
===================================================================
--- alloc.hÂÂÂÂ(Revision 72)
+++ alloc.hÂÂÂÂ(Arbeitskopie)
@@ -22,4 +22,4 @@

void *malloc( u32 size );
void *malloca( u32 size, u32 align );
-void free( void *ptr );
\ No newline at end of file
+void free( void *ptr );
Index: string.c
===================================================================
--- string.cÂÂÂÂ(Revision 72)
+++ string.cÂÂÂÂ(Arbeitskopie)
@@ -112,3 +112,5 @@
ÂÂÂÂ} while(*s++ != 0);
ÂÂÂÂreturn NULL;
}
+
+
Index: usbstorage.c
===================================================================
--- usbstorage.cÂÂÂÂ(Revision 72)
+++ usbstorage.cÂÂÂÂ(Arbeitskopie)
@@ -274,7 +274,11 @@
ÂÂÂÂcmd[0] = SCSI_TEST_UNIT_READY;

ÂÂÂÂretval = __cycle(dev, lun, NULL, 0, cmd, 1, 1, &status, NULL);
-ÂÂÂÂif(retval < 0) return retval;
+ÂÂÂÂif(retval < 0)
+ÂÂÂÂ{
+ÂÂÂÂÂÂÂÂif(sense)free(sense);
+ÂÂÂÂÂÂÂÂreturn retval;
+ÂÂÂÂ}

ÂÂÂÂif(status != 0)
ÂÂÂÂ{
Index: diskio.c
===================================================================
--- diskio.cÂÂÂÂ(Revision 72)
+++ diskio.cÂÂÂÂ(Arbeitskopie)
@@ -64,6 +64,7 @@
ÂÂÂÂif( USBStorage_Read_Sectors( sector, count, buffer ) != 1 )
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂdbgprintf("DIP: Failed to read disc: Sector:%d Count:%d dst:%p\n", sector, count, buff );
+ÂÂÂÂÂÂÂÂfree( buffer );
ÂÂÂÂÂÂÂÂreturn RES_ERROR;
ÂÂÂÂ}

@@ -75,13 +76,14 @@

DRESULT disk_write (BYTE drv, const BYTE *buff, DWORD sector, BYTE count)
{
-ÂÂÂÂint i;
+//ÂÂÂÂint i;
ÂÂÂÂu32 *buffer = malloca( count*512, 0x40 );
ÂÂÂÂmemcpy( buffer, buff, count*512 );

ÂÂÂÂif( USBStorage_Write_Sectors( sector, count, buffer ) != 1 )
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂdbgprintf("DIP: Failed to read disc: Sector:%d Count:%d dst:%p\n", sector, count, buff );
+ÂÂÂÂÂÂÂÂfree( buffer );
ÂÂÂÂÂÂÂÂreturn RES_ERROR;
ÂÂÂÂ}
ÂÂÂÂfree( buffer );
Index: ff.c
===================================================================
--- ff.cÂÂÂÂ(Revision 72)
+++ ff.cÂÂÂÂ(Arbeitskopie)
@@ -1926,6 +1926,7 @@
ÂÂÂÂDWORD ofsÂÂÂÂÂÂÂÂ/* File pointer from top of file */
)
{
+ÂÂÂÂ//dbgprintf("seek %x %d\n", ofs, ofs );
ÂÂÂÂFRESULT res;
ÂÂÂÂDWORD clst, bcs, nsect, ifptr;

Index: FS.c
===================================================================
--- FS.cÂÂÂÂ(Revision 72)
+++ FS.cÂÂÂÂ(Arbeitskopie)
@@ -76,7 +76,6 @@
ÂÂÂÂÂÂÂÂÂÂÂÂdbgprintf("FFS:ReadDir(\"%s\"):%d FileCount:%d\n", (char*)(v[0].data), ret, *(u32*)(v[1].data) );
#endif
ÂÂÂÂÂÂÂÂ} break;
-ÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂcase IOCTL_GETUSAGE:
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂif( memcmp( (char*)(v[0].data), "/title/00010001", 16 ) == 0 )
@@ -197,9 +196,9 @@
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂheap_free( 0, path );
ÂÂÂÂÂÂÂÂÂÂÂÂ}
#endif
-#ifdef DEBUG
+//#ifdef DEBUG
ÂÂÂÂÂÂÂÂÂÂÂÂdbgprintf("FFS:CreateDir(\"%s\", %02X, %02X, %02X, %02X ):%d\n", (char*)(bufin+6), *(u8*)(bufin+0x46), *(u8*)(bufin+0x47), *(u8*)(bufin+0x48), *(u8*)(bufin+0x49), ret );
-#endif
+//#endif
ÂÂÂÂÂÂÂÂ} break;

ÂÂÂÂÂÂÂÂcase IOCTL_SETATTR:
@@ -378,7 +377,31 @@
ÂÂÂÂÂÂÂÂÂÂÂÂdbgprintf("FFS:GetStats( %d, %d, %d ):%d\n", msg->fd, ((FDStat*)bufout)->file_length, ((FDStat*)bufout)->file_length, ret );
#endif
ÂÂÂÂÂÂÂÂ} break;
+ÂÂÂÂÂÂÂÂcase 0x22:
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂret = FS_Open( (char*)(bufin), 1 ); //always open read-only for these files
+ÂÂÂÂÂÂÂÂÂÂÂÂ//dbgprintf("FFS:OpenLongPathname( \"%s\" ):%d\n", (char*)(bufin), ret);
+ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
+ÂÂÂÂÂÂÂÂ}
+ÂÂÂÂÂÂÂÂcase 0x23:
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂret = FS_Close( *(u32*)(bufin) );
+ÂÂÂÂÂÂÂÂÂÂÂÂ//dbgprintf("FFS:CloseLongPathname( %d ):%d\n", *(u32*)(bufin), ret);
+ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
+ÂÂÂÂÂÂÂÂ}
+ÂÂÂÂÂÂÂÂcase 0x24:
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂret = FS_Seek( *(u32*)(bufin), *(u32*)(bufin+4), *(u32*)(bufin+8) );
+ÂÂÂÂÂÂÂÂÂÂÂÂ//dbgprintf("FFS:SeekLongPathname( %d, %x, %x ):%d\n", *(u32*)(bufin), *(u32*)(bufin+4), *(u32*)(bufin+8), ret);
+ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
+ÂÂÂÂÂÂÂÂ}

+ÂÂÂÂÂÂÂÂcase 0x25:
+ÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂret = FS_Read( *(u32*)(bufin), *(u32*)(bufin+4), *(u32*)(bufin+8) );
+ÂÂÂÂÂÂÂÂÂÂÂÂ//dbgprintf("FFS:ReadLongPathname( %d, %p, %x ):%d\n", *(u32*)(bufin), *(u32*)(bufin+4), *(u32*)(bufin+8), ret);
+ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
+ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂcase IOCTL_SHUTDOWN:
ÂÂÂÂÂÂÂÂÂÂÂÂ//dbgprintf("FFS:Shutdown()\n");
ÂÂÂÂÂÂÂÂÂÂÂÂ//Close all open FS handles
@@ -427,7 +450,7 @@
}
s32 FS_GetUsage( char *path, u32 *FileCount, u32 *TotalSize )
{
-ÂÂÂÂchar *file = heap_alloc_aligned( 0, 0x40, 0x40 );
+ÂÂÂÂÂÂÂÂchar *file = heap_alloc_aligned( 0, 0x40, 0x40 );

ÂÂÂÂDIR d;
ÂÂÂÂFILINFO FInfo;
@@ -673,6 +696,7 @@
}
s32 FS_Close( s32 FileHandle )
{
+ÂÂÂÂ//dbgprintf("FS:close\n");
ÂÂÂÂif( FileHandle == FS_FD || FileHandle == SD_FD )
ÂÂÂÂÂÂÂÂreturn FS_SUCCESS;
ÂÂÂÂ
@@ -694,6 +718,7 @@
}
s32 FS_Open( char *Path, u8 Mode )
{
+
ÂÂÂÂ// Is it a device?
ÂÂÂÂif( strncmp( Path, "/dev/", 5 ) == 0 )
ÂÂÂÂ{
@@ -711,7 +736,7 @@
ÂÂÂÂÂÂÂÂÂÂÂÂreturn FS_ENOENT;
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ} else { // Or is it a filepath ?
-
+//dbgprintf("FS:open\n");
ÂÂÂÂÂÂÂÂ//if( (strstr( Path, "data/setting.txt") != NULL) && (Mode&2) )
ÂÂÂÂÂÂÂÂ//{
ÂÂÂÂÂÂÂÂ//ÂÂÂÂreturn FS_EACCESS;
@@ -761,6 +786,7 @@
}
s32 FS_Read( s32 FileHandle, u8 *Data, u32 Length )
{
+ÂÂ // dbgprintf("FS:read\n");
ÂÂÂÂif( FS_CheckHandle(FileHandle) == 0)
ÂÂÂÂÂÂÂÂreturn FS_EINVAL;

@@ -786,6 +812,7 @@
*/
s32 FS_Seek( s32 FileHandle, s32 Where, u32 Whence )
{
+ÂÂÂÂ//dbgprintf("FS:seek\n");
ÂÂÂÂif( FS_CheckHandle(FileHandle) == 0)
ÂÂÂÂÂÂÂÂreturn FS_EINVAL;

@@ -793,7 +820,11 @@
ÂÂÂÂ{
ÂÂÂÂÂÂÂÂcase SEEK_SET:
ÂÂÂÂÂÂÂÂÂÂÂÂif( Where >= (u32)(&fd_stack[FileHandle].fsize) )
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn FS_EFATAL;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif( Where >= fd_stack[FileHandle].fsize )//wtf
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ{
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdbgprintf("FS:%x >= %x %x\n", Where, &fd_stack[FileHandle].fsize, fd_stack[FileHandle].fsize );
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn FS_EFATAL;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}

ÂÂÂÂÂÂÂÂÂÂÂÂif( f_lseek( &fd_stack[FileHandle], Where ) == FR_OK )
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn Where;
Index: FS.h
===================================================================
--- FS.hÂÂÂÂ(Revision 72)
+++ FS.hÂÂÂÂ(Arbeitskopie)
@@ -74,6 +74,7 @@
#defineÂÂÂÂIOCTL_GETSTATSÂÂ 0x0B
#defineÂÂÂÂIOCTL_GETUSAGEÂÂ 0x0C
#defineÂÂÂÂIOCTL_SHUTDOWNÂÂ 0x0D
+#defineÂÂÂÂIOCTL_OPENLONGPATHÂÂ 0x22

#define SEEK_SETÂÂÂÂ0
#define SEEK_CURÂÂÂÂ1
Index: main.c
===================================================================
--- main.cÂÂÂÂ(Revision 72)
+++ main.cÂÂÂÂ(Arbeitskopie)
@@ -24,11 +24,12 @@
#include "ipc.h"
#include "ff.h"
#include "FS.h"
+#include "alloc.h"


FATFS fatfs;
-static FIL f;
-static u8 GamePath[64];
+//static FIL f;
+//static u8 GamePath[64];

static char Heap[0x100] ALIGNED(32);
void *QueueSpace = NULL;
@@ -275,5 +276,5 @@
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}

-ÂÂÂÂreturn 0;
+//ÂÂÂÂreturn 0;
}
Index: alloc.c
===================================================================
--- alloc.cÂÂÂÂ(Revision 72)
+++ alloc.cÂÂÂÂ(Arbeitskopie)
@@ -26,7 +26,7 @@
ÂÂÂÂvoid *ptr = heap_alloc( 0, size );
ÂÂÂÂif( ptr == NULL )
ÂÂÂÂ{
-ÂÂÂÂÂÂÂÂdbgprintf("Malloc:%p Size:%08X FAILED\n", ptr, size );
+ÂÂÂÂÂÂÂÂdbgprintf("FS:Malloc:%p Size:%08X FAILED\n", ptr, size );
ÂÂÂÂÂÂÂÂwhile(1);
ÂÂÂÂ}
ÂÂÂÂreturn ptr;
@@ -36,7 +36,7 @@
ÂÂÂÂvoid *ptr = heap_alloc_aligned( 0, size, align );
ÂÂÂÂif( ptr == NULL )
ÂÂÂÂ{
-ÂÂÂÂÂÂÂÂdbgprintf("Malloca:%p Size:%08X FAILED\n", ptr, size );
+ÂÂÂÂÂÂÂÂdbgprintf("FS:Malloca:%p Size:%08X FAILED\n", ptr, size );
ÂÂÂÂÂÂÂÂwhile(1);
ÂÂÂÂ}
ÂÂÂÂreturn ptr;
@@ -49,4 +49,4 @@
ÂÂÂÂ//dbgprintf("Free:%p\n", ptr );

ÂÂÂÂreturn;
-}
\ No newline at end of file
+}<!--c2--></div><!--ec2-->
You don't need all changes, giantpune added/changed many debug stuff but I'm too lazy at the moment to filter out the interesting parts (the stuff that changes USB to ISFS).
 
OK, so I compiled the mod. The problem is, when I get to the Wii menu, my Wii locks up. Does anyone have any suggestions? I have an inkling that it may be the slot.bin, so I deleted it, but when I boot it up, it locks up and does not proceed to create a new slot.bin.

Any ideas?
 
do you have a folder called "sneek" on the root of the usb drive? it should create the folder itself, but there may be an issue with that. also it needs to find at least 1 valid game to create that file.
 
DP/Bumpish: I deleted region.bin and slot.bin, didn't work. Made sure that my game was installed correctly, didn't work. I'm believing that it's either

A) Game name, perhaps? I have it in the folder SXAE (as it is Guitar Hero: World Tour), but I don't see how that would be a problem.
B) Incorrect region
C) Issue with my compiles.

All in all, still not sure. I'll delete the sneek folder tomorrow and see if it creates one, but I highly doubt it will, seeing as it crashes near instantaneously.

Crash info:
It usually crashes in one of three ways.

1) Freezes on Health Screen (sometimes followed by a full shutdown of the Wii)
2) Gets to system menu, locks up and makes annoying buzzing noise
3) Gets past Health Screen, flashes green, then flashes red.
 
first make sure your nand and games work with sneek. if they work there and not here, im not sure how to diagnose it without a usb gecko log.
 
giantpune said:
if you want to do it yourself, it is really easy.

get sneek's fs-usb module from r72
do a DIF of that one and mine
this will give you probably 25 lines of code or less that are different
either make a patch or manually add those few lines into the current sneek SVN
do the same for the ES module.

Then just use this di module. You may not actually have to do anything with the ES module. I think I only added 1 or 2 lines in it which might not even be needed.

QUOTE(xander150 @ Apr 19 2010, 02:17 PM) You don't need all changes, giantpune added/changed many debug stuff but I'm too lazy at the moment to filter out the interesting parts (the stuff that changes USB to ISFS).

Hi, I would try to merge pune mod with the latest sneek/uneek revision.
Making svn diff I noticed that pune DI module had heavy modifications. Do I need to merge that module too? Or can I ignore it?

Thanks
 
Stupid question, but is the pressing start on a GC controller to get the SNEEK+DI menu still included in this, or was there something wrong with it when I compiled it?

Since I don't know as much what I'm doing as some, I just downloaded r72 from the server, overwrote the folders with the "PUNEEK" files, and then used the batch file to compile it. I had a few warnings, but no errors, and ended up with a DI.bin and a boot2_*.bin file (can't remember what the original file name was, but it only gave one instead of all 3 with the original SNEEK source, so I figured that had to be the right one).

So I copied the files to the SD and USB, and booted the Wii, and the emulated NAND on the USB seemed to be working, but the GameCube controller wouldn't activate the DI menu. I wanted to make sure the modded UNEEK had worked before attempting to mess with the downloaded source of USBloader_GX, since I'm not convinced of my ability to do that correctly either.
tongue.gif


Edit: Never mind, I know it's not working. The original SNEEK+DI shows a game in the disc channel right away, and this isn't giving me anything. Oh well, maybe eventually someone who knows what they're doing will release it as binaries.
 
jhoff80 said:
Stupid question, but is the pressing start on a GC controller to get the SNEEK+DI menu still included in this, or was there something wrong with it when I compiled it?
The code for the game selection is still in the es module, but as of r72 it was only for 4.2E.
jhoff80 said:
Since I don't know as much what I'm doing as some, I just downloaded r72 from the server, overwrote the folders with the "PUNEEK" files, and then used the batch file to compile it. I had a few warnings, but no errors, and ended up with a DI.bin and a boot2_*.bin file (can't remember what the original file name was, but it only gave one instead of all 3 with the original SNEEK source, so I figured that had to be the right one).
It only created the boot2_usb.bin because the build_boot2.cmd batch file was broken in r72 (it was missing .app extensions in the command lines for creating the boot2_sd.bin and boot2_di.bin files).
QUOTE(jhoff80 @ Apr 20 2010, 04:01 PM)
The original SNEEK+DI shows a game in the disc channel right away, and this isn't giving me anything. Oh well, maybe eventually someone who knows what they're doing will release it as binaries.

Quick and dirty to verify that the pune modules are working (USB):
  • Checkout r72.
  • Replace di, es, and fs-usb sources with pune sources.
  • Build
  • Must have boot2_USB.bin on SD root (as boot2.bin).
  • Must have boot2_USB.bin on USB root (as boot2.bin).
  • Must have di.bin on USB root.
  • Do not need di.bin on SD.
  • Do not need bootmii folder on USB.
  • Must have working NAND dump on USB.
  • Do not need NAND on SD.
  • Must have correctly installed game on USB
SNEEK will run the NAND off of the USB and load a game from USB in the disc channel. This worked for me. SNEEK apparently created 7 folders on my SD (import, meta, shared1, shared2, sys, ticket, and tmp). All were empty except shared1 which had a 0K content.map file.
This does not include anything about modifying current USB loaders to work with SNEEK.

Edit:
The folders must have been created when I was testing different combinations of files on the SD and USB devices. This does not happen when the correct files are used.
 
Could someone be so kind as to re-post the download link? I've been back through the thread and I keep missing it, apparently.

EDIT: Never mind - I found it. I got PUNEEK to compile, and I got it installed and working. How do you switch games? There doesn't seem to be a menu enabled when you press start on the gamecube controller. Also, how would one incorporate this into a newer revision of SNEEK?

I compared the SNEEK r72 fs-usb and es files to the equivalent files in Pune's mod, replicated the changes to r86, and everything compliled ok. I won't be able to test until I get home, but I'll be sure to post my results.

Also, could anyone verify which files need to be compared? I did all of them in the FS-USB folder, but only the ES.c file in the ES folder. I suspect that only a few files actually need the changes carried over.

My attempted compile did not work. I think perhaps I changed to much. I'll try again later.
 
hanman said:
Also, how would one incorporate this into a newer revision of SNEEK?

Looked to me when trying to manually make the changes into the newest SNEEK revision that things had changed just a little too much to be able to just incorporate the diffs into the newest files.

Could be wrong though.
 
Can't help myself, gave r72 another try and got it to compile and load correctly.

Now to (attempt to) figure out the hard part of modifying the loader.
biggrin.gif
 
jhoff80 said:
Can't help myself, gave r72 another try and got it to compile and load correctly.

Now to (attempt to) figure out the hard part of modifying the loader.
biggrin.gif
That's as far as I got and then the loader was the problem for me. No matter what I did it wouldn't compile without errors and/or when I got it to compile finally without errors it wouldn't work or I got code dumps.

pune had said he might release it in a couple days but it's been how long now ??? I'm not working up a sweat, I'm just saying, I tried and couldn't get it. Really frustrating not knowing what I was doing wrong and no way to ask without begging for help or having the source to compare.

"this is all you need to make it work" "oh yea, change all this stuff" "might be more than what you need but fuck it"
tongue.gif
 

Site & Scene News

Popular threads in this forum