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

Function zSaveLoad_CardCheckFormattedSingle

src/SB/Game/zSaveLoad.cpp:805–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803}
804
805S32 zSaveLoad_CardCheckFormattedSingle(S32 cardNumber)
806{
807 S32 rc;
808 st_XSAVEGAME_DATA* ldinst = xSGInit(XSG_MODE_LOAD);
809 S32 tgtmax;
810
811 rc = 0;
812 switch (xSGTgtCount(ldinst, &tgtmax))
813 {
814 case 2:
815 switch (xSGTgtIsFormat(ldinst, cardNumber, NULL))
816 {
817 case -1:
818 rc = 7;
819 break;
820 case 1:
821 rc = 1;
822 break;
823 case 0:
824 default:
825 rc = 0;
826 break;
827 }
828 break;
829 case 1:
830 S32 idx = xSGTgtPhysSlotIdx(ldinst, 0);
831 if (idx != cardNumber)
832 {
833 rc = -1;
834 }
835 else if (!(idx ^ cardNumber))
836 {
837 switch (xSGTgtIsFormat(ldinst, 0, NULL))
838 {
839 case -1:
840 rc = 7;
841 break;
842 case 1:
843 rc = 1;
844 break;
845 case 0:
846 default:
847 rc = 0;
848 break;
849 }
850 }
851 break;
852 case 0:
853 rc = -1;
854 break;
855 }
856
857 xSGDone(ldinst);
858 return rc;
859}
860
861S32 zSaveLoad_CardCheckSpaceSingle_doCheck(st_XSAVEGAME_DATA* xsgdata, S32 cardNumber)
862{

Callers 1

Calls 5

xSGTgtPhysSlotIdxFunction · 0.85
xSGInitFunction · 0.50
xSGTgtCountFunction · 0.50
xSGTgtIsFormatFunction · 0.50
xSGDoneFunction · 0.50

Tested by

no test coverage detected