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

Function GXInit

src/dolphin/src/gx/GXInit.c:213–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 } while (0);
212
213GXFifoObj* GXInit(void* base, u32 size)
214{
215 u32 i;
216 u32 reg;
217 u32 freqBase;
218
219 static u32 resetFuncRegistered;
220
221 OSRegisterVersion(__GXVersion);
222
223 __GXData->inDispList = FALSE;
224 __GXData->dlSaveContext = TRUE;
225 __GXData->abtWaitPECopy = 1;
226#if DEBUG
227 __GXinBegin = FALSE;
228#endif
229 __GXData->tcsManEnab = FALSE;
230 __GXData->tevTcEnab = FALSE;
231
232 GXSetMisc(GX_MT_XF_FLUSH, 0);
233
234 __piReg = OSPhysicalToUncached(0xC003000);
235 __cpReg = OSPhysicalToUncached(0xC000000);
236 __peReg = OSPhysicalToUncached(0xC001000);
237 __memReg = OSPhysicalToUncached(0xC004000);
238 __GXFifoInit();
239 GXInitFifoBase(&FifoObj, base, size);
240 GXSetCPUFifo(&FifoObj);
241 GXSetGPFifo(&FifoObj);
242
243 if (!resetFuncRegistered)
244 {
245 OSRegisterResetFunction(&GXResetFuncInfo);
246 resetFuncRegistered = 1;
247 }
248
249 __GXPEInit();
250 EnableWriteGatherPipe();
251
252 __GXData->genMode = 0;
253 SET_REG_FIELD(0, __GXData->genMode, 8, 24, 0);
254 __GXData->bpMask = 255;
255 SET_REG_FIELD(0, __GXData->bpMask, 8, 24, 0x0F);
256 __GXData->lpSize = 0;
257 SET_REG_FIELD(0, __GXData->lpSize, 8, 24, 0x22);
258
259 for (i = 0; i < 16; ++i)
260 {
261 __GXData->tevc[i] = 0;
262 __GXData->teva[i] = 0;
263 __GXData->tref[i / 2] = 0;
264 __GXData->texmapId[i] = GX_TEXMAP_NULL;
265 SET_REG_FIELD(1130, __GXData->tevc[i], 8, 24, 0xC0 + i * 2);
266 SET_REG_FIELD(1131, __GXData->teva[i], 8, 24, 0xC1 + i * 2);
267 SET_REG_FIELD(1133, __GXData->tevKsel[i / 2], 8, 24, 0xF6 + i / 2);
268 SET_REG_FIELD(1135, __GXData->tref[i / 2], 8, 24, 0x28 + i / 2);
269 }
270

Callers

nothing calls this directly

Calls 15

OSRegisterVersionFunction · 0.85
GXSetMiscFunction · 0.85
__GXFifoInitFunction · 0.85
GXInitFifoBaseFunction · 0.85
GXSetCPUFifoFunction · 0.85
GXSetGPFifoFunction · 0.85
OSRegisterResetFunctionFunction · 0.85
__GXPEInitFunction · 0.85
EnableWriteGatherPipeFunction · 0.85
GXSetVerifyCallbackFunction · 0.85
memsetFunction · 0.85
__GXFlushTextureStateFunction · 0.85

Tested by

no test coverage detected