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

Function zSaveLoad_CardCheckSingle

src/SB/Game/zSaveLoad.cpp:762–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760}
761
762S32 zSaveLoad_CardCheckSingle(S32 cardNumber)
763{
764 st_XSAVEGAME_DATA* ldinst = xSGInit(XSG_MODE_LOAD);
765 S32 wrongDevice;
766 S32 tgtmax;
767
768 switch (xSGTgtCount(ldinst, &tgtmax))
769 {
770 case 2:
771 xSGDone(ldinst);
772 return 1;
773 case 1:
774 int idx = xSGTgtPhysSlotIdx(ldinst, 0);
775 xSGDone(ldinst);
776 wrongDevice = iSGCheckForWrongDevice();
777 if (wrongDevice >= 0 && wrongDevice == cardNumber)
778 {
779 return 9;
780 }
781 else
782 {
783 if (idx == cardNumber)
784 {
785 return 1;
786 }
787 else
788 {
789 return 0;
790 }
791 }
792 case 0:
793 wrongDevice = iSGCheckForWrongDevice();
794 if (wrongDevice >= 0)
795 {
796 xSGDone(ldinst);
797 return wrongDevice == cardNumber ? 9 : 0;
798 }
799 xSGDone(ldinst);
800 return 0;
801 }
802 return -1;
803}
804
805S32 zSaveLoad_CardCheckFormattedSingle(S32 cardNumber)
806{

Callers 2

zSaveLoad_pollFunction · 0.70
zSaveLoad_CardCheckFunction · 0.70

Calls 5

xSGTgtPhysSlotIdxFunction · 0.85
iSGCheckForWrongDeviceFunction · 0.85
xSGInitFunction · 0.50
xSGTgtCountFunction · 0.50
xSGDoneFunction · 0.50

Tested by

no test coverage detected