diff options
author | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-11-29 19:24:28 +0800 |
---|---|---|
committer | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-12-06 09:44:08 +0800 |
commit | 3909b6408c0125fe311d49a3029a2806993615f7 (patch) | |
tree | a02365a6eb268dce08941968e11e319f3a7fe080 /src/field_specials.c | |
parent | 1b33ad6c26fa83aa7b77055ddde59c61df03d0e4 (diff) |
Fix alloc.c as per #386, define INVALID_ constants and rename malloc to alloc as per #325
Some of the INVALID_ are likely erroneously placed, due to lack of documentation
Diffstat (limited to 'src/field_specials.c')
-rw-r--r-- | src/field_specials.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/field_specials.c b/src/field_specials.c index 4da751b27..629f2d0de 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -20,7 +20,7 @@ #include "link.h" #include "list_menu.h" #include "main.h" -#include "malloc.h" +#include "alloc.h" #include "match_call.h" #include "menu.h" #include "overworld.h" @@ -1957,12 +1957,12 @@ void sub_8139D98(void) bool32 warp0_in_pokecenter(void) { - static const u16 gUnknown_085B2C2A[] = { 0x0202, 0x0301, 0x0405, 0x0504, 0x0604, 0x0700, 0x0804, 0x090b, 0x0a05, 0x0b05, 0x0c02, 0x0d06, 0x0e03, 0x0f02, 0x100c, 0x100a, 0x1a35, 0x193c, 0xffff }; + static const u16 gUnknown_085B2C2A[] = { 0x0202, 0x0301, 0x0405, 0x0504, 0x0604, 0x0700, 0x0804, 0x090b, 0x0a05, 0x0b05, 0x0c02, 0x0d06, 0x0e03, 0x0f02, 0x100c, 0x100a, 0x1a35, 0x193c, INVALID_U16 }; int i; u16 map = (gLastUsedWarp.mapGroup << 8) + gLastUsedWarp.mapNum; - for (i = 0; gUnknown_085B2C2A[i] != 0xFFFF; i++) + for (i = 0; gUnknown_085B2C2A[i] != INVALID_U16; i++) { if (gUnknown_085B2C2A[i] == map) return TRUE; @@ -2946,10 +2946,10 @@ void sub_813AA44(void) static void sub_813AA60(u16 a0, u16 a1) { - static const u16 gUnknown_085B312C[] = { 0x004b, 0x0067, 0x0057, 0x004f, 0x0054, 0x0055, 0x0056, 0x0050, 0x0051, 0x0052, 0xffff }; - static const u16 gUnknown_085B3142[] = { 0x0071, 0x006f, 0x0072, 0x0073, 0x0074, 0xffff }; - static const u16 gUnknown_085B314E[] = { 0x0040, 0x0043, 0x0041, 0x0046, 0x0042, 0x003f, 0xffff }; - static const u16 gUnknown_085B315C[] = { 0x00c8, 0x00b4, 0x00b7, 0x00b9, 0x00b3, 0x00ba, 0x00bb, 0x00c4, 0x00c6, 0xffff }; + static const u16 gUnknown_085B312C[] = { 0x004b, 0x0067, 0x0057, 0x004f, 0x0054, 0x0055, 0x0056, 0x0050, 0x0051, 0x0052, INVALID_U16 }; + static const u16 gUnknown_085B3142[] = { 0x0071, 0x006f, 0x0072, 0x0073, 0x0074, INVALID_U16 }; + static const u16 gUnknown_085B314E[] = { 0x0040, 0x0043, 0x0041, 0x0046, 0x0042, 0x003f, INVALID_U16 }; + static const u16 gUnknown_085B315C[] = { 0x00c8, 0x00b4, 0x00b7, 0x00b9, 0x00b3, 0x00ba, 0x00bb, 0x00c4, 0x00c6, INVALID_U16 }; static const u8 *const gUnknown_085B3170[] = { BattleFrontier_BattlePointExchangeServiceCorner_Text_2601AA, @@ -3004,7 +3004,7 @@ static void sub_813AA60(u16 a0, u16 a1) { case 3: AddTextPrinterParameterized2(0, 1, gUnknown_085B3170[a1], 0, NULL, 2, 1, 3); - if (gUnknown_085B312C[a1] == 0xFFFF) + if (gUnknown_085B312C[a1] == INVALID_U16) { sub_813ABD4(gUnknown_085B312C[a1]); } @@ -3017,7 +3017,7 @@ static void sub_813AA60(u16 a0, u16 a1) break; case 4: AddTextPrinterParameterized2(0, 1, gUnknown_085B319C[a1], 0, NULL, 2, 1, 3); - if (gUnknown_085B3142[a1] == 0xFFFF) + if (gUnknown_085B3142[a1] == INVALID_U16) { sub_813ABD4(gUnknown_085B3142[a1]); } @@ -3841,13 +3841,13 @@ bool32 sub_813B9C0(void) MAP_TRADE_CENTER, MAP_RECORD_CORNER, MAP_DOUBLE_BATTLE_COLOSSEUM, - 0xffff + INVALID_U16 }; int i; u16 map = (gSaveBlock1Ptr->location.mapGroup << 8) + gSaveBlock1Ptr->location.mapNum; - for (i = 0; gUnknown_085B3444[i] != 0xFFFF; i++) + for (i = 0; gUnknown_085B3444[i] != INVALID_U16; i++) { if (gUnknown_085B3444[i] == map) { |