The byte swapping and the relocation of the pointers of the data the game loads from files.
More...
Go to the source code of this file.
The byte swapping and the relocation of the pointers of the data the game loads from files.
◆ RELOCATED_POINTER_COUNT
| #define RELOCATED_POINTER_COUNT 0x800 |
The most entries of g_apRelocatedPointers.
◆ ByteSwapAndRelocateDisplayList()
| void ByteSwapAndRelocateDisplayList |
( |
GbiCommand * | pCommands | ) |
|
Byte-swap a display list through its end command and relocate texture and vertex pointers.
- Parameters
-
| pCommands | The loaded display list, or NULL. |
- Ghidra address:
- BRD3D: 0x1002bf80
- Ghidra address:
- BRGlide: 0x10019040
◆ ByteSwapTextureVariantTable()
The source table used when copying track texture images during relocation.
- Ghidra address:
- BRD3D: 0x10690bec
- Ghidra address:
- BRGlide: 0x106b7c7c Byte-swap animation frame offsets and times in a loaded texture variant table.
- Parameters
-
| pAnimation | The table, or NULL. |
- Ghidra address:
- BRD3D: 0x1002bc90
- Ghidra address:
- BRGlide: 0x10018d50
◆ ByteSwapAndRelocateTextureDescriptor()
| void ByteSwapAndRelocateTextureDescriptor |
( |
ModelTexture * | pTexture | ) |
|
Relocate a texture's image and palette pointers and byte-swap its dimensions and flags.
- Parameters
-
| pTexture | The loaded texture descriptor. |
- Ghidra address:
- BRD3D: 0x1002baa0
- Ghidra address:
- BRGlide: 0x10018b60
◆ ByteSwapTextureDescriptorArray()
| void ByteSwapTextureDescriptorArray |
( |
ModelTexture * | pTextures, |
|
|
int | nCount ) |
Apply texture descriptor relocation to nCount consecutive textures.
- Parameters
-
| pTextures | The first loaded texture descriptor. |
| nCount | The number of descriptors. |
- Ghidra address:
- BRD3D: 0x1002ba80
- Ghidra address:
- BRGlide: 0x10018b40
◆ AddPointerToRelocatedList()
| void AddPointerToRelocatedList |
( |
void * | pPointer | ) |
|
Add a pointer to g_apRelocatedPointers while it has room.
- Parameters
-
- Ghidra address:
- BRD3D: 0x1002c1f0
- Ghidra address:
- BRGlide: 0x100192b0
◆ IsPointerInRelocatedList()
| int IsPointerInRelocatedList |
( |
void * | pPointer | ) |
|
Report whether a pointer was relocated already.
- Parameters
-
- Returns
- Whether g_apRelocatedPointers includes it, and true for a null pointer.
- Ghidra address:
- BRD3D: 0x1002bf40
- Ghidra address:
- BRGlide: 0x10019000
◆ RelocatePointerValue()
| void RelocatePointerValue |
( |
unsigned * | pdwPointer | ) |
|
Move a pointer from g_dwOldBaseAddress to g_dwNewBaseAddress.
A pointer below the old base becomes null, and a null pointer is left null.
- Parameters
-
| pdwPointer | The pointer, as a word. |
- Ghidra address:
- BRD3D: 0x1002b970
- Ghidra address:
- BRGlide: 0x100189e0
◆ ByteSwapArray16()
| void ByteSwapArray16 |
( |
unsigned short * | pData, |
|
|
int | nCount ) |
Swap the two bytes of each of a run of halfwords.
- Parameters
-
| pData | The halfwords. |
| nCount | The number of halfwords. |
- Ghidra address:
- BRD3D: 0x1002b9e0
- Ghidra address:
- BRGlide: 0x10018a50
◆ ByteSwapFourShorts()
Swap the two bytes of each of the four halfwords of a triangle of the track.
- Parameters
-
- Ghidra address:
- BRD3D: 0x1002ba20
- Ghidra address:
- BRGlide: 0x10018a90
◆ ByteSwapShortQuadArray()
| void ByteSwapShortQuadArray |
( |
TrackSurface * | pData, |
|
|
int | nCount ) |
Swap the bytes of each halfword of a run of groups of four halfwords.
- Parameters
-
| pData | The groups. |
| nCount | The number of groups. |
- Ghidra address:
- BRD3D: 0x1002ba00
- Ghidra address:
- BRGlide: 0x10018a70
◆ ByteSwap3DWords()
| void ByteSwap3DWords |
( |
Vec3f * | pData | ) |
|
Reverse the four bytes of each component of a vector.
- Parameters
-
- Ghidra address:
- BRD3D: 0x100383c0
- Ghidra address:
- BRGlide: 0x10018af0
◆ ByteSwap3DWordsArray()
| void ByteSwap3DWordsArray |
( |
Vec3f * | pData, |
|
|
int | nCount ) |
Reverse the bytes of each component of a run of vectors.
- Parameters
-
| pData | The vectors. |
| nCount | The number of vectors. |
- Ghidra address:
- BRD3D: 0x1002ba60
- Ghidra address:
- BRGlide: 0x10018ad0
◆ ResetVertexConversionCache()
| void ResetVertexConversionCache |
( |
void | | ) |
|
Empty the cache of converted vertices and the count of relocated pointers.
- Ghidra address:
- BRD3D: 0x1002b9c0
- Ghidra address:
- BRGlide: 0x10018a30
◆ SetPointerRelocationBase()
| void SetPointerRelocationBase |
( |
unsigned | dwOldBase, |
|
|
unsigned | dwNewBase ) |
Empty the cache of converted vertices and record the address the pointers to relocate are based at and the address they move to.
- Parameters
-
| dwOldBase | The address the pointers are based at. |
| dwNewBase | The address the pointers move to. |
- Ghidra address:
- BRD3D: 0x1002b9a0
- Ghidra address:
- BRGlide: 0x10018a10
◆ SetCopyTextureDataOnRelocate()
| void SetCopyTextureDataOnRelocate |
( |
int | bCopy | ) |
|
Set whether the data of a texture is copied when its pointers are relocated.
- Parameters
-
- Ghidra address:
- BRD3D: 0x1002b9d0
- Ghidra address:
- BRGlide: 0x10018a40
◆ g_dwRelocatedPointerCount
| int g_dwRelocatedPointerCount |
|
extern |
The number of pointers relocated.
- Ghidra address:
- BRD3D: 0x1067b548
- Ghidra address:
- BRGlide: 0x105b76f0
◆ g_apRelocatedPointers
The pointers relocated, g_dwRelocatedPointerCount of them.
- Ghidra address:
- BRD3D: 0x1067b550
- Ghidra address:
- BRGlide: 0x105b76f8