diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-09-06 08:46:47 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-09-06 08:46:47 -0400 |
commit | 83dbdc031856410b8b1b9154900cfcb5c069ec46 (patch) | |
tree | 5474f5788bcdd0b57ce7dfea05e66ce4945cfdda | |
parent | 63dd0ea397ff01787753f182541ed8324f2d498b (diff) |
npc_clear_ids_and_state
-rw-r--r-- | asm/field_map_obj.s | 19 | ||||
-rw-r--r-- | include/global.h | 5 | ||||
-rw-r--r-- | ld_script.txt | 1 | ||||
-rw-r--r-- | src/field_map_obj.c | 9 |
4 files changed, 14 insertions, 20 deletions
diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index ff3c8c48d..5801bbc5f 100644 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -5,25 +5,6 @@ .text - thumb_func_start npc_clear_ids_and_state -npc_clear_ids_and_state: @ 808D3F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x24 - bl memset - movs r0, 0xFF - strb r0, [r4, 0x8] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x9] - strb r0, [r4, 0xA] - strb r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - thumb_func_end npc_clear_ids_and_state - thumb_func_start npcs_clear_ids_and_state npcs_clear_ids_and_state: @ 808D410 push {r4,r5,lr} diff --git a/include/global.h b/include/global.h index c43b57e03..f9c5f68be 100644 --- a/include/global.h +++ b/include/global.h @@ -9,6 +9,11 @@ // to help in decompiling #define asm_comment(x) asm volatile("@ -- " x " -- ") +#ifdef __APPLE__ +void memset(void *, int, size_t); +void memcpy(void *, const void *, size_t); +#endif // __APPLE__ + #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) #define POKEMON_NAME_LENGTH 10 diff --git a/ld_script.txt b/ld_script.txt index d0ae744d1..6e9a7e63c 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -85,6 +85,7 @@ SECTIONS { asm/field_camera.o(.text); asm/field_door.o(.text); asm/field_player_avatar.o(.text); + src/field_map_obj.o(.text); asm/field_map_obj.o(.text); asm/field_ground_effect.o(.text); asm/map_obj_8097404.o(.text); diff --git a/src/field_map_obj.c b/src/field_map_obj.c index ec9a7c002..9451863b4 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -13,4 +13,11 @@ // Code - +void npc_clear_ids_and_state(struct MapObject *mapObject) +{ + memset(mapObject, 0, sizeof(struct MapObject)); + mapObject->localId = 0xFF; + mapObject->mapNum = -1; + mapObject->mapGroup = -1; + mapObject->mapobj_unk_1C = -1; +} |