* Debugger: do not reload ram.nl every time automatically
This commit is contained in:
parent
20702c7267
commit
4a9a8f9bdd
|
@ -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);
|
||||
|
|
|
@ -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,6 +547,10 @@ void loadNameFiles()
|
|||
{
|
||||
int cb;
|
||||
|
||||
if (!ramBankNamesLoaded)
|
||||
{
|
||||
ramBankNamesLoaded = true;
|
||||
// load RAM names
|
||||
if (ramBankNames)
|
||||
free(ramBankNames);
|
||||
|
||||
|
@ -555,6 +560,7 @@ void loadNameFiles()
|
|||
|
||||
// Load the address descriptions for the RAM addresses
|
||||
ramBankNames = parseNameFile(NLfilename);
|
||||
}
|
||||
|
||||
// Find out which bank is loaded at 0xC000
|
||||
cb = getBank(0xC000);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 ###########################
|
||||
|
||||
|
|
Loading…
Reference in New Issue