| 553 | } |
| 554 | |
| 555 | S32 xSGWrapup(st_XSAVEGAME_DATA* xsgdata) |
| 556 | { |
| 557 | S32 result = 1; |
| 558 | S32 rc = 0; |
| 559 | |
| 560 | if (xsgdata->stage & 0x40000000) |
| 561 | { |
| 562 | result = 0; |
| 563 | } |
| 564 | else if (!(xsgdata->stage & 1)) |
| 565 | { |
| 566 | result = 0; |
| 567 | } |
| 568 | else if (!(xsgdata->stage & 0x10)) |
| 569 | { |
| 570 | result = 0; |
| 571 | xsgdata->stage |= 0x40000000; |
| 572 | } |
| 573 | |
| 574 | if (xsgdata->mode != XSG_MODE_LOAD) |
| 575 | { |
| 576 | return result; |
| 577 | } |
| 578 | if (result == 0) |
| 579 | { |
| 580 | return result; |
| 581 | } |
| 582 | |
| 583 | if (result != 0) |
| 584 | { |
| 585 | rc = xSG_ld_readhead(xsgdata); |
| 586 | } |
| 587 | if (rc < 0) |
| 588 | { |
| 589 | xsgdata->stage |= 0x40000000; |
| 590 | return -1; |
| 591 | } |
| 592 | |
| 593 | if (rc == 0) |
| 594 | { |
| 595 | result = 0; |
| 596 | } |
| 597 | if (result != 0) |
| 598 | { |
| 599 | rc = xSG_ld_validate(xsgdata); |
| 600 | } |
| 601 | |
| 602 | if (rc < 0) |
| 603 | { |
| 604 | xsgdata->stage |= 0x40000000; |
| 605 | return -1; |
| 606 | } |
| 607 | |
| 608 | if (rc == 0) |
| 609 | { |
| 610 | result = 0; |
| 611 | } |
| 612 | if (result != 0) |
no test coverage detected