typedef struct GsDispCtx GsDispCtx; struct GsDispCtx { // two circuits uint64 pmode; uint64 dispfb1; uint64 dispfb2; uint64 display1; uint64 display2; uint64 bgcolor; }; typedef struct GsDrawCtx GsDrawCtx; struct GsDrawCtx { //two contexts uint128 gifTag; uint64 frame1; uint64 ad_frame1; uint64 frame2; uint64 ad_frame2; uint64 zbuf1; uint64 ad_zbuf1; uint64 zbuf2; uint64 ad_zbuf2; uint64 xyoffset1; uint64 ad_xyoffset1; uint64 xyoffset2; uint64 ad_xyoffset2; uint64 scissor1; uint64 ad_scissor1; uint64 scissor2; uint64 ad_scissor2; }; typedef struct GsCtx GsCtx; struct GsCtx { // display context; two buffers GsDispCtx disp[2]; // draw context; two buffers GsDrawCtx draw[2]; }; typedef struct GsCrtState GsCrtState; struct GsCrtState { int16 inter, mode, ff; }; void GsSetDisp(GsDispCtx *disp); void GsSetDraw(GsDrawCtx *draw); extern int path2Textures; extern int synchTextures; extern int gateTextures; extern int finishCycle; void dmaFlip(int i); void dmaKick(void); namespace rw { namespace ps2 { struct VUdesc { uint32 process, buf1, buf2, buf3; }; extern int rw2gsPrim[]; extern int primSize[]; extern int primRepeat[]; struct RwStateCache { Raster *raster; uint32 addressU; uint32 addressV; uint32 filterMode; bool32 vertexAlpha; uint32 alphaTestEnable; uint32 alphaFunc; bool32 textureAlpha; bool32 blendEnable; uint32 srcblend, destblend; uint32 zwrite; uint32 ztest; uint32 cullmode; uint32 fogEnable; float32 fogStart; float32 fogEnd; }; extern RwStateCache rwStateCache; enum { vuLight = 0x3D0, vuMatrix = 0x3F0, vuXyzwScale = 0x3F4, vuXyzwOffset = 0x3F5, vuClipConsts = 0x3F6, vuGifTag = 0x3FA, vuColScale = 0x3FB, vuSurfProps = 0x3FC, vuVuSwitch = 0x3FF }; struct VuConst { QWord mat0, mat1, mat2, mat3; QWord xyzwScale_2D; QWord xyzwOffset_2D; QWord xyzwScale_3D; QWord xyzwOffset_3D; QWord clipConsts; QWord gifTag; QWord surfProps; QWord vuSwitch; }; extern VuConst vuConst; extern int32 doClipping; extern int32 doModulate2; extern QWord colorNoScale; extern QWord colorTexScale; void uploadRaster(Raster *raster); void setTexture(Raster *raster, uint32 addressU, uint32 addressV, uint32 filterMode); void flushGSRegs(void); void uploadVUCode(uint32 *code); void setMatrix(RawMatrix *combined, Matrix *world); void beginFrame(int frame); void endFrame(float *t1, float *t2); void defaultAtomicRender(rw::ObjPipeline *pipe, Atomic *atomic); // The reset should be private void renderPrim_VU(PrimitiveType type, void *verts, int32 numVerts); void renderIndexedPrim_VU(PrimitiveType type, void *verts, int32 numVerts, void *indices, int32 numIndices); void vuIm3DTransform(void *vertices, int32 numVertices, Matrix *world, uint32 flags); void vuIm3DRenderIndexed(PrimitiveType type, void *indices, int32 numIndices); void vuIm3DEnd(void); void clearCamera(Camera *cam, RGBA *col, uint32 mode); void beginUpdate(Camera *cam); void endUpdate(Camera *cam); void setRenderState(int32 state, void *pvalue); void *getRenderState(int32 state); int deviceSystem(DeviceReq req, void *arg, int32 n); } void genIm3DTransform(void *vertices, int32 numVertices, Matrix *world, uint32 flags); void genIm3DEnd(void); void genIm3DRenderIndexed(PrimitiveType prim, void *indices, int32 numIndices); }