diff --git a/dip.c b/dip.c index bfbfb78..a547222 100644 --- a/dip.c +++ b/dip.c @@ -44,6 +44,8 @@ void DIInit( void ) write32( DI_SCONFIG, 0xFF ); write32( DI_SCOVER, 0 ); + + write32( HW_TIMER, 0 ); } u32 DIUpdateRegisters( void ) { @@ -307,7 +309,9 @@ u32 DIUpdateRegisters( void ) write32( HW_ARMIRQFLAG, read32(HW_ARMIRQFLAG) ); set32( 0x0d80000C, (1<<2) ); } - + + write32( HW_TIMER, 0 ); + } break; default: { @@ -326,5 +330,12 @@ u32 DIUpdateRegisters( void ) } } + if( (u64)read32(HW_TIMER) >= 2 * 60 * 243000000LL / 128 ) + { + USBStorage_Read_Sectors( 23, 1, (void*)0x1000 ); + + write32( HW_TIMER, 0 ); + } + return 0; } diff --git a/dip.h b/dip.h index fb8ea88..78dde4c 100644 --- a/dip.h +++ b/dip.h @@ -13,6 +13,7 @@ #include "Config.h" #include "DVD.h" #include "elf.h" +#include "usbstorage.h" enum opcodes { diff --git a/global.h b/global.h index 2140ed2..2c540b5 100644 --- a/global.h +++ b/global.h @@ -14,8 +14,8 @@ #define REALNAND 1 #define PADHOOK 1 -#define CONFIG_VERSION 0x00000001 -#define DM_VERSION 0x00020001 +#define CONFIG_VERSION 0x00000002 +#define DM_VERSION 0x00020002 #define DI_SUCCESS 1 #define DI_ERROR 2