diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/debug/unk_debug_menu_3.c | 18 | ||||
-rw-r--r-- | src/mystery_event_script.c | 6 | ||||
-rw-r--r-- | src/util.c | 2 |
3 files changed, 23 insertions, 3 deletions
diff --git a/src/debug/unk_debug_menu_3.c b/src/debug/unk_debug_menu_3.c new file mode 100644 index 000000000..8603cb1e7 --- /dev/null +++ b/src/debug/unk_debug_menu_3.c @@ -0,0 +1,18 @@ +#if DEBUG + +#include "global.h" +#include "debug.h" +#include "mystery_event_script.h" + +extern const u8 gUnknown_Debug_845DAE1[]; +extern const u8 gUnknown_Debug_845DAE1End[]; + +size_t debug_sub_813C404(void * dest) +{ + size_t size = gUnknown_Debug_845DAE1End - gUnknown_Debug_845DAE1; + memcpy(dest, gUnknown_Debug_845DAE1, size); + unref_sub_812620C(dest, gUnknown_Debug_845DAE1); + return size; +} + +#endif // DEBUG diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index 6fcad66ac..83aa90102 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -114,8 +114,9 @@ static void SetWord(u8 *ptr, u32 val) ptr[3] = val >> 24; } -bool8 unref_sub_81261B4(u8 *a1, int a2) +bool8 unref_sub_81261B4(u8 *a1, const u8 * _a2) { + int a2 = (int)_a2; if (a1[0x0] == 1 && a1[0x11] == 15 && !GetWord(a1 + 0x12)) { int v4 = GetWord(a1 + 0x16) - a2 + (int)a1; @@ -128,8 +129,9 @@ bool8 unref_sub_81261B4(u8 *a1, int a2) return FALSE; } -bool8 unref_sub_812620C(u8 *a1, int a2) +bool8 unref_sub_812620C(u8 *a1, const u8 * _a2) { + int a2 = (int)_a2; if (a1[0x0] == 1 && a1[0x11] == 16 && !GetWord(a1 + 0x12)) { int v4 = GetWord(a1 + 0x16) - a2 + (int)a1; diff --git a/src/util.c b/src/util.c index 582b9f806..e14665a03 100644 --- a/src/util.c +++ b/src/util.c @@ -490,7 +490,7 @@ int CountTrailingZeroBits(u32 value) return 0; } -u16 CalcCRC16(u8 *data, int length) +u16 CalcCRC16(const u8 *data, int length) { u16 i, j; u16 crc = 0x1121; |