mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 23:52:49 +02:00
Make AGBPrint output to our Logging.
We also output using `dbgOutput`, hence the behaviour will not change for users relying on this.
This commit is contained in:
committed by
Rafael Kitover
parent
60f05cedc2
commit
d05e8fc141
@@ -55,10 +55,15 @@ void agbPrintFlush()
|
||||
uint16_t put = debuggerReadHalfWord(0x9fe20fe);
|
||||
|
||||
uint32_t address = (debuggerReadHalfWord(0x9fe20fa) << 16);
|
||||
|
||||
char message[0x10000];
|
||||
size_t index = 0;
|
||||
|
||||
if (address != 0xfd0000 && address != 0x1fd0000) {
|
||||
#ifdef BKPT_SUPPORT
|
||||
dbgOutput("Did you forget to call AGBPrintInit?\n", 0);
|
||||
#endif
|
||||
log("AGBprint: Did you forget to call AGBPrintInit?\n");
|
||||
// get rid of the text otherwise we will continue to be called
|
||||
debuggerWriteHalfWord(0x9fe20fc, put);
|
||||
return;
|
||||
@@ -72,6 +77,8 @@ void agbPrintFlush()
|
||||
s[0] = c;
|
||||
s[1] = 0;
|
||||
|
||||
message[index++] = s[0];
|
||||
|
||||
if (systemVerbose & VERBOSE_AGBPRINT)
|
||||
{
|
||||
#ifdef BKPT_SUPPORT
|
||||
@@ -81,5 +88,11 @@ void agbPrintFlush()
|
||||
if (c == '\n')
|
||||
break;
|
||||
}
|
||||
|
||||
message[index] = '\0';
|
||||
if (systemVerbose & VERBOSE_AGBPRINT)
|
||||
{
|
||||
log("AGBPrint: %s\n", message);
|
||||
}
|
||||
debuggerWriteHalfWord(0x9fe20fc, get);
|
||||
}
|
||||
|
Reference in New Issue
Block a user