Possible fix for 128 meg RAM xbox
This commit is contained in:
@@ -90,6 +90,25 @@ bool SetupNetwork()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if Xbox has 128 meg RAM make sure its used
|
||||||
|
void EnableExtraRAM()
|
||||||
|
{
|
||||||
|
LARGE_INTEGER regVal;
|
||||||
|
|
||||||
|
// Verify that we have 128 megs available
|
||||||
|
MEMORYSTATUS memStatus;
|
||||||
|
GlobalMemoryStatus( &memStatus );
|
||||||
|
if( memStatus.dwTotalPhys < (100 * 1024 * 1024) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Grab the existing default type (0x02FF)
|
||||||
|
READMSRREG( 0x02FF, ®Val );
|
||||||
|
|
||||||
|
// Set the default to WriteBack (0x06)
|
||||||
|
regVal.LowPart = (regVal.LowPart & ~0xFF) | 0x06;
|
||||||
|
WRITEMSRREG( 0x02FF, regVal );
|
||||||
|
}
|
||||||
|
|
||||||
ArchHooks_Xbox::ArchHooks_Xbox()
|
ArchHooks_Xbox::ArchHooks_Xbox()
|
||||||
{
|
{
|
||||||
XGetCustomLaunchData();
|
XGetCustomLaunchData();
|
||||||
@@ -98,6 +117,8 @@ ArchHooks_Xbox::ArchHooks_Xbox()
|
|||||||
MountDrives();
|
MountDrives();
|
||||||
|
|
||||||
SetupNetwork();
|
SetupNetwork();
|
||||||
|
|
||||||
|
EnableExtraRAM();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchHooks_Xbox::~ArchHooks_Xbox()
|
ArchHooks_Xbox::~ArchHooks_Xbox()
|
||||||
|
|||||||
@@ -11,6 +11,34 @@ public:
|
|||||||
~ArchHooks_Xbox();
|
~ArchHooks_Xbox();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Read a 64 bit MSR register
|
||||||
|
inline void READMSRREG( UINT32 reg, LARGE_INTEGER *val )
|
||||||
|
{
|
||||||
|
UINT32 lowPart, highPart;
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov ecx, reg
|
||||||
|
rdmsr
|
||||||
|
mov lowPart, eax
|
||||||
|
mov highPart, edx
|
||||||
|
};
|
||||||
|
|
||||||
|
val->LowPart = lowPart;
|
||||||
|
val->HighPart = highPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write a 64 bit MSR register
|
||||||
|
inline void WRITEMSRREG( UINT32 reg, LARGE_INTEGER val )
|
||||||
|
{
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov ecx, reg
|
||||||
|
mov eax, val.LowPart
|
||||||
|
mov edx, val.HighPart
|
||||||
|
wrmsr
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#undef ARCH_HOOKS
|
#undef ARCH_HOOKS
|
||||||
#define ARCH_HOOKS ArchHooks_Xbox
|
#define ARCH_HOOKS ArchHooks_Xbox
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user