diff --git a/trunk/src/drivers/win/debugger.cpp b/trunk/src/drivers/win/debugger.cpp index 71c3ec49..5fd32e6c 100644 --- a/trunk/src/drivers/win/debugger.cpp +++ b/trunk/src/drivers/win/debugger.cpp @@ -44,6 +44,7 @@ extern Name* lastBankNames; extern Name* loadedBankNames; extern Name* ramBankNames; +extern bool ramBankNamesLoaded; extern int lastBank; extern int loadedBank; extern int myNumWPs; @@ -1974,6 +1975,7 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara case IDC_DEBUGGER_RELOAD_SYMS: { + ramBankNamesLoaded = false; lastBank = loadedBank = -1; loadNameFiles(); UpdateDebugger(false); diff --git a/trunk/src/drivers/win/debuggersp.cpp b/trunk/src/drivers/win/debuggersp.cpp index 525ce55c..ded3f982 100644 --- a/trunk/src/drivers/win/debuggersp.cpp +++ b/trunk/src/drivers/win/debuggersp.cpp @@ -35,6 +35,7 @@ int GetNesFileAddress(int A); Name* lastBankNames = 0; Name* loadedBankNames = 0; Name* ramBankNames = 0; +bool ramBankNamesLoaded = false; int lastBank = -1; int loadedBank = -1; extern char LoadedRomFName[2048]; @@ -325,16 +326,16 @@ Name* parse(char* lines, const char* filename) if (fail == -1) { continue; - } - else if (fail) // Show an error to allow the user to correct the defect line + } else if (fail) { - const char* fmtString = "Error (Code: %d): Invalid line \"%s\" in NL file \"%s\""; + // Show an error to allow the user to correct the defect line + const char* fmtString = "Error (Code: %d): Invalid line \"%s\" in NL file \"%s\"\n"; char* msg = (char*)malloc(strlen(fmtString) + 8 + strlen(lines) + strlen(filename) + 1); sprintf(msg, fmtString, fail, lines, filename); MessageBox(0, msg, "Error", MB_OK | MB_ICONERROR); free(msg); lines = pos + 1; - MessageBox(0, lines, "Error", MB_OK | MB_ICONERROR); + //MessageBox(0, lines, "Error", MB_OK | MB_ICONERROR); continue; } @@ -546,16 +547,21 @@ void loadNameFiles() { int cb; - if (ramBankNames) - free(ramBankNames); + if (!ramBankNamesLoaded) + { + ramBankNamesLoaded = true; + // load RAM names + if (ramBankNames) + free(ramBankNames); - // The NL file for the RAM addresses has the name nesrom.nes.ram.nl - strcpy(NLfilename, mass_replace(LoadedRomFName, "|", ".").c_str()); - strcat(NLfilename, ".ram.nl"); + // The NL file for the RAM addresses has the name nesrom.nes.ram.nl + strcpy(NLfilename, mass_replace(LoadedRomFName, "|", ".").c_str()); + strcat(NLfilename, ".ram.nl"); + + // Load the address descriptions for the RAM addresses + ramBankNames = parseNameFile(NLfilename); + } - // Load the address descriptions for the RAM addresses - ramBankNames = parseNameFile(NLfilename); - // Find out which bank is loaded at 0xC000 cb = getBank(0xC000); if (cb == -1) // No bank was loaded at that offset diff --git a/trunk/src/drivers/win/pref.cpp b/trunk/src/drivers/win/pref.cpp index f85fba00..fad9cea9 100644 --- a/trunk/src/drivers/win/pref.cpp +++ b/trunk/src/drivers/win/pref.cpp @@ -160,10 +160,8 @@ int storeHexPreferences(FILE* f) int storePreferences(const char* romname) { - if (debuggerSaveLoadDEBFiles == false) { + if (debuggerSaveLoadDEBFiles == false) return 0; - } - FILE* f; char* filename; @@ -174,9 +172,7 @@ int storePreferences(const char* romname) // Moved debugger exit code due to complaints and the Debugger menu option being enabled if (!debuggerWasActive) - { return 0; - } /* // With some work, this could be made to prevent writing empty .deb files. diff --git a/trunk/src/drivers/win/tracer.cpp b/trunk/src/drivers/win/tracer.cpp index 0bb9b4ab..4b1b7f1a 100644 --- a/trunk/src/drivers/win/tracer.cpp +++ b/trunk/src/drivers/win/tracer.cpp @@ -51,9 +51,6 @@ using namespace std; extern Name* lastBankNames; extern Name* loadedBankNames; extern Name* ramBankNames; -extern int lastBank; -extern int loadedBank; -extern int myNumWPs; // ################################## End of SP CODE ###########################