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

Function QuickSaveMemWatch

src/drivers/win/memwatch.cpp:494–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494static void QuickSaveMemWatch() //Save rather than Save as
495{
496 if (fileChanged==false) //Checks if current watch has been changed, if so quick save has no effect.
497 return;
498 if (memwLastFilename[0]!=NULL) // Check if there is there something to save else default to save as
499 {
500 SaveStrings();
501 FILE *fp=FCEUD_UTF8fopen(memwLastFilename,"w");
502 for(int i=0;i<NUMWATCHES;i++)
503 {
504 //Use dummy strings to fill empty slots
505 if(addresses[i][0] == 0)
506 {
507 addresses[i][0] = '|';
508 addresses[i][1] = 0;
509 }
510 if(labels[i][0] == 0)
511 {
512 labels[i][0] = '|';
513 labels[i][1] = 0;
514 }
515 //spaces can be a problem for scanf so get rid of them
516 TakeOutSpaces(i);
517 fprintf(fp, "%s %s\n", addresses[i], labels[i]);
518 PutInSpaces(i);
519
520 }
521 fileChanged = false;
522 fclose (fp);
523 }
524 else
525 SaveMemWatch();
526}
527
528//Open Memwatch File
529static void LoadMemWatch()

Callers 2

CloseMemoryWatchFunction · 0.85
MemWatchCallBFunction · 0.85

Calls 5

SaveStringsFunction · 0.85
TakeOutSpacesFunction · 0.85
PutInSpacesFunction · 0.85
SaveMemWatchFunction · 0.85
FCEUD_UTF8fopenFunction · 0.70

Tested by

no test coverage detected