diff options
-rw-r--r-- | include/config.h | 13 | ||||
-rw-r--r-- | include/global.h | 2 | ||||
-rw-r--r-- | src/isagbprn.c | 6 | ||||
-rw-r--r-- | sym_bss.txt | 1 |
4 files changed, 21 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h index 162af3143..6619cfa9a 100644 --- a/include/config.h +++ b/include/config.h @@ -1,6 +1,19 @@ #ifndef GUARD_CONFIG_H #define GUARD_CONFIG_H +// In the Generation 3 games, Asserts were used in various debug builds. +// Ruby/Sapphire and Emerald do not have these asserts while Fire Red +// still has them in the ROM. This is because the developers forgot +// to define NOAGBPRN before release, which is actually supposed to be +// NDEBUG, however this has been changed as Ruby's actual debug build +// does not use the AGBPrint features. +// #define NDEBUG + +// Fire Red likely forgot to define NDEBUG/NOAGBPRN before release, leading +// to the inclusion of asserts in the retail ROM. Don't try to re-enable this yet +// since not all baseroms and pointers have been dumped yet and will result in +// a broken ROM. + #define ENGLISH #ifdef ENGLISH diff --git a/include/global.h b/include/global.h index 50d3f9104..dd466678d 100644 --- a/include/global.h +++ b/include/global.h @@ -1,8 +1,8 @@ #ifndef GUARD_GLOBAL_H #define GUARD_GLOBAL_H -#include "gba/gba.h" #include "config.h" +#include "gba/gba.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); 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 <stdarg.h> #include <stdio.h> +#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 diff --git a/sym_bss.txt b/sym_bss.txt index 4014026ab..b3b7ae4b5 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -285,6 +285,7 @@ gUnknown_3002080: @ 3002080 .space 0x4 @ This isn't needed for Ruby/Sapphire or Emerald. .include "tools/agbcc/lib/libgcc.a:dp-bit.o" + .space 0x4 @ huh? .include "tools/agbcc/lib/libgcc.a:fp-bit.o" .include "tools/agbcc/lib/libc.a:memcpy.o" .include "tools/agbcc/lib/libc.a:memset.o" |