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

Function xSGProcess

src/SB/Core/x/xsavegame.cpp:498–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498S32 xSGProcess(st_XSAVEGAME_DATA* xsgdata)
499{
500 S32 result = 1;
501 if (xsgdata->stage & 0x40000000)
502 {
503 result = 0;
504 }
505 else if (!(xsgdata->stage & 1))
506 {
507 result = 0;
508 }
509 else if (!(xsgdata->stage & 8))
510 {
511 result = 0;
512 }
513
514 if (result != 0 && xsgdata->mode == XSG_MODE_SAVE)
515 {
516 if (xSG_smem_blkopen(xsgdata) == 0)
517 {
518 result = 0;
519 }
520
521 if (result != 0 && xSG_sv_flipproc(xsgdata) == 0)
522 {
523 result = 0;
524 }
525 if (result != 0 && xSG_sv_bldchksum(xsgdata) == 0)
526 {
527 result = 0;
528 }
529 if (result != 0 && xSG_smem_blkclose(xsgdata) == 0)
530 {
531 result = 0;
532 }
533
534 if (result != 0)
535 {
536 xSG_sv_commit(xsgdata);
537 }
538 }
539 else if (result != 0 && xsgdata->mode == XSG_MODE_LOAD)
540 {
541 if (xSG_ld_readgame(xsgdata) == 0)
542 {
543 result = 0;
544 }
545 }
546
547 xsgdata->stage |= 0x10;
548 if (result == 0)
549 {
550 xsgdata->stage |= 0x40000000;
551 }
552 return result;
553}
554
555S32 xSGWrapup(st_XSAVEGAME_DATA* xsgdata)

Callers 3

zSaveLoad_DoAutoSaveFunction · 0.50
zSaveLoad_SaveGameFunction · 0.50
zSaveLoad_LoadGameFunction · 0.50

Calls 6

xSG_smem_blkopenFunction · 0.85
xSG_sv_bldchksumFunction · 0.85
xSG_ld_readgameFunction · 0.85
xSG_sv_flipprocFunction · 0.70
xSG_smem_blkcloseFunction · 0.70
xSG_sv_commitFunction · 0.70

Tested by

no test coverage detected