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

Function LoadCDLog

src/drivers/win/cdlogger.cpp:194–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194bool 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
236void LoadCDLogFile()
237{

Callers 4

CDLoggerCallBFunction · 0.70
LoadCDLogFileFunction · 0.70
CDLoggerROMChangedFunction · 0.70
cdl_loadcdlogFunction · 0.50

Calls 2

UpdateCDLoggerFunction · 0.85
RenameCDLogFunction · 0.70

Tested by

no test coverage detected