| 496 | } |
| 497 | |
| 498 | S32 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 | |
| 555 | S32 xSGWrapup(st_XSAVEGAME_DATA* xsgdata) |
no test coverage detected