summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-01-11 18:11:01 -0800
committerGitHub <noreply@github.com>2018-01-11 18:11:01 -0800
commit72af1f78801e9a05d34a9416dd460b4e888d18a1 (patch)
treeb580a5df2085135c0982846ddc6a334888749d07 /src
parent83b3cafa321b312f347c044f2c41e1c9803a4106 (diff)
parentbdf242c2876ce95673de446cbaea9498dc77d8ed (diff)
Merge pull request #1 from ProjectRevoTPP/assert
add NDEBUG define
Diffstat (limited to 'src')
-rw-r--r--src/isagbprn.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/isagbprn.c b/src/isagbprn.c
index 63e372ca2..3fd5e9142 100644
--- a/src/isagbprn.c
+++ b/src/isagbprn.c
@@ -1,5 +1,7 @@
#include <stdarg.h>
#include <stdio.h>
+#include "global.h"
+#include "config.h"
#include "gba/gba.h"
#define AGB_PRINT_FLUSH_ADDR 0x9FE209D
@@ -7,6 +9,12 @@
#define AGB_PRINT_PROTECT_ADDR 0x9FE2FFE
#define WSCNT_DATA (WAITCNT_PHI_OUT_16MHZ | WAITCNT_WS0_S_2 | WAITCNT_WS0_N_4)
+// originally for auto no$gba support, the string "no$gba" should be at this address,
+// the user needs to read this string out as the memory viewer won't show it.
+#define NOCASHGBAIDADDR 0x4FFFA00
+#define NOCASHGBAPRINTADDR1 0x4FFFA10 // automatically adds a newline after the string has finished
+#define NOCASHGBAPRINTADDR2 0x4FFFA14 // does not automatically add the newline. by default, NOCASHGBAPRINTADDR2 is used. this is used to keep strings consistent between no$gba and VBA-RR, but a user can choose to forgo this.
+
struct AGBPrintStruct
{
u16 m_nRequest;
@@ -17,6 +25,8 @@ struct AGBPrintStruct
typedef void (*LPFN_PRINT_FLUSH)(void);
+#ifndef NDEBUG
+
void AGBPrintFlush1Block(void);
void AGBPrintInit(void)
@@ -146,3 +156,23 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP
AGBPrintf("WARING FILE=[%s] LINE=[%d] EXP=[%s] \n", pFile, nLine, pExpression);
}
}
+
+// no$gba print functions, uncomment to use
+/*
+void NoCashGBAPrint(const char *pBuf)
+{
+ *(volatile u32*)NOCASHGBAPRINTADDR2 = (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