feat(binana): update files

This commit is contained in:
phaneron 2024-07-21 04:57:59 -04:00
parent c9bc10c3ca
commit 5a8e559a74
19 changed files with 2325 additions and 702 deletions

View file

@ -1,35 +1,58 @@
#ifndef GX_CAPS_H
#define GX_CAPS_H
#include "gx/types.h"
#include <stdint.h>
typedef struct CGxCaps CGxCaps;
struct CGxCaps {
int32_t m_numTmus;
int32_t m_pixelCenterOnEdge;
int32_t m_texelCenterOnEdge;
int32_t m_numStreams;
int32_t int10;
EGxColorFormat m_colorFormat;
uint32_t m_maxIndex;
int32_t m_generateMipMaps;
// int32_t m_texFmt[GxTexFormats_Last];
int32_t m_texFmt[13];
// int32_t m_texTarget[GxTexTargets_Last];
int32_t m_texTarget[4];
// uint32_t m_texMaxSize[GxTexTargets_Last];
uint32_t m_texMaxSize[4];
// int32_t m_shaderTargets[GxShTargets_Last];
int32_t m_shaderTargets[6];
int32_t m_texFilterTrilinear;
int32_t m_texFilterAnisotropic;
uint32_t m_maxTexAnisotropy;
int32_t m_depthBias;
int32_t int130;
int32_t int134;
int32_t int138;
};
#endif
#ifndef GX_CAPS_H
#define GX_CAPS_H
#include <stdint.h>
#include "gx/types.h"
typedef struct CGxCaps CGxCaps;
struct CGxCaps {
int32_t m_numTmus;
int32_t m_pixelCenterOnEdge;
int32_t m_texelCenterOnEdge;
int32_t m_numStreams;
int32_t int10;
EGxColorFormat m_colorFormat;
uint32_t unk18;
uint32_t m_maxIndex;
int32_t m_generateMipMaps;
// int32_t m_texFmt[GxTexFormats_Last];
int32_t m_texFmt[13];
// int32_t m_texTarget[GxTexTargets_Last];
int32_t m_texTarget[4];
uint32_t unk68;
// uint32_t m_texMaxSize[GxTexTargets_Last];
uint32_t m_texMaxSize[4];
uint32_t unk7C;
uint32_t unk80;
uint32_t unk84;
uint32_t unk88;
uint32_t unk8C;
uint32_t unk90;
uint32_t unk94;
uint32_t unk98;
uint32_t unk9C;
uint32_t unkA0;
uint32_t unkA4;
uint32_t unkA8;
int32_t hwPcf;
uint32_t unkB0;
// int32_t m_shaderTargets[GxShTargets_Last];
int32_t m_shaderTargets[6];
uint32_t m_unkCC[6];
int32_t m_texFilterTrilinear;
int32_t m_texFilterAnisotropic;
uint32_t m_maxTexAnisotropy;
int32_t m_depthBias;
uint32_t unkF4;
int32_t m_maxClipPlanes;
uint32_t unkFC[6];
uint32_t unk114[6];
int32_t m_stereoAvailable;
int32_t int130;
int32_t int134;
int32_t int138;
};
#endif

46
3.3.5a/include/gx/d3d9.h Normal file
View file

@ -0,0 +1,46 @@
#ifndef GX_D3D9_H
#define GX_D3D9_H
#include "gx/device.h"
#include "d3d9/device.h"
typedef struct CGxDeviceD3d CGxDeviceD3d;
struct CGxDeviceD3d {
CGxDevice b_base;
void* m_hwnd;
uint16_t m_hwndClass;
uint16_t unk396E;
int32_t m_ownhwnd;
void* m_d3dLib;
IDirect3D9* m_d3d;
IDirect3DDevice9* m_d3dDevice;
D3DCAPS9 m_d3dCaps;
int32_t m_d3dIsHwDevice;
uint32_t unk3AB4[11];
IDirect3DVertexDeclaration9* m_d3dVertexDecl[14];
D3DDISPLAYMODE m_desktopDisplayMode;
int32_t m_inScene;
uint32_t unk3B2C;
D3DFORMAT m_devDepthFormat;
D3DFORMAT m_devAdapterFormat;
uint32_t unk3B38;
IDirect3DSurface9* m_defColorSurface;
IDirect3DSurface9* m_defDepthSurface;
uint32_t unk3B44;
uint32_t unk3B48;
uint32_t unk3B4C;
uint32_t unk3B50;
uint32_t unk3B54;
uint32_t unk3B58;
IDirect3DVertexDeclaration9* m_d3dCurrentVertexDecl;
IDirect3DIndexBuffer9* m_d3dCurrentIndexBuf;
IDirect3DVertexBuffer9* m_d3dVertexStreamBuf[8];
uint32_t m_d3dVertexStreamOfs[8];
uint32_t m_d3dVertexStreamStride[8];
uint32_t m_deviceStates[182];
bool m_texEnabled[8];
};
#endif

View file

