From 5d7a038cea2cdb57df1354e8e9cbc57931cd4170 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 6 Jan 2018 21:29:51 -0500 Subject: add NDEBUG define --- src/isagbprn.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/isagbprn.c b/src/isagbprn.c index 63e372ca2..18d342162 100644 --- a/src/isagbprn.c +++ b/src/isagbprn.c @@ -1,5 +1,7 @@ #include #include +#include "global.h" +#include "config.h" #include "gba/gba.h" #define AGB_PRINT_FLUSH_ADDR 0x9FE209D @@ -17,6 +19,8 @@ struct AGBPrintStruct typedef void (*LPFN_PRINT_FLUSH)(void); +#ifndef NDEBUG + void AGBPrintFlush1Block(void); void AGBPrintInit(void) @@ -146,3 +150,5 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP AGBPrintf("WARING FILE=[%s] LINE=[%d] EXP=[%s] \n", pFile, nLine, pExpression); } } + +#endif -- cgit v1.2.3 From 5dd7baee5e9983c3a8199c785f276b600bd6bd93 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Mon, 8 Jan 2018 17:03:51 -0500 Subject: let the user deal with nogbaprint, forget this --- src/isagbprn.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/isagbprn.c b/src/isagbprn.c index 18d342162..5c897f16b 100644 --- a/src/isagbprn.c +++ b/src/isagbprn.c @@ -9,6 +9,11 @@ #define AGB_PRINT_PROTECT_ADDR 0x9FE2FFE #define WSCNT_DATA (WAITCNT_PHI_OUT_16MHZ | WAITCNT_WS0_S_2 | WAITCNT_WS0_N_4) +// for auto no$gba support, the string "no$gba" should be at this address. +// except it's not, blame Martin, hence I'm letting the user deal with this nonsense. +#define NOGBAIDADDR 0x4FFFA00 +#define NOGBAPRINTADDR 0x4FFFA14 + struct AGBPrintStruct { u16 m_nRequest; @@ -151,4 +156,12 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP } } +// TODO: Find a way to seamlessly support no$gba without shit hack defines +// nogba print function +/* +void NOGBAPrint(const char *pBuf) +{ + *(volatile u32*)NOGBAPRINTADDR = (u32)pBuf; +}*/ + #endif -- cgit v1.2.3 From eb0635784ce23b38fb09d6ccb5dea75a3ed3ba0f Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Mon, 8 Jan 2018 17:05:02 -0500 Subject: actually change NOGBAPrint, stupid --- src/isagbprn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/isagbprn.c b/src/isagbprn.c index 5c897f16b..91d5c3f08 100644 --- a/src/isagbprn.c +++ b/src/isagbprn.c @@ -156,12 +156,12 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP } } -// TODO: Find a way to seamlessly support no$gba without shit hack defines -// nogba print function +// nogba print function, uncomment to use /* void NOGBAPrint(const char *pBuf) { *(volatile u32*)NOGBAPRINTADDR = (u32)pBuf; -}*/ +} +*/ #endif -- cgit v1.2.3 From a8833519c9ccda46fe60b314f8e6624ca7388c8a Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Mon, 8 Jan 2018 21:42:19 -0500 Subject: nogba to nocashgba --- src/isagbprn.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/isagbprn.c b/src/isagbprn.c index 91d5c3f08..d2a41a9db 100644 --- a/src/isagbprn.c +++ b/src/isagbprn.c @@ -11,8 +11,8 @@ // for auto no$gba support, the string "no$gba" should be at this address. // except it's not, blame Martin, hence I'm letting the user deal with this nonsense. -#define NOGBAIDADDR 0x4FFFA00 -#define NOGBAPRINTADDR 0x4FFFA14 +#define NOCASHGBAIDADDR 0x4FFFA00 +#define NOCASHGBAPRINTADDR 0x4FFFA14 struct AGBPrintStruct { @@ -156,11 +156,11 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP } } -// nogba print function, uncomment to use +// no$gba print function, uncomment to use /* -void NOGBAPrint(const char *pBuf) +void NoCashGBAPrint(const char *pBuf) { - *(volatile u32*)NOGBAPRINTADDR = (u32)pBuf; + *(volatile u32*)NOCASHGBAPRINTADDR = (u32)pBuf; } */ -- cgit v1.2.3 From 149d308a67fe75781873c8da24a00e587935a689 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Mon, 8 Jan 2018 22:03:53 -0500 Subject: nocashgba printf --- src/isagbprn.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/isagbprn.c b/src/isagbprn.c index d2a41a9db..a2f9b5241 100644 --- a/src/isagbprn.c +++ b/src/isagbprn.c @@ -156,12 +156,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 -- cgit v1.2.3 From 9e8079fc1bd201946a1bb667096b417cbf16ecbb Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 9 Jan 2018 19:28:58 -0500 Subject: comment --- src/isagbprn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/isagbprn.c b/src/isagbprn.c index a2f9b5241..52d7653bc 100644 --- a/src/isagbprn.c +++ b/src/isagbprn.c @@ -9,8 +9,8 @@ #define AGB_PRINT_PROTECT_ADDR 0x9FE2FFE #define WSCNT_DATA (WAITCNT_PHI_OUT_16MHZ | WAITCNT_WS0_S_2 | WAITCNT_WS0_N_4) -// for auto no$gba support, the string "no$gba" should be at this address. -// except it's not, blame Martin, hence I'm letting the user deal with this nonsense. +// 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 NOCASHGBAPRINTADDR 0x4FFFA14 -- cgit v1.2.3 From bdf242c2876ce95673de446cbaea9498dc77d8ed Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 9 Jan 2018 19:39:29 -0500 Subject: both print defines for nocashgba --- src/isagbprn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/isagbprn.c b/src/isagbprn.c index 52d7653bc..3fd5e9142 100644 --- a/src/isagbprn.c +++ b/src/isagbprn.c @@ -12,7 +12,8 @@ // 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 NOCASHGBAPRINTADDR 0x4FFFA14 +#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 { @@ -160,7 +161,7 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP /* void NoCashGBAPrint(const char *pBuf) { - *(volatile u32*)NOCASHGBAPRINTADDR = (u32)pBuf; + *(volatile u32*)NOCASHGBAPRINTADDR2 = (u32)pBuf; } void NoCashGBAPrintf(const char *pBuf, ...) -- cgit v1.2.3