mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Original Source for 1.13 Mod High Resolution version from 12/06/05
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@21 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef RADMALWI
|
||||
#define RADMALWI
|
||||
|
||||
#ifdef __RADWINEXT__
|
||||
|
||||
|
||||
u32 GetLimit(u16 sel);
|
||||
#pragma aux GetLimit = "lsl eax,ax" parm [ax];
|
||||
|
||||
RADEXPFUNC void PTR4* RADEXPLINK radmalloc(u32 numbytes)
|
||||
{
|
||||
u32 temp;
|
||||
HGLOBAL handle;
|
||||
if ((numbytes==0) || (numbytes==0xffffffff))
|
||||
return(0);
|
||||
|
||||
handle=GlobalAlloc(GMEM_SHARE|GMEM_MOVEABLE,numbytes+4);
|
||||
if (handle) {
|
||||
GlobalFix(handle);
|
||||
temp=(u32)GlobalLock(handle);
|
||||
temp=((u32)_16To32(temp));
|
||||
((u32 PTR4*)temp)[0]=handle;
|
||||
return(((u32 PTR4*)temp)+1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
RADEXPFUNC void RADEXPLINK radfree(void PTR4* ptr)
|
||||
{
|
||||
HGLOBAL h=((u32 PTR4*)ptr)[-1];
|
||||
GlobalUnfix(h);
|
||||
GlobalUnlock(h);
|
||||
GlobalFree(h);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "radmal.i"
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user