@ -47,11 +47,11 @@ struct ShaderConstants {
// 84 functions
struct CGxDevice__vtable {
// void ITexMarkAsUpdated(CGxTex*, unsigned int);
// void ITexMarkAsUpdated(CGxTex*, uint32_t);
void* v_fn_0_ITexMarkAsUpdated;
// void IRsSendToHw(EGxRenderState);
void* v_fn_1_IRsSendToHw;
// void ICursorCreate(CGxFormat const&);
// void ICursorCreate(const CGxFormat&);
void* v_fn_2_ICursorCreate;
// void ICursorDestroy();
void* v_fn_3_ICursorDestroy;
@ -66,11 +66,15 @@ struct CGxDevice__vtable {
// don't know if this ever gets called (something deleted?)
void* v_fn_8;
void* v_fn_9;
// int32_t DeviceCreate(long (*)(void*, uint32_t, uint32_t, int32_t), CGxFormat const&);
void* v_fn_10_DeviceCreate;
void* v_fn_11;
void* v_fn_12;
// int32_t DeviceSetFormat(struct CGxFormat const &);
void* v_fn_13_DeviceSetFormat;
// void DeviceSetBaseMipLevel(uint32_t);
void* v_fn_14_DeviceSetBaseMipLevel;
// void DeviceSetGamma(CGxGammaRamp const&);
void* v_fn_15_DeviceSetGamma;
void* v_fn_16;
void* v_fn_17;
@ -78,7 +82,8 @@ struct CGxDevice__vtable {
void* v_fn_19;
void* v_fn_20;
void* v_fn_21;
void* v_fn_22;
// void DeviceWM(EGxWM, int32_t, int32_t);
void* v_fn_22_DeviceWM;
void* v_fn_23;
void* v_fn_24;
void* v_fn_25;
@ -91,9 +96,11 @@ struct CGxDevice__vtable {
void* v_fn_32;
void* v_fn_33;
void* v_fn_34;
// void CapsWindowSize(CRect&);
void* v_fn_35_CapsWindowSize;
void* v_fn_36;
void* v_fn_37;
// void ScenePresent(uint32_t);
void* v_fn_38_ScenePresent;
void* v_fn_39;
// void XformSetProjection(const C44Matrix&);
@ -108,15 +115,23 @@ struct CGxDevice__vtable {
void* v_fn_48;
void* v_fn_49;
void* v_fn_50;
// void MasterEnableSet(EGxMasterEnables, int);
void* v_fn_51_MasterEnableSet;
void* v_fn_52;
// void PoolDestroy(CGxPool*);
void* v_fn_53_PoolDestroy;
// char* BufLock(CGxBuf*);
void* v_fn_54_BufLock;
// int32_t BufUnlock(CGxBuf*, uint32_t);
void* v_fn_55_BufUnlock;
// void BufData(CGxBuf*, void const*, uint32_t, uint32_t);
void* v_fn_56_BufData;
// int32_t TexCreate(EGxTexTarget, uint32_t, uint32_t, uint32_t, EGxTexFormat, EGxTexFormat, CGxTexFlags, void*, void (*)(EGxTexCommand, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t&, void const*&), char const*, CGxTex*&);
void* v_fn_57_TexCreate;
void* v_fn_58;
void* v_fn_59;
// void TexDestroy(CGxTex*);
void* v_fn_58_TexDestroy;
// int32_t TexCopy(CGxTex*, CGxTex*, const C2iVector&, const C2iVector&, const C2iVector&, uint32_t);
void* v_fn_59_TexCopy;
void* v_fn_60;
void* v_fn_61;
void* v_fn_62;
@ -125,8 +140,10 @@ struct CGxDevice__vtable {
void* v_fn_65;
void* v_fn_66;
void* v_fn_67;
// void ShaderCreate(CGxShader*[], EGxShTarget, const char*, const char*, int32_t);
void* v_fn_68_ShaderCreate;
void* v_fn_69;
// void ShaderConstantsSet(EGxShTarget, uint32_t, const float*, uint32_t);
void* v_fn_70_ShaderConstantsSet;
void* v_fn_71;
void* v_fn_72;
@ -145,33 +162,42 @@ struct CGxDevice__vtable {
// this class is at least 14688 bytes in size
struct CGxDevice {
// TODO: pointer to struct CGxDevice__vtable
CGxDevice__vtable* v_vtable; // 0x0
TSGrowableArray_CGxPushedRenderState m_pushedStates;
TSGrowableArray_uint32_t m_stackOffsets;
TSGrowableArray_EGxRenderState m_dirtyStates;
uint32_t m_unk[73];
CRect m_defWindowRect;
CRect m_curWindowRect; // 0x174
// pointer to struct CGxDevice__vtable
CGxDevice__vtable* v_vtable; // 0x0 (size: 0x4)
TSGrowableArray_CGxPushedRenderState m_pushedStates; // 0x4 (size: 0x14)
TSGrowableArray_uint32_t m_stackOffsets; // 0x18 (size: 0x14)
TSGrowableArray_EGxRenderState m_dirtyStates; // 0x2C (size: 0x14)
uint32_t m_unk40[76];
CRect m_defWindowRect; // 0x164 (size: 0x10)
CRect m_curWindowRect; // 0x174 (size: 0x10)
uint32_t m_unk184[12];
EGxApi m_api; // 0x1b4
uint32_t m_cpuFeatures;
CGxFormat m_format;
CGxCaps m_caps;
uint32_t m_baseMipLevel;
CGxGammaRamp m_gammaRamp;
CGxGammaRamp m_systemGammaRamp;
// TSHashTable_CGxShader_HASHKEY_STRI m_shaderList[GxShTargets_Last];
TSHashTable_CGxShader_HASHKEY_STRI m_shaderList[6];
// TSHashTable_CGxShader_HASHKEY_STRI m_shaderList[6];
int32_t (*m_windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam);
int32_t m_context;
int32_t intF5C;
int32_t m_windowVisible;
int32_t intF64;
int32_t intF68;
int32_t intF6C;
CBoundingBox m_viewport;
C44Matrix m_projection;
C44Matrix m_projNative;
// CGxMatrixStack m_xforms[GxXforms_Last];
CGxMatrixStack m_xforms[11];
CGxMatrixStack m_texGen[8];
uint32_t unk24D0[162];
uint32_t m_appMasterEnables;
uint32_t m_hwMasterEnables;
TSList_CGxPool m_poolList;
uint32_t unk276C[3];
// CGxBuf* m_bufLocked[GxPoolTargets_Last];
CGxBuf* m_bufLocked[2];
CGxPool* m_vertexPool;
@ -189,9 +215,19 @@ struct CGxDevice {
uint32_t m_primVertexSize;
CGxBuf* m_primIndexBuf;
int32_t m_primIndexDirty;
uint32_t unk28C4;
uint32_t unk28C8;
uint32_t unk28CC;
uint32_t unk28D0;
uint32_t unk28D4;
uint32_t unk28D8;
uint32_t unk28DC;
uint32_t unk28E0;
uint32_t unk28E4;
uint32_t unk28E8;
TSFixedArray_CGxAppRenderState m_appRenderStates;
TSFixedArray_CGxStateBom m_hwRenderStates;
uint32_t m_baseMipLevel; // TODO placeholder
uint32_t unk2904[1049];
};
#endif

View file

@ -1,37 +1,50 @@
#ifndef GX_FORMAT_H
#define GX_FORMAT_H
#include <stdint.h>
#include <stdbool.h>
#include "tempest/vector.h"
typedef enum CGxFormat__Format CGxFormat__Format;
typedef struct CGxFormat CGxFormat;
enum CGxFormat__Format {
Fmt_Rgb565 = 0,
Fmt_ArgbX888 = 1,
Fmt_Argb8888 = 2,
Fmt_Argb2101010 = 3,
Fmt_Ds160 = 4,
Fmt_Ds24X = 5,
Fmt_Ds248 = 6,
Fmt_Ds320 = 7,
Formats_Last = 8
};
struct CGxFormat {
bool hwTnL;
int8_t window;
int32_t maximize;
CGxFormat__Format depthFormat;
C2iVector size;
uint32_t sampleCount;
CGxFormat__Format colorFormat;
uint32_t refreshRate;
uint32_t vsync;
C2iVector pos;
};
#endif
#ifndef GX_FORMAT_H
#define GX_FORMAT_H
#include <stdint.h>
#include <stdbool.h>
#include "tempest/vector.h"
typedef enum CGxFormat__Format CGxFormat__Format;
typedef struct CGxFormat CGxFormat;
enum CGxFormat__Format {
Fmt_Rgb565 = 0,
Fmt_ArgbX888 = 1,
Fmt_Argb8888 = 2,
Fmt_Argb2101010 = 3,
Fmt_Ds160 = 4,
Fmt_Ds24X = 5,
Fmt_Ds248 = 6,
Fmt_Ds320 = 7,
Formats_Last = 8
};
struct CGxFormat {
uint32_t unk0;
bool hwTnL;
int8_t unk5;
int8_t fixLag;
int8_t window;
uint32_t unk8;
int32_t maximize;
CGxFormat__Format depthFormat;
C2iVector size;
uint32_t unk1C;
uint32_t sampleCount;
float float24;
CGxFormat__Format colorFormat;
uint32_t refreshRate;
uint32_t vsync;
uint32_t unk34;
uint32_t unk38;
uint32_t unk3C;
uint32_t unk40;
uint32_t unk44;
uint32_t unk48;
uint32_t unk4C;
C2iVector pos;
};
#endif

View file

@ -1,383 +1,390 @@
#ifndef GX_TYPES_H
#define GX_TYPES_H
#include <stdint.h>
#include "storm/array.h"
typedef enum BlitAlpha BlitAlpha;
typedef enum BlitFormat BlitFormat;
typedef enum EGxApi EGxApi;
typedef enum EGxBlend EGxBlend;
typedef enum EGxColorFormat EGxColorFormat;
typedef enum EGxFontHJusts EGxFontHJusts;
typedef enum EGxFontVJusts EGxFontVJusts;
typedef enum EGxMasterEnables EGxMasterEnables;
typedef enum EGxPrim EGxPrim;
typedef enum EGxPrimMask EGxPrimMask;
typedef enum EGxRenderState EGxRenderState;
typedef enum EGxShPS EGxShPS;
typedef enum EGxShTarget EGxShTarget;
typedef enum EGxShVS EGxShVS;
typedef enum EGxTexCommand EGxTexCommand;
typedef enum EGxTexFilter EGxTexFilter;
typedef enum EGxTexFormat EGxTexFormat;
typedef enum EGxTexTarget EGxTexTarget;
typedef enum EGxTexWrapMode EGxTexWrapMode;
typedef enum EGxXform EGxXform;
typedef enum EGxuDrawListCategory EGxuDrawListCategory;
typedef enum EGxWM EGxWM;
typedef enum COLOR_FILE_FORMAT COLOR_FILE_FORMAT;
typedef enum PIXEL_FORMAT PIXEL_FORMAT;
typedef struct C4Pixel C4Pixel;
typedef struct MipBits MipBits;
enum BlitAlpha {
BlitAlpha_0 = 0,
BlitAlpha_1 = 1,
BlitAlpha_8 = 2,
BlitAlpha_Filler = 3,
BlitAlphas_Last = 4
};
enum BlitFormat {
BlitFormat_Unknown = 0,
BlitFormat_Abgr8888 = 1,
BlitFormat_Argb8888 = 2,
BlitFormat_Argb4444 = 3,
BlitFormat_Argb1555 = 4,
BlitFormat_Rgb565 = 5,
BlitFormat_Dxt1 = 6,
BlitFormat_Dxt3 = 7,
BlitFormat_Dxt5 = 8,
BlitFormat_Uv88 = 9,
BlitFormat_Gr1616F = 10,
BlitFormat_R32F = 11,
BlitFormat_D24X8 = 12,
BlitFormats_Last = 13
};
enum EGxApi {
GxApi_OpenGl = 0,
GxApi_D3d9 = 1,
GxApi_D3d9Ex = 2,
GxApi_D3d10 = 3,
GxApi_D3d11 = 4,
GxApi_GLL = 5,
GxApi_GLSDL = 6,
GxApis_Last = 7
};
enum EGxBlend {
GxBlend_Opaque = 0,
GxBlend_AlphaKey = 1,
GxBlend_Alpha = 2,
GxBlend_Add = 3,
GxBlend_Mod = 4,
GxBlend_Mod2x = 5,
GxBlend_ModAdd = 6,
GxBlend_InvSrcAlphaAdd = 7,
GxBlend_InvSrcAlphaOpaque = 8,
GxBlend_SrcAlphaOpaque = 9,
GxBlend_NoAlphaAdd = 10,
GxBlend_ConstantAlpha = 11,
GxBlends_Last = 12
};
enum EGxColorFormat {
GxCF_argb = 0,
GxCF_rgba = 1,
GxColorFormats_Last = 2,
};
enum EGxFontHJusts {
GxHJ_Left = 0,
GxHJ_Center = 1,
GxHJ_Right = 2,
GxHJ_Last = 3
};
enum EGxFontVJusts {
GxVJ_Top = 0,
GxVJ_Middle = 1,
GxVJ_Bottom = 2,
GxVJ_Last = 3
};
enum EGxMasterEnables {
GxMasterEnable_Lighting = 0,
GxMasterEnable_Fog = 1,
GxMasterEnable_DepthTest = 2,
GxMasterEnable_DepthWrite = 3,
GxMasterEnable_ColorWrite = 4,
GxMasterEnable_Culling = 5,
GxMasterEnable_DoubleBuffering = 6,
GxMasterEnable_NormalProjection = 7,
GxMasterEnable_PolygonFill = 8,
GxMasterEnables_Last = 9
};
enum EGxPrim {
GxPrim_Points = 0,
GxPrim_Lines = 1,
GxPrim_LineStrip = 2,
GxPrim_Triangles = 3,
GxPrim_TriangleStrip = 4,
GxPrim_TriangleFan = 5,
GxPrims_Last = 6
};
enum EGxPrimMask {
GxPrim_Position = 0x1,
GxPrim_BlendWeight = 0x2,
GxPrim_BlendIndices = 0x4,
GxPrim_Normal = 0x8,
GxPrim_Color0 = 0x10,
GxPrim_Color1 = 0x20,
GxPrim_TexCoord0 = 0x40,
GxPrim_TexCoord1 = 0x80
};
enum EGxRenderState {
GxRs_PolygonOffset = 0,
GxRs_MatDiffuse = 1,
GxRs_MatEmissive = 2,
GxRs_MatSpecular = 3,
GxRs_MatSpecularExp = 4,
GxRs_NormalizeNormals = 5,
GxRs_BlendingMode = 6,
GxRs_AlphaRef = 7,
GxRs_FogStart = 8,
GxRs_FogEnd = 9,
GxRs_FogColor = 10,
GxRs_Lighting = 11,
GxRs_Fog = 12,
GxRs_DepthTest = 13,
GxRs_DepthFunc = 14,
GxRs_DepthWrite = 15,
GxRs_ColorWrite = 16,
GxRs_Culling = 17,
GxRs_ClipPlaneMask = 18,
GxRs_Multisample = 19,
GxRs_ScissorTest = 20,
GxRs_Texture0 = 21,
GxRs_Texture1 = 22,
GxRs_Texture2 = 23,
GxRs_Texture3 = 24,
GxRs_Texture4 = 25,
GxRs_Texture5 = 26,
GxRs_Texture6 = 27,
GxRs_Texture7 = 28,
GxRs_Texture8 = 29,
GxRs_Texture9 = 30,
GxRs_Texture10 = 31,
GxRs_Texture11 = 32,
GxRs_Texture12 = 33,
GxRs_Texture13 = 34,
GxRs_Texture14 = 35,
GxRs_Texture15 = 36,
GxRs_ColorOp0 = 37,
GxRs_ColorOp1 = 38,
GxRs_ColorOp2 = 39,
GxRs_ColorOp3 = 40,
GxRs_ColorOp4 = 41,
GxRs_ColorOp5 = 42,
GxRs_ColorOp6 = 43,
GxRs_ColorOp7 = 44,
GxRs_AlphaOp0 = 45,
GxRs_AlphaOp1 = 46,
GxRs_AlphaOp2 = 47,
GxRs_AlphaOp3 = 48,
GxRs_AlphaOp4 = 49,
GxRs_AlphaOp5 = 50,
GxRs_AlphaOp6 = 51,
GxRs_AlphaOp7 = 52,
GxRs_TexGen0 = 53,
GxRs_TexGen1 = 54,
GxRs_TexGen2 = 55,
GxRs_TexGen3 = 56,
GxRs_TexGen4 = 57,
GxRs_TexGen5 = 58,
GxRs_TexGen6 = 59,
GxRs_TexGen7 = 60,
GxRs_Unk61 = 61,
GxRs_Unk62 = 62,
GxRs_Unk63 = 63,
GxRs_Unk64 = 64,
GxRs_Unk65 = 65,
GxRs_Unk66 = 66,
GxRs_Unk67 = 67,
GxRs_Unk68 = 68,
GxRs_Unk69 = 69,
GxRs_Unk70 = 70,
GxRs_Unk71 = 71,
GxRs_Unk72 = 72,
GxRs_Unk73 = 73,
GxRs_Unk74 = 74,
GxRs_Unk75 = 75,
GxRs_Unk76 = 76,
GxRs_VertexShader = 77,
GxRs_PixelShader = 78,
GxRs_PointScale = 79,
GxRs_PointScaleAttenuation = 80,
GxRs_PointScaleMin = 81,
GxRs_PointScaleMax = 82,
GxRs_PointSprite = 83,
GxRs_Unk84 = 84,
GxRs_ColorMaterial = 85,
GxRenderStates_Last = 86
};
STORM_TS_GROWABLE_ARRAY(EGxRenderState);
enum EGxShPS {
GxShPS_none = 0,
GxShPS_ps_1_1 = 1,
GxShPS_ps_1_4 = 2,
GxShPS_ps_2_0 = 3,
GxShPS_ps_3_0 = 4,
GxShPS_ps_4_0 = 5,
GxShPS_ps_5_0 = 6,
GxShPS_nvrc = 7,
GxShPS_nvts = 8,
GxShPS_nvts2 = 9,
GxShPS_nvts3 = 10,
GxShPS_nvfp2 = 11,
GxShPS_arbfp1 = 12,
GxShPS_glsl = 13,
};
enum EGxShTarget {
GxSh_Vertex = 0,
GxSh_Hull = 1,
GxSh_Domain = 2,
GxSh_Geometry = 3,
GxSh_Pixel = 4,
GxSh_Compute = 5,
GxShTargets_Last = 6
};
enum EGxShVS {
GxShVS_none = 0,
GxShVS_vs_1_1 = 1,
GxShVS_vs_2_0 = 2,
GxShVS_vs_3_0 = 3,
GxShVS_vs_4_0 = 4,
GxShVS_vs_5_0 = 5,
GxShVS_arbvp1 = 6,
GxShVS_arbvp1_cg12 = 7,
GxShVS_nvvp = 8,
GxShVS_nvvp2 = 9,
GxShVS_nvvp3 = 10,
GxShVS_glsl = 11
};
enum EGxTexCommand {
GxTex_Lock = 0,
GxTex_Latch = 1,
GxTex_Unlock = 2,
GxTexCommands_Last = 3
};
enum EGxTexFilter {
GxTex_Nearest = 0x0,
GxTex_Linear = 0x1,
GxTex_NearestMipNearest = 0x2,
GxTex_LinearMipNearest = 0x3,
GxTex_LinearMipLinear = 0x4,
GxTex_Anisotropic = 0x5,
GxTexFilters_Last = 0x6,
};
enum EGxTexFormat {
GxTex_Unknown = 0x0,
GxTex_Abgr8888 = 0x1,
GxTex_Argb8888 = 0x2,
GxTex_Argb4444 = 0x3,
GxTex_Argb1555 = 0x4,
GxTex_Rgb565 = 0x5,
GxTex_Dxt1 = 0x6,
GxTex_Dxt3 = 0x7,
GxTex_Dxt5 = 0x8,
GxTex_Uv88 = 0x9,
GxTex_Gr1616F = 0xA,
GxTex_R32F = 0xB,
GxTex_D24X8 = 0xC,
GxTexFormats_Last = 0xD,
};
enum EGxTexTarget {
GxTex_2d = 0x0,
GxTex_CubeMap = 0x1,
GxTex_Rectangle = 0x2,
GxTex_NonPow2 = 0x3,
GxTexTargets_Last = 0x4
};
enum EGxTexWrapMode {
GxTex_Clamp = 0,
GxTex_Wrap = 1
};
enum EGxXform {
GxXform_Tex0 = 0,
GxXform_Tex1 = 1,
GxXform_Tex2 = 2,
GxXform_Tex3 = 3,
GxXform_Tex4 = 4,
GxXform_Tex5 = 5,
GxXform_Tex6 = 6,
GxXform_Tex7 = 7,
GxXform_World = 8,
GxXform_Projection = 9,
GxXform_View = 10,
GxXforms_Last = 11
};
enum EGxuDrawListCategory {
GxuCat_0 = 0,
GxuCat_1 = 1,
GxuCat_2 = 2
};
enum EGxWM {
GxWM_Size = 0,
GxWM_DisplayChange = 1,
GxWM_Destroy = 2,
GxWM_SetFocus = 3,
GxWM_KillFocus = 4,
};
enum COLOR_FILE_FORMAT {
COLOR_JPEG = 0,
COLOR_PAL = 1,
COLOR_DXT = 2,
COLOR_3 = 3
};
enum PIXEL_FORMAT {
PIXEL_DXT1 = 0x0,
PIXEL_DXT3 = 0x1,
PIXEL_ARGB8888 = 0x2,
PIXEL_ARGB1555 = 0x3,
PIXEL_ARGB4444 = 0x4,
PIXEL_RGB565 = 0x5,
PIXEL_A8 = 0x6,
PIXEL_DXT5 = 0x7,
PIXEL_UNSPECIFIED = 0x8,
PIXEL_ARGB2565 = 0x9,
NUM_PIXEL_FORMATS = 0xA
};
struct C4Pixel {
char b;
char g;
char r;
char a;
};
struct MipBits {
C4Pixel* mip[1];
};
#endif
#ifndef GX_TYPES_H
#define GX_TYPES_H
#include <stdint.h>
#include "storm/array.h"
typedef enum BlitAlpha BlitAlpha;
typedef enum BlitFormat BlitFormat;
typedef enum EGxApi EGxApi;
typedef enum EGxBlend EGxBlend;
typedef enum EGxColorFormat EGxColorFormat;
typedef enum EGxFontHJusts EGxFontHJusts;
typedef enum EGxFontVJusts EGxFontVJusts;
typedef enum EGxMasterEnables EGxMasterEnables;
typedef enum EGxPrim EGxPrim;
typedef enum EGxPrimMask EGxPrimMask;
typedef enum EGxRenderState EGxRenderState;
typedef enum EGxShPS EGxShPS;
typedef enum EGxShTarget EGxShTarget;
typedef enum EGxShVS EGxShVS;
typedef enum EGxTexCommand EGxTexCommand;
typedef enum EGxTexFilter EGxTexFilter;
typedef enum EGxTexFormat EGxTexFormat;
typedef enum EGxTexTarget EGxTexTarget;
typedef enum EGxTexWrapMode EGxTexWrapMode;
typedef enum EGxXform EGxXform;
typedef enum EGxuDrawListCategory EGxuDrawListCategory;
typedef enum EGxWM EGxWM;
typedef enum COLOR_FILE_FORMAT COLOR_FILE_FORMAT;
typedef enum PIXEL_FORMAT PIXEL_FORMAT;
typedef struct C4Pixel C4Pixel;
typedef struct MipBits MipBits;
typedef struct CGxGammaRamp CGxGammaRamp;
enum BlitAlpha {
BlitAlpha_0 = 0,
BlitAlpha_1 = 1,
BlitAlpha_8 = 2,
BlitAlpha_Filler = 3,
BlitAlphas_Last = 4
};
enum BlitFormat {
BlitFormat_Unknown = 0,
BlitFormat_Abgr8888 = 1,
BlitFormat_Argb8888 = 2,
BlitFormat_Argb4444 = 3,
BlitFormat_Argb1555 = 4,
BlitFormat_Rgb565 = 5,
BlitFormat_Dxt1 = 6,
BlitFormat_Dxt3 = 7,
BlitFormat_Dxt5 = 8,
BlitFormat_Uv88 = 9,
BlitFormat_Gr1616F = 10,
BlitFormat_R32F = 11,
BlitFormat_D24X8 = 12,
BlitFormats_Last = 13
};
enum EGxApi {
GxApi_OpenGl = 0,
GxApi_D3d9 = 1,
GxApi_D3d9Ex = 2,
GxApi_D3d10 = 3,
GxApi_D3d11 = 4,
GxApi_GLL = 5,
GxApi_GLSDL = 6,
GxApis_Last = 7
};
enum EGxBlend {
GxBlend_Opaque = 0,
GxBlend_AlphaKey = 1,
GxBlend_Alpha = 2,
GxBlend_Add = 3,
GxBlend_Mod = 4,
GxBlend_Mod2x = 5,
GxBlend_ModAdd = 6,
GxBlend_InvSrcAlphaAdd = 7,
GxBlend_InvSrcAlphaOpaque = 8,
GxBlend_SrcAlphaOpaque = 9,
GxBlend_NoAlphaAdd = 10,
GxBlend_ConstantAlpha = 11,
GxBlends_Last = 12
};
enum EGxColorFormat {
GxCF_argb = 0,
GxCF_rgba = 1,
GxColorFormats_Last = 2,
};
enum EGxFontHJusts {
GxHJ_Left = 0,
GxHJ_Center = 1,
GxHJ_Right = 2,
GxHJ_Last = 3
};
enum EGxFontVJusts {
GxVJ_Top = 0,
GxVJ_Middle = 1,
GxVJ_Bottom = 2,
GxVJ_Last = 3
};
enum EGxMasterEnables {
GxMasterEnable_Lighting = 0,
GxMasterEnable_Fog = 1,
GxMasterEnable_DepthTest = 2,
GxMasterEnable_DepthWrite = 3,
GxMasterEnable_ColorWrite = 4,
GxMasterEnable_Culling = 5,
GxMasterEnable_DoubleBuffering = 6,
GxMasterEnable_NormalProjection = 7,
GxMasterEnable_PolygonFill = 8,
GxMasterEnables_Last = 9
};
enum EGxPrim {
GxPrim_Points = 0,
GxPrim_Lines = 1,
GxPrim_LineStrip = 2,
GxPrim_Triangles = 3,
GxPrim_TriangleStrip = 4,
GxPrim_TriangleFan = 5,
GxPrims_Last = 6
};
enum EGxPrimMask {
GxPrim_Position = 0x1,
GxPrim_BlendWeight = 0x2,
GxPrim_BlendIndices = 0x4,
GxPrim_Normal = 0x8,
GxPrim_Color0 = 0x10,
GxPrim_Color1 = 0x20,
GxPrim_TexCoord0 = 0x40,
GxPrim_TexCoord1 = 0x80
};
enum EGxRenderState {
GxRs_PolygonOffset = 0,
GxRs_MatDiffuse = 1,
GxRs_MatEmissive = 2,
GxRs_MatSpecular = 3,
GxRs_MatSpecularExp = 4,
GxRs_NormalizeNormals = 5,
GxRs_BlendingMode = 6,
GxRs_AlphaRef = 7,
GxRs_FogStart = 8,
GxRs_FogEnd = 9,
GxRs_FogColor = 10,
GxRs_Lighting = 11,
GxRs_Fog = 12,
GxRs_DepthTest = 13,
GxRs_DepthFunc = 14,
GxRs_DepthWrite = 15,
GxRs_ColorWrite = 16,
GxRs_Culling = 17,
GxRs_ClipPlaneMask = 18,
GxRs_Multisample = 19,
GxRs_ScissorTest = 20,
GxRs_Texture0 = 21,
GxRs_Texture1 = 22,
GxRs_Texture2 = 23,
GxRs_Texture3 = 24,
GxRs_Texture4 = 25,
GxRs_Texture5 = 26,
GxRs_Texture6 = 27,
GxRs_Texture7 = 28,
GxRs_Texture8 = 29,
GxRs_Texture9 = 30,
GxRs_Texture10 = 31,
GxRs_Texture11 = 32,
GxRs_Texture12 = 33,
GxRs_Texture13 = 34,
GxRs_Texture14 = 35,
GxRs_Texture15 = 36,
GxRs_ColorOp0 = 37,
GxRs_ColorOp1 = 38,
GxRs_ColorOp2 = 39,
GxRs_ColorOp3 = 40,
GxRs_ColorOp4 = 41,
GxRs_ColorOp5 = 42,
GxRs_ColorOp6 = 43,
GxRs_ColorOp7 = 44,
GxRs_AlphaOp0 = 45,
GxRs_AlphaOp1 = 46,
GxRs_AlphaOp2 = 47,
GxRs_AlphaOp3 = 48,
GxRs_AlphaOp4 = 49,
GxRs_AlphaOp5 = 50,
GxRs_AlphaOp6 = 51,
GxRs_AlphaOp7 = 52,
GxRs_TexGen0 = 53,
GxRs_TexGen1 = 54,
GxRs_TexGen2 = 55,
GxRs_TexGen3 = 56,
GxRs_TexGen4 = 57,
GxRs_TexGen5 = 58,
GxRs_TexGen6 = 59,
GxRs_TexGen7 = 60,
GxRs_Unk61 = 61,
GxRs_Unk62 = 62,
GxRs_Unk63 = 63,
GxRs_Unk64 = 64,
GxRs_Unk65 = 65,
GxRs_Unk66 = 66,
GxRs_Unk67 = 67,
GxRs_Unk68 = 68,
GxRs_Unk69 = 69,
GxRs_Unk70 = 70,
GxRs_Unk71 = 71,
GxRs_Unk72 = 72,
GxRs_Unk73 = 73,
GxRs_Unk74 = 74,
GxRs_Unk75 = 75,
GxRs_Unk76 = 76,
GxRs_VertexShader = 77,
GxRs_PixelShader = 78,
GxRs_PointScale = 79,
GxRs_PointScaleAttenuation = 80,
GxRs_PointScaleMin = 81,
GxRs_PointScaleMax = 82,
GxRs_PointSprite = 83,
GxRs_Unk84 = 84,
GxRs_ColorMaterial = 85,
GxRenderStates_Last = 86
};
STORM_TS_GROWABLE_ARRAY(EGxRenderState);
enum EGxShPS {
GxShPS_none = 0,
GxShPS_ps_1_1 = 1,
GxShPS_ps_1_4 = 2,
GxShPS_ps_2_0 = 3,
GxShPS_ps_3_0 = 4,
GxShPS_ps_4_0 = 5,
GxShPS_ps_5_0 = 6,
GxShPS_nvrc = 7,
GxShPS_nvts = 8,
GxShPS_nvts2 = 9,
GxShPS_nvts3 = 10,
GxShPS_nvfp2 = 11,
GxShPS_arbfp1 = 12,
GxShPS_glsl = 13,
};
enum EGxShTarget {
GxSh_Vertex = 0,
GxSh_Hull = 1,
GxSh_Domain = 2,
GxSh_Geometry = 3,
GxSh_Pixel = 4,
GxSh_Compute = 5,
GxShTargets_Last = 6
};
enum EGxShVS {
GxShVS_none = 0,
GxShVS_vs_1_1 = 1,
GxShVS_vs_2_0 = 2,
GxShVS_vs_3_0 = 3,
GxShVS_vs_4_0 = 4,
GxShVS_vs_5_0 = 5,
GxShVS_arbvp1 = 6,
GxShVS_arbvp1_cg12 = 7,
GxShVS_nvvp = 8,
GxShVS_nvvp2 = 9,
GxShVS_nvvp3 = 10,
GxShVS_glsl = 11
};
enum EGxTexCommand {
GxTex_Lock = 0,
GxTex_Latch = 1,
GxTex_Unlock = 2,
GxTexCommands_Last = 3
};
enum EGxTexFilter {
GxTex_Nearest = 0x0,
GxTex_Linear = 0x1,
GxTex_NearestMipNearest = 0x2,
GxTex_LinearMipNearest = 0x3,
GxTex_LinearMipLinear = 0x4,
GxTex_Anisotropic = 0x5,
GxTexFilters_Last = 0x6,
};
enum EGxTexFormat {
GxTex_Unknown = 0x0,
GxTex_Abgr8888 = 0x1,
GxTex_Argb8888 = 0x2,
GxTex_Argb4444 = 0x3,
GxTex_Argb1555 = 0x4,
GxTex_Rgb565 = 0x5,
GxTex_Dxt1 = 0x6,
GxTex_Dxt3 = 0x7,
GxTex_Dxt5 = 0x8,
GxTex_Uv88 = 0x9,
GxTex_Gr1616F = 0xA,
GxTex_R32F = 0xB,
GxTex_D24X8 = 0xC,
GxTexFormats_Last = 0xD,
};
enum EGxTexTarget {
GxTex_2d = 0x0,
GxTex_CubeMap = 0x1,
GxTex_Rectangle = 0x2,
GxTex_NonPow2 = 0x3,
GxTexTargets_Last = 0x4
};
enum EGxTexWrapMode {
GxTex_Clamp = 0,
GxTex_Wrap = 1
};
enum EGxXform {
GxXform_Tex0 = 0,
GxXform_Tex1 = 1,
GxXform_Tex2 = 2,
GxXform_Tex3 = 3,
GxXform_Tex4 = 4,
GxXform_Tex5 = 5,
GxXform_Tex6 = 6,
GxXform_Tex7 = 7,
GxXform_World = 8,
GxXform_Projection = 9,
GxXform_View = 10,
GxXforms_Last = 11
};
enum EGxuDrawListCategory {
GxuCat_0 = 0,
GxuCat_1 = 1,
GxuCat_2 = 2
};
enum EGxWM {
GxWM_Size = 0,
GxWM_DisplayChange = 1,
GxWM_Destroy = 2,
GxWM_SetFocus = 3,
GxWM_KillFocus = 4,
};
enum COLOR_FILE_FORMAT {
COLOR_JPEG = 0,
COLOR_PAL = 1,
COLOR_DXT = 2,
COLOR_3 = 3
};
enum PIXEL_FORMAT {
PIXEL_DXT1 = 0x0,
PIXEL_DXT3 = 0x1,
PIXEL_ARGB8888 = 0x2,
PIXEL_ARGB1555 = 0x3,
PIXEL_ARGB4444 = 0x4,
PIXEL_RGB565 = 0x5,
PIXEL_A8 = 0x6,
PIXEL_DXT5 = 0x7,
PIXEL_UNSPECIFIED = 0x8,
PIXEL_ARGB2565 = 0x9,
NUM_PIXEL_FORMATS = 0xA
};
struct C4Pixel {
char b;
char g;
char r;
char a;
};
struct MipBits {
C4Pixel* mip[1];
};
struct CGxGammaRamp {
uint16_t red[256];
uint16_t green[256];
uint16_t blue[256];
};
#endif