fixed CParticle crash && RandTable

implemented PC codewarrior rand
updated premake
This commit is contained in:
Fire-Head
2019-05-31 00:49:06 +03:00
parent 2bf6674afc
commit 3ef6029764
9 changed files with 39 additions and 15 deletions

View File

@@ -20,15 +20,24 @@ WRAPPER void gtadelete(void *p) { EAXJMP(0x5A07E0); }
void *operator new(size_t sz) { return gtanew(sz); }
void operator delete(void *ptr) noexcept { gtadelete(ptr); }
// Use our own implementation of rand, stolen from PS2
#if USE_PS2_RAND == TRUE
unsigned __int64 myrand_seed = 1;
#else
unsigned long int myrand_seed = 1;
#endif
int
myrand(void)
{
#if USE_PS2_RAND == TRUE
// Use our own implementation of rand, stolen from PS2
myrand_seed = 0x5851F42D4C957F2D * myrand_seed + 1;
return ((myrand_seed >> 32) & 0x7FFFFFFF);
#else
// or original codewarrior rand
myrand_seed = myrand_seed * 1103515245 + 12345;
return((myrand_seed >> 16) & 0x7FFF);
#endif
}
void