Fix an inaccuracy with the No$gba debug registers 04fffa14 and 04fffa18 (#2119)

Writing to either of the two registers would print one newline too many

Co-authored-by: pants64DS <pants64DS@users.noreply.github.com>
This commit is contained in:
pants64DS 2024-07-31 02:13:06 +03:00 committed by GitHub
parent b778fbaad1
commit 37c0320cbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View File

@ -1463,7 +1463,7 @@ u64 NDS::GetSysClockCycles(int num)
return ret;
}
void NDS::NocashPrint(u32 ncpu, u32 addr)
void NDS::NocashPrint(u32 ncpu, u32 addr, bool appendNewline)
{
// addr: debug string
@ -1541,7 +1541,7 @@ void NDS::NocashPrint(u32 ncpu, u32 addr)
}
output[ptr] = '\0';
Log(LogLevel::Debug, "%s\n", output);
Log(LogLevel::Debug, appendNewline ? "%s\n" : "%s", output);
}
void NDS::MonitorARM9Jump(u32 addr)
@ -3609,10 +3609,8 @@ void NDS::ARM9IOWrite32(u32 addr, u32 val)
case 0x04FFFA14:
case 0x04FFFA18:
{
bool appendLF = 0x04FFFA18 == addr;
NocashPrint(0, val);
if(appendLF)
Log(LogLevel::Debug, "\n");
NocashPrint(0, val, 0x04FFFA18 == addr);
return;
}

View File

@ -423,7 +423,7 @@ public: // TODO: Encapsulate the rest of these members
u32 GetPC(u32 cpu) const;
u64 GetSysClockCycles(int num);
void NocashPrint(u32 cpu, u32 addr);
void NocashPrint(u32 cpu, u32 addr, bool appendNewline = true);
void MonitorARM9Jump(u32 addr);