|
Wing Commander
Reconstructed Win32 source (1996)
|
Near-heap descriptor allocation and compaction carried over from DOS. More...
Go to the source code of this file.
Functions | |
| unsigned short | MergeAdjacentNearHeapBlocks (int descriptorAddress) |
| int | ReleaseNearHeapBlock (int descriptorAddress) |
| void | PurgeNearHeapBlocks (unsigned short flags) |
| unsigned short | InitializeNearHeap (void) |
| void | ShutdownNearHeap (void) |
| void * | AllocateNearHeapBlockFromEnd (int size, unsigned short flags) |
| void * | AllocateNearHeapBlockByFlags (int size, unsigned short flags) |
| void | FreeNearHeapBlock (void *pointer) |
| int | GetNearHeapBlockSize (void *pointer) |
Variables | |
| int | nNearHeapSize |
| int | nNearHeapBase |
| int | nCurrentNearHeapFirstDescriptor |
| void * | pCurrentNearHeapAlloc |
| short | nNavMapMaximumPositionX |
| short | nNavigationMapMinimumCoordX |
| unsigned short | awMapNavObjectiveLabelIndex [16] |
| short | nNavMapMaximumPosY |
| short | nNavMapCentreX |
| short | nNavigationMapMinimumPositionY |
| TextContext | stCurrentNavMapTxtCtx |
| static short | nNearHeapActive = 0 |
| short | nNearHeapMaxDescriptors = 0x80 |
| static unsigned int | nNearHeapRelocationBytes = 0 |
Near-heap descriptor allocation and compaction carried over from DOS.
Address range 40e890-40efdf.
Definition in file nearheap.c.
| void * AllocateNearHeapBlockByFlags | ( | int | size, |
| unsigned short | flags ) |
Definition at line 246 of file nearheap.c.
References NearHeapBlock::address, AllocateNearHeapBlockByFlags(), AllocateNearHeapBlockFromEnd(), DosNearPtrToFar(), nCurrentNearHeapFirstDescriptor, nNearHeapBase, nNearHeapMaxDescriptors, nNearHeapSize, and NearHeapBlock::sizeAndFlags.
Referenced by AllocateNearHeapBlockByFlags().
| void * AllocateNearHeapBlockFromEnd | ( | int | size, |
| unsigned short | flags ) |
Definition at line 153 of file nearheap.c.
References NearHeapBlock::address, AllocateNearHeapBlockFromEnd(), DosNearPtrToFar(), nCurrentNearHeapFirstDescriptor, nNearHeapBase, nNearHeapMaxDescriptors, nNearHeapSize, and NearHeapBlock::sizeAndFlags.
Referenced by AllocateNearHeapBlockByFlags(), and AllocateNearHeapBlockFromEnd().
Definition at line 342 of file nearheap.c.
References NearHeapBlock::address, DosFarPtrToNear(), DosNearPtrToFar(), FreeNearHeapBlock(), nCurrentNearHeapFirstDescriptor, nNearHeapBase, nNearHeapSize, ReleaseNearHeapBlock(), and NearHeapBlock::sizeAndFlags.
Referenced by FreeNearHeapBlock().
| int GetNearHeapBlockSize | ( | void * | pointer | ) |
Definition at line 368 of file nearheap.c.
References NearHeapBlock::address, DosFarPtrToNear(), DosNearPtrToFar(), GetNearHeapBlockSize(), nCurrentNearHeapFirstDescriptor, nNearHeapBase, nNearHeapSize, and NearHeapBlock::sizeAndFlags.
Referenced by GetNearHeapBlockSize().
| unsigned short InitializeNearHeap | ( | void | ) |
Definition at line 95 of file nearheap.c.
References AllocateTaggedMemory(), DosFarPtrToNear(), DosMemcpy(), DosNearPtrToFar(), FreeIfNotNull(), GetNavRangeSentinel(), InitializeNearHeap(), nNearHeapActive, nNearHeapBase, nNearHeapMaxDescriptors, nNearHeapRelocationBytes, nNearHeapSize, pCurrentNearHeapAlloc, and PurgeNearHeapBlocks().
Referenced by InitializeNearHeap().
| unsigned short MergeAdjacentNearHeapBlocks | ( | int | descriptorAddress | ) |
Definition at line 25 of file nearheap.c.
References NearHeapBlock::address, DosNearPtrToFar(), MergeAdjacentNearHeapBlocks(), nCurrentNearHeapFirstDescriptor, and NearHeapBlock::sizeAndFlags.
Referenced by MergeAdjacentNearHeapBlocks(), and ReleaseNearHeapBlock().
| void PurgeNearHeapBlocks | ( | unsigned short | flags | ) |
Definition at line 69 of file nearheap.c.
References NearHeapBlock::address, DosNearPtrToFar(), nCurrentNearHeapFirstDescriptor, nNearHeapActive, nNearHeapBase, nNearHeapMaxDescriptors, nNearHeapSize, PurgeNearHeapBlocks(), ReleaseNearHeapBlock(), and NearHeapBlock::sizeAndFlags.
Referenced by InitializeNearHeap(), and PurgeNearHeapBlocks().
| int ReleaseNearHeapBlock | ( | int | descriptorAddress | ) |
Definition at line 49 of file nearheap.c.
References DosNearPtrToFar(), MergeAdjacentNearHeapBlocks(), nCurrentNearHeapFirstDescriptor, nNearHeapBase, nNearHeapSize, ReleaseNearHeapBlock(), and NearHeapBlock::sizeAndFlags.
Referenced by FreeNearHeapBlock(), PurgeNearHeapBlocks(), and ReleaseNearHeapBlock().
Definition at line 138 of file nearheap.c.
References DosMemcpy(), DosNearPtrToFar(), FreeIfNotNull(), nNearHeapActive, nNearHeapBase, nNearHeapRelocationBytes, nNearHeapSize, pCurrentNearHeapAlloc, and ShutdownNearHeap().
Referenced by ShutdownNearHeap().
| unsigned short awMapNavObjectiveLabelIndex[16] |
Definition at line 18 of file nearheap.c.
Referenced by BuildMap(), and SelectNavObjectiveAtPoint().
| int nCurrentNearHeapFirstDescriptor |
Definition at line 14 of file nearheap.c.
Referenced by AllocateNearHeapBlockByFlags(), AllocateNearHeapBlockFromEnd(), FreeNearHeapBlock(), GetFreeNearHeapBytes(), GetLargestFreeNearHeapBlock(), GetNearHeapBlockSize(), MergeAdjacentNearHeapBlocks(), PurgeNearHeapBlocks(), and ReleaseNearHeapBlock().
| short nNavigationMapMinimumCoordX |
Definition at line 17 of file nearheap.c.
Referenced by CheckPoint(), and SetScale().
| short nNavigationMapMinimumPositionY |
Definition at line 21 of file nearheap.c.
Referenced by CheckPoint(), and SetScale().
| short nNavMapCentreX |
Definition at line 20 of file nearheap.c.
Referenced by ScaleNavMapCoordinates(), and SetScale().
| short nNavMapMaximumPositionX |
Definition at line 16 of file nearheap.c.
Referenced by CheckPoint(), and SetScale().
| short nNavMapMaximumPosY |
Definition at line 19 of file nearheap.c.
Referenced by CheckPoint(), and SetScale().
|
static |
Definition at line 64 of file nearheap.c.
Referenced by InitializeNearHeap(), PurgeNearHeapBlocks(), and ShutdownNearHeap().
| int nNearHeapBase |
Definition at line 13 of file nearheap.c.
Referenced by AllocateNearHeapBlockByFlags(), AllocateNearHeapBlockFromEnd(), FreeNearHeapBlock(), GetFreeNearHeapBytes(), GetLargestFreeNearHeapBlock(), GetNearHeapBlockSize(), InitializeNearHeap(), PurgeNearHeapBlocks(), ReleaseNearHeapBlock(), and ShutdownNearHeap().
| short nNearHeapMaxDescriptors = 0x80 |
Definition at line 65 of file nearheap.c.
Referenced by AllocateNearHeapBlockByFlags(), AllocateNearHeapBlockFromEnd(), InitializeNearHeap(), LoadOriginFxDrivers(), and PurgeNearHeapBlocks().
|
static |
Definition at line 66 of file nearheap.c.
Referenced by InitializeNearHeap(), and ShutdownNearHeap().
| int nNearHeapSize |
Definition at line 12 of file nearheap.c.
Referenced by AllocateNearHeapBlockByFlags(), AllocateNearHeapBlockFromEnd(), FreeNearHeapBlock(), GetFreeNearHeapBytes(), GetLargestFreeNearHeapBlock(), GetNearHeapBlockSize(), InitializeNearHeap(), PurgeNearHeapBlocks(), ReleaseNearHeapBlock(), and ShutdownNearHeap().
| void* pCurrentNearHeapAlloc |
Definition at line 15 of file nearheap.c.
Referenced by InitializeNearHeap(), and ShutdownNearHeap().
| TextContext stCurrentNavMapTxtCtx |
Definition at line 22 of file nearheap.c.
Referenced by DrawNavLocationReadout(), InflightComputer(), and UpdateInflightNavText().