Merge pull request #756 from parasyte/fix/debugger-overflow

Fix "OVERFLOW" byte not being shown at address $FFFF.
This commit is contained in:
thor2016 2024-11-24 03:47:20 -05:00 committed by GitHub
commit 6dc277a27c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -687,7 +687,7 @@ void Disassemble(HWND hWnd, int id, int scrollid, unsigned int addr)
{ {
if ((addr + size) > 0xFFFF) if ((addr + size) > 0xFFFF)
{ {
while (addr < 0xFFFF) while (addr <= 0xFFFF)
{ {
swprintf(chr, L"%02X OVERFLOW\n", GetMem(addr++)); swprintf(chr, L"%02X OVERFLOW\n", GetMem(addr++));
wcscat(debug_wstr, chr); wcscat(debug_wstr, chr);
@ -1901,7 +1901,7 @@ BOOL CALLBACK IDC_DEBUGGER_DISASSEMBLY_WndProc(HWND hwndDlg, UINT uMsg, WPARAM w
if (GetNesFileAddress(i) == -1) if (GetNesFileAddress(i) == -1)
sprintf(str,"CPU Address $%04X, Error retreiving ROM File Address!",i); sprintf(str,"CPU Address $%04X, Error retreiving ROM File Address!",i);
else else
sprintf(str,"CPU Address %02X:%04X, Offset 0x%06X in file \"%.40s%s\" (NL file: %X)",getBank(i),i,GetNesFileAddress(i),ptr,dotdot,getBank(i)); sprintf(str,"CPU Address %02X:%04X, Offset 0x%06X in file \"%.40s%s\"",getBank(i),i,GetNesFileAddress(i),ptr,dotdot);
SetDlgItemText(hDebug, IDC_DEBUGGER_ADDR_LINE,str); SetDlgItemText(hDebug, IDC_DEBUGGER_ADDR_LINE,str);
} else } else
{ {