summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2018-01-08 22:01:47 -0500
committerProjectRevoTPP <projectrevotpp@hotmail.com>2018-01-08 22:01:47 -0500
commitdcf12f9ecdbaab26afb8899eaa05f4cab09a5f82 (patch)
treed74dc57ee7437adc3059699be0a8142bffd80778
parent1c6c7da6fba8903d8eff02ac12465a4098ebca47 (diff)
nocashgba printf
-rw-r--r--include/config.h7
-rwxr-xr-xsrc/libs/libisagbprn.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h
index 6d9e15a15..796da359c 100644
--- a/include/config.h
+++ b/include/config.h
@@ -16,6 +16,13 @@
// still in part authoritative.
#define NDEBUG
+// To enable print debugging, comment out "#define NDEBUG". This allows
+// the various AGBPrint functions to be used. (See include/gba/isagbprint.h).
+// Some emulators support a debug console window: uncomment NoCashGBAPrint()
+// and NoCashGBAPrintf() in libisagbprn.c to use no$gba's own proprietary
+// printing system. Use NoCashGBAPrint() and NoCashGBAPrintf() like you
+// would normally use AGBPrint() and AGBPrintf().
+
#ifndef REVISION
#define REVISION 0
#endif
diff --git a/src/libs/libisagbprn.c b/src/libs/libisagbprn.c
index 007f90bb7..a9656f3c5 100755
--- a/src/libs/libisagbprn.c
+++ b/src/libs/libisagbprn.c
@@ -155,12 +155,22 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP
}
}
-// no$gba print function, uncomment to use
+// no$gba print functions, uncomment to use
/*
void NoCashGBAPrint(const char *pBuf)
{
*(volatile u32*)NOCASHGBAPRINTADDR = (u32)pBuf;
}
+
+void NoCashGBAPrintf(const char *pBuf, ...)
+{
+ char bufPrint[0x100];
+ va_list vArgv;
+ va_start(vArgv, pBuf);
+ vsprintf(bufPrint, pBuf, vArgv);
+ va_end(vArgv);
+ NoCashGBAPrint(bufPrint);
+}
*/
#endif