Merge branch 'master' of github.com:TASEmulators/fceux

This commit is contained in:
mjbudd77 2022-02-07 18:15:19 -05:00
commit 2dde684af4
1 changed files with 4 additions and 15 deletions

View File

@ -284,16 +284,14 @@ int loadDebuggerPreferences(FILE* f)
// Read the breakpoints // Read the breakpoints
for (i=0;i<65;i++) for (i=0;i<65;i++)
{ {
uint16 start, end;
uint8 flags;
unsigned int len; unsigned int len;
// Read the start address of the BP // Read the start address of the BP
if (fread(&start, sizeof(start), 1, f) != 1) return 1; if (fread(&watchpoint[myNumWPs].address, sizeof(watchpoint[myNumWPs].address), 1, f) != 1) return 1;
// Read the end address of the BP // Read the end address of the BP
if (fread(&end, sizeof(end), 1, f) != 1) return 1; if (fread(&watchpoint[myNumWPs].endaddress, sizeof(watchpoint[myNumWPs].endaddress), 1, f) != 1) return 1;
// Read the flags of the BP // Read the flags of the BP
if (fread(&flags, sizeof(flags), 1, f) != 1) return 1; if (fread(&watchpoint[myNumWPs].flags, sizeof(watchpoint[myNumWPs].flags), 1, f) != 1) return 1;
// Read the length of the BP condition // Read the length of the BP condition
if (fread(&len, sizeof(len), 1, f) != 1) return 1; if (fread(&len, sizeof(len), 1, f) != 1) return 1;
@ -327,17 +325,8 @@ int loadDebuggerPreferences(FILE* f)
if (fread(watchpoint[myNumWPs].desc, 1, len, f) != len) return 1; if (fread(watchpoint[myNumWPs].desc, 1, len, f) != len) return 1;
} }
watchpoint[i].address = 0; if (watchpoint[myNumWPs].address || watchpoint[myNumWPs].endaddress || watchpoint[myNumWPs].flags)
watchpoint[i].endaddress = 0;
watchpoint[i].flags = 0;
// Activate breakpoint
if (start || end || flags)
{ {
watchpoint[myNumWPs].address = start;
watchpoint[myNumWPs].endaddress = end;
watchpoint[myNumWPs].flags = flags;
myNumWPs++; myNumWPs++;
} }
} }