| 192 | } |
| 193 | |
| 194 | bool LoadCDLog(const char* nameo) |
| 195 | { |
| 196 | FILE *FP; |
| 197 | int i,j; |
| 198 | |
| 199 | FP = fopen(nameo, "rb"); |
| 200 | if (FP == NULL) |
| 201 | return false; |
| 202 | |
| 203 | for(i = 0;i < (int)cdloggerdataSize;i++) |
| 204 | { |
| 205 | j = fgetc(FP); |
| 206 | if (j == EOF) |
| 207 | break; |
| 208 | if ((j & 1) && !(cdloggerdata[i] & 1)) |
| 209 | codecount++; //if the new byte has something logged and |
| 210 | if ((j & 2) && !(cdloggerdata[i] & 2)) |
| 211 | datacount++; //and the old one doesn't. Then increment |
| 212 | if ((j & 3) && !(cdloggerdata[i] & 3)) |
| 213 | undefinedcount--; //the appropriate counter. |
| 214 | cdloggerdata[i] |= j; |
| 215 | } |
| 216 | |
| 217 | if(cdloggerVideoDataSize != 0) |
| 218 | { |
| 219 | for(i = 0;i < (int)cdloggerVideoDataSize;i++) |
| 220 | { |
| 221 | j = fgetc(FP); |
| 222 | if(j == EOF)break; |
| 223 | if((j & 1) && !(cdloggervdata[i] & 1))rendercount++; //if the new byte has something logged and |
| 224 | if((j & 2) && !(cdloggervdata[i] & 2))vromreadcount++; //if the new byte has something logged and |
| 225 | if((j & 3) && !(cdloggervdata[i] & 3))undefinedvromcount--; //the appropriate counter. |
| 226 | cdloggervdata[i] |= j; |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | fclose(FP); |
| 231 | RenameCDLog(nameo); |
| 232 | UpdateCDLogger(); |
| 233 | return true; |
| 234 | } |
| 235 | |
| 236 | void LoadCDLogFile() |
| 237 | { |
no test coverage detected