diff --git a/asm/gzip/gzip_inflate_block.s b/asm/gzip/gzip_inflate_block.s index 0eba9367..023336a9 100644 --- a/asm/gzip/gzip_inflate_block.s +++ b/asm/gzip/gzip_inflate_block.s @@ -1,4 +1,4 @@ -glabel gzip_inflate_block +glabel gzip_inflate_block /* Official name: inflate_block */ /* 0C74C0 800C68C0 3C0B8013 */ lui $t3, %hi(gzip_num_bits) # $t3, 0x8013 /* 0C74C4 800C68C4 8D6BAAD4 */ lw $t3, %lo(gzip_num_bits)($t3) /* 0C74C8 800C68C8 3C018013 */ lui $at, %hi(D_8012AAD8) # $at, 0x8013 diff --git a/asm/gzip/gzip_inflate_codes.s b/asm/gzip/gzip_inflate_codes.s index 017c4fb8..bb6c0f43 100644 --- a/asm/gzip/gzip_inflate_codes.s +++ b/asm/gzip/gzip_inflate_codes.s @@ -1,4 +1,4 @@ -glabel gzip_inflate_codes +glabel gzip_inflate_codes /* Official name: inflate_codes */ /* 0C7C40 800C7040 27BDFFF0 */ addiu $sp, $sp, -0x10 /* 0C7C44 800C7044 3C0B800F */ lui $t3, %hi(gzip_mask_bits) # $t3, 0x800f /* 0C7C48 800C7048 AFB20008 */ sw $s2, 8($sp) diff --git a/asm/gzip/gzip_inflate_dynamic.s b/asm/gzip/gzip_inflate_dynamic.s index 9d646209..bd2abca5 100644 --- a/asm/gzip/gzip_inflate_dynamic.s +++ b/asm/gzip/gzip_inflate_dynamic.s @@ -1,4 +1,4 @@ -glabel gzip_inflate_dynamic +glabel gzip_inflate_dynamic /* Official name: inflate_dynamic */ /* 0C75C4 800C69C4 27BDFAC0 */ addiu $sp, $sp, -0x540 /* 0C75C8 800C69C8 AFB30028 */ sw $s3, 0x28($sp) /* 0C75CC 800C69CC 3C138013 */ lui $s3, %hi(gzip_num_bits) # $s3, 0x8013 diff --git a/asm/gzip/gzip_inflate_fixed.s b/asm/gzip/gzip_inflate_fixed.s index a23f6294..1a1b4cd2 100644 --- a/asm/gzip/gzip_inflate_fixed.s +++ b/asm/gzip/gzip_inflate_fixed.s @@ -1,4 +1,4 @@ -glabel gzip_inflate_fixed +glabel gzip_inflate_fixed /* Official name: inflate_fixed */ /* 0C79DC 800C6DDC 27BDFAD0 */ addiu $sp, $sp, -0x530 /* 0C79E0 800C6DE0 AFBF001C */ sw $ra, 0x1c($sp) /* 0C79E4 800C6DE4 23AB0044 */ addi $t3, $sp, 0x44 diff --git a/asm/gzip/gzip_inflate_stored.s b/asm/gzip/gzip_inflate_stored.s index 47aca107..38ad522e 100644 --- a/asm/gzip/gzip_inflate_stored.s +++ b/asm/gzip/gzip_inflate_stored.s @@ -1,4 +1,4 @@ -glabel gzip_inflate_stored +glabel gzip_inflate_stored /* Official name: inflate_stored */ /* 0C7B34 800C6F34 3C0D8013 */ lui $t5, %hi(gzip_num_bits) # $t5, 0x8013 /* 0C7B38 800C6F38 8DADAAD4 */ lw $t5, %lo(gzip_num_bits)($t5) /* 0C7B3C 800C6F3C 3C0C8013 */ lui $t4, %hi(gzip_bit_buffer) # $t4, 0x8013 diff --git a/asm/math_util/clear_status_register_flags.s b/asm/math_util/clear_status_register_flags.s index d0296317..05ae352e 100644 --- a/asm/math_util/clear_status_register_flags.s +++ b/asm/math_util/clear_status_register_flags.s @@ -1,4 +1,4 @@ -glabel clear_status_register_flags +glabel clear_status_register_flags /* Official name: disableInterrupts */ /* 070110 8006F510 3C08800E */ lui $t0, %hi(D_800DD430) # $t0, 0x800e /* 070114 8006F514 8108D430 */ lb $t0, %lo(D_800DD430)($t0) /* 070118 8006F518 11000006 */ beqz $t0, .L8006F534 diff --git a/asm/math_util/coss.s b/asm/math_util/coss.s index b3de160e..ae17eebc 100644 --- a/asm/math_util/coss.s +++ b/asm/math_util/coss.s @@ -1,6 +1,6 @@ glabel coss /* 07142C 8007082C 24844000 */ addiu $a0, $a0, 0x4000 -glabel sins +glabel sins /* Official name: mathSinInterp */ /* 071430 80070830 00041440 */ sll $v0, $a0, 0x11 /* 071434 80070834 04430003 */ bgezl $v0, .L80070844 /* 071438 80070838 000450C2 */ srl $t2, $a0, 3 diff --git a/asm/math_util/set_status_register_flags.s b/asm/math_util/set_status_register_flags.s index 4631b581..092d2480 100644 --- a/asm/math_util/set_status_register_flags.s +++ b/asm/math_util/set_status_register_flags.s @@ -1,4 +1,4 @@ -glabel set_status_register_flags +glabel set_status_register_flags /* Official name: enableInterrupts */ /* 07013C 8006F53C 3C08800E */ lui $t0, %hi(D_800DD430) # $t0, 0x800e /* 070140 8006F540 8108D430 */ lb $t0, %lo(D_800DD430)($t0) /* 070144 8006F544 11000005 */ beqz $t0, .L8006F55C # Identical to __osRestoreInt below this line diff --git a/asm/math_util/sins_2.s b/asm/math_util/sins_2.s index eb1128e0..ece436a5 100644 --- a/asm/math_util/sins_2.s +++ b/asm/math_util/sins_2.s @@ -1,6 +1,6 @@ glabel coss_2 /* 07148C 8007088C 24844000 */ addiu $a0, $a0, 0x4000 -glabel sins_2 +glabel sins_2 /* Official name: mathSin */ /* 071490 80070890 00041440 */ sll $v0, $a0, 0x11 /* 071494 80070894 04430003 */ bgezl $v0, .L800708A4 /* 071498 80070898 000450C2 */ srl $t2, $a0, 3 diff --git a/asm/non_matchings/printf/render_printf.s b/asm/non_matchings/printf/render_printf.s index f8e34e5f..6580cb4f 100644 --- a/asm/non_matchings/printf/render_printf.s +++ b/asm/non_matchings/printf/render_printf.s @@ -1,4 +1,4 @@ -glabel render_printf +glabel render_printf /* official name: diPrintf */ /* 0B6ADC 800B5EDC 3C0E8013 */ lui $t6, %hi(gDebugPrintBufferEnd) # $t6, 0x8013 /* 0B6AE0 800B5EE0 8DCE85D8 */ lw $t6, %lo(gDebugPrintBufferEnd)($t6) /* 0B6AE4 800B5EE4 27BDFFE0 */ addiu $sp, $sp, -0x20 diff --git a/include/libc/math.h b/include/libc/math.h index 8cea459b..1586b056 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -3,7 +3,7 @@ #define M_PI 3.14159265358979323846 -float sinf(float); +float sinf(float); //official name: fsin double sin(double); float cosf(float); double cos(double); diff --git a/lib/asm/bcopy.s b/lib/asm/bcopy.s index 0ede373b..9eec765e 100644 --- a/lib/asm/bcopy.s +++ b/lib/asm/bcopy.s @@ -7,7 +7,7 @@ .set noreorder # dont insert nops after branches .set gp=64 # 64-bit instructions are used -glabel bcopy +glabel bcopy /* Official name: _bcopy */ /* 0CA9A0 800C9DA0 10C0001A */ beqz $a2, .L800C9E0C /* 0CA9A4 800C9DA4 00A03825 */ move $a3, $a1 /* 0CA9A8 800C9DA8 10850018 */ beq $a0, $a1, .L800C9E0C diff --git a/lib/asm/bzero.s b/lib/asm/bzero.s index 81481b1a..863d1e19 100644 --- a/lib/asm/bzero.s +++ b/lib/asm/bzero.s @@ -7,7 +7,7 @@ .set noreorder # dont insert nops after branches .set gp=64 # 64-bit instructions are used -glabel bzero +glabel bzero /* Official name: _blkclr */ /* 0D10E0 800D04E0 28A1000C */ slti $at, $a1, 0xc /* 0D10E4 800D04E4 1420001D */ bnez $at, .L800D055C /* 0D10E8 800D04E8 00041823 */ negu $v1, $a0 diff --git a/lib/src/libc/rmonPrintf.c b/lib/src/libc/rmonPrintf.c index 6c23cd91..39f898fc 100644 --- a/lib/src/libc/rmonPrintf.c +++ b/lib/src/libc/rmonPrintf.c @@ -18,6 +18,7 @@ static char *is_proutSyncPrintf(UNUSED char *str, UNUSED const char *buf, UNUSED * Like sprintf, but simpler. It just hardcodes NULL for the dst, * and calls a function that just hardcodes a fake pointer. * Could still be an earlier version of osSyncPrintf + * Official name: osSyncPrintf */ void rmonPrintf(const char *format, ...) { va_list args; diff --git a/lib/src/os/osMotor.c b/lib/src/os/osMotor.c index 3a9ca083..b21e8c59 100644 --- a/lib/src/os/osMotor.c +++ b/lib/src/os/osMotor.c @@ -14,6 +14,7 @@ OSPifRam _MotorStopData[MAXCONTROLLERS]; OSPifRam _MotorStartData[MAXCONTROLLERS]; u8 _motorstopbuf[BLOCKSIZE]; u8 _motorstartbuf[BLOCKSIZE]; +/* Official name: nosMotorStop */ s32 osMotorStop(OSPfs *pfs) { int i; s32 ret; @@ -97,6 +98,7 @@ static void _MakeMotorData(int channel, u16 address, u8 *buffer, OSPifRam *mdata ptr[0] = CONT_CMD_END; } +/* Official name: nosMotorInit */ s32 osMotorInit(OSMesgQueue *mq, OSPfs *pfs, int channel) { int i; s32 ret; diff --git a/src/asset_loading.c b/src/asset_loading.c index a4c0da91..34cc2e47 100644 --- a/src/asset_loading.c +++ b/src/asset_loading.c @@ -63,6 +63,7 @@ u32 *load_asset_section_from_rom(u32 assetIndex) { /** * Loads a gzip compressed asset from the ROM file. * Returns a pointer to the decompressed data. + * Official name: piRomLoadCompressed */ UNUSED u8 *load_compressed_asset_from_rom(u32 assetIndex, s32 extraMemory) { s32 size; @@ -115,6 +116,7 @@ UNUSED s32 load_asset_section_from_rom_to_address(u32 assetIndex, u32 address) { /** * Loads part of an asset section to a specific memory address. * Returns the size argument. + * Official name: piRomLoadSection */ s32 load_asset_to_address(u32 assetIndex, u32 address, s32 assetOffset, s32 size) { u32 *index; @@ -133,6 +135,7 @@ s32 load_asset_to_address(u32 assetIndex, u32 address, s32 assetOffset, s32 size /** * Returns a rom offset of an asset given its asset section and a local offset. + * Official name: piRomGetSectionPtr */ u8 *get_rom_offset_of_asset(u32 assetIndex, u32 assetOffset) { u32 *index; @@ -150,6 +153,7 @@ u8 *get_rom_offset_of_asset(u32 assetIndex, u32 assetOffset) { /** * Returns the size of an asset section. + * Official name: piRomGetFileSize */ s32 get_size_of_asset_section(u32 assetIndex) { u32 *index; @@ -167,6 +171,7 @@ s32 get_size_of_asset_section(u32 assetIndex) { /** * Copies data from the game cartridge to a ram address. + * Official name: romCopy */ void dmacopy(u32 romOffset, u32 ramAddress, s32 numBytes) { OSMesg dmaMesg; diff --git a/src/camera.c b/src/camera.c index 0a0753bf..b37ebac7 100644 --- a/src/camera.c +++ b/src/camera.c @@ -480,6 +480,7 @@ void camDisableUserView(s32 viewPortIndex, s32 arg1) { /** * Return's the current viewport's flag status for extended backgrounds. * Required to draw some extra things used in menus. + * Official name: camIsUserView */ s32 check_viewport_background_flag(s32 viewPortIndex) { return gScreenViewports[viewPortIndex].flags & VIEWPORT_EXTRA_BG; @@ -543,6 +544,7 @@ void resize_viewport(s32 viewPortIndex, s32 x1, s32 y1, s32 x2, s32 y2) { /** * Set the selected viewport's coordinate offsets and view size. * If you pass VIEWPORT_AUTO through, then the property will be automatically set when the game creates the viewports. + * Official name: camSetUserViewSpecial */ void set_viewport_properties(s32 viewPortIndex, s32 posX, s32 posY, s32 width, s32 height) { if (posX != VIEWPORT_AUTO) { @@ -576,6 +578,7 @@ void set_viewport_properties(s32 viewPortIndex, s32 posX, s32 posY, s32 width, s /** * Sets the passed values to be equal to the selected viewports scissor size, before drawing the background elements. * Usually, this is the same size as the viewport's size. + * Official name: camGetVisibleUserView */ s32 copy_viewport_background_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, s32 *x2, s32 *y2) { //gDPFillRectangle values @@ -591,6 +594,7 @@ s32 copy_viewport_background_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, /** * Sets the passed values to the coordinate size of the passed viewport. + * Official name: camGetUserView */ void copy_viewport_frame_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, s32 *x2, s32 *y2) { *x1 = gScreenViewports[viewPortIndex].x1; @@ -1410,6 +1414,7 @@ GLOBAL_ASM("asm/non_matchings/camera/func_8006A1C4.s") /** * Set the first 4 player ID's to the controller numbers, so players can input in the menus after boot. + * Official name: joyResetMap */ void initialise_player_ids(void) { s32 i; @@ -1421,6 +1426,7 @@ void initialise_player_ids(void) { /** * Assign the first four player ID's to the index of the connected players. * Assign the next four player ID's to the index of the players who are not connected. + * Official name: joyCreateMap */ void assign_player_ids(s8 *activePlayers) { s32 i; @@ -1439,6 +1445,7 @@ void assign_player_ids(s8 *activePlayers) { /** * Returns the id of the selected index. + * Official name: joyGetController */ u8 get_player_id(s32 player) { return sPlayerID[player]; @@ -1456,6 +1463,7 @@ void swap_player_1_and_2_ids(void) { /** * Returns the buttons that are currently pressed down on the controller. + * Official name: joyGetButtons */ u16 get_buttons_held_from_player(s32 player) { return sControllerData[sPlayerID[player]].button; diff --git a/src/camera.h b/src/camera.h index f4669c32..1df7cf4d 100644 --- a/src/camera.h +++ b/src/camera.h @@ -44,7 +44,7 @@ enum ViewportCount { }; enum ViewPortFlags { - VIEWPORT_EXTRA_BG = 0x0001, + VIEWPORT_EXTRA_BG = 0x0001, //official name (guessed): VIEWPORT_IS_USER_VIEW VIEWPORT_UNK_02 = 0x0002, VIEWPORT_UNK_04 = 0x0004, VIEWPORT_X_CUSTOM = 0x0008, diff --git a/src/game.c b/src/game.c index 324c4a9d..9f62f169 100644 --- a/src/game.c +++ b/src/game.c @@ -672,6 +672,7 @@ s32 func_8006BD88(void) { /** * Return the race type ID of the current level. + * Official name: levelGetType */ u8 get_current_level_race_type(void) { return gCurrentLevelHeader->race_type; @@ -1881,6 +1882,7 @@ s8 is_postrace_viewport_active(void) { /** * Sets and returns (nonzero) the message set when pressing the reset button. + * Official name: mainResetPressed */ s32 is_reset_pressed(void) { if (gNMIMesgBuf[0] == 0) { @@ -2107,6 +2109,7 @@ void pre_intro_loop(void) { /** * Returns TRUE if the game doesn't detect any controllers. + * Official name: mainDemoOnly */ s32 is_controller_missing(void) { if (sControllerStatus == CONTROLLER_MISSING) { diff --git a/src/gzip.c b/src/gzip.c index b69659cb..c4b60699 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -29,6 +29,8 @@ void rzipInit(void) { /** * Converts a little endian value to big endian. + * Official name: rzipUncompressSize + * (so, this probably expects a gzip header) */ s32 byteswap32(u8 *arg0) { s32 value; @@ -41,6 +43,7 @@ s32 byteswap32(u8 *arg0) { /** * Returns the uncompressed size of a gzip compressed asset. + * Official name: rzipUncompressSizeROM */ s32 get_asset_uncompressed_size(s32 assetIndex, s32 assetOffset) { load_asset_to_address(assetIndex, (u32) gAssetAddress, assetOffset, 8); @@ -50,6 +53,7 @@ s32 get_asset_uncompressed_size(s32 assetIndex, s32 assetOffset) { /** * Decompresses gzip data. * Returns the pointer to the decompressed data. + * Official name: rzipUncompress */ u8 *gzip_inflate(u8 *compressedInput, u8 *decompressedOutput) { gzip_inflate_input = compressedInput + 5; // The compression header is 5 bytes. @@ -60,6 +64,7 @@ u8 *gzip_inflate(u8 *compressedInput, u8 *decompressedOutput) { return decompressedOutput; } +/* Official name: huft_build */ void gzip_huft_build(u32 *b, u32 n, u32 s, u16 *d, u16 *e, huft **t, s32 *m) { u32 a; /* counter for codes of length k */ u32 c[BMAX+1]; /* bit length count table */ diff --git a/src/main.c b/src/main.c index 56aad644..8d48ddd4 100644 --- a/src/main.c +++ b/src/main.c @@ -21,6 +21,7 @@ UNUSED u64 gUnusedThreadStack[0x200]; //Thread1 stack? * Where it all begins. * Once the boot procedure is finished in IPL3, this function is run. * It kicks things off by initialising thread1, which serves as the top level + * Official name: boot */ void main(void) { osInitialize(); @@ -32,6 +33,7 @@ void main(void) { * Initialise the crash handler thread, then initialise the main game thread. * Reset the start and endpoint of the game thread stack, then set thread priority to zero, effectively * stopping this thread, as it's no longer needed. + * Official name: main */ void thread1_main(UNUSED void *unused) { thread0_create(); diff --git a/src/math_util.c b/src/math_util.c index 98a9d834..3df85705 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -60,6 +60,7 @@ GLOBAL_ASM("asm/math_util/f32_matrix_to_s32_matrix.s") #endif #ifdef NON_MATCHING +/* Official name: mathMtxXFMF */ void guMtxXFMF(Matrix mf, float x, float y, float z, float *ox, float *oy, float *oz) { *ox = mf[0][0]*x + mf[1][0]*y + mf[2][0]*z + mf[3][0]; *oy = mf[0][1]*x + mf[1][1]*y + mf[2][1]*z + mf[3][1]; @@ -70,6 +71,7 @@ GLOBAL_ASM("asm/math_util/guMtxXFMF.s") #endif #ifdef NON_EQUIVALENT +/* Official name: mathMtxFastXFMF */ void f32_matrix_dot(Matrix *mat1, Matrix *mat2, Matrix *output) { (*output)[0][0] = ((*mat2)[0][0] * (*mat1)[0][0]) + ((*mat2)[0][1] * (*mat1)[1][0]) + ((*mat2)[0][2] * (*mat1)[2][0]); (*output)[0][1] = ((*mat2)[0][0] * (*mat1)[0][1]) + ((*mat2)[0][1] * (*mat1)[1][1]) + ((*mat2)[0][2] * (*mat1)[2][1]); @@ -80,6 +82,7 @@ GLOBAL_ASM("asm/math_util/f32_matrix_dot.s") #endif #ifdef NON_EQUIVALENT +/* Official name: mathMtxCatF */ void f32_matrix_mult(Matrix *mat1, Matrix *mat2, Matrix *output) { s32 i; for(i = 0; i < 4; i++) { @@ -94,6 +97,7 @@ GLOBAL_ASM("asm/math_util/f32_matrix_mult.s") #endif #ifdef NON_EQUIVALENT +/* Official name: mathMtxF2L */ void f32_matrix_to_s16_matrix(Matrix *input, MatrixS *output) { s32 temp_f10; s32 temp_f4; @@ -141,6 +145,7 @@ s32 get_rng_seed(void) { GLOBAL_ASM("asm/math_util/rng.s") #ifdef NON_EQUIVALENT +/* Official name: fastShortReflection(?) */ void s16_matrix_rotate(s16 *arg0[4][4], s16 arg1[4][4]) { s32 temp_t6; @@ -227,6 +232,7 @@ GLOBAL_ASM("asm/math_util/object_transform_to_matrix.s") #endif #ifdef NON_MATCHING +/* Official name: mathSquashY(?) */ void f32_matrix_scale(Matrix *input, f32 scale) { input[0][1][0] *= scale; input[0][1][1] *= scale; @@ -237,6 +243,7 @@ GLOBAL_ASM("asm/math_util/f32_matrix_scale.s") #endif #ifdef NON_MATCHING +/* Official name: mathTransY(?) */ void f32_matrix_y_scale(Matrix *input, f32 scale) { input[0][3][0] += input[0][1][0] * scale; input[0][3][1] += input[0][1][1] * scale; diff --git a/src/memory.c b/src/memory.c index 56bac0d4..59ad5aaf 100644 --- a/src/memory.c +++ b/src/memory.c @@ -60,6 +60,7 @@ void init_main_memory_pool(void) { /** * Creates a new memory pool that is sectioned off the main one. + * Official name: mmAllocRegion */ MemoryPoolSlot *new_sub_memory_pool(s32 poolDataSize, s32 numSlots) { s32 size; @@ -178,6 +179,7 @@ MemoryPoolSlot *allocate_from_memory_pool(s32 poolIndex, s32 size, u32 colourTag return 0; } +/* Official name: mmAllocR */ void *allocate_from_pool_containing_slots(MemoryPoolSlot *slots, s32 size) { s32 i; for (i = gNumberOfMemoryPools; i != 0; i--) { @@ -228,6 +230,7 @@ void *allocate_at_address_in_main_pool(s32 size, u8 *address, u32 colorTag) { /** * Sets the state of the free queue. State is either 0, 1, or 2. * The free queue will get flushed if the state is set to 0. + * Official name: mmSetDelay */ void set_free_queue_state(s32 state) { s32 *flags = clear_status_register_flags(); @@ -278,6 +281,7 @@ void clear_free_queue(void) { set_status_register_flags(flags); } +/* Official name: heapFree */ void free_slot_containing_address(u8 *address) { s32 slotIndex; s32 poolIndex; @@ -390,6 +394,7 @@ s32 func_80071538(u8 *address) { /** * Returns the index of the memory pool containing the memory address. + * Official(?) name: getHeapIdxOf */ s32 get_memory_pool_index_containing_address(u8 *address) { s32 i; @@ -495,6 +500,7 @@ s32 allocate_memory_pool_slot(s32 poolIndex, s32 slotIndex, s32 size, s32 slotIs /** * Returns the passed in address aligned to the next 16-byte boundary. + * Official name: mmAlign16 */ u8 *align16(u8 *address) { s32 remainder = (s32)address & 0xF; @@ -507,6 +513,7 @@ u8 *align16(u8 *address) { /** * Returns the passed in address aligned to the next 8-byte boundary. * Unused. + * Official name: mmAlign8 */ u8 *align8(u8 *address) { s32 remainder = (s32)address & 0x7; @@ -519,6 +526,7 @@ u8 *align8(u8 *address) { /** * Returns the passed in address aligned to the next 4-byte boundary. * Unused. + * Official name: mmAlign4 */ u8 *align4(u8 *address) { s32 remainder = (s32)address & 0x3; diff --git a/src/object_functions.c b/src/object_functions.c index d4295278..3a7b1736 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -1338,6 +1338,7 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 updateRate) { } } +/* Offical name: animInit */ void obj_init_animator(Object *obj, LevelObjectEntry_Animator *entry, s32 arg2) { Object_Animator *obj64; LevelModel *levelModel; @@ -3332,6 +3333,7 @@ void obj_init_seamonster(UNUSED Object *obj, UNUSED LevelObjectEntry_SeaMonster void obj_loop_seamonster(UNUSED Object *obj, UNUSED s32 updateRate) { } +/* Official name: fogInit(?) */ void obj_init_fogchanger(Object *obj, LevelObjectEntry_FogChanger *entry) { f32 temp_f0; temp_f0 = entry->unk8 * 8.0f; @@ -4340,6 +4342,7 @@ void obj_init_audio(Object *obj, LevelObjectEntry_Audio *entry) { gParticlePtrList_addObject(obj); } +/* Official name: audioLineInit */ void obj_init_audioline(Object *obj, LevelObjectEntry_AudioLine *entry) { Object_AudioLine *obj64; @@ -4372,6 +4375,7 @@ void obj_init_audioreverb(Object *obj, LevelObjectEntry_AudioReverb *entry) { gParticlePtrList_addObject(obj); } +/* Official name: texscrollInit */ void obj_init_texscroll(Object *obj, LevelObjectEntry_TexScroll *entry, s32 arg2) { Object_TexScroll *obj64; LevelModel *levelModel; @@ -4397,6 +4401,7 @@ void obj_init_texscroll(Object *obj, LevelObjectEntry_TexScroll *entry, s32 arg2 GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_texscroll.s") +/* Official name: rgbalightInit */ void obj_init_rgbalight(Object *obj, LevelObjectEntry_RgbaLight *entry, UNUSED s32 arg2) { obj->unk64 = func_80031CAC(obj, entry); } @@ -4504,6 +4509,7 @@ void obj_loop_log(Object *obj, s32 updateRate) { obj->unk5C->unk100 = NULL; } +/* Official name: weatherInit */ void obj_init_weather(Object *obj, LevelObjectEntry_Weather *entry) { f32 temp = entry->unk8; temp *= temp; @@ -4684,6 +4690,7 @@ void obj_init_midichset(Object *obj, LevelObjectEntry_Midichset *entry) { temp->unk3 = entry->unkB; } +/* Official name: bubblerInit */ void obj_init_bubbler(Object *obj, LevelObjectEntry_Bubbler *entry) { func_800AF134((Particle *) obj->unk6C, entry->unk9, entry->unk8, 0, 0, 0); obj->unk78 = entry->unkA; @@ -4714,6 +4721,7 @@ void obj_loop_unknown94(UNUSED Object *obj, s32 UNUSED updateRate) { void obj_init_rangetrigger(UNUSED Object *obj, UNUSED LevelObjectEntry_RangeTrigger *entry) { } +/* Official name: rangetriggerControl */ void obj_loop_rangetrigger(Object *obj, s32 updateRate) { UNUSED s32 temp; LevelObjectEntry_RangeTrigger *level_entry; diff --git a/src/objects.c b/src/objects.c index 838ee613..fa1b8eee 100644 --- a/src/objects.c +++ b/src/objects.c @@ -762,6 +762,7 @@ GLOBAL_ASM("asm/non_matchings/objects/func_8000E898.s") /** * Returns the object at the current offset by ID. + * Official name: objGetObject */ Object *get_object(s32 index) { if (index < 0 || index >= objCount) { @@ -2136,6 +2137,7 @@ GLOBAL_ASM("asm/non_matchings/objects/func_8001D4B4.s") /** * Take the normalised length of the position set by the perspective and set the world angle for the envmap. + * Official name: setObjectViewNormal */ void update_envmap_position(f32 x, f32 y, f32 z) { f32 vecLength = sqrtf((x * x) + (y * y) + (z * z)); @@ -2192,6 +2194,7 @@ GLOBAL_ASM("asm/non_matchings/objects/func_8001E13C.s") /** * Returns a pointer to the asset in the misc. section. If index is out of range, then this * function just returns the pointer to gAssetsMiscSection. + * Official name: objGetTable */ s32 *get_misc_asset(s32 index) { if (index < 0 || index >= gAssetsMiscTableLength) { diff --git a/src/printf.c b/src/printf.c index e31e066f..63def063 100644 --- a/src/printf.c +++ b/src/printf.c @@ -135,9 +135,11 @@ void func_800B4A08(s32 arg0) { D_800E2EF0 = arg0; } -void func_800B4A14(char *s, char *format, ...) { +/* Official name: sprintf(?) */ +UNUSED void func_800B4A14(char *s, char *format, ...) { va_list args; va_start(args, format); + //!@bug Should be calling vsprintf here. sprintf(s, format, args); va_end(args); } @@ -229,6 +231,7 @@ void set_render_printf_background_colour(u8 red, u8 green, u8 blue, u8 alpha) { /** * Sets the character position of further prints to the given coordinates. + * Official name: diPrintfSetXY */ void set_render_printf_position(u16 x, u16 y) { RENDER_PRINTF_CMD_SET_POSITION(x, y) diff --git a/src/save_data.c b/src/save_data.c index b2d89b8a..65d47a43 100644 --- a/src/save_data.c +++ b/src/save_data.c @@ -1547,6 +1547,7 @@ SIDeviceStatus func_800756D4(s32 controllerIndex, u8 *arg1, u8 *arg2, u8 *arg3, return ret; } +/* Official name: packOpen */ SIDeviceStatus get_si_device_status(s32 controllerIndex) { OSMesg unusedMsg; s32 ret; @@ -1603,6 +1604,7 @@ SIDeviceStatus get_si_device_status(s32 controllerIndex) { return NO_CONTROLLER_PAK; } +/* Official name: packClose */ s32 start_reading_controller_data(UNUSED s32 controllerIndex) { osContStartReadData(sControllerMesgQueue); return 0; @@ -1657,6 +1659,7 @@ void init_controller_paks(void) { osContStartReadData(sControllerMesgQueue); } +/* Official name: packIsPresent */ UNUSED SIDeviceStatus check_for_rumble_pak(s32 controllerIndex) { s32 ret; @@ -1671,6 +1674,7 @@ UNUSED SIDeviceStatus check_for_rumble_pak(s32 controllerIndex) { } //Inspects and repairs the Controller Pak's file system +/* Official name: packRepair */ SIDeviceStatus repair_controller_pak(s32 controllerIndex) { s32 ret; s32 status = get_si_device_status(controllerIndex); @@ -1691,6 +1695,7 @@ SIDeviceStatus repair_controller_pak(s32 controllerIndex) { } //Reformat Controller Pak +/* Official name: packFormat */ SIDeviceStatus reformat_controller_pak(s32 controllerIndex) { s32 ret; s32 status = get_si_device_status(controllerIndex); @@ -1910,6 +1915,7 @@ s32 copy_controller_pak_data(s32 controllerIndex, s32 fileNumber, s32 secondCont // s32 fileType; // u8 game_name[PFS_FILE_NAME_LEN]; // } fileStruct; +/* Official name: packOpenFile */ SIDeviceStatus get_file_number(s32 controllerIndex, char *fileName, char *fileExt, s32 *fileNumber) { u32 gameCode; char fileNameAsFontCodes[PFS_FILE_NAME_LEN]; @@ -1950,6 +1956,7 @@ SIDeviceStatus get_file_number(s32 controllerIndex, char *fileName, char *fileEx return CONTROLLER_PAK_BAD_DATA; } +/* Official name: packReadFile */ SIDeviceStatus read_data_from_controller_pak(s32 controllerIndex, s32 fileNum, u8 *data, s32 dataLength) { s32 readResult = osPfsReadWriteFile(&pfs[controllerIndex], fileNum, PFS_READ, 0, dataLength, data); @@ -1973,6 +1980,7 @@ SIDeviceStatus read_data_from_controller_pak(s32 controllerIndex, s32 fileNum, u } //If fileNumber -1, it creates a new file? +/* Official name: packWriteFile */ SIDeviceStatus write_controller_pak_file(s32 controllerIndex, s32 fileNumber, char *fileName, char *fileExt, u8 *dataToWrite, s32 fileSize) { s32 temp; u8 fileNameAsFontCodes[PFS_FILE_NAME_LEN]; @@ -2048,6 +2056,7 @@ SIDeviceStatus write_controller_pak_file(s32 controllerIndex, s32 fileNumber, ch } //Get File size for given controller's Control Pak +/* Official name: packFileSize */ SIDeviceStatus get_file_size(s32 controllerIndex, s32 fileNum, s32 *fileSize) { OSPfsState state; diff --git a/src/set_rsp_segment.c b/src/set_rsp_segment.c index b5b688f3..d958c48d 100644 --- a/src/set_rsp_segment.c +++ b/src/set_rsp_segment.c @@ -9,6 +9,7 @@ /** * Set the offset for the given address, so the RSP can get the correct physical address. * This is used for the colour and depth buffers. + * Official(?) name: segSetBase */ void set_rsp_segment(Gfx **dlist, s32 segment, s32 base) { gSPSegment((*dlist)++, segment, base + K0BASE) diff --git a/src/textures_sprites.c b/src/textures_sprites.c index beff2a34..9a389378 100644 --- a/src/textures_sprites.c +++ b/src/textures_sprites.c @@ -1466,6 +1466,7 @@ GLOBAL_ASM("asm/non_matchings/textures_sprites/func_8007CA68.s") #ifdef NON_EQUIVALENT // andi 0xff instead of a simple mov for j = i. s32 doesn't work. +/* Official name: texFreeSprite */ void free_sprite(Sprite *sprite) { s32 i; u8 j; @@ -1595,6 +1596,7 @@ void func_8007F1E8(unk8007F1E8 *arg0) { GLOBAL_ASM("asm/non_matchings/textures_sprites/func_8007F24C.s") +/* Official name: resetMixCycle */ void init_pulsating_light_data(PulsatingLightData *data) { s32 i; data->currentFrame = 0; diff --git a/src/thread0_epc.c b/src/thread0_epc.c index 9076acd8..53a1737c 100644 --- a/src/thread0_epc.c +++ b/src/thread0_epc.c @@ -224,6 +224,7 @@ s32 get_lockup_status(void) { return sLockupStatus; } +/* Official name: diCpuTraceTick */ void lockup_screen_loop(s32 updateRate) { sLockupDelay += updateRate; if (sLockupDelay > 60) { diff --git a/src/unknown_0255E0.c b/src/unknown_0255E0.c index 7d4666f4..d6267173 100644 --- a/src/unknown_0255E0.c +++ b/src/unknown_0255E0.c @@ -1102,6 +1102,7 @@ s32 get_inside_segment_count_xz(s32 x, s32 z, s32 *arg2) { /** * Carbon copy of the above function, but takes into account the Y axis, too. + * Official name: trackGetCubeBlockList */ s32 get_inside_segment_count_xyz(s32 *arg0, s16 xPos1, s16 yPos1, s16 zPos1, s16 xPos2, s16 yPos2, s16 zPos2) { s32 cnt; @@ -1143,6 +1144,7 @@ LevelModelSegment *get_segment(s32 segmentID) { /** * Returns the bounding box data of this segment. + * Official name: trackBlockDim */ LevelModelSegmentBoundingBox *get_segment_bounding_box(s32 segmentID) { if (segmentID < 0 || gCurrentLevelModel->numberOfSegments < segmentID) diff --git a/src/unknown_078050.c b/src/unknown_078050.c index e078a1a0..215413e2 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -396,6 +396,7 @@ UNUSED void func_80077AAC(void *bufPtr, s32 bufSize, UNUSED s32 unused) { /** * Sets the primitive colour for the cyclemode fillrect background. + * Official name: rcpSetScreenColour */ void set_background_prim_colour(u8 red, u8 green, u8 blue) { sBackgroundPrimColourR = red; @@ -406,6 +407,7 @@ void set_background_prim_colour(u8 red, u8 green, u8 blue) { /** * Sets the fill colour for the fillmode fillrect background. * Uses RGBA5551 + * Official name: rcpSetBorderColour */ void set_background_fill_colour(s32 red, s32 green, s32 blue) { sBackgroundFillColour = GPACK_RGBA5551(red, green, blue, 1); @@ -486,6 +488,7 @@ void init_rdp_and_framebuffer(Gfx **dList) { /** * Calls the draw command that sets all the OtherModes, ready for use. + * Official name: rcpInitSp or rcpInitDpNoSize */ void init_rsp(Gfx **dList) { gSPDisplayList((*dList)++, dRspInit);