Skip to content

Commit

Permalink
add slimmed down ASSERT for effects
Browse files Browse the repository at this point in the history
  • Loading branch information
JCog committed Sep 30, 2024
1 parent a62c953 commit 18f3ca6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions include/effects_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

#include "effects.h"

// slimmed down assert so that all effects still fit under the TLB page size limit of 0x1000 bytes
#define ASSERT(condition) \
if (!(condition)) { \
IS_DEBUG_PANIC("Assert", __FILE_NAME__, __LINE__, NULL); \
}

s32 effect_rand_int(s32);
s32 effect_simple_rand(s32, s32);

Expand Down
2 changes: 1 addition & 1 deletion src/crash_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void crash_screen_set_assert_info(const char* message, const char* file, u32 lin
}
file = slash + 1;
}
sprintf(crashScreenAssertLocation, "%s (%s:%d)", func, file, line);
sprintf(crashScreenAssertLocation, "%s (%s:%d)", func == NULL ? "Unknown" : func, file, line);
}

void crash_screen_sleep(s32 ms) {
Expand Down

0 comments on commit 18f3ca6

Please sign in to comment.