diff options
-rw-r--r-- | asm/field_map_obj.s | 19 | ||||
-rw-r--r-- | include/field_map_obj.h | 10 | ||||
-rw-r--r-- | include/global.h | 5 | ||||
-rw-r--r-- | ld_script.txt | 1 | ||||
-rw-r--r-- | src/field_map_obj.c | 23 |
5 files changed, 39 insertions, 19 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/field_map_obj.h b/include/field_map_obj.h new file mode 100644 index 000000000..ebc445794 --- /dev/null +++ b/include/field_map_obj.h @@ -0,0 +1,10 @@ +#ifndef POKEEMERALD_FIELD_MAP_OBJ_H +#define POKEEMERALD_FIELD_MAP_OBJ_H + +// Exported struct declarations + +// Exported RAM declarations + +// Exported ROM declarations + +#endif //POKEEMERALD_FIELD_MAP_OBJ_H 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 new file mode 100644 index 000000000..9451863b4 --- /dev/null +++ b/src/field_map_obj.c @@ -0,0 +1,23 @@ +// Includes + +#include "global.h" +#include "field_map_obj.h" + +// Static struct declarations + +// Static RAM declarations + +// Static ROM declarations + +// ROM data + +// 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; +} |