MCPcopy Create free account
hub / github.com/TASEmulators/fceux / LoadCDLog

Function LoadCDLog

src/drivers/Qt/CodeDataLogger.cpp:850–896  ·  view source on GitHub ↗

----------------------------------------------------

Source from the content-addressed store, hash-verified

848}
849//----------------------------------------------------
850bool LoadCDLog(const char *nameo)
851{
852 FILE *FP;
853 int i, j;
854
855 FP = fopen(nameo, "rb");
856 if (FP == NULL)
857 {
858 return false;
859 }
860
861 for (i = 0; i < (int)cdloggerdataSize; i++)
862 {
863 j = fgetc(FP);
864 if (j == EOF)
865 break;
866 if ((j & 1) && !(cdloggerdata[i] & 1))
867 codecount++; //if the new byte has something logged and
868 if ((j & 2) && !(cdloggerdata[i] & 2))
869 datacount++; //and the old one doesn't. Then increment
870 if ((j & 3) && !(cdloggerdata[i] & 3))
871 undefinedcount--; //the appropriate counter.
872 cdloggerdata[i] |= j;
873 }
874
875 if (cdloggerVideoDataSize != 0)
876 {
877 for (i = 0; i < (int)cdloggerVideoDataSize; i++)
878 {
879 j = fgetc(FP);
880 if (j == EOF)
881 break;
882 if ((j & 1) && !(cdloggervdata[i] & 1))
883 rendercount++; //if the new byte has something logged and
884 if ((j & 2) && !(cdloggervdata[i] & 2))
885 vromreadcount++; //if the new byte has something logged and
886 if ((j & 3) && !(cdloggervdata[i] & 3))
887 undefinedvromcount--; //the appropriate counter.
888 cdloggervdata[i] |= j;
889 }
890 }
891
892 fclose(FP);
893 RenameCDLog(nameo);
894
895 return true;
896}
897//----------------------------------------------------
898void StartCDLogging(void)
899{

Callers 3

loadCdlFileMethod · 0.70
CDLoggerROMChangedFunction · 0.70

Calls 1

RenameCDLogFunction · 0.70

Tested by

no test coverage detected