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

Function PKR_LoadStep_Async

src/SB/Core/x/xpkrsvc.cpp:318–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318S32 PKR_LoadStep_Async()
319{
320 S32 rc;
321 static st_PACKER_READ_DATA* curpr = NULL;
322 static st_PACKER_LTOC_NODE* asynlay = NULL;
323
324 if (asynlay == NULL)
325 {
326 PKR_findNextLayerToLoad(&curpr, &asynlay);
327
328 if (asynlay != NULL)
329 {
330 if (PKR_layerLoadDest(asynlay->laytyp) != PKR_LDDEST_SKIP && asynlay->laysize > 1 &&
331 asynlay->assref.cnt > 0)
332 {
333 asynlay->laymem = PKR_LayerMemReserve(curpr, asynlay);
334 PKR_drv_guardLayer(asynlay);
335 st_PACKER_ATOC_NODE* tmpass = (st_PACKER_ATOC_NODE*)asynlay->assref.list[0];
336 g_hiprf->setSpot(tmpass->ownpkg, tmpass->d_off);
337
338 if (g_hiprf->readBytes(tmpass->ownpkg, asynlay->laymem, asynlay->laysize))
339 {
340 asynlay->flg_ldstat |= 0x1000000;
341 }
342 else
343 {
344 PKR_LayerMemRelease(curpr, asynlay);
345 asynlay->flg_ldstat &= 0xfcffffff;
346 curpr = NULL;
347 asynlay = NULL;
348 }
349
350 rc = 1;
351 }
352 else
353 {
354 rc = 1;
355 asynlay->flg_ldstat |= 0x2000000;
356 asynlay = NULL;
357 }
358 }
359 else
360 {
361 rc = 0;
362 curpr = NULL;
363 asynlay = NULL;
364 }
365 }
366 else
367 {
368 S32 moretodo = g_hiprf->pollRead(curpr->pkg);
369 if (moretodo == 1)
370 {
371 moretodo = PKR_drv_guardVerify(asynlay);
372 }
373
374 if (!moretodo)
375 {

Callers 1

PKRLoadStepFunction · 0.70

Calls 9

PKR_layerLoadDestFunction · 0.85
PKR_drv_guardLayerFunction · 0.85
PKR_drv_guardVerifyFunction · 0.85
PKR_layerTypeNeedsXFormFunction · 0.85
PKR_findNextLayerToLoadFunction · 0.70
PKR_LayerMemReserveFunction · 0.70
PKR_LayerMemReleaseFunction · 0.70
PKR_updateLayerAssetsFunction · 0.70
PKR_xformLayerAssetsFunction · 0.70

Tested by

no test coverage detected