|
coastline 0.0.4
|
The interpreter of the display lists of the game in the PC port. More...
#include <array>#include <windows.h>#include "common/framestatistics.h"#include "common/gbicommand.h"#include "common/textureupload.h"#include "common/vecmath.h"#include <glide.h>

Go to the source code of this file.
Classes | |
| struct | GbiVertexSource |
| The vertex a command of the display lists loaded. More... | |
| struct | GbiVertex |
| A vertex of the display lists after its transform. More... | |
| struct | GbiClipPolygon |
| A circular list of vertices undergoing homogeneous clipping. More... | |
Macros | |
| #define | GBI_DISPLAY_LIST_STACK_SIZE 10 |
| The number of entries of g_apGbiDisplayListReturnStack. | |
| #define | GBI_MATRIX_STACK_RESET_DEPTH 10 |
| The depth g_dwGbiMatrixStackDepth takes when a pop empties it. | |
| #define | GBI_LIGHT_COUNT 8 |
| The number of entries of g_aGbiLights. | |
| #define | GBI_VERTEX_CACHE_SIZE 128 |
| The number of entries of g_aGbiVertexCache and g_apVertexPool. | |
| #define | GBI_CLIP_VERTEX_POOL_SIZE 64 |
| The number of vertices available while clipping display-list geometry. | |
| #define | OVERLAY_DISPLAY_LIST_SIZE 0x8000 |
| The bytes of the display list of the text drawn over a frame. | |
| #define | OVERLAY_TEXT_SIZE 20 |
| The size of the text drawn over a frame. | |
| #define | OVERLAY_TEXT_X 0 |
| The left of the text drawn over a frame. | |
| #define | OVERLAY_TEXT_Y 60 |
| The top of the text drawn over a frame. | |
| #define | GBI_END_DISPLAY_LIST_W0 0xb8000000 |
| The first word of the command that ends a display list. | |
| #define | DEBUG_OVERLAY_TEXT_SIZE 0x408 |
| The size of g_szDebugOverlayText, the room before the next datum. | |
| #define | GBI_HANDLER_COUNT 256 |
| The number of entries of g_apfnGbiHandlers, one for each opcode. | |
Typedefs | |
| using | GbiLight = Light |
| A light of the display lists, in the shared console format. | |
| typedef struct GbiVertexSource | GbiVertexSource |
| The vertex a command of the display lists loaded, named for C and for both renderers. | |
| typedef GbiCommand *(* | GbiHandler) (GbiCommand *pCommand) |
| A handler of a command of a display list. | |
Functions | |
| void | SelectVertexSubmitterForCombineMode (unsigned dwCombineHi, unsigned dwCombineLo) |
| Choose the routine that submits vertices for a combine mode, and the colour of the combine modes that draw in one colour. | |
| void | ApplyGeometryModeChanges (void) |
| Apply the geometry mode after a change: the culling and the comparison of depth of the device when they changed, and the handlers of vertices and triangles in g_apfnGbiHandlers. | |
| GbiCommand * | HandleGbiSetTexRectW (GbiCommand *pCommand) |
| Set the scale of the width of a texture rectangle. | |
| GbiCommand * | HandleGbiSetTexRectDepth (GbiCommand *pCommand) |
| Set the depth of a texture rectangle. | |
| GbiCommand * | HandleGbiSetCombine (GbiCommand *pCommand) |
| Set the combine mode and choose the routine that submits vertices for it. | |
| GbiCommand * | HandleGbiClearGeometryMode (GbiCommand *pCommand) |
| Clear bits of the geometry mode. | |
| GbiCommand * | HandleGbiSetGeometryMode (GbiCommand *pCommand) |
| Set bits of the geometry mode. | |
| GbiCommand * | HandleGbiPopMatrix (GbiCommand *pCommand) |
| Pop the stack of matrices. | |
| GbiCommand * | HandleGbiDisplayList (GbiCommand *pCommand) |
| Branch to a display list, or call it when bits 16 to 23 of the first word are clear. | |
| GbiCommand * | HandleGbiNoOp (GbiCommand *pCommand) |
| Skip a command. | |
| void | ApplyRdpRenderMode (unsigned dwRenderMode) |
| Apply the blending, the depth, and the test of alpha of a render mode of the console. | |
| GbiCommand * | HandleGbiSetRenderMode (GbiCommand *pCommand) |
| Set the render mode. | |
| GbiCommand * | HandleGbiSetOtherModeL (GbiCommand *pCommand) |
| Set the low word of the other modes. | |
| void | DrawFillRectangle (int nLeft, int nTop, int nRight, int nBottom) |
| Fill a rectangle of the screen with the fill colour. | |
| GbiCommand * | HandleGbiFillRectangleIntCoords (GbiCommand *pCommand) |
| Fill a rectangle given in whole pixels of the console, whose rows run up from the bottom of the screen of the PC. | |
| GbiCommand * | HandleGbiFillRectangle (GbiCommand *pCommand) |
| Fill a rectangle given in pixels of the console with two bits of fraction, whose rows run up from the bottom of the screen of the PC. | |
| GbiCommand * | HandleGbiSetFillColor (GbiCommand *pCommand) |
| Set the fill colour from the RGBA 5551 colour in the low 16 bits of the command. | |
| GbiCommand * | HandleGbiSetEnvColor (GbiCommand *pCommand) |
| Set the environment colour from the RGBA colour of the command. | |
| void | DrawTextureRectangle (int nUpperLeftX, int nUpperLeftY, int nLowerRightX, int nLowerRightY, int nTile) |
| Draw a rectangle of a tile of texture. | |
| GbiCommand * | HandleGbiTextureRectangle (GbiCommand *pCommand) |
| Draw a texture rectangle of a command of one word pair, its corners in pixels with two bits of fraction, as DrawTextureRectangle() reads them with four. | |
| GbiCommand * | HandleGbiTextureRectangleNative (GbiCommand *pCommand) |
| Draw a texture rectangle of the console, which takes three commands, its corners as the console gives them. | |
| GbiCommand * | HandleGbiSetViewport (GbiCommand *pCommand) |
| Set the viewport. | |
| void | HalveGbiTriangleVertexIndices (GbiCommand *pCommand) |
| Convert the packed indices of a single-triangle command from doubled byte offsets to vertices. | |
| void | HalveGbiTrianglePairVertexIndices (GbiCommand *pCommand) |
| Convert both packed triangle index triples from doubled byte offsets to vertices. | |
| GbiCommand * | HandleGbiMoveWord (GbiCommand *pCommand) |
| Set the number of lights or the colour of a light. | |
| GbiCommand * | HandleGbiLoadMatrix (GbiCommand *pCommand) |
| Copy the matrix of the command into g_GbiMvpMatrix. | |
| GbiCommand * | HandleGbiMoveMem (GbiCommand *pCommand) |
| Set the viewport, a vector of the look-at, a light, or g_GbiMvpMatrix from memory. | |
| GbiCommand * | HandleGbiSetTileSize (GbiCommand *pCommand) |
| Set the edges of the tile, and its width and height in whole texels. | |
| GbiCommand * | HandleGbiLoadPreparedTexture (GbiCommand *pCommand) |
| Upload a texture the game loaded to its surface. | |
| void | ComputeVertexDirectionalLight (const ConvertedModelVertex *pVertex, GbiVertexSource *pDest) |
| Light a vertex normal with the first directional light and the ambient colour. | |
| int | ComputeVertexClipCodes (const GbiVertexSource *pVertex) |
Mark every homogeneous clip plane outside pVertex, including unordered coordinates. | |
| void | TransformVertexToScreen (GrVertex *pDest, const GbiVertexSource *pSource, float fRed, float fGreen, float fBlue) |
| Take a vertex inside the view to the screen with a colour, its position snapped to a quarter of a pixel. | |
| GbiVertexSource * | LerpVertexFromPool (const GbiVertexSource *pFirst, const GbiVertexSource *pSecond, float fFraction) |
| Take a clipping vertex from the free list and interpolate its attributes. | |
| void | ClipPolygonPositiveWPlane (GbiClipPolygon *pPolygon) |
| Clip a polygon to vertices with nonnegative homogeneous W. | |
| void | ClipPolygonLeftPlane (GbiClipPolygon *pPolygon) |
| Clip a polygon against the left plane, where X is at least negative W. | |
| void | ClipPolygonRightPlane (GbiClipPolygon *pPolygon) |
| Clip a polygon against the right plane, where X is at most W. | |
| void | ClipPolygonBottomPlane (GbiClipPolygon *pPolygon) |
| Clip a polygon against the bottom plane, where Y is at least negative W. | |
| void | ClipPolygonTopPlane (GbiClipPolygon *pPolygon) |
| Clip a polygon against the top plane, where Y is at most W. | |
| void | ClipPolygonNearZPlane (GbiClipPolygon *pPolygon) |
| Clip a polygon against the near plane, where Z is at least negative W. | |
| void | ClipPolygonFarZPlane (GbiClipPolygon *pPolygon) |
| Clip a polygon against the far plane, where Z is at most W. | |
| void | ScaleVertexTexCoords (GrVertex *pVertex, const GbiVertexSource *pSource) |
| Scale the texture coordinates of a vertex as it was loaded into those of both units of the vertex, divided by its w. | |
| void | ClipAndSubmitTriangle (GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2) |
| Clip a triangle to the planes of the view and submit what remains. | |
| void | ClipPolygonAndSubmitFlat (GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2, float fRed, float fGreen, float fBlue) |
| Clip and submit a triangle with one colour for all surviving vertices. | |
| void | ClipPolygonAndSubmitDepthScaled (GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2, float fRed, float fGreen, float fBlue) |
| Clip and submit a triangle with one colour at the fixed far depth. | |
| void | ClipAndSubmitTriangleAtFarDepth (GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2) |
| Clip a triangle to the planes of the view and submit what remains at the far depth. | |
| void | RenderGbiDisplayListFrame (GbiCommand *pDisplayList) |
| Draw a frame of the game: set the render states the display lists start from, run the display list and the text over the frame, show the frame, and record its time. | |
| void | BindTextureEntry (int nEntry) |
| Bind an entry's device texture and stage its addressing, scale and active tile bounds. | |
| GbiCommand * | HandleGbiBindTextureEntry (GbiCommand *pCommand) |
| Draw the triangles waiting, and bind a texture the game loaded in place of the commands that load it on the console. | |
| GbiCommand * | HandleGbiSetPrimColor (GbiCommand *pCommand) |
| Set the primitive colour from the RGBA colour of the command. | |
| GbiCommand * | HandleGbiSetFogColor (GbiCommand *pCommand) |
| Set the colour of the fog of the device from the RGBA colour of the command. | |
| GbiCommand * | HandleGbiSetScissor (GbiCommand *pCommand) |
| Set the scissor from corners in pixels of the console with two bits of fraction, dropping the fractions, and clip the device to it. | |
| GbiCommand * | HandleGbiSetScissorIntCoords (GbiCommand *pCommand) |
| Set the scissor from corners in whole pixels of the console, and clip the device to it. | |
| GbiCommand * | HandleGbiEndDisplayList (GbiCommand *pCommand) |
| Return from a display list to the command after its call. | |
| GbiCommand * | HandleGbiMatrix (GbiCommand *pCommand) |
| Multiply or load the projection or the model view matrix, and update g_GbiMvpMatrix. | |
| GbiCommand * | HandleGbiVertexUnlit (GbiCommand *pCommand) |
| Load vertices without lighting. | |
| GbiCommand * | HandleGbiTri1Smooth (GbiCommand *pCommand) |
| Draw one triangle with smooth shading, after giving the device the dirty render states. | |
| GbiCommand * | HandleGbiTri2Smooth (GbiCommand *pCommand) |
| Draw two triangles with smooth shading, after giving the device the dirty render states. | |
| GbiCommand * | HandleGbiVertexLit (GbiCommand *pCommand) |
| Load vertices with lighting. | |
| GbiCommand * | HandleGbiVertexLitEnvColorModulated (GbiCommand *pCommand) |
| Load vertices with lighting modulated by the environment colour. | |
| GbiCommand * | HandleGbiVertexTexGen (GbiCommand *pCommand) |
| Load vertices that generate their texture coordinates. | |
| void | GenerateGbiVertexTextureCoordinates (const ConvertedModelVertex *pInput, GbiVertexSource *pSource) |
| Generate tile-relative texture coordinates from the transformed vertex normal. | |
| void | GenerateGbiVertexTextureCoordinatesLinear (const ConvertedModelVertex *pInput, GbiVertexSource *pSource) |
| Generate texture coordinates with the linear-mode vertical arcsine mapping. | |
| GbiCommand * | HandleGbiVertexTexGenLinear (GbiCommand *pCommand) |
| Load vertices that generate their texture coordinates linearly. | |
| GbiCommand * | HandleGbiVertexLitNoZBuffer (GbiCommand *pCommand) |
| Load vertices with lighting without the depth buffer. | |
| GbiCommand * | HandleGbiVertexUnlitNoZBuffer (GbiCommand *pCommand) |
| Load vertices without lighting without the depth buffer. | |
| void | DrawFlatShadedTriangle (int nVertex0, int nVertex1, int nVertex2) |
| Draw a triangle of g_aGbiVertexCache in the colour of its first vertex. | |
| GbiCommand * | HandleGbiTri1Flat (GbiCommand *pCommand) |
| Draw one triangle with flat shading, after giving the device the dirty render states. | |
| GbiCommand * | HandleGbiTri2Flat (GbiCommand *pCommand) |
| Draw two triangles with flat shading, after giving the device the dirty render states. | |
| void | DrawFlatShadedTriangleDepthScaled (int nVertex0, int nVertex1, int nVertex2) |
| Draw a triangle of g_aGbiVertexCache in the colour of its first vertex, without the depth buffer. | |
| GbiCommand * | HandleGbiTri1SmoothNoZBuffer (GbiCommand *pCommand) |
| Draw one triangle with smooth shading without the depth buffer, after giving the device the dirty render states. | |
| GbiCommand * | HandleGbiTri2SmoothNoZBuffer (GbiCommand *pCommand) |
| Draw two triangles with smooth shading without the depth buffer, after giving the device the dirty render states. | |
| GbiCommand * | HandleGbiTri1FlatNoZBuffer (GbiCommand *pCommand) |
| Draw one triangle with flat shading without the depth buffer, after giving the device the dirty render states. | |
| GbiCommand * | HandleGbiTri2FlatNoZBuffer (GbiCommand *pCommand) |
| Draw two triangles with flat shading without the depth buffer, after giving the device the dirty render states. | |
| void | ExecuteGbiDisplayList (GbiCommand *pCommand) |
| Run a display list through g_apfnGbiHandlers until a handler returns nullptr. | |
Variables | |
| float | g_fTexRectScaleW |
| The scale of the width of a texture rectangle. | |
| float | g_fTexRectDepth |
| The depth of a texture rectangle. | |
| unsigned | g_dwGbiCombineModeHi |
| The first word of the combine mode set last. | |
| unsigned | g_dwGbiCombineModeLo |
| The second word of the combine mode set last. | |
| unsigned | g_dwGbiGeometryMode |
| The geometry mode. | |
| unsigned | g_dwGbiPrevGeometryMode |
| The geometry mode before the last change. | |
| int | g_dwGbiMatrixStackDepth |
| The depth of the stack of matrices. | |
| int | g_dwGbiDisplayListStackDepth |
| The number of entries of g_apGbiDisplayListReturnStack in use. | |
| GbiCommand * | g_apGbiDisplayListReturnStack [GBI_DISPLAY_LIST_STACK_SIZE] |
| The commands that follow the calls of display lists, to return to. | |
| unsigned | g_dwGbiRenderMode |
| The render mode of the console the display lists set last. | |
| unsigned char | g_bGbiFillColorR |
| The red of the fill colour. | |
| unsigned char | g_bGbiFillColorG |
| The green of the fill colour. | |
| unsigned char | g_bGbiFillColorB |
| The blue of the fill colour. | |
| unsigned char | g_bGbiFillColorA |
| The alpha of the fill colour, 0 or 255. | |
| float | g_fGbiEnvColorR |
| The red of the environment colour, from 0 to 1. | |
| float | g_fGbiEnvColorG |
| The green of the environment colour, from 0 to 1. | |
| float | g_fGbiEnvColorB |
| The blue of the environment colour, from 0 to 1. | |
| float | g_fGbiEnvColorA |
| The alpha of the environment colour, from 0 to 1. | |
| float | g_fGbiPrimColorR |
| The red of the primitive colour, from 0 to 1. | |
| float | g_fGbiPrimColorG |
| The green of the primitive colour, from 0 to 1. | |
| float | g_fGbiPrimColorB |
| The blue of the primitive colour, from 0 to 1. | |
| float | g_fGbiPrimColorA |
| The alpha of the primitive colour, from 0 to 1. | |
| float | g_fViewportScaleX |
| The scale of x of the viewport, in pixels. | |
| float | g_fViewportScaleY |
| The scale of y of the viewport, in pixels, negative for Direct3D. | |
| float | g_fViewportTranslateX |
| The translation of x of the viewport, in pixels. | |
| float | g_fViewportTranslateY |
| The translation of y of the viewport, in pixels, from the bottom of the screen for Glide. | |
| int | g_dwGbiNumLights |
| The number of lights the display lists set, as their command gives it. | |
| GbiLight | g_aGbiLights [GBI_LIGHT_COUNT] |
| The lights of the display lists. | |
| int | g_bGbiLightsTransformed |
| Whether the lights were transformed since they last changed. | |
| float | g_GbiMvpMatrix [4][4] |
| The matrix that takes a vertex of the display lists to the screen. | |
| float | g_GbiProjectionMatrix [4][4] |
| The current projection matrix of the display-list interpreter. | |
| float | g_aGbiModelViewStack [GBI_MATRIX_STACK_RESET_DEPTH][4][4] |
| The stack of model-view matrices used by display-list matrix commands. | |
| const Light * | g_pGbiLookAtY |
| The second vector of the look-at of the display lists, as a move memory command gives it. | |
| const Light * | g_pGbiLookAtX |
| The first vector of the look-at of the display lists, as a move memory command gives it. | |
| int | g_dwTileSizeUls |
| The left edge of the tile, in texels with two bits of fraction. | |
| int | g_dwTileSizeUlt |
| The top edge of the tile, in texels with two bits of fraction. | |
| int | g_dwTileSizeLrs |
| The right edge of the tile, in texels with two bits of fraction. | |
| int | g_dwTileSizeLrt |
| The bottom edge of the tile, in texels with two bits of fraction. | |
| int | g_dwTileSizeWidth |
| The width of the tile, in whole texels. | |
| int | g_dwTileSizeHeight |
| The height of the tile, in whole texels. | |
| void(* | g_pfnUploadTextureEntryToSurface )(int nEntry, TextureUploadData payload) |
| Upload a texture the game loaded to its surface, set by InitializeTextureSubsystem(). | |
| float | g_fGbiLight0ColorR |
| The red channel of the first directional light. | |
| float | g_fGbiLight0ColorG |
| The green channel of the first directional light. | |
| float | g_fGbiLight0ColorB |
| The blue channel of the first directional light. | |
| Vec3f | g_GbiLight0Direction |
| The direction of the first directional light. | |
| float | g_fGbiAmbientColorR |
| The red channel of the ambient light. | |
| float | g_fGbiAmbientColorG |
| The green channel of the ambient light. | |
| float | g_fGbiAmbientColorB |
| The blue channel of the ambient light. | |
| GbiVertexSource | g_aClipVertexPool [GBI_CLIP_VERTEX_POOL_SIZE] |
| The temporary vertices used while clipping display-list geometry. | |
| GbiVertexSource * | g_pVertexFreeList |
| The first available clipping vertex in the pool, or NULL when the pool is full. | |
| int | g_bRdpBlendStateOverride |
| Whether a render mode set the blend of the frame. | |
| GbiVertex | g_aGbiVertexCache [GBI_VERTEX_CACHE_SIZE] |
| The vertices the display lists loaded. | |
| float | g_fTexCoordScaleS |
| The scale from the s of a vertex to its u. | |
| float | g_fTexCoordScaleT |
| The scale from the t of a vertex to its v. | |
| char | g_szDebugOverlayText [DEBUG_OVERLAY_TEXT_SIZE] |
| The text drawn over each frame. | |
| DWORD | g_dwGbiLastFrameTime |
| The time the last frame was shown, in milliseconds. | |
| DWORD | g_dwGbiFrameDeltaTime |
| The time between the last two frames shown, in milliseconds. | |
| void(* | g_pfnBindTextureEntry )(int nEntry) |
| Bind a texture the game loaded, set by InitializeTextureSubsystem(). | |
| int | g_nBoundTextureEntry |
| The entry whose texture is bound, or -1 after texture initialization. | |
| int | g_dwScissorLeft |
| The left edge of the scissor, in pixels. | |
| int | g_dwScissorTop |
| The top edge of the scissor, in pixels from the bottom of the screen. | |
| int | g_dwScissorRight |
| The right edge of the scissor, in pixels. | |
| int | g_dwScissorBottom |
| The bottom edge of the scissor, in pixels from the bottom of the screen. | |
| int | g_bCombineModeSpecialSubmitter |
| Whether the combine mode takes the routine that modulates the lighting by the environment colour. | |
| std::array< GbiHandler, GBI_HANDLER_COUNT > | g_apfnGbiHandlers |
| The handlers of the commands of the display lists, by the opcode in the high byte of the first word. | |
The interpreter of the display lists of the game in the PC port.
Each handler runs one command and returns the command to run next.
| #define GBI_DISPLAY_LIST_STACK_SIZE 10 |
The number of entries of g_apGbiDisplayListReturnStack.
| #define GBI_MATRIX_STACK_RESET_DEPTH 10 |
The depth g_dwGbiMatrixStackDepth takes when a pop empties it.
| #define GBI_LIGHT_COUNT 8 |
The number of entries of g_aGbiLights.
| #define GBI_VERTEX_CACHE_SIZE 128 |
The number of entries of g_aGbiVertexCache and g_apVertexPool.
| #define GBI_CLIP_VERTEX_POOL_SIZE 64 |
The number of vertices available while clipping display-list geometry.
| #define OVERLAY_DISPLAY_LIST_SIZE 0x8000 |
The bytes of the display list of the text drawn over a frame.
| #define OVERLAY_TEXT_SIZE 20 |
The size of the text drawn over a frame.
| #define OVERLAY_TEXT_X 0 |
The left of the text drawn over a frame.
| #define OVERLAY_TEXT_Y 60 |
The top of the text drawn over a frame.
| #define GBI_END_DISPLAY_LIST_W0 0xb8000000 |
The first word of the command that ends a display list.
| #define DEBUG_OVERLAY_TEXT_SIZE 0x408 |
The size of g_szDebugOverlayText, the room before the next datum.
| #define GBI_HANDLER_COUNT 256 |
The number of entries of g_apfnGbiHandlers, one for each opcode.
| typedef struct GbiVertexSource GbiVertexSource |
The vertex a command of the display lists loaded, named for C and for both renderers.
| typedef GbiCommand *(* GbiHandler) (GbiCommand *pCommand) |
A handler of a command of a display list.
| void SelectVertexSubmitterForCombineMode | ( | unsigned | dwCombineHi, |
| unsigned | dwCombineLo ) |
Choose the routine that submits vertices for a combine mode, and the colour of the combine modes that draw in one colour.
One combine mode takes the handler of lit vertices that modulates by the environment colour, and every other gives it up.
| dwCombineHi | The first word of the combine mode. |
| dwCombineLo | The second word of the combine mode. |
| void ApplyGeometryModeChanges | ( | void | ) |
Apply the geometry mode after a change: the culling and the comparison of depth of the device when they changed, and the handlers of vertices and triangles in g_apfnGbiHandlers.
| GbiCommand * HandleGbiSetTexRectW | ( | GbiCommand * | pCommand | ) |
Set the scale of the width of a texture rectangle.
| pCommand | The command. |
| GbiCommand * HandleGbiSetTexRectDepth | ( | GbiCommand * | pCommand | ) |
Set the depth of a texture rectangle.
| pCommand | The command. |
| GbiCommand * HandleGbiSetCombine | ( | GbiCommand * | pCommand | ) |
Set the combine mode and choose the routine that submits vertices for it.
| pCommand | The command. |
| GbiCommand * HandleGbiClearGeometryMode | ( | GbiCommand * | pCommand | ) |
Clear bits of the geometry mode.
| pCommand | The command, the bits in its second word. |
| GbiCommand * HandleGbiSetGeometryMode | ( | GbiCommand * | pCommand | ) |
Set bits of the geometry mode.
| pCommand | The command, the bits in its second word. |
| GbiCommand * HandleGbiPopMatrix | ( | GbiCommand * | pCommand | ) |
Pop the stack of matrices.
A pop that empties it sets its depth to GBI_MATRIX_STACK_RESET_DEPTH.
| pCommand | The command. |
| GbiCommand * HandleGbiDisplayList | ( | GbiCommand * | pCommand | ) |
Branch to a display list, or call it when bits 16 to 23 of the first word are clear.
A call that fills the last entry of g_apGbiDisplayListReturnStack exits the game.
| pCommand | The command. |
| GbiCommand * HandleGbiNoOp | ( | GbiCommand * | pCommand | ) |
Skip a command.
| pCommand | The command. |
| void ApplyRdpRenderMode | ( | unsigned | dwRenderMode | ) |
Apply the blending, the depth, and the test of alpha of a render mode of the console.
| dwRenderMode | The render mode. |
| GbiCommand * HandleGbiSetRenderMode | ( | GbiCommand * | pCommand | ) |
Set the render mode.
| pCommand | The command, the render mode in its second word. |
| GbiCommand * HandleGbiSetOtherModeL | ( | GbiCommand * | pCommand | ) |
Set the low word of the other modes.
Only the render mode is applied, and the comparison of alpha and every other mode are skipped.
| pCommand | The command, the shift of the mode in bits 8 to 15 of its first word. |
| void DrawFillRectangle | ( | int | nLeft, |
| int | nTop, | ||
| int | nRight, | ||
| int | nBottom ) |
Fill a rectangle of the screen with the fill colour.
| nLeft | The left edge. |
| nTop | The top edge. |
| nRight | The right edge. |
| nBottom | The bottom edge. |
| GbiCommand * HandleGbiFillRectangleIntCoords | ( | GbiCommand * | pCommand | ) |
Fill a rectangle given in whole pixels of the console, whose rows run up from the bottom of the screen of the PC.
| pCommand | The command, the lower right corner in its first word and the upper left in its second, as signed fields of 12 bits. |
| GbiCommand * HandleGbiFillRectangle | ( | GbiCommand * | pCommand | ) |
Fill a rectangle given in pixels of the console with two bits of fraction, whose rows run up from the bottom of the screen of the PC.
The fractions are dropped.
| pCommand | The command, the lower right corner in its first word and the upper left in its second. |
| GbiCommand * HandleGbiSetFillColor | ( | GbiCommand * | pCommand | ) |
Set the fill colour from the RGBA 5551 colour in the low 16 bits of the command.
| pCommand | The command. |
| GbiCommand * HandleGbiSetEnvColor | ( | GbiCommand * | pCommand | ) |
Set the environment colour from the RGBA colour of the command.
| pCommand | The command, the colour in its second word. |
| void DrawTextureRectangle | ( | int | nUpperLeftX, |
| int | nUpperLeftY, | ||
| int | nLowerRightX, | ||
| int | nLowerRightY, | ||
| int | nTile ) |
Draw a rectangle of a tile of texture.
| nUpperLeftX | The left edge. |
| nUpperLeftY | The top edge. |
| nLowerRightX | The right edge. |
| nLowerRightY | The bottom edge. |
| nTile | The tile. |
| GbiCommand * HandleGbiTextureRectangle | ( | GbiCommand * | pCommand | ) |
Draw a texture rectangle of a command of one word pair, its corners in pixels with two bits of fraction, as DrawTextureRectangle() reads them with four.
| pCommand | The command, the lower right corner in its first word, and the tile and the upper left corner in its second. |
| GbiCommand * HandleGbiTextureRectangleNative | ( | GbiCommand * | pCommand | ) |
Draw a texture rectangle of the console, which takes three commands, its corners as the console gives them.
| pCommand | The first command, the lower right corner in its first word, and the tile and the upper left corner in its second. |
| GbiCommand * HandleGbiSetViewport | ( | GbiCommand * | pCommand | ) |
Set the viewport.
Direct3D turns its y over through the scale, and Glide through the translation from the height of the screen.
| pCommand | The command, the viewport in its second word. |
| void HalveGbiTriangleVertexIndices | ( | GbiCommand * | pCommand | ) |
Convert the packed indices of a single-triangle command from doubled byte offsets to vertices.
| void HalveGbiTrianglePairVertexIndices | ( | GbiCommand * | pCommand | ) |
Convert both packed triangle index triples from doubled byte offsets to vertices.
| GbiCommand * HandleGbiMoveWord | ( | GbiCommand * | pCommand | ) |
Set the number of lights or the colour of a light.
Every other word is skipped.
| pCommand | The command, the index of the word in the low byte of its first word. |
| GbiCommand * HandleGbiLoadMatrix | ( | GbiCommand * | pCommand | ) |
Copy the matrix of the command into g_GbiMvpMatrix.
| pCommand | The command, the matrix in its second word. |
| GbiCommand * HandleGbiMoveMem | ( | GbiCommand * | pCommand | ) |
Set the viewport, a vector of the look-at, a light, or g_GbiMvpMatrix from memory.
Every other index is skipped.
| pCommand | The command, the index in bits 16 to 23 of its first word and the size of a light in its low 16 bits. |
| GbiCommand * HandleGbiSetTileSize | ( | GbiCommand * | pCommand | ) |
Set the edges of the tile, and its width and height in whole texels.
| pCommand | The command, the upper left corner in its first word and the lower right in its second, as signed fields of 12 bits. |
| GbiCommand * HandleGbiLoadPreparedTexture | ( | GbiCommand * | pCommand | ) |
Upload a texture the game loaded to its surface.
| pCommand | The command, the entry of the texture in the low 24 bits of its first word. |
| void ComputeVertexDirectionalLight | ( | const ConvertedModelVertex * | pVertex, |
| GbiVertexSource * | pDest ) |
Light a vertex normal with the first directional light and the ambient colour.
| int ComputeVertexClipCodes | ( | const GbiVertexSource * | pVertex | ) |
Mark every homogeneous clip plane outside pVertex, including unordered coordinates.
| void TransformVertexToScreen | ( | GrVertex * | pDest, |
| const GbiVertexSource * | pSource, | ||
| float | fRed, | ||
| float | fGreen, | ||
| float | fBlue ) |
Take a vertex inside the view to the screen with a colour, its position snapped to a quarter of a pixel.
| pDest | The vertex on the screen. |
| pSource | The vertex as it was loaded. |
| fRed | The red, from 0 to 255. |
| fGreen | The green, from 0 to 255. |
| fBlue | The blue, from 0 to 255. |
| GbiVertexSource * LerpVertexFromPool | ( | const GbiVertexSource * | pFirst, |
| const GbiVertexSource * | pSecond, | ||
| float | fFraction ) |
Take a clipping vertex from the free list and interpolate its attributes.
| void ClipPolygonPositiveWPlane | ( | GbiClipPolygon * | pPolygon | ) |
Clip a polygon to vertices with nonnegative homogeneous W.
| void ClipPolygonLeftPlane | ( | GbiClipPolygon * | pPolygon | ) |
Clip a polygon against the left plane, where X is at least negative W.
| void ClipPolygonRightPlane | ( | GbiClipPolygon * | pPolygon | ) |
Clip a polygon against the right plane, where X is at most W.
| void ClipPolygonBottomPlane | ( | GbiClipPolygon * | pPolygon | ) |
Clip a polygon against the bottom plane, where Y is at least negative W.
| void ClipPolygonTopPlane | ( | GbiClipPolygon * | pPolygon | ) |
Clip a polygon against the top plane, where Y is at most W.
| void ClipPolygonNearZPlane | ( | GbiClipPolygon * | pPolygon | ) |
Clip a polygon against the near plane, where Z is at least negative W.
| void ClipPolygonFarZPlane | ( | GbiClipPolygon * | pPolygon | ) |
Clip a polygon against the far plane, where Z is at most W.
| void ScaleVertexTexCoords | ( | GrVertex * | pVertex, |
| const GbiVertexSource * | pSource ) |
Scale the texture coordinates of a vertex as it was loaded into those of both units of the vertex, divided by its w.
| pVertex | The vertex. |
| pSource | The vertex as it was loaded. |
Clip a triangle to the planes of the view and submit what remains.
| pVertex0 | The first vertex. |
| pVertex1 | The second vertex. |
| pVertex2 | The third vertex. |
| void ClipPolygonAndSubmitFlat | ( | GbiVertex * | pVertex0, |
| GbiVertex * | pVertex1, | ||
| GbiVertex * | pVertex2, | ||
| float | fRed, | ||
| float | fGreen, | ||
| float | fBlue ) |
Clip and submit a triangle with one colour for all surviving vertices.
| pVertex0 | The first vertex. |
| pVertex1 | The second vertex. |
| pVertex2 | The third vertex. |
| fRed | The red of the triangle. |
| fGreen | The green of the triangle. |
| fBlue | The blue of the triangle. |
| void ClipPolygonAndSubmitDepthScaled | ( | GbiVertex * | pVertex0, |
| GbiVertex * | pVertex1, | ||
| GbiVertex * | pVertex2, | ||
| float | fRed, | ||
| float | fGreen, | ||
| float | fBlue ) |
Clip and submit a triangle with one colour at the fixed far depth.
| pVertex0 | The first vertex. |
| pVertex1 | The second vertex. |
| pVertex2 | The third vertex. |
| fRed | The red of the triangle. |
| fGreen | The green of the triangle. |
| fBlue | The blue of the triangle. |
| void ClipAndSubmitTriangleAtFarDepth | ( | GbiVertex * | pVertex0, |
| GbiVertex * | pVertex1, | ||
| GbiVertex * | pVertex2 ) |
Clip a triangle to the planes of the view and submit what remains at the far depth.
| pVertex0 | The first vertex. |
| pVertex1 | The second vertex. |
| pVertex2 | The third vertex. |
| void RenderGbiDisplayListFrame | ( | GbiCommand * | pDisplayList | ) |
Draw a frame of the game: set the render states the display lists start from, run the display list and the text over the frame, show the frame, and record its time.
With Direct3D the frame is drawn in a scene, surfaces lost are restored, and the frame is dropped when the scene cannot start or end.
| pDisplayList | The display list of the frame. |
| void BindTextureEntry | ( | int | nEntry | ) |
Bind an entry's device texture and stage its addressing, scale and active tile bounds.
| nEntry | The loaded texture entry. |
| GbiCommand * HandleGbiBindTextureEntry | ( | GbiCommand * | pCommand | ) |
Draw the triangles waiting, and bind a texture the game loaded in place of the commands that load it on the console.
| pCommand | The command, the entry of g_pTextureEntries in the low 24 bits of its first word and the number of commands it replaces in its second. |
| GbiCommand * HandleGbiSetPrimColor | ( | GbiCommand * | pCommand | ) |
Set the primitive colour from the RGBA colour of the command.
| pCommand | The command, the colour in its second word. |
| GbiCommand * HandleGbiSetFogColor | ( | GbiCommand * | pCommand | ) |
Set the colour of the fog of the device from the RGBA colour of the command.
| pCommand | The command, the colour in its second word. |
| GbiCommand * HandleGbiSetScissor | ( | GbiCommand * | pCommand | ) |
Set the scissor from corners in pixels of the console with two bits of fraction, dropping the fractions, and clip the device to it.
| pCommand | The command, the upper left corner in its first word and the lower right in its second. |
| GbiCommand * HandleGbiSetScissorIntCoords | ( | GbiCommand * | pCommand | ) |
Set the scissor from corners in whole pixels of the console, and clip the device to it.
| pCommand | The command, the upper left corner in its first word and the lower right in its second. |
| GbiCommand * HandleGbiEndDisplayList | ( | GbiCommand * | pCommand | ) |
Return from a display list to the command after its call.
| pCommand | The command. |
| GbiCommand * HandleGbiMatrix | ( | GbiCommand * | pCommand | ) |
Multiply or load the projection or the model view matrix, and update g_GbiMvpMatrix.
| pCommand | The command. |
| GbiCommand * HandleGbiVertexUnlit | ( | GbiCommand * | pCommand | ) |
Load vertices without lighting.
| pCommand | The command. |
| GbiCommand * HandleGbiTri1Smooth | ( | GbiCommand * | pCommand | ) |
Draw one triangle with smooth shading, after giving the device the dirty render states.
| pCommand | The command, the entries of g_aGbiVertexCache of the triangle in the low three bytes of its second word. |
| GbiCommand * HandleGbiTri2Smooth | ( | GbiCommand * | pCommand | ) |
Draw two triangles with smooth shading, after giving the device the dirty render states.
| pCommand | The command, the entries of g_aGbiVertexCache of each triangle in the low three bytes of each word. |
| GbiCommand * HandleGbiVertexLit | ( | GbiCommand * | pCommand | ) |
Load vertices with lighting.
| pCommand | The command. |
| GbiCommand * HandleGbiVertexLitEnvColorModulated | ( | GbiCommand * | pCommand | ) |
Load vertices with lighting modulated by the environment colour.
| pCommand | The command. |
| GbiCommand * HandleGbiVertexTexGen | ( | GbiCommand * | pCommand | ) |
Load vertices that generate their texture coordinates.
| pCommand | The command. |
| void GenerateGbiVertexTextureCoordinates | ( | const ConvertedModelVertex * | pInput, |
| GbiVertexSource * | pSource ) |
Generate tile-relative texture coordinates from the transformed vertex normal.
| pInput | The converted model vertex. |
| pSource | The vertex that receives the texture coordinates. |
| void GenerateGbiVertexTextureCoordinatesLinear | ( | const ConvertedModelVertex * | pInput, |
| GbiVertexSource * | pSource ) |
Generate texture coordinates with the linear-mode vertical arcsine mapping.
| pInput | The converted model vertex. |
| pSource | The vertex that receives the texture coordinates. |
| GbiCommand * HandleGbiVertexTexGenLinear | ( | GbiCommand * | pCommand | ) |
Load vertices that generate their texture coordinates linearly.
| pCommand | The command. |
| GbiCommand * HandleGbiVertexLitNoZBuffer | ( | GbiCommand * | pCommand | ) |
Load vertices with lighting without the depth buffer.
| pCommand | The command. |
| GbiCommand * HandleGbiVertexUnlitNoZBuffer | ( | GbiCommand * | pCommand | ) |
Load vertices without lighting without the depth buffer.
| pCommand | The command. |
| void DrawFlatShadedTriangle | ( | int | nVertex0, |
| int | nVertex1, | ||
| int | nVertex2 ) |
Draw a triangle of g_aGbiVertexCache in the colour of its first vertex.
| nVertex0 | The entry of the first vertex, whose colour the triangle takes. |
| nVertex1 | The entry of the second vertex. |
| nVertex2 | The entry of the third vertex. |
| GbiCommand * HandleGbiTri1Flat | ( | GbiCommand * | pCommand | ) |
Draw one triangle with flat shading, after giving the device the dirty render states.
The top byte of the second word chooses the vertex whose colour the triangle takes.
| pCommand | The command, the entries of g_aGbiVertexCache of the triangle in the low three bytes of its second word. |
| GbiCommand * HandleGbiTri2Flat | ( | GbiCommand * | pCommand | ) |
Draw two triangles with flat shading, after giving the device the dirty render states.
| pCommand | The command, the entries of g_aGbiVertexCache of each triangle in the low three bytes of each word. |
| void DrawFlatShadedTriangleDepthScaled | ( | int | nVertex0, |
| int | nVertex1, | ||
| int | nVertex2 ) |
Draw a triangle of g_aGbiVertexCache in the colour of its first vertex, without the depth buffer.
| nVertex0 | The entry of the first vertex, whose colour the triangle takes. |
| nVertex1 | The entry of the second vertex. |
| nVertex2 | The entry of the third vertex. |
| GbiCommand * HandleGbiTri1SmoothNoZBuffer | ( | GbiCommand * | pCommand | ) |
Draw one triangle with smooth shading without the depth buffer, after giving the device the dirty render states.
| pCommand | The command, the entries of g_aGbiVertexCache of the triangle in the low three bytes of its second word. |
| GbiCommand * HandleGbiTri2SmoothNoZBuffer | ( | GbiCommand * | pCommand | ) |
Draw two triangles with smooth shading without the depth buffer, after giving the device the dirty render states.
| pCommand | The command, the entries of g_aGbiVertexCache of each triangle in the low three bytes of each word. |
| GbiCommand * HandleGbiTri1FlatNoZBuffer | ( | GbiCommand * | pCommand | ) |
Draw one triangle with flat shading without the depth buffer, after giving the device the dirty render states.
The top byte of the second word chooses the vertex whose colour the triangle takes.
| pCommand | The command, the entries of g_aGbiVertexCache of the triangle in the low three bytes of its second word. |
| GbiCommand * HandleGbiTri2FlatNoZBuffer | ( | GbiCommand * | pCommand | ) |
Draw two triangles with flat shading without the depth buffer, after giving the device the dirty render states.
| pCommand | The command, the entries of g_aGbiVertexCache of each triangle in the low three bytes of each word. |
| void ExecuteGbiDisplayList | ( | GbiCommand * | pCommand | ) |
Run a display list through g_apfnGbiHandlers until a handler returns nullptr.
| pCommand | The first command, or nullptr for none. |
|
extern |
The scale of the width of a texture rectangle.
|
extern |
The depth of a texture rectangle.
|
extern |
The first word of the combine mode set last.
|
extern |
The second word of the combine mode set last.
|
extern |
The geometry mode.
|
extern |
The geometry mode before the last change.
|
extern |
The depth of the stack of matrices.
|
extern |
The number of entries of g_apGbiDisplayListReturnStack in use.
|
extern |
The commands that follow the calls of display lists, to return to.
|
extern |
The render mode of the console the display lists set last.
|
extern |
The red of the fill colour.
|
extern |
The green of the fill colour.
|
extern |
The blue of the fill colour.
|
extern |
The alpha of the fill colour, 0 or 255.
|
extern |
The red of the environment colour, from 0 to 1.
|
extern |
The green of the environment colour, from 0 to 1.
|
extern |
The blue of the environment colour, from 0 to 1.
|
extern |
The alpha of the environment colour, from 0 to 1.
|
extern |
The red of the primitive colour, from 0 to 1.
|
extern |
The green of the primitive colour, from 0 to 1.
|
extern |
The blue of the primitive colour, from 0 to 1.
|
extern |
The alpha of the primitive colour, from 0 to 1.
|
extern |
The scale of x of the viewport, in pixels.
|
extern |
The scale of y of the viewport, in pixels, negative for Direct3D.
|
extern |
The translation of x of the viewport, in pixels.
|
extern |
The translation of y of the viewport, in pixels, from the bottom of the screen for Glide.
|
extern |
The number of lights the display lists set, as their command gives it.
|
extern |
The lights of the display lists.
|
extern |
Whether the lights were transformed since they last changed.
|
extern |
The matrix that takes a vertex of the display lists to the screen.
|
extern |
The current projection matrix of the display-list interpreter.
|
extern |
The stack of model-view matrices used by display-list matrix commands.
|
extern |
The second vector of the look-at of the display lists, as a move memory command gives it.
|
extern |
The first vector of the look-at of the display lists, as a move memory command gives it.
|
extern |
The left edge of the tile, in texels with two bits of fraction.
|
extern |
The top edge of the tile, in texels with two bits of fraction.
|
extern |
The right edge of the tile, in texels with two bits of fraction.
|
extern |
The bottom edge of the tile, in texels with two bits of fraction.
|
extern |
The width of the tile, in whole texels.
|
extern |
The height of the tile, in whole texels.
|
extern |
Upload a texture the game loaded to its surface, set by InitializeTextureSubsystem().
|
extern |
The red channel of the first directional light.
|
extern |
The green channel of the first directional light.
|
extern |
The blue channel of the first directional light.
|
extern |
The direction of the first directional light.
|
extern |
The red channel of the ambient light.
|
extern |
The green channel of the ambient light.
|
extern |
The blue channel of the ambient light.
|
extern |
The temporary vertices used while clipping display-list geometry.
|
extern |
The first available clipping vertex in the pool, or NULL when the pool is full.
|
extern |
Whether a render mode set the blend of the frame.
The render modes after it do not change the blend.
|
extern |
The vertices the display lists loaded.
|
extern |
The scale from the s of a vertex to its u.
|
extern |
The scale from the t of a vertex to its v.
|
extern |
The text drawn over each frame.
BRD3D never writes it, and BRGlide appends the errors of its texture memory to it.
|
extern |
The time the last frame was shown, in milliseconds.
|
extern |
The time between the last two frames shown, in milliseconds.
|
extern |
Bind a texture the game loaded, set by InitializeTextureSubsystem().
|
extern |
The entry whose texture is bound, or -1 after texture initialization.
|
extern |
The left edge of the scissor, in pixels.
|
extern |
The top edge of the scissor, in pixels from the bottom of the screen.
|
extern |
The right edge of the scissor, in pixels.
|
extern |
The bottom edge of the scissor, in pixels from the bottom of the screen.
|
extern |
Whether the combine mode takes the routine that modulates the lighting by the environment colour.
|
extern |
The handlers of the commands of the display lists, by the opcode in the high byte of the first word.
Every opcode without a handler of its own takes HandleGbiNoOp().