| 492 | } |
| 493 | |
| 494 | static 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 |
| 529 | static void LoadMemWatch() |
no test coverage detected