----------------------------------------------------
| 848 | } |
| 849 | //---------------------------------------------------- |
| 850 | bool 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 | //---------------------------------------------------- |
| 898 | void StartCDLogging(void) |
| 899 | { |
no test coverage detected