MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / DrawFrame

Function DrawFrame

src/SB/Core/gc/iFMV.cpp:104–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104static void DrawFrame(float arg0, float arg1, float arg2, float arg3)
105{
106 GXRenderModeObj* rm = _RwDlRenderMode;
107 Mtx idt;
108 Mtx44 mtx;
109
110 GXSetViewport(0.0f, 0.0f, rm->fbWidth, rm->efbHeight, 0.0f, 1.0f);
111 GXSetScissor(0, 0, rm->fbWidth, rm->efbHeight);
112 GXSetDispCopySrc(0, 0, rm->fbWidth, rm->efbHeight);
113 GXSetDispCopyDst(rm->fbWidth, rm->xfbHeight);
114 GXSetDispCopyYScale((float)rm->xfbHeight / rm->efbHeight);
115 GXSetCopyFilter(rm->aa, rm->sample_pattern, GX_TRUE, rm->vfilter);
116
117 if (rm->aa)
118 {
119 GXSetPixelFmt(GX_PF_RGB565_Z16, GX_ZC_LINEAR);
120 }
121 else
122 {
123 GXSetPixelFmt(GX_PF_RGB8_Z24, GX_ZC_LINEAR);
124 }
125
126 GXSetDispCopyGamma(GX_GM_1_0);
127 C_MTXOrtho(mtx, 0.0f, 480.0f, 0.0f, 640.0f, 0.0f, 10000.0f);
128 GXSetProjection(mtx, GX_ORTHOGRAPHIC);
129 PSMTXIdentity(idt);
130 GXLoadPosMtxImm(idt, 0);
131
132 GXClearVtxDesc();
133 GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
134 GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
135 GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
136 GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_NRM_NBT, GX_S16, 0);
137 GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_NRM_NBT, GX_RGBA8, 0);
138 GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_NRM_NBT, GX_RGBA6, 0);
139
140 GXSetNumTexGens(1);
141 GXSetNumChans(1);
142 GXSetNumTevStages(1);
143 GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x3c);
144 GXSetTevOp(GX_TEVSTAGE0, GX_MODULATE);
145 GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
146
147 if (rm->field_rendering)
148 {
149 u32 field = VIGetNextField();
150 GXSetViewportJitter(0.0f, 0.0f, rm->fbWidth, rm->efbHeight, 0.0f, 1.0f, field);
151 }
152 else
153 {
154 GXSetViewport(0.0f, 0.0f, rm->fbWidth, rm->efbHeight, 0.0f, 1.0f);
155 }
156
157 GXInvalidateVtxCache();
158 GXInvalidateTexAll();
159 Blit_RAD_3D_image(Image, arg0, arg1, arg2, arg3, 1.0f);
160}
161

Callers 1

Show_frameFunction · 0.85

Calls 15

GXSetViewportFunction · 0.85
GXSetScissorFunction · 0.85
GXSetDispCopySrcFunction · 0.85
GXSetDispCopyDstFunction · 0.85
GXSetDispCopyYScaleFunction · 0.85
GXSetCopyFilterFunction · 0.85
GXSetPixelFmtFunction · 0.85
GXSetDispCopyGammaFunction · 0.85
C_MTXOrthoFunction · 0.85
GXSetProjectionFunction · 0.85
PSMTXIdentityFunction · 0.85
GXLoadPosMtxImmFunction · 0.85

Tested by

no test coverage detected