Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mike8699 committed May 27, 2022
1 parent 8bce5d8 commit cb4e0e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 12 additions & 10 deletions base/src/get_npc_model_offset.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#include <stdint.h>

uint32_t get_npc_model_offset(uint32_t item_id) {
// These values are offsets that are used to calculate the char* that contains the name of the .bin
// file (see: Npc/ directory in the rom) of the NPC being spawned. The exact way it is used is:
// char *npc = 20ddf40 + (<return_value> * 0xC)
switch (item_id) {
case 0x1: // key
return 0xC;
case 0x3: // oshus sword
return 0xE3;
}
// TODO: calculate values for rest of items
// These values are offsets that are used to calculate the char* that contains
// the name of the .bin
// file (see: Npc/ directory in the rom) of the NPC being spawned. The exact
// way it is used is:
// char *npc = 20ddf40 + (<return_value> * 0xC)
switch (item_id) {
case 0x1: // key
return 0xC;
case 0x3: // oshus sword
return 0xE3;
}
// TODO: calculate values for rest of items
}
4 changes: 2 additions & 2 deletions base/src/spawn_custom_freestanding_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
static uint16_t get_item_id() {
uint16_t *item_id_address;
// Pull the base address of the NPCA entry's item_id off of the stack.
// This value is set in the NPCA section of the
// This value is set in the NPCA section of the
// ZMB file in byte 0xC of an ITGE actor.
asm volatile("ldr %0, [sp, #0x4]" : "=r"(item_id_address) :);
// return the item id
Expand All @@ -25,7 +25,7 @@ uint16_t spawn_custom_freestanding_item(void *param_1, uint32_t npc_type,
(void *)0x20C3FE8;

uint16_t item_id = get_item_id();

*param_4 = item_id;
return (*spawn_npc)(param_1, npc_type, param_3, param_4);
}

0 comments on commit cb4e0e2

Please sign in to comment.