summaryrefslogtreecommitdiff
path: root/src/engine/main.c
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-01-11 18:09:25 -0800
committerGitHub <noreply@github.com>2018-01-11 18:09:25 -0800
commit6a2e39eb97db47b542eea76c1e45df37184a0705 (patch)
tree3d6a4208a965d358154edc4b7f52a64eb18b027f /src/engine/main.c
parente7672a1aeb5e42d6f4e416ede9f6220122d11743 (diff)
parentf658a355e5434a647153d76087b50eec0d5041b1 (diff)
Merge pull request #495 from ProjectRevoTPP/assert
Add NDEBUG support to pokeruby.
Diffstat (limited to 'src/engine/main.c')
-rw-r--r--src/engine/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/engine/main.c b/src/engine/main.c
index 1bed4080b..54a443e80 100644
--- a/src/engine/main.c
+++ b/src/engine/main.c
@@ -83,6 +83,10 @@ static void WaitForVBlank(void);
#define B_START_SELECT (B_BUTTON | START_BUTTON | SELECT_BUTTON)
+#ifndef NDEBUG
+ #include <stdlib.h> // don't include if not needed.
+#endif
+
void AgbMain()
{
RegisterRamReset(RESET_ALL);
@@ -98,6 +102,14 @@ void AgbMain()
gSoftResetDisabled = FALSE;
+// In Fire Red, AGBPrintInit is called at this spot. For user convenience, I
+// opt to initialize the print area here. It is up to the user where they choose
+// to print stuff from, as anything else declared is NOT authoritative.
+#ifndef NDEBUG
+ AGBPrintInit();
+ __mb_cur_max = 1; // fix for AGBPrintf
+#endif
+
if (gFlashMemoryPresent != TRUE)
SetMainCallback2(NULL);