Merge branch 'mr-origin-96'

This commit is contained in:
banjo.decomp
2024-10-19 23:10:46 -05:00
291 changed files with 2238 additions and 2204 deletions

View File

@@ -152,41 +152,41 @@ segments:
- [0xF3F680, c, code_1D00] # NONMATCHING
- [0xF40490, c, pimanager]
- [0xF40650, c, defragmanager]
- [0xF40850, c, code_2FA0]
- [0xF40850, c, stub_2FA0]
- [0xF40A70, c, initthread]
- [0xF40B00, c, code_3250]
- [0xF41320, c, code_3A70]
- [0xF41320, c, stub_3A70]
- [0xF42F00, c, code_5650]
- [0xF44940, c, code_7090]
- [0xF44b60, c, code_72B0]
- [0xF45810, c, code_7F60]
- [0xF46500, c, code_8C50]
- [0xF475C0, c, code_ABB0]
- [0xF475C0, c, framebufferdraw]
- [0xF49870, c, code_CE60]
- [0xF4AD70, c, code_E360]
- [0xF4B4C0, c, code_EAF0]
- [0xF4D3D0, c, code_10A00]
- [0xF4AD70, c, vimgr]
- [0xF4B4C0, c, viewport]
- [0xF4D3D0, c, pfsmanager]
- [0xF4E490, c, code_11AC0]
- [0xF4F890, c, rumblemanager]
- [0xF50010, c, code_13640]
- [0xF50050, c, code_13680]
- [0xF50010, c, stub_13640]
- [0xF50050, c, sprite]
- [0xF500a0, c, overlaymanager]
- [0xF50360, c, code_13990]
- [0xF50360, c, mlmtx]
- [0xF51FC0, hasm, code_155F0]
- [0xF52000, c, overlay]
- [0xF52140, c, code_15770]
- [0xF52140, c, depthbuffer]
- [0xF52500, c, code_15B30]
- [0xF53420, c, memory]
- [0xF54AE0, c, code_18110]
- [0xF54BE0, c, code_18210]
- [0xF54CE0, c, code_18310]
- [0xF54D20, c, code_18350]
- [0xF54AE0, c, eeprom]
- [0xF54BE0, c, ucode]
- [0xF54CE0, c, lookup]
- [0xF54D20, c, ml]
- [0xF58860, c, code_1BE90]
- [0xF59F60, c, code_1D590]
- [0xF59F60, c, stub_1D590]
- [0xF59F90, hasm, code_1D5C0]
- [0xF59FA0, c, code_1D5D0]
- [0xF5AD30, c, code_1E360]
- [0xF5B0B0, c, code_1E6E0]
- [0xF5AD30, c, sns]
- [0xF5B0B0, c, crccalc]
- [0xF5B1F0, hasm, code_1E820]
- [0xF5B290, c, audio/n_sl]
- [0xF5B320, c, audio/n_synthesizer]
@@ -365,29 +365,29 @@ segments:
- [0xF74830, .data, code_660]
- [0xF74930, .data, code_1D00]
- [0xF74A10, bin, data_37E30] #unreferenced
- [0xF74A20, .data, code_2FA0]
- [0xF74A20, .data, stub_2FA0]
- [0xF74A30, .data, code_3250]
- [0xF74A40, .data, code_3A70]
- [0xF74A40, .data, stub_3A70]
- [0xF74A80, .data, code_5650]
- [0xF74AA0, .data, code_7090]
- [0xF74AB0, bin, data_37ED0] #unreferenced
- [0xF74AC0, .data, code_7F60]
- [0xF74AD0, .data, code_8C50]
- [0xF74C60, .data, code_ABB0]
- [0xF74C60, .data, framebufferdraw]
- [0xF74C70, .data, code_CE60]
- [0xF74CE0, .data, code_E360]
- [0xF74DD0, .data, code_EAF0]
- [0xF74DE0, .data, code_10A00]
- [0xF74CE0, .data, vimgr]
- [0xF74DD0, .data, viewport]
- [0xF74DE0, .data, pfsmanager]
- [0xF74DF0, .data, code_11AC0]
- [0xF75380, .data, overlaymanager]
- [0xF75620, .data, code_13990]
- [0xF75620, .data, mlmtx]
- [0xF75630, .data, code_15B30]
- [0xF75640, .data, memory]
- [0xF75670, .data, code_18310]
- [0xF75D60, .data, code_18350]
- [0xF75670, .data, lookup]
- [0xF75D60, .data, ml]
- [0xF75EE0, .data, code_1BE90]
- [0xF75EF0, .data, code_1D5D0]
- [0xF75F10, .data, code_1E360]
- [0xF75F10, .data, sns]
- [0xF75F20, .data, data_1E820]
- [0xF75F30, .data, audio/n_sl]
- [0xF75F40, .data, audio/n_drvrNew]
@@ -411,18 +411,18 @@ segments:
- [0xF76680, .data, io/vimodentsclan1]
- [0xF766D0, .rodata, code_1D00]
- [0xF766F0, .rodata, code_3250]
- [0xF76700, .rodata, code_3A70]
- [0xF76700, .rodata, stub_3A70]
- [0xF76710, .rodata, code_5650]
- [0xF76770, .rodata, code_72B0]
- [0xF76790, .rodata, code_7F60]
- [0xF767B0, .rodata, code_CE60]
- [0xF76A80, .rodata, code_EAF0]
- [0xF76B00, .rodata, code_10A00]
- [0xF76A80, .rodata, viewport]
- [0xF76B00, .rodata, pfsmanager]
- [0xF77210, .rodata, code_11AC0]
- [0xF77220, .rodata, rumblemanager]
- [0xF77230, .rodata, overlaymanager]
- [0xF772B0, .rodata, code_13990]
- [0xF772D0, .rodata, code_18350]
- [0xF772B0, .rodata, mlmtx]
- [0xF772D0, .rodata, ml]
- [0xF773D0, .rodata, code_1BE90]
- [0xF77400, .rodata, code_1D5D0]
- [0xF77460, .rodata, audio/n_synthesizer]
@@ -463,22 +463,22 @@ segments:
- [0xF791D0, .bss, code_7090]
- [0xF791D0, .bss, code_72B0]
- [0xF791D0, .bss, code_8C50]
- [0xF791D0, .bss, code_ABB0]
- [0xF791D0, .bss, framebufferdraw]
- [0xF791D0, .bss, code_CE60]
- [0xF791D0, .bss, code_E360]
- [0xF791D0, .bss, code_EAF0]
- [0xF791D0, .bss, code_10A00]
- [0xF791D0, .bss, vimgr]
- [0xF791D0, .bss, viewport]
- [0xF791D0, .bss, pfsmanager]
- [0xF791D0, .bss, code_11AC0]
- [0xF791D0, .bss, rumblemanager]
- [0xF791D0, .bss, code_13640]
- [0xF791D0, .bss, stub_13640]
- [0xF791D0, .bss, overlaymanager]
- [0xF791D0, .bss, code_13990]
- [0xF791D0, .bss, code_15770]
- [0xF791D0, .bss, mlmtx]
- [0xF791D0, .bss, depthbuffer]
- [0xF791D0, .bss, code_15B30]
- [0xF791D0, .bss, memory]
- [0xF791D0, .bss, code_18210]
- [0xF791D0, .bss, ucode]
- [0xF791D0, .bss, code_1D5D0]
- [0xF791D0, .bss, code_1E360]
- [0xF791D0, .bss, sns]
- [0xF791D0, .bss, os/initialize]
- [0xF791D0, .bss, io/pimgr]
- [0xF791D0, .bss, io/sptask]

View File

@@ -152,42 +152,42 @@ segments:
- [0xF1AF50, c, code_1D00] #DONE
- [0xF1BE20, c, pimanager]
- [0xF1BFF0, c, defragmanager] #DONE
- [0xF1C1F0, c, code_2FA0] #DONE
- [0xF1C1F0, c, stub_2FA0] #DONE
- [0xF1C410, c, initthread] #DONE
- [0xF1C4A0, c, code_3250] #DONE
- [0xF1CCC0, c, code_3A70] #DONE
- [0xF1CCC0, c, stub_3A70] #DONE
- [0xF1E8A0, c, code_5650]
- [0xF202E0, c, code_7090] #DONE
- [0xF20500, c, code_72B0] #DONE
- [0xF211B0, c, code_7F60] #DONE
- [0xF21EA0, c, code_8C50] #DONE
- [0xF22F80, c, code_9D30] #DONE
- [0xF23E00, c, code_ABB0] #DONE
- [0xF23E00, c, framebufferdraw] #DONE
- [0xF260B0, c, code_CE60] #DONE
- [0xF275B0, c, code_E360] #DONE
- [0xF27D40, c, code_EAF0] #DONE
- [0xF29C50, c,code_10A00]
- [0xF275B0, c, vimgr] #DONE
- [0xF27D40, c, viewport] #DONE
- [0xF29C50, c,pfsmanager]
- [0xF2AD10, c, code_11AC0] #DONE
- [0xF2C160, c, rumblemanager] #DONE
- [0xF2C890, c, code_13640] #DONE
- [0xF2C8D0, c, code_13680] #DONE
- [0xF2C890, c, stub_13640] #DONE
- [0xF2C8D0, c, sprite] #DONE
- [0xF2C920, c, overlaymanager] #DONE
- [0xF2CBE0, c, code_13990]
- [0xF2CBE0, c, mlmtx]
- [0xF2E840, hasm, code_155F0] #DONE
- [0xF2E880, c, overlay] #DONE
- [0xF2E9C0, c, code_15770] #DONE
- [0xF2E9C0, c, depthbuffer] #DONE
- [0xF2ED80, c, code_15B30] #DONE
- [0xF2FCA0, c, memory] #DONE
- [0xF31360, c, code_18110] #DONE
- [0xF31460, c, code_18210] #DONE
- [0xF31560, c, code_18310] #DONE
- [0xF315A0, c, code_18350] #DONE
- [0xF31360, c, eeprom] #DONE
- [0xF31460, c, ucode] #DONE
- [0xF31560, c, lookup] #DONE
- [0xF315A0, c, ml] #DONE
- [0xF350E0, c, code_1BE90] #DONE
- [0xF367E0, c, code_1D590] #DONE
- [0xF367E0, c, stub_1D590] #DONE
- [0xF36810, hasm, code_1D5C0] #DONE
- [0xF36820, c, code_1D5D0] #DONE
- [0xF375B0, c, code_1E360] #DONE
- [0xF37930, c, code_1E6E0] #DONE
- [0xF375B0, c, sns] #DONE
- [0xF37930, c, crccalc] #DONE
- [0xF37A70, hasm, code_1E820] #DONE
- [0xF37B10, c, audio/n_sl] #DONE
- [0xF37BA0, c, audio/n_synthesizer] #DONE
@@ -365,30 +365,30 @@ segments:
- [0xF50EA0, .data, code_660]
- [0xF50FA0, .data, code_1D00]
- [0xF51080, bin, data_37E30] #unreferenced
- [0xF51090, .data, code_2FA0]
- [0xF51090, .data, stub_2FA0]
- [0xF510A0, .data, code_3250]
- [0xF510B0, .data, code_3A70]
- [0xF510B0, .data, stub_3A70]
- [0xF510F0, .data, code_5650]
- [0xF51110, .data, code_7090]
- [0xF51120, bin, data_37ED0] #unreferenced
- [0xF51130, .data, code_7F60]
- [0xF51140, .data, code_8C50]
- [0xF51280, .data, code_9D30]
- [0xF51430, .data, code_ABB0]
- [0xF51430, .data, framebufferdraw]
- [0xF51440, .data, code_CE60]
- [0xF514B0, .data, code_E360]
- [0xF51550, .data, code_EAF0]
- [0xF51560, .data, code_10A00]
- [0xF514B0, .data, vimgr]
- [0xF51550, .data, viewport]
- [0xF51560, .data, pfsmanager]
- [0xF51570, .data, code_11AC0]
- [0xF51B00, .data, overlaymanager]
- [0xF51DA0, .data, code_13990]
- [0xF51DA0, .data, mlmtx]
- [0xF51DB0, .data, code_15B30]
- [0xF51DC0, .data, memory]
- [0xF51DF0, .data, code_18310]
- [0xF524E0, .data, code_18350]
- [0xF51DF0, .data, lookup]
- [0xF524E0, .data, ml]
- [0xF52660, .data, code_1BE90]
- [0xF52670, .data, code_1D5D0]
- [0xF52690, .data, code_1E360]
- [0xF52690, .data, sns]
- [0xF526A0, .data, data_1E820]
- [0xF526B0, .data, audio/n_sl]
- [0xF526C0, .data, audio/n_drvrNew]
@@ -412,19 +412,19 @@ segments:
- [0xF52DB0, .data, io/vimodentsclan1]
- [0xF52E50, .rodata, code_1D00]
- [0xF52E70, .rodata, code_3250]
- [0xF52E80, .rodata, code_3A70]
- [0xF52E80, .rodata, stub_3A70]
- [0xF52E90, .rodata, code_5650]
- [0xF52EF0, .rodata, code_72B0]
- [0xF52F10, .rodata, code_7F60]
- [0xF52F30, .rodata, code_9D30]
- [0xF52F50, .rodata, code_CE60]
- [0xF53220, .rodata, code_EAF0]
- [0xF532A0, .rodata, code_10A00]
- [0xF53220, .rodata, viewport]
- [0xF532A0, .rodata, pfsmanager]
- [0xF539B0, .rodata, code_11AC0]
- [0xF539C0, .rodata, rumblemanager]
- [0xF539D0, .rodata, overlaymanager]
- [0xF53A50, .rodata, code_13990]
- [0xF53A70, .rodata, code_18350]
- [0xF53A50, .rodata, mlmtx]
- [0xF53A70, .rodata, ml]
- [0xF53B70, .rodata, code_1BE90]
- [0xF53BA0, .rodata, code_1D5D0]
- [0xF53C00, .rodata, audio/n_synthesizer]
@@ -464,22 +464,22 @@ segments:
- [0xF55960, .bss, code_7090]
- [0xF55960, .bss, code_72B0]
- [0xF55960, .bss, code_8C50]
- [0xF55960, .bss, code_ABB0]
- [0xF55960, .bss, framebufferdraw]
- [0xF55960, .bss, code_CE60]
- [0xF55960, .bss, code_E360]
- [0xF55960, .bss, code_EAF0]
- [0xF55960, .bss, code_10A00]
- [0xF55960, .bss, vimgr]
- [0xF55960, .bss, viewport]
- [0xF55960, .bss, pfsmanager]
- [0xF55960, .bss, code_11AC0]
- [0xF55960, .bss, rumblemanager]
- [0xF55960, .bss, code_13640]
- [0xF55960, .bss, stub_13640]
- [0xF55960, .bss, overlaymanager]
- [0xF55960, .bss, code_13990]
- [0xF55960, .bss, code_15770]
- [0xF55960, .bss, mlmtx]
- [0xF55960, .bss, depthbuffer]
- [0xF55960, .bss, code_15B30]
- [0xF55960, .bss, memory]
- [0xF55960, .bss, code_18210]
- [0xF55960, .bss, ucode]
- [0xF55960, .bss, code_1D5D0]
- [0xF55960, .bss, code_1E360]
- [0xF55960, .bss, sns]
- [0xF55960, .bss, os/initialize]
- [0xF55960, .bss, io/pimgr]
- [0xF55960, .bss, io/sptask]

View File

@@ -1,9 +1,130 @@
#ifndef __CORE_1_H__
#define __CORE_1_H__
#ifndef BANJO_KAZOOIE_CORE1_CORE1_H
#define BANJO_KAZOOIE_CORE1_CORE1_H
#include <ultra64.h>
#include "bool.h"
#include "enums.h"
#include "structs.h"
#include "prop.h"
#include "core1/eeprom.h"
#include "core1/framebufferdraw.h"
#include "core1/lookup.h"
#include "core1/main.h"
#include "core1/mem.h"
#include "core1/ml.h"
#include "core1/mlmtx.h"
#include "core1/pfsmanager.h"
#include "core1/rarezip.h"
#include "core1/sns.h"
#include "core1/sprite.h"
#include "core1/ucode.h"
#include "core1/viewport.h"
#include "core1/vimgr.h"
void mlMtx_apply_vec3f(f32[3], f32[3]);
void func_80252C08(f32 arg0[3], f32 arg1[3], f32 scale, f32 arg3[3]);
/* need to sort out in individual header files */
void glcrc_calc_checksum(void *start, void *end, u32 checksum[2]);
void func_80250530(s32 arg0, u16 chan_mask, f32 arg2);
void func_8025A104(enum comusic_e arg0, s32 arg1);
void func_8025A55C(s32 arg0, s32 arg1, s32 arg2);
s32 func_8025A864(enum comusic_e track_id);
void func_8025ABB8(enum comusic_e comusic_id, s32 arg1, s32 arg2, s32 arg3);
int func_8025AD7C(enum comusic_e arg0);
int func_8025ADBC(enum comusic_e arg0);
/* src/core1/code_7090.c */
void core1_7090_alloc(void);
void core1_7090_release(void);
void core1_7090_initSfxSource(s32 idx, s32 lookup_idx, s32 sample_rate, f32 volume);
void core1_7090_freeSfxSource(int idx);
/* src/core1/code_CE60.c */
void core1_ce60_setChanMask(s32 chan_mask);
void core1_ce60_setChanMaskWithValue(s32 chan_mask, f32 arg1);
bool core1_ce60_isPlayerInRange(s32 x, s32 z, s32 distance);
f32 core1_ce60_getPlayerDistance(f32 x, f32 z);
bool core1_ce60_isPlayerInsideBoundingBox(s32 box_idx);
void core1_ce60_func_8024A9EC(s32 arg0);
void core1_ce60_func_8024AAB0(void);
void core1_ce60_func_8024ADF0(bool arg0);
void core1_ce60_func_8024AE74(void);
void core1_ce60_resetState(void);
void core1_ce60_setChanMaskFromWaterState(s32 chan_mask_underwater, s32 chan_mask_surface);
void core1_ce60_func_8024AF48(void);
void core1_ce60_incOrDecCounter(bool increment);
void core1_ce60_func_8024BD40(s32 arg0, s32 arg1);
/* src/core1/depthbuffer.c */
extern u8 D_8000E800;
void func_80253190(Gfx **gfx);
void func_80253208(Gfx **gfx, s32 x, s32 y, s32 w, s32 h, void *color_buffer);
bool func_80253400(void);
bool depthBuffer_isPointerSet(void);
void depthBuffer_stub(void);
void func_80253428(int arg0);
void func_802534A8(int arg0);
void zBuffer_set(Gfx **gfx);
void *zBuffer_get(void);
/* src/core1/code_15B30.c */
typedef struct {
s32 unk0;
s32 unk4;
Gfx *unk8;
Gfx *unkC;
s32 unk10;
s32 unk14;
}Struct_Core1_15B30;
#define DEFAULT_FRAMEBUFFER_WIDTH 292
#define DEFAULT_FRAMEBUFFER_HEIGHT 216
extern s32 gFramebufferWidth;
extern s32 gFramebufferHeight;
extern u16 gFramebuffers[2][DEFAULT_FRAMEBUFFER_WIDTH * DEFAULT_FRAMEBUFFER_HEIGHT];
void func_80253550(void);
void func_8025357C(void);
void func_802535A8(Gfx **arg0, Gfx **arg1, UNK_TYPE(s32) arg2, UNK_TYPE(s32) arg3);
void func_80253640(Gfx ** gdl, void *arg1);
void scissorBox_SetForGameMode(Gfx **gdl, s32 framebuffer_idx);
void setupScissorBoxAndFramebuffer(Gfx **gfx, s32 framebuffer_address);
void setupDefaultScissorBoxAndFramebuffer(Gfx **gfx, s32 framebuffer_idx);
void func_80253DC0(Gfx **gfx);
void finishFrame(Gfx **gdl);
void func_80253E14(Gfx *arg0, Gfx *arg1, s32 arg2);
void func_80253EA4(Gfx *arg0, Gfx *arg1);
void func_80253EC4(Gfx *arg0, Gfx *arg1);
void func_80253EE4(Gfx **arg0, Gfx **arg1, s32 arg2);
void func_80253F74(Gfx **arg0, Gfx **arg1);
void func_80253F94(Gfx **arg0, Gfx **arg1);
void scissorBox_get(u32 *left, u32 *top, u32 *right, u32 *bottom);
void func_80253FE8(void);
void func_80254008(void);
void func_80254028(void);
void drawRectangle2D(Gfx **gfx, s32 x, s32 y, s32 w, s32 h, s32 r, s32 g, s32 b);
void graphicsCache_release(void);
void graphicsCache_init(void);
void scissorBox_set(s32 left, s32 top, s32 right, s32 bottom);
void scissorBox_setDefault(void);
void func_80254374(s32 arg0);
void toggleTextureFilterPoint(void);
void getGraphicsStacks(Gfx **gfx, Mtx **mtx, Vtx **vtx);
void dummy_func_80254464(void);
#endif

7
include/core1/eeprom.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef BANJO_KAZOOIE_CORE1_EEPROM_H
#define BANJO_KAZOOIE_CORE1_EEPROM_H
s32 eeprom_writeBlocks(s32 file, s32 offset, void *buffer, s32 count);
s32 eeprom_readBlocks(s32 file, s32 offset, void *buffer, s32 count);
#endif

View File

@@ -0,0 +1,28 @@
#ifndef BANJO_KAZOOIE_CORE1_FRAMEBUFFERDRAW_H
#define BANJO_KAZOOIE_CORE1_FRAMEBUFFERDRAW_H
void framebufferdraw_drawSpriteCI4(s32 x, s32 y, BKSprite *sprite, s32 frame, s32 alpha_enabled);
void framebufferdraw_drawSpriteCI8(s32 x, s32 y, BKSprite *sprite, s32 frame, s32 alpha_enabled);
void framebufferdraw_drawSpriteRGBA16(s32 x, s32 y, BKSprite *sprite, s32 frame, bool alpha_enabled);
void framebufferdraw_drawSpriteI4(s32 x, s32 y, BKSprite *sprite, s32 frame, bool aplha_enabled);
void framebufferdraw_drawSpriteIA4(s32 x, s32 y, BKSprite *sprite, s32 frame, bool aplha_enabled);
void framebufferdraw_drawSpriteI8(s32 x, s32 y, BKSprite *sprite, s32 frame, s32 alpha_enabled);
void framebufferdraw_drawSpriteIA8(s32 x, s32 y, BKSprite *sprite, s32 frame, bool alpha_enabled);
void framebufferdraw_drawSpriteRGBA32(s32 x, s32 y, BKSprite *sprite, s32 frame, s32 alpha_enabled);
void framebufferdraw_stub1(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
void framebufferdraw_stub2(s32 arg0, s32 arg1, s32 arg2, s32 arg3);
void framebufferdraw_drawTexture_CI4(s32 x, s32 y, void *tmem, s32 w, s32 h, bool alpha_enabled);
void framebufferdraw_draw(s32 x, s32 y, BKSprite *sprite, s32 frame, s32 alpha_enabled);
void framebufferdraw_func_80249DE0(s32 x, s32 y, s16 *arg2, s32 arg3, s32 arg4);
void framebufferdraw_func_80249F34(s32 x, s32 y, Struct84s* maskList, s32 maskIndex, s32 mX, s32 mY, s32 mW, s32 mH, s32 maskColor, s32 mStride, bool dim, s32 replacementColor);
void framebufferdraw_drawGrid(s32 x, s32 y, s32 arg2, s32 arg3, s32 horz_spacing, s32 vert_spacing);
void framebufferdraw_setPixel(s32 x, s32 y);
void framebufferdraw_drawOutline(s32 x, s32 y, s32 w, s32 h);
void framebufferdraw_func_8024A564(s32 x, s32 y, u16 *arg2, s32 arg3, s32 arg4, f32 arg5, f32 arg6);
void framebufferdraw_drawRect(s32 x, s32 y, s32 w, s32 h);
void framebufferdraw_resetPrimColorAndBuffer(void);
void framebufferdraw_setPrimColor(s32 r, s32 g, s32 b);
void framebufferdraw_setBufferIndex(s32 buffer_indx);
s32 framebufferdraw_getBufferIndex(void);
#endif

8
include/core1/lookup.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef BANJO_KAZOOIE_CORE1_LOOKUP_H
#define BANJO_KAZOOIE_CORE1_LOOKUP_H
enum comusic_e lookup_getCoMusicId(s32 idx);
enum sfx_e lookup_getSfxId(s32 idx);
enum asset_e lookup_getAnimAssetId(s32 idx);
#endif

26
include/core1/main.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef BANJO_KAZOOIE_CORE1_MAIN_H
#define BANJO_KAZOOIE_CORE1_MAIN_H
void func_8023DA20(s32 arg0);
void func_8023DA74(void);
void func_8023DA9C(s32 arg0);
u32 globalTimer_getTimeMasked(u32 mask);
//s32 globalTimer_getTime(void);
void globalTimer_reset(void);
enum map_e getSpecialBootMap(void);
enum map_e getDefaultBootMap(void);
void func_8023DBAC(void);
void func_8023DBDC(void);
void core1_init(void);
void globalTimer_incTimer(void);
void globalTimer_decTimer(void);
void mainLoop(void);
void mainThread_entry(void *arg);
void func_8023DFF0(s32 arg0);
s32 func_8023E000(void);
void setBootMap(enum map_e map_id);
void mainThread_create(void);
OSThread *mainThread_get(void);
void disableInput_set(void);
#endif

View File

@@ -1,5 +1,5 @@
#ifndef __MEM_H__
#define __MEM_H__
#ifndef BANJO_KAZOOIE_CORE1_MEMORY_H
#define BANJO_KAZOOIE_CORE1_MEMORY_H
/**
* copy memory area

122
include/core1/ml.h Normal file
View File

@@ -0,0 +1,122 @@
#ifndef BANJO_KAZOOIE_CORE1_ML_H
#define BANJO_KAZOOIE_CORE1_ML_H
f32 ml_acosf_deg(f32 x);
void ml_vec3f_sub_and_rotate(f32 vec1[3], f32 rotation[3], f32 vec2[3], f32 dst[3]);
f32 ml_vec3f_cos_between(f32 vec1[3], f32 vec2[3]);
void ml_vec3f_cross_product(f32 dst[3], f32 vec1[3], f32 vec2[3]);
void ml_vec3f_interpolate_fast(f32 dst[3], f32 start[3], f32 end[3], f32 t);
f32 ml_vec3f_dot_product(f32 vec1[3], f32 vec2[3]);
f32 ml_vec3f_distance(f32 vec1[3], f32 vec2[3]);
f32 ml_func_802560D0(f32 arg0[3], f32 arg1[3], f32 arg2[3]);
f32 ml_distanceSquared_vec3f(f32 vec1[3], f32 vec2[3]);
void func_802562DC(f32 vec1[3], f32 vec2[3], f32 vec3[3]);
f32 ml_vec3f_length_unused(f32 vec[3]);
void ml_vec3f_normalize_copy(f32 arg0[3], f32 arg1[3]);
void ml_vec3f_normalize(f32 vec[3]);
void ml_vec2f_normalize(f32 vec[2]);
void ml_3f_normalize(f32 *x, f32 *y, f32 *z);
void ml_vec3f_set_length_copy(f32 dst[3], f32 src[3], f32 len);
void func_80256664(f32 ptr[3]);
void func_80256740(f32 vec[3]);
void ml_vec3f_pitch_rotate_copy(f32 dst[3], f32 src[3], f32 pitch);
void ml_vec3f_yaw_rotate_copy(f32 dst[3], f32 src[3], f32 yaw);
void ml_vec3f_roll_rotate_copy(f32 dst[3], f32 src[3], f32 roll);
void ml_vec3f_set_length(f32 vec[3], f32 length);
f32 func_80256AB4(f32 x1, f32 y1, f32 x2, f32 y2);
f32 func_80256B54(f32 vec1[3], f32 vec2[3]);
f32 func_80256C60(f32 vec[3], s32 val);
void func_80256D0C(f32 val1, f32 val2, f32 x, f32 y, f32 z, f32 *dstX, f32 *dstY, f32 *dstZ);
void func_80256E24(f32 dst[3], f32 theta, f32 phi, f32 x, f32 y, f32 z);
void func_80256F44(f32 vec1[3], f32 vec2[3], f32 vec3[3], f32 dst[3]);
f32 ml_acosf(f32 x);
f32 func_8025715C(f32 val1, f32 val2);
f32 func_80257204(f32 val1, f32 val2, f32 val3, f32 val4);
f32 func_80257248(f32 vec1[3], f32 vec2[3]);
void func_8025727C(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 *o1, f32 *o2);
void ml_init(void);
void ml_free(void);
f32 func_802575BC(f32 val);
f32 func_80257618(f32 val);
f32 func_80257658(f32 val);
f32 func_80257680(f32 val1, f32 val2, f32 val3);
void ml_defrag(void);
bool ml_timer_update(f32 *timer, f32 delta);
void func_8025778C(f32 dst[3], f32 arg1[3], f32 arg2[3][3]);
void func_802578A4(f32 dst[3], f32 vec1[3], f32 vec2[3]);
void func_80257918(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3]);
bool func_802579B0(f32 vec[3], f32 x1, f32 z1, f32 x2, f32 z2);
f32 func_80257A44(f32 val1, f32 val2);
f32 func_80257A6C(f32 val1, f32 val2);
f32 func_80257AD4(f32 val1, f32 val2);
f32 ml_map_f(f32 val, f32 in_min, f32 in_max, f32 out_min, f32 out_max);
f32 ml_mapRange_f(f32 val, f32 in_min, f32 in_max, f32 out_min, f32 out_max);
f32 ml_interpolate_f(f32 arg0, f32 arg1, f32 arg2);
f32 ml_mapFunction_f(f32 a, f32 b, f32 c, f32 d, f32 e, f32 (*func)(f32));
f32 func_80257CC0(f32 a, f32 b, f32 c, f32 d, f32 e);
f32 func_80257CF8(f32 a, f32 b, f32 c, f32 d, f32 e);
f32 ml_mapAbsRange_f(f32 val, f32 in_min, f32 in_max, f32 out_min, f32 out_max);
void func_80257DB0(f32 arg0[3], f32 arg1[3], f32 arg2[3]);
void ml_setLength_vec3f(f32 v[3], f32 a);
s32 ml_clamp_w(s32 val, s32 min, s32 max);
f32 ml_clamp_f(f32 val, f32 min, f32 max);
int func_80257F18(f32 src[3], f32 target[3], f32 *yaw);
int func_8025801C(f32 target[3], f32 *yaw);
int func_80258108(f32 vec[3], f32 *arg1, f32 *arg2);
int func_80258210(f32 x, f32 y, f32 *dst);
bool ml_isZero_vec3f(f32 vec[3]);
bool ml_isNonzero_vec3f(f32 vec[3]);
bool ml_vec3f_not_on_vertical_axis(f32 vec[3]);
bool ml_vec3f_inside_box_f(f32 vec[3], f32 minX, f32 minY, f32 minZ, f32 maxX, f32 maxY, f32 maxZ);
bool ml_vec3f_inside_box_vec3f(f32 vec[3], f32 min[3], f32 max[3]);
bool ml_vec3w_inside_box_w(s32 vec[3], s32 minX, s32 minY, s32 minZ, s32 maxX, s32 maxY, s32 maxZ);
f32 ml_vec3f_horizontal_distance_zero_likely(f32 vec1[3], f32 vec2[3]);
f32 ml_vec3f_horizontal_distance_squared_zero_likely(f32 vec1[3], f32 vec2[3]);
f32 ml_vec3f_length(f32 vec1[3], f32 vec2[3]);
f32 ml_vec3f_length_sq(f32 vec1[3], f32 vec2[3]);
f32 ml_sin_deg(f32 angle_deg);
f32 ml_cos_deg(f32 angle_deg);
f32 mlNormalizeAngle(f32 angle);
f32 ml_remainder_f(f32 arg0, f32 arg1);
f32 ml_max_f(f32 arg0, f32 arg1);
f32 ml_min_f(f32 arg0, f32 arg1);
int ml_max_w(int arg0, int arg1);
int ml_min_w(int arg0, int arg1);
f32 mlAbsF(f32 arg0);
f32 func_80258994(f32 arg0[3]);
int ml_abs_w(int arg0);
void func_802589E4(f32 dst[3], f32 yaw, f32 length);
void func_80258A4C(f32 vec1[3], f32 arg1, f32 vec2[3], f32 *arg3, f32 *arg4, f32 *arg5);
void ml_vec3f_clear(f32 dst[3]);
void ml_vec3f_copy(f32 dst[3], f32 src[3]);
void ml_vec3f_diff_copy(f32 dst[3], f32 src1[3], f32 src2[3]);
void ml_vec3f_diff(f32 dst[3], f32 src[3]);
void ml_vec3f_assign(f32 dst[3], f32 x, f32 y, f32 z);
void ml_vec3f_add(f32 dst[3], f32 src1[3], f32 src2[3]);
void ml_vec3f_scale(f32 vec[3], f32 scale);
void ml_vec3f_scale_copy(f32 dst[3], f32 src[3], f32 scale);
void func_80258CDC(f32 vec1[3], f32 vec2[3]);
void ml_vec3w_to_vec3f(f32 dst[3], s32 src[3]);
void ml_vec3h_to_vec3f(f32 dst[3], s16 src[3]);
void ml_vec3f_to_vec3w(s32 dst[3], f32 src[3]);
void ml_vec3f_to_vec3h(s16 dst[3], f32 src[3]);
void ml_translate_y_local(f32 position[3], f32 rotation[3], f32 dy);
void ml_translate_z_local(f32 dst[3], f32 src[3], f32 dz);
void ml_translate_x_local(f32 dst[3], f32 src[3], f32 dx);
void func_8025901C(f32 arg0, f32 arg1[3], f32 arg2[3], f32 arg3);
f32 func_80259198(f32 arg0, f32 arg1);
f32 mlDiffDegF(f32 arg0, f32 arg1);
bool ml_vec3f_point_within_horizontal_distance(f32 vec[3], f32 x, f32 z, f32 distance);
bool ml_vec3f_within_horizontal_distance(f32 vec1[3], f32 vec2[3], f32 distance);
bool ml_vec3w_within_horizontal_distance(s32 vec1[3], s32 vec2[3], s32 distance);
bool ml_vec3f_within_distance(f32 vec1[3], f32 vec2[3], f32 distance);
bool ml_stub_80259400(f32 x);
void ml_sub_delta_time(f32 *x);
void func_8025947C(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]);
f32 func_80259554(f32 dst[3], f32 vec1[3], f32 vec2[3], f32 vec3[3]);
void func_802596AC(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]);
s32 ml_getViewportYawWithOffset(f32 x);
bool ml_isViewportYawWithOffsetNormalized(f32 x);
void ml_vec3f_interpolate(f32 dst[3], f32 start[3], f32 end[3], f32 t);
#endif

45
include/core1/mlmtx.h Normal file
View File

@@ -0,0 +1,45 @@
#ifndef BANJO_KAZOOIE_CORE1_MLMTX_H
#define BANJO_KAZOOIE_CORE1_MLMTX_H
void mlMtxGet(MtxF *dst);
MtxF *mlMtx_get_stack_pointer(void);
void mlMtxApply(Mtx *mPtr);
void mlMtxPop(void);
void mlMtx_push_duplicate(void);
void mlMtx_push_identity(void);
void mlMtx_push_translation(f32 x, f32 y, f32 z);
void mlMtx_push_mtx(f32* mtx);
void mlMtx_push_multiplied(f32* l_mtx);
void mlMtx_push_multiplied_2(MtxF * l_mtx, MtxF * r_mtx);
void mlMtxIdent(void);
void func_80251B5C(f32 x, f32 y, f32 z);
void mlMtxSet(MtxF* arg0);
void mlMtxRotate(f32 a, f32 x, f32 y, f32 z);
void mlMtxRotPitch(f32 arg0);
void mlMtxRotYaw(f32 arg0);
void mlMtxRotRoll(f32 arg0);
void mlMtx_rotate_pitch_deg(f32 arg0);
void mlMtx_rotate_yaw_deg(f32 arg0);
void mlMtxRotatePYR(f32 pitch, f32 yaw, f32 roll);
void mlMtxScale_xyz(f32 x, f32 y, f32 z);
void mlMtxScale(f32 scale);
void func_80252330(f32 x, f32 y, f32 z);
void mlMtx_apply_vec3f(f32 dst[3], f32 src[3]);
void mlMtx_apply_vec3f_restricted(f32 dst[3], f32 src[3]);
void mlMtx_apply_f3(f32 dst[3], f32 x, f32 y, f32 z);
void mlMtx_apply_vec3s(s16 dst[3], s16 src[3]);
void func_8025276C(s32 arg0[3], s32 arg1[3], s32 arg2[3], s32 arg3[3]);
void mlMtxTranslate(f32 x, f32 y, f32 z);
void func_80252A38(f32 x, f32 y, f32 z);
void func_80252AF0(f32 arg0[3], f32 arg1[3], f32 rotation[3], f32 scale, f32 arg4[3]);
void func_80252C08(f32 arg0[3], f32 rotation[3], f32 scale, f32 arg3[3]);
void func_80252CC4(f32 position[3], f32 rotation[3], f32 scale, f32 arg3[3]);
void func_80252D8C(f32 position[3], f32 rotation[3]);
void func_80252DDC(f32 position[3], f32 rotation[3]);
void func_80252E4C(f32 position[3], f32 rotation[3]);
void func_80252EC8(f32 position[3], f32 rotation[3]);
void func_80252F50(f32 rotation[3]);
void func_80252F8C(f32 rotation[3]);
void func_80252FC8(f32 rotation[3]);
#endif

View File

@@ -0,0 +1,68 @@
#ifndef BANJO_KAZOOIE_CORE1_PFSMANAGER_H
#define BANJO_KAZOOIE_CORE1_PFSMANAGER_H
typedef struct pfs_manager_face_buttons_s {
bool button_a;
bool button_b;
bool button_c_left;
bool button_c_up;
bool button_c_down;
bool button_c_right;
} PfsManagerFaceButtons;
typedef struct pfs_manager_side_buttons_s {
bool button_z;
bool button_l;
bool button_r;
} PfsManagerSideButtons;
typedef struct pfs_manager_controller_data {
union { s32 face_button[6]; PfsManagerFaceButtons face_button2; };
union { s32 side_button[3]; PfsManagerSideButtons side_button2; };
s32 unk24[4];
s32 start_button;
} PfsManagerControllerData;
typedef struct {
s16 unk0;
s16 unk2;
u16 unk4;
u16 unk6;
f32 unk8[2];
f32 joystick[2];
}Struct_core1_10A00_1;
f32 func_8024E420(s32 arg0, s32 arg1, s32 arg2);
void controller_copyFaceButtons(s32 controller_index, s32 dst[6]);
void pfsManager_getFirstControllerFaceButtonState(s32 controller_index, s32 dst[6]);
s32 func_8024E5E8(s32 arg0, s32 arg1);
s32 func_8024E60C(s32 controller_index, s32 dst[3]);
s32 func_8024E640(s32 controller_index, s32 dst[3]);
f32 func_8024E668(s32 controller_index);
s32 controller_getStartButton(s32 controller_index);
s32 func_8024E698(s32 controller_index);
void func_8024E6E0(s32 controller_index, s32 *dst[4]);
void controller_getJoystick(s32 controller_index, f32 dst[2]);
void pfsManager_update(void);
void pfsManager_readData();
void pfsManager_entry(void *arg);
void pfsManager_init(void);
bool pfsManager_contErr(void);
void func_8024F150(void);
void func_8024F180(void);
void pfsManager_getStartReadData(void);
void func_8024F1F0(void);
void func_8024F224(void);
void func_8024F2E4(s32 arg0, Struct_core1_10A00_1 *arg1);
void func_8024F328(s32 controller_index, s32 arg1);
OSMesgQueue * pfsManager_getFrameReplyQ(void);
OSMesgQueue *pfsManager_getFrameMesgQ(void);
void func_8024F35C(s32 arg0);
bool pfsManager_isBusy(void);
int func_8024F3C4(int arg0);
OSContPad *func_8024F3F4(void);
void func_8024F400(void);
void func_8024F450(void);
void func_8024F4AC(void);
#endif

View File

@@ -1,7 +1,5 @@
#ifndef RAREZIP_H
#define RAREZIP_H
#include <ultra64.h>
#ifndef BANJO_KAZOOIE_CORE1_RAREZIP_H
#define BANJO_KAZOOIE_CORE1_RAREZIP_H
extern u8 D_80275670[];
//border[]= { /* Order of the bit length code lengths */

View File

@@ -1,6 +1,5 @@
#ifndef __SNS_H__
#define __SNS_H__
#include <ultra64.h>
#ifndef BANJO_KAZOOIE_CORE1_SNS_H
#define BANJO_KAZOOIE_CORE1_SNS_H
/**
* sns sets

11
include/core1/sprite.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef BANJO_KAZOOIE_CORE1_SPRITE_H
#define BANJO_KAZOOIE_CORE1_SPRITE_H
u32 sprite_getUnk8(BKSprite *this);
u32 sprite_getUnkA(BKSprite *this);
u32 sprite_getUnk6(BKSprite *this);
u32 sprite_getUnk4(BKSprite *this);
s32 sprite_getFrameCount(BKSprite *this);
BKSpriteFrame *sprite_getFramePtr(BKSprite *this, u32 frame_id);
#endif

10
include/core1/ucode.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef BANJO_KAZOOIE_CORE1_UCODE_H
#define BANJO_KAZOOIE_CORE1_UCODE_H
void ucode_load(void);
void ucode_stub1(void); // does nothing
void ucode_stub2(void); // performs dummy read on PI
s32 ucode_stub3(void); // returns always 0
void ucode_getPtrAndSize(void **ptr, u32 *size);
#endif

View File

@@ -1,10 +1,5 @@
#ifndef BANJO_KAZOOIE_VIEWPORT_H
#define BANJO_KAZOOIE_VIEWPORT_H
#include <ultra64.h>
#include <prop.h> // for Cube
#include "ml/mtx.h" // for MtxF
#ifndef BANJO_KAZOOIE_CORE1_VIEWPORT_H
#define BANJO_KAZOOIE_CORE1_VIEWPORT_H
void viewport_moveAlongZAxis(f32 offset);
f32 viewport_getDistance(f32 arg0[3]);

28
include/core1/vimgr.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef BANJO_KAZOOIE_CORE1_VIMGR_H
#define BANJO_KAZOOIE_CORE1_VIMGR_H
typedef struct struct_1_s{
OSMesgQueue *messageQueue;
OSMesg message;
} struct1;
u32 getOtherFramebuffer(void);
s32 viMgr_func_8024BD94(void);
s32 getActiveFramebuffer(void);
void viMgr_func_8024BDAC(OSMesgQueue *mq, OSMesg msg);
void viMgr_init(void);
void viMgr_func_8024BF94(s32 arg0);
s32 viMgr_func_8024BFA0(void);
void viMgr_func_8024BFAC(void);
void viMgr_func_8024BFD8(s32 arg0);
void viMgr_func_8024C1B4(void);
void viMgr_func_8024C1DC(void);
void viMgr_func_8024C1FC(OSMesgQueue *mq, OSMesg msg);
void viMgr_setActiveFramebuffer(s32 arg0);
void viMgr_entry(void *arg0);
void viMgr_setScreenBlack(s32 active);
void viMgr_clearFramebuffers(void);
s32 viMgr_func_8024C4E8(void);
void viMgr_func_8024C4F8(s32 arg0);
#endif

View File

@@ -3,7 +3,6 @@
#include <ultra64.h>
#include "generic.h"
#include "ml/mtx.h"
#ifndef NONMATCHING
#define animctrl_start(this, file, line) _animctrl_start(this, file, line)

View File

@@ -12,4 +12,7 @@ void func_8035179C_copyPosition(Struct68s* arg0, f32 arg1[3]);
void func_80351814(Struct68s *arg0, f32 arg1[3]);
f32 func_80351830(Struct68s *arg0);
extern void sfxsource_setSampleRate(u8, s32);
#endif

View File

@@ -14,8 +14,6 @@
#include "core2/core2.h"
#include "math.h" // ToDo: sort out actual dependencies
#include "ml.h"
#include "ml/mtx.h"
#include "bs_funcs.h"
#include "bsint.h"
@@ -45,20 +43,8 @@ void * malloc(s32 size);
void free(void*);
void *realloc(void* ptr, s32 size);
f32 ml_map_f(f32 val, f32 in_min, f32 in_max, f32 out_min, f32 out_max);
float mlNormalizeAngle(float);
f32 ml_max_f(f32, f32);
f32 ml_min_f(f32, f32);
void ml_vec3f_copy(f32 dst[3], f32 src[3]);
void ml_vec3f_add(f32 dst[3], f32 src1[3], f32 src2[3]);
void ml_vec3f_scale(f32 vec[3], f32 scale);
void ml_vec3f_scale_copy(f32 dst[3], f32 src[3], f32 scale);
float gu_sqrtf(float val);
BKSpriteFrame *spriteGetFramePtr(BKSprite *, u32);
bool baanim_isAt(f32);
void baanim_playForDuration_once(enum asset_e anim_id, f32 duration);
void baanim_setEnd(f32);
@@ -226,22 +212,7 @@ void particleEmitter_setSpawnInterval(ParticleEmitter *, f32);
OSContPad *func_8024F3F4(void);
OSMesgQueue *pfsManager_getFrameReplyQ(void);
void ml_vec3f_clear(f32 dst[3]);
void ml_vec3f_roll_rotate_copy(f32[3], f32[3], f32);
void rumbleManager_80250D94(f32, f32, f32);
void func_80256E24(f32[3], f32, f32, f32, f32, f32);
void func_8025727C(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 *o1, f32 *o2);
f32 func_80257A44(f32, f32);
f32 ml_interpolate_f(f32, f32, f32);
f32 ml_mapAbsRange_f(f32, f32, f32, f32, f32);
int func_80257F18(f32 src[3], f32 target[3], f32 *yaw);
bool func_8025801C(f32[3], f32*);
f32 mlAbsF(f32);
f32 ml_clamp_f(f32, f32, f32);
f32 ml_remainder_f(f32, f32);
void func_802589E4(f32 dst[3], f32 yaw, f32 length);
f32 mlDiffDegF(f32, f32);
void func_8025A6EC(enum comusic_e, s32);
void comusic_playTrack(enum comusic_e);
@@ -456,15 +427,12 @@ Actor *actorArray_findClosestActorFromActorId(f32 position[3], enum actor_e acto
Actor *subaddie_getLinkedActor(Actor *);
/* used in RBB */
void ml_vec3f_pitch_rotate_copy(f32 dst[3], f32 src[3], f32 pitch);
int ml_timer_update(f32 *arg0, f32 arg1);
Actor *actor_draw(ActorMarker *, Gfx**, Mtx**, Vtx **);
Actor *func_80325340(ActorMarker *, Gfx **, Mtx **, Vtx **);
void func_8032AA58(Actor *, f32);
void func_80324E38(f32, s32);
void timed_playSfx(f32, enum sfx_e, f32, s32);
f32 ml_distance_vec3f(f32 [3], f32 [3]);
void timed_setStaticCameraToNode(f32, s32);
void timed_exitStaticCamera(f32);
int actor_animationIsAt(Actor*, f32);
@@ -479,10 +447,8 @@ void func_802FA060(s32, s32, s32, f32);
Actor *actorArray_findActorFromActorId(enum actor_e);
f32 func_8038A6B8(ActorMarker *);
void *defrag_asset(void *);
void ml_interpolate_vec3f(f32 [3], f32 [3], f32 [3], f32);
void sfxsource_set_fade_distances(u8, f32, f32);
void func_8030DB04(u8, s32, f32 position[3], f32, f32);
void func_80258A4C(f32 [3], f32, f32 [3], f32 *, f32 *, f32 *);
void func_802E4078(enum map_e map, s32 exit, s32 transition);
@@ -494,7 +460,6 @@ void mapSpecificFlags_set(s32, s32);
struct0 *func_8031B9D8(void);
extern int func_80259808(f32);
void actor_playAnimationOnce(Actor *);
void actor_loopAnimation(Actor *);
@@ -504,7 +469,6 @@ void actor_update_func_80326224(Actor *this);
void func_802F9FD0(s32, f32, f32, f32);
void func_80324D54(f32, enum sfx_e, f32, s32, f32 [3], f32, f32);
void glcrc_calc_checksum(void *start, void *end, u32 *checksum);
f32 climbGetBottomY(void);
f32 climbGetTopY(void);
void func_802596AC(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]);

View File

@@ -1,10 +0,0 @@
#ifndef __MATH_LIBRARY_H__
#define __MATH_LIBRARY_H__
void ml_vec3f_normalize_copy(f32 arg0[3], f32 arg1[3]);
void ml_vec3f_yaw_rotate_copy(f32 arg0[3], f32 arg1[3], f32 arg2);
void ml_vec3f_diff_copy(f32 dst[3], f32 src1[3], f32 src2[3]);
void ml_vec3f_set_length_copy(f32 dst[3], f32 src[3], f32 len);
void ml_vec3f_set_length(f32 arg0[3], f32 arg2);
#endif

View File

@@ -1,35 +0,0 @@
#ifndef __ML_MTX__
#define __ML_MTX__
typedef struct {
f32 m[4][4];
} MtxF;
void mlMtxGet(MtxF *dst);
MtxF *mlMtx_get_stack_pointer(void);
void mlMtxApply(Mtx *mPtr);
void mlMtxPop(void);
void mlMtx_push_duplicate(void);
void mlMtx_push_identity(void);
void mlMtx_push_translation(f32 x, f32 y, f32 z);
void mlMtx_push_mtx(f32* mtx);
void mlMtx_push_multiplied(f32* l_mtx);
void mlMtx_push_multiplied_2(MtxF * l_mtx, MtxF * r_mtx);
void mlMtxIdent(void);
void mlMtxSet(MtxF* arg0);
void mlMtxRotPitch(f32 arg0);
void mlMtxRotYaw(f32 arg0);
void mlMtxRotRoll(f32 arg0);
void mlMtx_rotate_pitch_deg(f32 arg0);
void mlMtx_rotate_yaw_deg(f32 arg0);
void mlMtxRotatePYR(f32 pitch, f32 yaw, f32 roll);
void mlMtxScale_xyz(f32 x, f32 y, f32 z);
void mlMtxScale(f32 scale);
void mlMtx_apply_f3(f32 dst[3], f32 x, f32 y, f32 z);
void mlMtx_apply_vec3s(s16 dst[3], s16 src[3]);
void mlMtxTranslate(f32 x, f32 y, f32 z);
MtxF *func_8024DD90(void);
MtxF *func_8024DD9C(void);
#endif

View File

@@ -186,7 +186,7 @@ typedef struct actor_s{
f32 unk4C;
/* 0x50 */ f32 yaw; //0x50
f32 unk54; //0x54
u32 unk58_31: 15;
u32 animctrl_asset_id: 15; // animation asset id (enum asset_id)
u32 stored_animctrl_index: 14; //animctrlAnimIndex;
u32 unk58_2: 1;
u32 unk58_1: 1;

View File

@@ -47,6 +47,10 @@ typedef struct freelist_s{
#define FREE_LIST(T) struct freelist_s
//^defined to keep element type with sla
typedef struct {
f32 m[4][4];
} MtxF;
typedef struct bk_sprite_s{
s16 frameCnt;
s16 type;

View File

@@ -14,9 +14,6 @@ struct Overlay {
extern struct Overlay gOverlayTable[];
extern s32 framebuffer_width;
extern s32 framebuffer_height;
extern f32 climbPoleBottom[3];
extern f32 climbPoleTop[3];
#endif

View File

@@ -21,7 +21,7 @@ D_803FBE00 = 0x803FBE00;
D_803FFE00 = 0x803FFE00;
D_803FFE10 = 0x803FFE10;
gOverlayTable = 0x803FFE10;
D_803A5D00 = 0x803A5D00; /* framebuffers */
gFramebuffers = 0x803A5D00; /* framebuffers */
/* Renames for the boot segment */
boot_D_8002D500 = D_8002D500;

View File

@@ -20,7 +20,7 @@ D_803FBE00 = 0x803FBE00;
D_803FFE00 = 0x803FFE00;
D_803FFE10 = 0x803FFE10;
gOverlayTable = 0x803FFE10;
D_803A5D00 = 0x803A5D00; /* framebuffers */
gFramebuffers = 0x803A5D00; /* framebuffers */
/* Renames for the boot segment */
boot_D_8002D500 = D_8002D500;

View File

@@ -321,7 +321,7 @@ void chTiptup_update(Actor *this){
}
}
else{
if(ml_distance_vec3f(this->position, player_position) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){
if(ml_vec3f_distance(this->position, player_position) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){
chTiptup_setState(this, 2);
}
}
@@ -335,12 +335,12 @@ void chTiptup_update(Actor *this){
}
} //L80389370
else{
if(ml_distance_vec3f(this->position, player_position) >= 300.0f)
if(ml_vec3f_distance(this->position, player_position) >= 300.0f)
chTiptup_setState(this, 1);
}
}//L803893A0
if(this->state == 6){
if(ml_distance_vec3f(this->position, player_position) < 300.0f && !unqPtr->unk8){
if(ml_vec3f_distance(this->position, player_position) < 300.0f && !unqPtr->unk8){
unqPtr->unk8 = 1;
gcdialog_showText(0xc7d, 4, 0, 0, 0, 0);
}

View File

@@ -17,7 +17,6 @@ typedef struct{
extern f32 mapModel_getFloorY(f32 *);
extern void func_80256E24(f32 [3], f32, f32, f32, f32, f32);
void chflibbit_update(Actor *this);
Actor *chflibbit_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
@@ -373,7 +372,7 @@ void chflibbit_update(Actor *this){
sp84[0] = (f32)local->unkE[0];
sp84[1] = (f32)local->unkE[1];
sp84[2] = (f32)local->unkE[2];
if(ml_distance_vec3f(this->position, sp84) < 30.0f){
if(ml_vec3f_distance(this->position, sp84) < 30.0f){
func_80386AEC(this, 1);
}
else{

View File

@@ -260,7 +260,7 @@ bool func_8038C2A8(ActorMarker *marker) {
local = (ActorLocal_MrVile *)&this->local;
player_getPosition(player_position);
if (this->state == 6) {
return ml_distance_vec3f(this->position, player_position) < 150.0f;
return ml_vec3f_distance(this->position, player_position) < 150.0f;
}
return local->unk0 == 1;
}
@@ -351,7 +351,7 @@ void chvile_update(Actor *this) {
local->game_marker = actorArray_findClosestActorFromActorId(this->position, 0x138, -1, &sp90)->marker;
}
player_getPosition(player_position);
sp90 = ml_distance_vec3f(this->position, player_position);
sp90 = ml_vec3f_distance(this->position, player_position);
if (sp90 <= 300.0f) {
local->unk0 = (local->unk0 == 0) ? 1 : 2;
} else if (sp90 > 300.0f) {
@@ -411,7 +411,7 @@ void chvile_update(Actor *this) {
if (this->state == 4) {
player_getPosition(local->target_position);
local->unk10 = 500.0f;
if ((local->unkC == 102) && (ml_distance_vec3f(this->position, local->target_position) < 200.0f)) {
if ((local->unkC == 102) && (ml_vec3f_distance(this->position, local->target_position) < 200.0f)) {
BGS_func_8038BBA0(this, 103);
}
if ((local->unkC == 103) && (skeletalAnim_getLoopCount(this->unk148) >= 2)) {
@@ -420,7 +420,7 @@ void chvile_update(Actor *this) {
}
if (this->state == 5) {
local->unk10 = 200.0f;
if (ml_distance_vec3f(this->position, local->target_position) < 100.0f) {
if (ml_vec3f_distance(this->position, local->target_position) < 100.0f) {
local->target_position[0] = randf2(-500.0f, 500.0f);
local->target_position[1] = 0.0f;
local->target_position[2] = randf2(-500.0f, 500.0f);
@@ -428,12 +428,12 @@ void chvile_update(Actor *this) {
}
if ((this->state == 6)){
local->unk10 = 400.0f;
if((ml_distance_vec3f(this->position, local->target_position) < 100.0f) || (ml_distance_vec3f(player_position, local->target_position) < 300.0f)) {
if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(player_position, local->target_position) < 300.0f)) {
for(i = 0; i < 10; i++){
random_position[0] = randf2(-500.0f, 500.0f);
random_position[1] = 0.0f;
random_position[2] = randf2(-500.0f, 500.0f);
if ((i == 0) || (ml_distance_vec3f(player_position, random_position) > ml_distance_vec3f(player_position, local->target_position))) {
if ((i == 0) || (ml_vec3f_distance(player_position, random_position) > ml_vec3f_distance(player_position, local->target_position))) {
local->target_position[0] = random_position[0];
local->target_position[1] = random_position[1];
local->target_position[2] = random_position[2];

View File

@@ -140,7 +140,7 @@ void func_8038F6A4(Actor *this)
player_getPosition(sp48);
if (!this->has_met_before)
{
if ((((ml_distance_vec3f(local->unk18, sp48) < 250.0f) && (ml_distance_vec3f(local->unk18, sp48) > 80.0f)) && (!func_8028ECAC())) && (player_getTransformation() == TRANSFORM_1_BANJO))
if ((((ml_vec3f_distance(local->unk18, sp48) < 250.0f) && (ml_vec3f_distance(local->unk18, sp48) > 80.0f)) && (!func_8028ECAC())) && (player_getTransformation() == TRANSFORM_1_BANJO))
{
gcdialog_showText(0xC7E, 0, 0, 0, 0, 0);
this->has_met_before = TRUE;

View File

@@ -423,7 +423,7 @@ void BGS_func_8038E034(Actor *this) {
sp7C[0] = (f32) local->unk10[0];
sp7C[1] = (f32) local->unk10[1];
sp7C[2] = (f32) local->unk10[2];
if (ml_distance_vec3f(this->position, sp7C) < 30.0f) {
if (ml_vec3f_distance(this->position, sp7C) < 30.0f) {
func_8038D9D0(this, 1);
} else {
func_8038D9D0(this, 5);

View File

@@ -3,8 +3,6 @@
#include "math.h"
#include "variables.h"
extern f32 func_80256AB4(f32, f32, f32, f32);
extern f32 func_8025715C(f32, f32);
extern f32 *chVile_getPostion(ActorMarker *);
extern void bundle_setRandomVelocity(f32);
extern void func_802FDCB8(s32);
@@ -171,7 +169,7 @@ void BGS_func_80389850(Actor *this, s32 arg1) {
sp7C[2] = 0.0f;
sp7C[1] = sp94[1];
sp7C[0] = 0.0f;
if(ml_distance_vec3f(sp94, sp7C) <= 1000.0f){
if(ml_vec3f_distance(sp94, sp7C) <= 1000.0f){
break;
}
}
@@ -430,7 +428,7 @@ void chvilegame_player_consume_piece(Actor *this) {
if ((end != begin) && BGS_func_80389810(sp44)){
sp44[1] = 0.0f;
for(i_ptr = begin; i_ptr < end; i_ptr++){
if ((ml_distance_vec3f(i_ptr->position, sp44) < 65.25) && chyumblie_is_edible(i_ptr->marker)) {
if ((ml_vec3f_distance(i_ptr->position, sp44) < 65.25) && chyumblie_is_edible(i_ptr->marker)) {
is_correct_type = ((local->current_type != YUMBLIE) && (i_ptr->type != YUMBLIE)) || (((local->current_type == YUMBLIE) && i_ptr->type == YUMBLIE));
if (is_correct_type) {
local->player_score++;
@@ -468,7 +466,7 @@ bool chvilegame_cpu_consume_piece(ActorMarker *marker, f32 position[3]) {
begin = vector_getBegin(local->game_pieces);
end = vector_getEnd(local->game_pieces);
for(i_ptr = begin; i_ptr < end; i_ptr++){
if ((ml_distance_vec3f(i_ptr->position, position) < 50.0f) && func_8038B684(i_ptr->marker)) {
if ((ml_vec3f_distance(i_ptr->position, position) < 50.0f) && func_8038B684(i_ptr->marker)) {
local->vile_score++;
timedFunc_set_1(0.0f, (GenFunction_1)func_802FDCB8, ITEM_1B_VILE_VILE_SCORE);
timedFunc_set_1(0.5f, (GenFunction_1)func_802FDCB8, ITEM_1B_VILE_VILE_SCORE);
@@ -547,12 +545,12 @@ bool chvilegame_find_closest_piece(ActorMarker *marker, f32 position[0], f32 yaw
piece_direction[0] = i_ptr->position[0] - position[0];
piece_direction[1] = i_ptr->position[1] - position[1];
piece_direction[2] = i_ptr->position[2] - position[2];
distance = ml_distance_vec3f(i_ptr->position, position);
distance = ml_vec3f_distance(i_ptr->position, position);
angle_diff = func_80256AB4(target_direction[0], target_direction[2], piece_direction[0], piece_direction[2]);
if( (distance > 300.0f)
|| ((-0.8 < angle_diff) && (angle_diff < 0.8) && ((piece_direction[0]*target_direction[0] + piece_direction[1]*target_direction[1] + piece_direction[2]*target_direction[2]) >= 0.0f))
) {
if ((closest_piece == NULL) || (distance < ml_distance_vec3f(position, closest_piece->position))){
if ((closest_piece == NULL) || (distance < ml_vec3f_distance(position, closest_piece->position))){
closest_piece = i_ptr;
}
}

View File

@@ -1,9 +1,9 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "CC.h"
#include <core1/viewport.h>
#include "core2/modelRender.h"
typedef struct{

View File

@@ -1,8 +1,8 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
#include "core2/modelRender.h"
extern BKCollisionTri *func_8028EF48(void);
@@ -19,7 +19,6 @@ extern int func_80340020(s32, f32[3], s32, f32, s32, BKVertexList *, f32[3], f32
extern void boneTransformList_getBoneScale(s32, s32, f32[3]);
extern void boneTransformList_setBoneScale(s32, s32, f32[3]);
extern void func_8033A9A8(s32, s32, f32[3]);
extern void ml_vec3f_normalize(f32[3]);
extern void func_8033A45C(s32, s32);
extern void modelRender_setBoneTransformList(s32);
extern void func_8028FAB0(f32[3]);
@@ -331,7 +330,7 @@ void CC_func_80388F4C(void){
CC_func_80387D4C();
if(D_80389FA0.unk21 != 0 && func_80334904() == 2){
player_getPosition(sp6C);
D_80389FA0.unk20 = (ml_distance_vec3f(sp6C, D_80389FA0.unkC) < 200.0f);
D_80389FA0.unk20 = (ml_vec3f_distance(sp6C, D_80389FA0.unkC) < 200.0f);
D_80389FA0.unk38 += sp68;
sp64 = skeletalAnim_getProgress(D_80389FA0.unk0);
@@ -381,7 +380,7 @@ void CC_func_80388F4C(void){
if(D_80389FA0.unk21 == 3){
func_8034A174(D_80389FA0.unk34, 6, sp48);
if(ml_distance_vec3f(sp48, sp6C) <= 130.0f && sp6C[1] - sp48[1] < 50.0f){
if(ml_vec3f_distance(sp48, sp6C) <= 130.0f && sp6C[1] - sp48[1] < 50.0f){
func_8031D04C(MAP_21_CC_WITCH_SWITCH_ROOM, 1);
}
}//L80389260

View File

@@ -136,7 +136,7 @@ void func_803870F8(Actor *this){
sp3C[0] = this->position_x;
sp3C[1] = this->position_y + 100;
sp3C[2] = this->position_z;
if(ml_distance_vec3f(&sp3C, &sp70) < 120.0f){
if(ml_vec3f_distance(&sp3C, &sp70) < 120.0f){
func_8031D04C(MAP_22_CC_INSIDE_CLANKER, (local->unk0 == 1)? 7 : 6);
}
}//L80387500

View File

@@ -45,7 +45,7 @@ void func_803878A0(Actor *this, s32 next_state) {
local->unkC[0] = randf2(-500.0f, 500.0f);
local->unkC[1] = randf2(400.0f, 900.0f);
local->unkC[2] = randf2(-400.0f, 700.0f);
if(ml_distance_vec3f(this->position, local->unkC) > 800.0f)
if(ml_vec3f_distance(this->position, local->unkC) > 800.0f)
break;
}
local->unk8 = randf2(500.0f, 1000.0f);
@@ -90,7 +90,7 @@ void CCW_func_80387A40(Actor *this) {
sp5C[0] = local->unkC[0] - this->position[0];
sp5C[1] = local->unkC[1] - this->position[1];
sp5C[2] = local->unkC[2] - this->position[2];
if (ml_distance_vec3f(this->position, local->unkC) < 500.0f) {
if (ml_vec3f_distance(this->position, local->unkC) < 500.0f) {
ml_vec3f_set_length(sp5C, local->unk8 * 8.0f);
} else {
ml_vec3f_set_length(sp5C, local->unk8 * 2);
@@ -106,7 +106,7 @@ void CCW_func_80387A40(Actor *this) {
}
func_80258A4C(this->position, this->yaw - 90.0f, local->unkC, &sp58, &sp54, &sp50);
this->yaw += 140.0f * sp50 * sp68;
if (ml_distance_vec3f(this->position, local->unkC) < 100.0f) {
if (ml_vec3f_distance(this->position, local->unkC) < 100.0f) {
func_803878A0(this, 1);
}
}

View File

@@ -1,8 +1,8 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
typedef struct{
@@ -183,10 +183,10 @@ void func_8038687C(Actor *this) {
sp4C[1] = -100.0f;
sp4C[2] = randf2(-500.0f, 900.0f);
if(ml_distance_vec3f(this->position, sp4C) < 400.0f)
if(ml_vec3f_distance(this->position, sp4C) < 400.0f)
continue;
tmp = ml_distance_vec3f(sp5C, sp4C);
tmp = ml_vec3f_distance(sp5C, sp4C);
phi_v0 = (phi_s0 < 0xA) ? 500 : 200;
if(tmp < (f32) phi_v0)
continue;
@@ -207,7 +207,7 @@ void func_8038687C(Actor *this) {
func_803865F4(this, 3);
} else if ((local->unk0 != NULL) && (map_get() == MAP_5A_CCW_SUMMER_ZUBBA_HIVE)) {
player_getPosition(sp40);
if ((ml_distance_vec3f(this->position, sp40) < 300.0f) && (player_getTransformation() == TRANSFORM_1_BANJO)) {
if ((ml_vec3f_distance(this->position, sp40) < 300.0f) && (player_getTransformation() == TRANSFORM_1_BANJO)) {
func_803865F4(this, 2);
}
}

View File

@@ -161,7 +161,7 @@ void chGobiCCW_update(Actor *this) {
if(this->state == 1){
if (!this->has_met_before) {
player_getPosition(sp48);
if (ml_distance_vec3f(this->position, sp48) < 600.0f) {
if (ml_vec3f_distance(this->position, sp48) < 600.0f) {
if (local->unk0->unk2 != 0) {
gcdialog_showText((s32) local->unk0->unk2, 4, NULL, NULL, NULL, NULL);
}

View File

@@ -271,7 +271,7 @@ void CCW_func_80389BFC(Actor *this) {
}
if ((local->unk0->map_id != MAP_43_CCW_SPRING) && ((this->position[0] + 500.0f) < sp4C[0])) {
player_setCarryObjectPoseInCylinder(this->position, 1110.0f, 200.0f, ACTOR_2A2_CATERPILLAR, &this);
if ((local->unk0->unkE != 0) && (carriedObj_getActorId() == ACTOR_2A2_CATERPILLAR) && (ml_distance_vec3f(this->position, sp4C) < 1010.0f) && (player_throwCarriedObject() != 0)) {
if ((local->unk0->unkE != 0) && (carriedObj_getActorId() == ACTOR_2A2_CATERPILLAR) && (ml_vec3f_distance(this->position, sp4C) < 1010.0f) && (player_throwCarriedObject() != 0)) {
player_setThrowTargetPosition(D_8038FDE0);
if ((local->unk0->map_id == MAP_44_CCW_SUMMER) && (local->unk4 == 0)) {
gcdialog_showText(0xCD8, 4, NULL, NULL, NULL, NULL);

View File

@@ -111,13 +111,13 @@ void chcaterpillar_update(Actor *this){
if(this->state == 1){
skeletalAnim_getProgressRange(this->unk148, &sp64, &sp60);
player_getPosition(sp74);
if(ml_distance_vec3f(this->position, local->unk0) < 10.0f){
if(ml_vec3f_distance(this->position, local->unk0) < 10.0f){
for(i = 0; i < 10; i++){
local->unk0[0] = randf2(-300.0f, 300.0f) + this->position_x;
local->unk0[1] = this->position_y;
local->unk0[2] = randf2(-300.0f, 300.0f) + this->position_z;
if( !(ml_distance_vec3f(local->unk0, this->position) < 50.0f) && func_80329210(this, local->unk0))
if( !(ml_vec3f_distance(local->unk0, this->position) < 50.0f) && func_80329210(this, local->unk0))
break;
}//L8038A544
if(i == 10){
@@ -150,7 +150,7 @@ void chcaterpillar_update(Actor *this){
}
}//L8038A714
if(ml_distance_vec3f(this->position, sp74) < 50.0f){
if(ml_vec3f_distance(this->position, sp74) < 50.0f){
func_8028F030(ACTOR_2A2_CATERPILLAR);
if(!volatileFlag_get(VOLATILE_FLAG_B2)){
gcdialog_showText(ASSET_CC7_TEXT_UNKNOWN, 4, NULL, NULL, NULL, NULL);
@@ -177,7 +177,7 @@ void chcaterpillar_update(Actor *this){
local->unk24 += 3.3333333333333335*sp84;
local->unk24 = (1.0 < local->unk24) ? 1.0 : local->unk24;
ml_interpolate_vec3f(this->position, local->unkC, local->unk18, local->unk24);
ml_vec3f_interpolate_fast(this->position, local->unkC, local->unk18, local->unk24);
this->position[1] += 50.0f*sinf(local->unk24*3.141592654);
if(1.0 == local->unk24){

View File

@@ -101,7 +101,7 @@ void func_8038AA8C(Actor *this) {
}
player_getPosition(sp54);
if (ml_distance_vec3f(this->position, sp54) < 850.0f) {
if (ml_vec3f_distance(this->position, sp54) < 850.0f) {
func_8038A950(this, 2);
}
}

View File

@@ -133,7 +133,7 @@ void chnabnut_update(Actor *this) {
if (this->state == NABNUT_STATE_1_SAD) {
player_getPosition(sp30);
if (!this->has_met_before && (ml_distance_vec3f(this->position, sp30) < 400.0f)) {
if (!this->has_met_before && (ml_vec3f_distance(this->position, sp30) < 400.0f)) {
this->has_met_before = TRUE;
gcdialog_showText(0xCCA, 0xE, this->position, NULL, NULL, NULL);
}
@@ -143,7 +143,7 @@ void chnabnut_update(Actor *this) {
}
if (this->has_met_before && !func_803114B0()) {
player_setCarryObjectPoseInCylinder(this->position, 500.0f, 200.0f, ACTOR_2A9_ACORN, &this);
if ((carriedObj_getActorId() == ACTOR_2A9_ACORN) && (ml_distance_vec3f(this->position, sp30) < 300.0f) && player_throwCarriedObject()) {
if ((carriedObj_getActorId() == ACTOR_2A9_ACORN) && (ml_vec3f_distance(this->position, sp30) < 300.0f) && player_throwCarriedObject()) {
player_setThrowTargetPosition(D_8038F350);
local->returned_acorn_count++;
if (local->returned_acorn_count == 6) {

View File

@@ -114,7 +114,7 @@ void func_8038C41C(Actor *this) {
if ((this->marker->id == 0x1CB) && (this->state == 2)) {
player_getPosition(sp2C);
if (!this->has_met_before && (ml_distance_vec3f(this->position, sp2C) < 400.0f)) {
if (!this->has_met_before && (ml_vec3f_distance(this->position, sp2C) < 400.0f)) {
this->has_met_before = TRUE;
gcdialog_showText(0xCCD, 0, NULL, NULL, NULL, NULL);
}

View File

@@ -73,7 +73,7 @@ void func_8038C7A8(Actor *this) {
if (this->state == 1) {
player_getPosition(sp38);
if (ml_distance_vec3f(this->position, sp38) < 50.0f) {
if (ml_vec3f_distance(this->position, sp38) < 50.0f) {
func_8028F030(0x2A9);
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 25000, this->position, 500, 2500);
CCW_func_8038C6A0(this, 5);
@@ -91,7 +91,7 @@ void func_8038C7A8(Actor *this) {
if (this->state == 3) {
local->unk18 += 3.3333333333333333 * sp44;
local->unk18 = (local->unk18 > 1.0) ? 1.0 : local->unk18;
ml_interpolate_vec3f(this->position, local->unk0, local->unkC, local->unk18);
ml_vec3f_interpolate_fast(this->position, local->unk0, local->unkC, local->unk18);
this->position[1] += 50.0f * sinf(local->unk18 * BAD_PI);
if (local->unk18 == 1.0) {
CCW_func_8038C6A0(this, 4);

View File

@@ -118,7 +118,7 @@ void func_8038CC4C(Actor *this) {
}
if (!this->has_met_before) {
player_getPosition(sp38);
if (ml_distance_vec3f(this->position, sp38) < 900.0f) {
if (ml_vec3f_distance(this->position, sp38) < 900.0f) {
if (local->unk0->map_id != MAP_46_CCW_WINTER || func_8028F2FC()) {
gcdialog_showText(local->unk0->unk4, 4, NULL, NULL, NULL, NULL);
this->has_met_before = TRUE;

View File

@@ -116,7 +116,7 @@ void func_8038CFB4(Actor *this) {
if (this->state == 1) {
if (!this->has_met_before) {
player_getPosition(sp60);
if (ml_distance_vec3f(this->position, sp60) < 900.0f) {
if (ml_vec3f_distance(this->position, sp60) < 900.0f) {
gcdialog_showText(0xCCF, 4, NULL, NULL, NULL, NULL);
this->has_met_before = TRUE;
}

View File

@@ -69,7 +69,7 @@ void func_8038D368(Actor *this) {
if(!this->has_met_before){
player_getPosition(plyr_pos);
if (ml_distance_vec3f(this->position, plyr_pos) < 600.0f) {
if (ml_vec3f_distance(this->position, plyr_pos) < 600.0f) {
if (!jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) {
gcdialog_showText(local->unk0->unk2, 4, NULL, NULL, NULL, NULL);
} else {

View File

@@ -84,7 +84,7 @@ void func_8038A318(ActorMarker *caller, enum asset_e text_id, s32 arg1){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000);
func_8025A6EC(COMUSIC_5B_FP_IGLOO_HAPPY, 25000);
func_8025A58C(0, 4000);
func_8024BD08(0);
core1_ce60_incOrDecCounter(FALSE);
}
}

View File

@@ -201,7 +201,7 @@ void func_80388D70(ActorMarker *caller, enum asset_e text_id, s32 arg2){
case 0xc29://L80388DC4
func_8025A6EC(COMUSIC_3A_FP_BOGGY_RACE, 25000);
func_8025A58C(0, 4000);
func_8024BD08(0);
core1_ce60_incOrDecCounter(FALSE);
func_802BE720();
local->unk0 = partEmitMgr_newEmitter(16);
local->unk4 = partEmitMgr_newEmitter(16);

View File

@@ -1,7 +1,6 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
void chScarfSled_update(Actor *this);

View File

@@ -199,7 +199,7 @@ void func_8038D3D8(void){
comusic_8025AB44(COMUSIC_68_TWINKLY_MINIGAME, 0, 4000);
func_8025AABC(COMUSIC_68_TWINKLY_MINIGAME);
func_8025A58C(-1, 4000);
func_8024BD08(1);
core1_ce60_incOrDecCounter(TRUE);
}
void func_8038D41C(ActorMarker *marker){
@@ -265,7 +265,7 @@ void func_8038D5C8(ActorMarker *this_marker, ActorMarker *other_marker){
this->unk1C[1] = 0.0f;
func_8025A6EC(COMUSIC_68_TWINKLY_MINIGAME, 25000);
func_8025A58C(0, 4000);
func_8024BD08(0);
core1_ce60_incOrDecCounter(FALSE);
this->unk1C[2] = 428571.0f;
func_8025AEA0(0x68, (s32)this->unk1C[2]);
subaddie_set_state_with_direction(this, 3, 0.001f, 1);

View File

@@ -140,7 +140,7 @@ bool func_8038F5D4(Actor *this, f32 arg1[3], f32 arg2, f32 arg3, s32 arg4){
}
this->actor_specific_1_f = (1.0f- sp24)*arg2;
func_80329054(this, 2);
if(ml_distance_vec3f(this->position, arg1) <= arg4)
if(ml_vec3f_distance(this->position, arg1) <= arg4)
return TRUE;
return FALSE;

View File

@@ -1,7 +1,7 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
void func_80390EB0(Actor *this);

View File

@@ -1,8 +1,8 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "prop.h"
#include "SnS.h"
#include "actor.h"
extern ActorInfo D_80367FE0;

View File

@@ -69,7 +69,7 @@ void func_8038ABDC(void){
comusic_8025AB44(COMUSIC_3A_FP_BOGGY_RACE, 0, 4000);
func_8025AABC(COMUSIC_3A_FP_BOGGY_RACE);
func_8025A58C(-1, 4000);
func_8024BD08(1);
core1_ce60_incOrDecCounter(TRUE);
}
void func_8038AC20(s32 gate_indx, s32 arg1){

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void func_80244BB0(s32, s32, s32, f32);
extern void core1_7090_initSfxSource(s32, s32, s32, f32);
typedef struct {
f32 unk0[3];
@@ -75,13 +75,13 @@ void func_80386620(Actor *this){
}
void func_8038678C(void){
func_80244BB0(3, 0x85, 0x7ff8, 1.0f);
func_80244BB0(4, 0x85, 0x7ff8, 1.0f);
core1_7090_initSfxSource(3, 0x85, 0x7ff8, 1.0f);
core1_7090_initSfxSource(4, 0x85, 0x7ff8, 1.0f);
}
void func_803867CC(void){
func_80244C78(3);
func_80244C78(4);
core1_7090_freeSfxSource(3);
core1_7090_freeSfxSource(4);
}
void func_803867F4(void){
@@ -167,7 +167,7 @@ void chAncientOne_update(Actor *this){
if(this->unkF4_8 < 5){
D_80390C28[this->unkF4_8]->propPtr->unk8_4 = TRUE;
func_802BAFE4(GV_D_80390C20[this->unkF4_8 - 1]);
func_80244BB0(2, 0x86, 0x7ff8, 0.3f);
core1_7090_initSfxSource(2, 0x86, 0x7ff8, 0.3f);
timedFunc_set_0(0.45f, func_8038678C);
}//L80386DB0
@@ -190,7 +190,7 @@ void chAncientOne_update(Actor *this){
}//L80386D80
}
if(LOCAL_CH_ANCIENT_ONE(this)->unk1C <= this->position_y){
func_80244C78(2);
core1_7090_freeSfxSource(2);
timedFunc_set_0(0.5f, func_803867CC);
}
}//L80386DB0

View File

@@ -1,7 +1,7 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
void GV_func_8038A084(Actor *this);

View File

@@ -2,7 +2,6 @@
#include "functions.h"
#include "variables.h"
f32 func_80257204(f32, f32, f32, f32);
void func_8038B124(Actor *this);
/* .data */

View File

@@ -72,7 +72,7 @@ void func_8038D47C(Actor *this){
if(!mapSpecificFlags_get(0x14)){
player_getPosition(sp3C);
if(func_8028ECAC() == 0){
if( ml_distance_vec3f(sp3C, this->unk1C) < 100.0f || ml_distance_vec3f(sp3C, this->velocity) < 100.0f){
if( ml_vec3f_distance(sp3C, this->unk1C) < 100.0f || ml_vec3f_distance(sp3C, this->velocity) < 100.0f){
if(gcdialog_showText(ASSET_A7B_TEXT_JINXY_MEET, 0, NULL, NULL, NULL, NULL)){
mapSpecificFlags_set(0x14, 1);
}

View File

@@ -1,10 +1,10 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "SnS.h"
#include "actor.h"
extern void func_80244BB0(s32, s32, s32, f32);
extern void core1_7090_initSfxSource(s32, s32, s32, f32);
extern void func_802D3D54(Actor *this);
extern void func_802D3D74(Actor *this);
extern Actor *func_80325F2C(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
@@ -231,7 +231,7 @@ void func_8038E648(Actor *this){
func_802BAFE4(2);
subaddie_set_state(this, 6);
this->unk38_31 = 600;
func_80244BB0(0, 0x6A, 0x7ff8, 0.3f);
core1_7090_initSfxSource(0, 0x6A, 0x7ff8, 0.3f);
func_802D68F0(25);
item_set(ITEM_6_HOURGLASS, 1);
}
@@ -243,7 +243,7 @@ void func_8038E648(Actor *this){
subaddie_set_state(this, 7);
this->pitch = 90.0f;
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
func_80244C78(0);
core1_7090_freeSfxSource(0);
}
break;
@@ -251,7 +251,7 @@ void func_8038E648(Actor *this){
this->unk38_31 -= time_getDelta();
if(this->unk38_31 == 0){
subaddie_set_state(this, 8);
func_80244BB0(0, 0x6A, 0x7ff8, 0.3f);
core1_7090_initSfxSource(0, 0x6A, 0x7ff8, 0.3f);
}
break;
@@ -262,7 +262,7 @@ void func_8038E648(Actor *this){
this->pitch = 0.0f;
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
mapSpecificFlags_set(5, FALSE);
func_80244C78(0);
core1_7090_freeSfxSource(0);
volatileFlag_setAndTriggerDialog_0(VOLATILE_FLAG_AC_GV_TRAPDOOR_MISSED);
}
break;
@@ -296,7 +296,7 @@ void func_8038E97C(Actor *this){
this->position_y += 130.0;
this->unk38_31 = 30;
subaddie_set_state(this, 8);
func_80244BB0(1, 0x6A, 0x7ff8, 0.3f);
core1_7090_initSfxSource(1, 0x6A, 0x7ff8, 0.3f);
}
}//L8038EA6C
@@ -314,7 +314,7 @@ void func_8038E97C(Actor *this){
this->unk38_31 -= 1;
if(this->unk38_31 == 0){
subaddie_set_state(this, 1);
func_80244C78(1);
core1_7090_freeSfxSource(1);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
}
@@ -330,7 +330,7 @@ void chKazooieDoor_update(Actor *this){
func_8025A6EC(COMUSIC_2B_DING_B, -1);
func_802BAFE4(3);
subaddie_set_state(this, 6);
func_80244BB0(1, 0x6a, 0x7ff8, 0.3f);
core1_7090_initSfxSource(1, 0x6a, 0x7ff8, 0.3f);
this->unk1C[1] = this->position_y + 210.0f;
this->unk1C[0] = this->position_y;
}
@@ -342,7 +342,7 @@ void chKazooieDoor_update(Actor *this){
if(this->unk1C[1] <= this->position_y){
subaddie_set_state(this, 7);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
func_80244C78(1);
core1_7090_freeSfxSource(1);
this->unk38_31 = 450;
}
break;
@@ -351,7 +351,7 @@ void chKazooieDoor_update(Actor *this){
this->unk38_31--;
if(this->unk38_31 == 0){
subaddie_set_state(this, 8);
func_80244BB0(1, 0x6a, 0x7ff8, 0.3f);
core1_7090_initSfxSource(1, 0x6a, 0x7ff8, 0.3f);
}
break;
@@ -362,7 +362,7 @@ void chKazooieDoor_update(Actor *this){
this->position_y = this->unk1C[0];
subaddie_set_state(this, 1);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
func_80244C78(1);
core1_7090_freeSfxSource(1);
mapSpecificFlags_set(6, FALSE);
}
break;

View File

@@ -8,7 +8,7 @@
/* external function declarations */
void func_80353064(f32 *, f32);
void func_802BB3DC(s32, f32, f32);
void func_80244BB0(s32, s32, s32, f32);
void core1_7090_initSfxSource(s32, s32, s32, f32);
/* public function declarations */
void chchimpystump_update(Actor *this);
@@ -33,7 +33,7 @@ void __chchimpystump_updateShaking(Actor *this) {
if (this->unk10_12 == 0) {
this->unk10_12 = 1;
func_802BB3DC(1, 3.0f, 1.0f);
func_80244BB0(0, 0x6A, 0x7FF8, 0.2f);
core1_7090_initSfxSource(0, 0x6A, 0x7FF8, 0.2f);
}//L80386D0C
this->position_x = ((globalTimer_getTime() & 1) * 2) ^ (s32) this->position_x;
@@ -67,7 +67,7 @@ void chchimpystump_update(Actor *this) {
this->position_y = this->actor_specific_1_f;
subaddie_set_state(this, CHIMPY_STUMP_STATE_3_RAISED);
func_802BB41C(1);
func_80244C78(0);
core1_7090_freeSfxSource(0);
}
if ((globalTimer_getTime() & 3) == 2) {

View File

@@ -2,9 +2,6 @@
#include "functions.h"
#include "variables.h"
/* extern functions */
extern void ml_vec3f_assign(f32[3], f32, f32, f32);
/* public functions */
void chLoggo_update(Actor *this);

View File

@@ -1,7 +1,7 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
typedef struct{
ActorMarker *jiggy_marker;

View File

@@ -210,7 +210,7 @@ void chChompa_update(Actor *this) {
}//L803880B4
player_getPosition(plyr_position);
plyr_dist = ml_distance_vec3f(this->position, plyr_position);
plyr_dist = ml_vec3f_distance(this->position, plyr_position);
if (this->state == CHOMPA_STATE_4_BITING) {
actor_collisionOn(this);

View File

@@ -1,7 +1,7 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "SnS.h"
#include "actor.h"
extern ActorInfo D_8038BC28;
@@ -33,7 +33,7 @@ extern ActorInfo D_8038BEFC;
extern ActorInfo D_80367E70;
extern ActorInfo D_80372C3C;
extern void func_80244BB0(s32, s32, s32, f32);
extern void core1_7090_initSfxSource(s32, s32, s32, f32);
extern void func_8025AE0C(s32, f32);
extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32);
extern void *func_80309B48(f32[3], f32[3], f32[3], u32);
@@ -307,7 +307,7 @@ void func_80388BDC(Actor *this) {
if(mapSpecificFlags_get(MMM_SPECIFIC_FLAG_0_UNKNOWN)) {
func_802BAFE4(0x21);
subaddie_set_state(this, 6);
func_80244BB0(0, 0x6A, 0x7FF8, 0.3f);
core1_7090_initSfxSource(0, 0x6A, 0x7FF8, 0.3f);
mapSpecificFlags_set(MMM_SPECIFIC_FLAG_2_UNKNOWN, FALSE);
func_8025A6EC(COMUSIC_4_MMM_CLOCK_VERSION, -1);
func_8025AE0C(2000, 3.0f);
@@ -320,7 +320,7 @@ void func_80388BDC(Actor *this) {
subaddie_set_state(this, 7U);
this->yaw = 270.0f;
func_8030E540(0x7F);
func_80244C78(0);
core1_7090_freeSfxSource(0);
func_802D68F0(0xE);
item_set(6, 1);
}
@@ -341,7 +341,7 @@ void func_80388BDC(Actor *this) {
func_802BAFE4(0x23);
}
subaddie_set_state(this, 8);
func_80244BB0(0, 0x6A, 0x7FF8, 0.3f);
core1_7090_initSfxSource(0, 0x6A, 0x7FF8, 0.3f);
}
break;
case 8:
@@ -351,7 +351,7 @@ void func_80388BDC(Actor *this) {
this->yaw = 0.0f;
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
mapSpecificFlags_set(MMM_SPECIFIC_FLAG_0_UNKNOWN, FALSE);
func_80244C78(0);
core1_7090_freeSfxSource(0);
if (!this->unk38_31) {
func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 0x7FF8);
func_8025AE0C(0x7D0, 2.5f);

View File

@@ -385,7 +385,7 @@ void organMinigame_update(void){
if(func_8038769C(D_8038C4F0.motzhand_marker)){
player_getPosition(plyr_pos);
motzhand_2 = marker_getActor(D_8038C4F0.motzhand_marker);
if( ml_distance_vec3f(motzhand_2->position, plyr_pos) < 400.0f
if( ml_vec3f_distance(motzhand_2->position, plyr_pos) < 400.0f
&& motzhand_2->position_y - 50.0f <= plyr_pos[1]
){
organMinigame_setState(2);

View File

@@ -1,11 +1,10 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
/* extern functions */
extern void sfxsource_setSampleRate(u8, s32);
extern f32 ml_vec3f_horizontal_distance_zero_likely(f32[3], f32[3]);
/* data */
enum chTumblar_state_e {

View File

@@ -119,7 +119,7 @@ void func_803890BC(Actor *this){
local->unk1C += 0.25 * sp38;
if(1.0f < local->unk1C)
local->unk1C = 1.0f;
ml_interpolate_vec3f(sp2C, local->unk4, local->unk10, local->unk1C);
ml_vec3f_interpolate_fast(sp2C, local->unk4, local->unk10, local->unk1C);
this->pitch = sp2C[0];
this->yaw = sp2C[1];
this->roll = sp2C[2];

View File

@@ -4,7 +4,6 @@
#include "core2/particle.h"
extern void ml_interpolate_vec3f(f32 [3], f32 [3], f32 [3], f32);
extern void bundle_setYaw(f32);
extern int func_80309EB0(f32(*)[3], f32, f32 (*)[3], s32);
extern int func_803342AC(f32(*)[3], f32(*)[3],f32);
@@ -276,7 +275,7 @@ void func_8038F430(ActorMarker *marker, s32 arg1){
if(actor->state < 3){
player_getPosition(&sp18);
if(ml_distance_vec3f(&actor->position, &sp18) < 300.0f)
if(ml_vec3f_distance(&actor->position, &sp18) < 300.0f)
func_8028F55C(5, actor->marker);
func_8038F190(actor, 3);
}//L8038F4A4
@@ -353,7 +352,7 @@ void func_8038F618(Actor *this){
}
func_8038E92C(this);
if(this->state == 1){
if(sp78 && ml_distance_vec3f(&this->position, &sp7C) < 500.0f){
if(sp78 && ml_vec3f_distance(&this->position, &sp7C) < 500.0f){
func_8038F190(this, 2);
}
}//L8038F7A0
@@ -372,7 +371,7 @@ void func_8038F618(Actor *this){
skeletalAnim_getProgressRange(this->unk148, &sp6C, &sp68);
if(0.1 <= sp68 && sp68 <= 0.6)
ml_interpolate_vec3f(this->position, &local->unk14, &local->unk20, (sp68 - 0.1) /0.5 );
ml_vec3f_interpolate_fast(this->position, &local->unk14, &local->unk20, (sp68 - 0.1) /0.5 );
if(sp6C < 0.6 && 0.6 <= sp68)
func_8030E878(SFX_6C_LOCKUP_CLOSING, 1.1 + randf2(-0.05f, 0.05f), 20000, this->position, 500.0f, 1000.0f);
@@ -387,7 +386,7 @@ void func_8038F618(Actor *this){
this->yaw += (sp44*400.0f)*sp70;
if(skeletalAnim_getLoopCount(this->unk148) > 0){
if(ml_distance_vec3f(&this->position, &local->unk8) < 10.0f){
if(ml_vec3f_distance(&this->position, &local->unk8) < 10.0f){
func_8038F190(this, 1);
}else{
func_8038F190(this, 2);

View File

@@ -546,7 +546,7 @@ void func_8038D8BC(Actor *this){
}
}
else{//L8038DAA8
if(ml_distance_vec3f(this->position, player_position) < 1200.0f){
if(ml_vec3f_distance(this->position, player_position) < 1200.0f){
RBB_func_8038CC9C(this, 2);
}
}
@@ -582,7 +582,7 @@ void func_8038D8BC(Actor *this){
skeletalAnim_getProgressRange(this->unk148, &sp54, &sp50);
if(0.1 <= sp50 && sp50 <= 0.6){
sp4C = (sp50 - 0.1)/0.5;
ml_interpolate_vec3f(this->position, local->unk8, local->unk14, sp4C);
ml_vec3f_interpolate_fast(this->position, local->unk8, local->unk14, sp4C);
this->yaw = local->unk24 + sp4C*(local->unk28 - local->unk24);
}
@@ -600,7 +600,7 @@ void func_8038D8BC(Actor *this){
tmp_f2 = tmp_f2/0.3;
else
tmp_f2 = 1.0f;
ml_interpolate_vec3f(this->position, local->unk8, local->unk14, tmp_f2);
ml_vec3f_interpolate_fast(this->position, local->unk8, local->unk14, tmp_f2);
}
}//L8038DE10

View File

@@ -1,9 +1,9 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "prop.h"
#include "actor.h"
#include <core1/viewport.h>
extern ActorInfo D_80390D20;

View File

@@ -101,7 +101,7 @@ void func_80387488(ActorMarker *marker){
player_getPosition(&sp1C);
if(-50.0f < sp1C[1] && sp1C[1] < 600.0f){
sp1C[1] = 0;
if(ml_distance_vec3f(&sp1C, &D_80390264) < 500.0f){
if(ml_vec3f_distance(&sp1C, &D_80390264) < 500.0f){
timedFunc_set_1(1.0f, (GenFunction_1) func_80387488, (s32)actor->marker);
return;
}

View File

@@ -495,7 +495,7 @@ void chSmBottles_update(Actor *this) {
(this->unkF4_8 == 8 && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_2)) ||
(this->unkF4_8 == 8 && mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_F))
) {//L80389C50
if (((ml_distance_vec3f(plyr_pos, this->unk1C) < this->actor_specific_1_f) && func_8028F20C()) ||
if (((ml_vec3f_distance(plyr_pos, this->unk1C) < this->actor_specific_1_f) && func_8028F20C()) ||
mapSpecificFlags_get(SM_SPECIFIC_FLAG_10)
) {//L80389C8C
if (func_80329530(this, 0x96)) {

View File

@@ -475,7 +475,7 @@ void chVegetablesUpdate(Actor *this) {
ml_vec3f_set_length(this->velocity, 50.0f);
}
if (ml_distance_vec3f(this->position, this->unk1C) < 20.0f) {
if (ml_vec3f_distance(this->position, this->unk1C) < 20.0f) {
func_80387E64(this);
}

View File

@@ -40,7 +40,7 @@ void func_8038A8F8(Actor *this){
this->volatile_initialized = TRUE;
}//L8038A968
player_getPosition(this->velocity);
sp2C = ml_distance_vec3f(this->velocity, this->position);
sp2C = ml_vec3f_distance(this->velocity, this->position);
if(sp2C < (f32) this->unkF4_8)
func_80388D48();
@@ -48,7 +48,7 @@ void func_8038A8F8(Actor *this){
if( !mapSpecificFlags_get(SM_SPECIFIC_FLAG_2)
|| (mapSpecificFlags_get(SM_SPECIFIC_FLAG_3_ALL_SM_ABILITIES_LEARNED) && !mapSpecificFlags_get(SM_SPECIFIC_FLAG_F))
){ //L8038AA54
this->yaw_ideal = ml_distance_vec3f(this->velocity, this->unk1C) / 150.0;
this->yaw_ideal = ml_vec3f_distance(this->velocity, this->unk1C) / 150.0;
func_8028F3D8(this->unk1C, this->yaw_ideal, func_8038A8C0, this->marker);
mapSpecificFlags_set(SM_SPECIFIC_FLAG_10, TRUE);
}

View File

@@ -3,7 +3,6 @@
#include "variables.h"
extern Actor *spawnQueue_bundle_f32(s32, s32, s32, s32);
extern f32 func_80257204(f32, f32, f32, f32);
extern ActorProp * func_80320EB0(ActorMarker *, f32, s32);
static void __chClam_updateFunc(Actor *this);

View File

@@ -213,13 +213,13 @@ static void __chNipper_updateFunc(Actor *this){
if(0.0f == this->velocity_x && xVelocity){
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, -1, 5000);
func_8032BB88(this, 0, 4000);
func_8024BD08(0);
core1_ce60_incOrDecCounter(FALSE);
}
else if(!xVelocity && 0.0f != this->velocity_x){
comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 0, 300);
func_8025AABC(COMUSIC_12_TTC_NIPPER);
func_8032BB88(this, -1, 300);
func_8024BD08(1);
core1_ce60_incOrDecCounter(TRUE);
}
this->velocity_x = xVelocity;
}

View File

@@ -1,8 +1,8 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "prop.h"
#include "SnS.h"
#include "actor.h"
extern ActorInfo gChClam;

View File

@@ -1,8 +1,8 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "SnS.h"
/* extern */
extern void func_802D6310(f32, enum map_e, s32, s32, enum file_progress_e);

View File

@@ -1,4 +1,5 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "version.h"
@@ -6,10 +7,6 @@
#define MAIN_THREAD_STACK_SIZE 0x17F0
void setBootMap(enum map_e);
void func_8023DFF0(s32);
#if VERSION == VERSION_PAL
extern s32 D_80000300;
#endif
@@ -17,10 +14,7 @@ void func_8023DFF0(s32);
s32 D_80275610 = 0;
s32 D_80275614 = 0;
u32 gGlobalTimer = 0;
u32 sDebugVar_8027561C[] = { // never used
0x9, 0x4, 0xA, 0x3, 0xB, 0x2, 0xC, 0x5, 0x0,
0x1, 0x6, 0xD, -1
};
u32 sDebugVar_8027561C[] = { 0x9, 0x4, 0xA, 0x3, 0xB, 0x2, 0xC, 0x5, 0x0, 0x1, 0x6, 0xD, -1 }; // never used
u32 D_80275650 = VER_SELECT(0xAD019D3C, 0xA371A8F3, 0, 0); //SM_DATA_CRC_1
u32 D_80275654 = VER_SELECT(0xD381B72F, 0xD0709154, 0, 0); //SM_DATA_CRC_2
char sDebugVar_80275658[] = VER_SELECT("HjunkDire:218755", "HjunkDire:300875", "HjunkDire:", "HjunkDire:");
@@ -33,13 +27,11 @@ u64 sDebugVar_8027A540; // never used
u8 sMainThreadStack[MAIN_THREAD_STACK_SIZE]; // The real size of the stack is unclear yet, maybe there are some out-optimized debug variables below the stack
OSThread sMainThread;
s32 gBootMap;
s32 gDisableInput;
u64 sDebugVar_8027BEF0; // never used
static bool sDisableInput;
static u64 sDebugVar_8027BEF0; // never used
extern u8 core2_TEXT_START[];
extern u16 D_803A5D00[2][0x1ECC0/2];
void func_8023DA20(s32 arg0){
bzero(&D_8027A130, core2_TEXT_START - (u8*)&D_8027A130);
osWriteBackDCacheAll();
@@ -55,7 +47,7 @@ void func_8023DA74(void){
void func_8023DA9C(s32 arg0){
func_80254008();
func_8024C428();
viMgr_clearFramebuffers();
if (D_8027A130 == 4){
func_802E3580();
}
@@ -70,7 +62,7 @@ void func_8023DA9C(s32 arg0){
if (D_8027A130 == 4){
dummy_func_802E35D0();
}
dummy_func_80255CD8();
ucode_stub1();
}
u32 globalTimer_getTimeMasked(u32 mask){
@@ -107,10 +99,10 @@ void core1_init(void) {
#if VERSION == VERSION_PAL
osTvType = 0;
#endif
func_80255C30();
ucode_load();
setBootMap(getDefaultBootMap());
rarezip_init(); //initialize decompressor's huft table
func_8024BE30();
viMgr_init();
overlayManagerloadCore2();
sDebugVar_8027BEF0 = sDebugVar_8027A538;
heap_init();
@@ -151,14 +143,14 @@ void mainLoop(void){
if(D_8027A130 != 3 || getGameMode() != GAME_MODE_4_PAUSED)
globalTimer_incTimer();
if(!gDisableInput)
if (!sDisableInput)
pfsManager_update();
gDisableInput = 0;
sDisableInput = FALSE;
rumbleManager_80250C08();
if(!mapSpecificFlags_validateCRC1()){
write_file_blocks(0, 0, 0x80397AD0, 0x40);
eeprom_writeBlocks(0, 0, 0x80397AD0, 0x40);
}
switch(D_8027A130){
@@ -185,7 +177,7 @@ void mainLoop(void){
){
s32 offset;
//render weird CRC failure image
for(y= 0x1e; y < framebuffer_height - 0x1e; y++){//L8023DEB4
for(y= 0x1e; y < gFramebufferHeight - 0x1e; y++){//L8023DEB4
for(x = 0x14; x < 0xeb; x++){
tmp = ((8 * globalTimer_getTime()) + ((x*x) + (y*y)));
@@ -196,9 +188,9 @@ void mainLoop(void){
rgba = b | r | g | a;
offset = ((framebuffer_width - 0xFF) / 2) + x + (y*framebuffer_width);
D_803A5D00[0][offset] = (s32) rgba;
D_803A5D00[1][offset] = (s32) rgba;
offset = ((gFramebufferWidth - 0xFF) / 2) + x + (y*gFramebufferWidth);
gFramebuffers[0][offset] = (s32) rgba;
gFramebuffers[1][offset] = (s32) rgba;
}
}
}//L8023DF70
@@ -234,5 +226,5 @@ OSThread *mainThread_get(void) {
}
void disableInput_set(void){
gDisableInput = 1;
sDisableInput = TRUE;
}

View File

@@ -1,4 +1,5 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
@@ -23,7 +24,6 @@ u8 func_8025F4A0(ALCSPlayer *, u8);
void func_8025F3F0(ALCSPlayer *, f32, f32);
u16 func_80250474(s32 arg0);
void func_8024AF48(void);
void func_8024FB8C(void);
/* .data */
@@ -602,7 +602,7 @@ u16 func_80250474(s32 arg0){
D_80282110[i].unk10 = -1.0f;
}
osSetIntMask(sp1C);
func_8024AF48();
core1_ce60_func_8024AF48();
if(D_802762C0 == -1){
D_802762C0 = 0xFFFF;
}

View File

@@ -1,21 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8025108C(s32 arg0);
/* .bss */
s32 D_802827F0;
/* .code */
s32 func_80251060(void){
return D_802827F0;
}
void func_8025106C(void){
func_8025108C(0);
}
void func_8025108C(s32 arg0){
D_802827F0 = arg0;
}

View File

@@ -1,31 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
u32 func_802510A0(BKSprite *this){
return this->unk8;
}
u32 func_802510A8(BKSprite *this){
return this->unkA;
}
u32 func_802510B0(BKSprite *this){
return this->unk6;
}
u32 func_802510B8(BKSprite *this){
return this->unk4;
}
s32 spriteGetFrameCount(BKSprite *this){
return this->frameCnt;
}
BKSpriteFrame *spriteGetFramePtr(BKSprite *this, u32 frame)
{
BKSpriteFrame * new_var;
new_var = this->offsets[frame] + ((s32) ((*this).offsets + this->frameCnt));
return new_var;
}

View File

@@ -1,74 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
struct {
u16 *data;
int unk4;
} gzBuffer;
extern u8 D_8000E800;
extern u16 D_803A5D00[2][0xF660];
void func_80253208(Gfx **gdl, s32 x, s32 y, s32 w, s32 h, void *color_buffer);
void func_80253190(Gfx **gdl){
func_80253208(gdl, 0, 0, framebuffer_width, framebuffer_height, D_803A5D00[getActiveFramebuffer()]);
}
void func_80253208(Gfx **gdl, s32 x, s32 y, s32 w, s32 h, void *color_buffer){
if( gzBuffer.data != NULL && (getGameMode() != GAME_MODE_4_PAUSED || func_80335134())){
//draw z_buffer
gDPPipeSync((*gdl)++);
gDPSetColorImage((*gdl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, OS_K0_TO_PHYSICAL(gzBuffer.data));
gDPSetCycleType((*gdl)++, G_CYC_FILL);
gDPSetRenderMode((*gdl)++, G_RM_NOOP, G_RM_NOOP2);
gDPSetFillColor((*gdl)++, 0xFFFCFFFC);
gDPScisFillRectangle((*gdl)++, x, y, x + w - 1, y + h - 1);
//draw color_buffer
gDPPipeSync((*gdl)++);
gDPSetColorImage((*gdl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, OS_K0_TO_PHYSICAL(color_buffer));
}
}
int func_80253400(void){
return gzBuffer.unk4;
}
int func_8025340C(void){
return gzBuffer.data != NULL;
}
void dummy_func_80253420(void){}
void func_80253428(int arg0) {
u16 *var_v0;
int new_var;
if (arg0) {
var_v0 = (gzBuffer.data = &D_8000E800);
while (((s32) gzBuffer.data) % 0x40) {\
var_v0 = (gzBuffer.data = var_v0 + 1);
}
do { } while ((&D_8000E800 && 1) * 0); //remove this
}else{
gzBuffer.data = 0;
}
gzBuffer.unk4 = 0;
}
void func_802534A8(int arg0){
gzBuffer.unk4 = (gzBuffer.data != NULL && arg0);
}
void zBuffer_set(Gfx **gdl){
if(gzBuffer.data && getGameMode() != GAME_MODE_4_PAUSED){
gDPPipeSync((*gdl)++);
gDPSetDepthImage((*gdl)++, gzBuffer.data);
}
}
void *zBuffer_get(void){
return gzBuffer.data;
}

View File

@@ -1,29 +1,13 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core1/core1.h"
#include <core1/viewport.h>
static Gfx *sGfxStack[2] = { NULL, NULL };
s32 gFramebufferWidth = DEFAULT_FRAMEBUFFER_WIDTH;
s32 gFramebufferHeight = DEFAULT_FRAMEBUFFER_HEIGHT;
typedef struct {
s32 unk0;
s32 unk4;
Gfx *unk8;
Gfx *unkC;
s32 unk10;
s32 unk14;
}Struct_Core1_15B30;
extern u8 D_803A5D00[2][0x1ecc0];
/* .data */
Gfx *gGfxStack[2] = {NULL, NULL};
s32 framebuffer_width = 292;
s32 framebuffer_height = 216;
/* .bss */
Mtx *gMtxStack[2];
Vtx *gVtxStack[2];
s32 gStackSelector;
static Mtx *sMtxStack[2];
static Vtx *sVtxStack[2];
static s32 sStackSelector;
s32 gTextureFilterPoint;
Struct_Core1_15B30 D_80283008[20];
s32 D_802831E8;
@@ -35,11 +19,6 @@ u16 gScissorBoxTop;
u16 gScissorBoxBottom;
Gfx *D_80283214;
/* .h */
void scissorBox_setDefault(void);
void dummy_func_80254464(void);
/* .code */
void func_80253550(void){
osRecvMesg(&D_802831F0, NULL, OS_MESG_BLOCK);
}
@@ -74,8 +53,8 @@ void func_80253640(Gfx ** gdl, void *arg1){
gDPSetAlphaCompare((*gdl)++, G_AC_NONE);
gDPSetColorDither((*gdl)++, G_CD_MAGICSQ);
gDPSetScissor((*gdl)++, G_SC_NON_INTERLACE, gScissorBoxLeft, gScissorBoxRight, gScissorBoxTop, gScissorBoxBottom);
func_80253208(gdl, 0, 0, framebuffer_width, framebuffer_height, arg1);
gDPSetColorImage((*gdl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, OS_K0_TO_PHYSICAL(arg1));
func_80253208(gdl, 0, 0, gFramebufferWidth, gFramebufferHeight, arg1);
gDPSetColorImage((*gdl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gFramebufferWidth, OS_K0_TO_PHYSICAL(arg1));
gDPSetCycleType((*gdl)++, G_CYC_1CYCLE);
gDPSetTextureConvert((*gdl)++, G_TC_FILT);
gDPSetTextureDetail((*gdl)++, G_TD_CLAMP);
@@ -98,13 +77,13 @@ void scissorBox_SetForGameMode(Gfx **gdl, s32 framebuffer_idx) {
}
else{
scissorBox_setDefault();
func_80253640(gdl, D_803A5D00[framebuffer_idx]);
func_80253640(gdl, gFramebuffers[framebuffer_idx]);
}
}
void setupScissorBoxAndFramebuffer(Gfx **gfx, s32 framebuffer_address){
gSPSegment((*gfx)++, 0x00, 0x00000000);
gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, OS_PHYSICAL_TO_K0(framebuffer_address));
gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gFramebufferWidth, OS_PHYSICAL_TO_K0(framebuffer_address));
gSPClearGeometryMode((*gfx)++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
gSPTexture((*gfx)++, 0, 0, 0, G_TX_RENDERTILE, G_OFF);
gSPSetGeometryMode((*gfx)++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH);
@@ -121,7 +100,7 @@ void setupScissorBoxAndFramebuffer(Gfx **gfx, s32 framebuffer_address){
void setupDefaultScissorBoxAndFramebuffer(Gfx **gfx, s32 framebuffer_idx){
scissorBox_setDefault();
setupScissorBoxAndFramebuffer(gfx, D_803A5D00[framebuffer_idx]);
setupScissorBoxAndFramebuffer(gfx, gFramebuffers[framebuffer_idx]);
}
void func_80253DC0(Gfx **gfx){
@@ -184,7 +163,7 @@ void scissorBox_get(u32 *left, u32 *top, u32 *right, u32 *bottom){
}
void func_80253FE8(void){
func_8024BFAC();
viMgr_func_8024BFAC();
}
void func_80254008(void){
@@ -208,29 +187,29 @@ void drawRectangle2D(Gfx **gfx, s32 x, s32 y, s32 w, s32 h, s32 r, s32 g, s32 b)
gDPScisFillRectangle((*gfx)++, x, y, x + w -1, y + h -1);
}
void graphicsCache_release(void){
if(gGfxStack[0]){
free(gGfxStack[0]);
free(gGfxStack[1]);
free(gMtxStack[0]);
free(gMtxStack[1]);
free(gVtxStack[0]);
free(gVtxStack[1]);
gGfxStack[0] = NULL;
void graphicsCache_release(void) {
if (sGfxStack[0]) {
free(sGfxStack[0]);
free(sGfxStack[1]);
free(sMtxStack[0]);
free(sMtxStack[1]);
free(sVtxStack[0]);
free(sVtxStack[1]);
sGfxStack[0] = NULL;
}
}
void graphicsCache_init(void){
if(gGfxStack[0] == NULL){
gGfxStack[0] = (Gfx *)malloc(29600); // 3700 dlist commands
gGfxStack[1] = (Gfx *)malloc(29600);
gMtxStack[0] = (Mtx *)malloc(44800); // 700 matrices
gMtxStack[1] = (Mtx *)malloc(44800);
gVtxStack[0] = (Vtx *)malloc(6880); // 430 vertices
gVtxStack[1] = (Vtx *)malloc(6880);
if(sGfxStack[0] == NULL){
sGfxStack[0] = (Gfx *)malloc(29600); // 3700 dlist commands
sGfxStack[1] = (Gfx *)malloc(29600);
sMtxStack[0] = (Mtx *)malloc(44800); // 700 matrices
sMtxStack[1] = (Mtx *)malloc(44800);
sVtxStack[0] = (Vtx *)malloc(6880); // 430 vertices
sVtxStack[1] = (Vtx *)malloc(6880);
dummy_func_80254464();
}
gStackSelector = 0;
sStackSelector = 0;
gTextureFilterPoint = 0;
}
@@ -239,8 +218,8 @@ void scissorBox_set(s32 left, s32 top, s32 right, s32 bottom) {
gScissorBoxTop = top;
gScissorBoxRight = right;
gScissorBoxBottom = bottom;
framebuffer_width = top - left;
framebuffer_height = bottom - right;
gFramebufferWidth = top - left;
gFramebufferHeight = bottom - right;
viewport_pushFramebufferExtendsToVpStack();
}
@@ -253,7 +232,7 @@ void func_80254374(s32 arg0) {
Struct_Core1_15B30 *sp1C;
func_80253550();
func_8024C2A0(arg0);
viMgr_setActiveFramebuffer(arg0);
sp1C = &D_80283008[D_802831E8];
D_802831E8 = (s32) (D_802831E8 + 1) % 20;
func_8025357C();
@@ -267,10 +246,10 @@ void toggleTextureFilterPoint(void){
}
void getGraphicsStacks(Gfx **gfx, Mtx **mtx, Vtx **vtx){
gStackSelector = (1 - gStackSelector);
*gfx = gGfxStack[gStackSelector];
*mtx = gMtxStack[gStackSelector];
*vtx = gVtxStack[gStackSelector];
sStackSelector = (1 - sStackSelector);
*gfx = sGfxStack[sStackSelector];
*mtx = sMtxStack[sStackSelector];
*vtx = sVtxStack[sStackSelector];
}
void dummy_func_80254464(void){}
void dummy_func_80254464(void) {}

View File

@@ -1,28 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "save.h"
#define ROUND_UP_DIVIDE(a, b) (((a) + (b) - 1) / (b))
// The round up divide is not technically needed, but will come in handy for modding
#define gameFile_NUM_BLOCKS ROUND_UP_DIVIDE(sizeof(SaveData),EEPROM_BLOCK_SIZE)
s32 write_file_blocks(s32 filenum, s32 blockOffset, u8 *buffer, s32 blockCount) {
s32 address = (filenum * gameFile_NUM_BLOCKS) + blockOffset;
s32 ret;
func_8024F35C(3);
ret = osEepromLongWrite(pfsManager_getFrameReplyQ(), address, buffer, blockCount * EEPROM_BLOCK_SIZE);
func_8024F35C(0);
return ret;
}
s32 load_file_blocks(s32 filenum, s32 blockOffset, u8 *buffer, s32 blockCount) {
s32 address = (filenum * gameFile_NUM_BLOCKS) + blockOffset;
s32 ret;
func_8024F35C(3);
ret = osEepromLongRead(pfsManager_getFrameReplyQ(), address, buffer, blockCount * EEPROM_BLOCK_SIZE);
func_8024F35C(0);
return ret;
}

View File

@@ -1,32 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
/* .bss */
u8 D_80283280[0x100];
s32 D_80283380;
s32 D_80283384;
s32 D_80283388;
void func_80255C30(void) {
D_80283384 = *(s32 *)0xA4000000 ^ -1;
D_80283388 = (D_80283384) ? 1 :0;
D_80283380 = *(s32 *)0xA4001000 ^ 6103;
D_80283388 |= (D_80283380) ? 2 :0;
if (D_80283388 == 0) {
piMgr_read(&D_80283280, 0xB0000B70, 0x100);
}
}
void dummy_func_80255CD8(void){}
void func_80255CE0(void){
osPiReadIo(0, NULL);
}
s32 func_80255D04(void){return 0;}
void func_80255D0C(u64 **ucode_ptr, u32 *ucode_size){
*ucode_ptr = &D_80283280;
*ucode_size = 0x100;
}

View File

@@ -1,4 +1,5 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"

View File

@@ -1,4 +1,5 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "version.h"

View File

@@ -1,15 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void dummy_func_8025AFB0(void) {}
void dummy_func_8025AFB8(void) {}
void dummy_func_8025AFC0(Gfx **arg0, Mtx **arg1, Vtx **arg2) {}
s32 dummy_func_8025AFD0(void)
{
return 0;
}

View File

@@ -1,7 +1,7 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "SnS.h"
#include "save.h"
bool snsToRestoreItems = FALSE;

View File

@@ -1,71 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include <core1/viewport.h>
s32 D_80275860 = 0;
void func_802409C0(f32 arg0[3], f32 arg1){
f32 vp_rotation[3];
f32 sp30[3];
f32 sp28[2];
f32 dt;
dt = time_getDelta()*arg1;
controller_getJoystick(0, sp28);
sp30[0] = sp28[0] * dt;
sp30[1] = 0.0f;
sp30[2] = -(sp28[1] * dt);
viewport_getRotation_vec3f(vp_rotation);
ml_vec3f_yaw_rotate_copy(sp30, sp30, vp_rotation[1]);
arg0[0] = arg0[0] + sp30[0];
arg0[1] = arg0[1] + sp30[1];
arg0[2] = arg0[2] + sp30[2];
}
void func_80240A74(f32 arg0[3]){
func_802409C0(arg0, 400.0f);
}
f32 func_80240A94(s32 arg0, f32 arg1){
if(arg0 >= 0x29){
arg0 = 0x28;
}
return arg1 + (f32)arg0*(arg1)/16 ;
}
void func_80240AC8(f32 arg0[3], f32 arg1){
f32 vp_rotation[3];
f32 sp30[3];
f32 sp28[2];
f32 dt;
dt = time_getDelta()*arg1;
controller_getJoystick(0, sp28);
if(0.0f != sp28[0] || 0.0f != sp28[1]){
D_80275860++;
if(D_80275860 >= 0x12D)
D_80275860 = 0x12C;
}
else{
D_80275860 = 1;
}
dt = func_80240A94(D_80275860, dt);
sp30[0] = sp28[0] * dt;
sp30[1] = 0.0f;
sp30[2] = -(sp28[1] * dt);
viewport_getRotation_vec3f(vp_rotation);
ml_vec3f_yaw_rotate_copy(sp30, sp30, vp_rotation[1]);
arg0[0] = arg0[0] + sp30[0];
arg0[1] = arg0[1] + sp30[1];
arg0[2] = arg0[2] + sp30[2];
}

View File

@@ -1,4 +1,6 @@
#include <ultra64.h>
#include "core1/core1.h"
extern f32 gu_sqrtf(f32);
static void __guMtxF2L(float mf[4][4], Mtx *m)

View File

@@ -1,4 +1,5 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "n_libaudio.h"

View File

@@ -1,7 +1,5 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core1/rarezip.h"
#include "core1/core1.h"
static int _rarezip_uncompress(u8 **arg0, u8 **arg1, struct huft * arg2);

View File

@@ -1,70 +1,62 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
extern void sfxsource_setSampleRate(u8, s32);
extern void func_8030E2C4(u8);
s16 *D_802758E0 = NULL;
typedef struct struct_27_s{
s16 unk0;
u8 pad2[0x12];
}struct27s;
s16 * D_802758E0 = NULL;
void func_80244C78(int arg0);
/* .code */
void func_80244AB0(void){
void core1_7090_alloc(void) {
int i;
if(D_802758E0)
if (D_802758E0)
return;
D_802758E0 = (struct16s *) malloc(10*sizeof(s16));
for(i = 0; i < 10; i++){
D_802758E0 = (s16 *) malloc(10 * sizeof(s16));
for (i = 0; i < 10; i++) {
D_802758E0[i] = 0;
}
}
void func_80244B3C(void){
void core1_7090_release(void) {
int i;
if(!D_802758E0)
if (!D_802758E0)
return;
for(i = 0; i < 10; i++){
if(D_802758E0[i])
func_8030E394((u8)D_802758E0[i]);
for (i = 0; i < 10; i++) {
if (D_802758E0[i])
func_8030E394(D_802758E0[i]);
}
free(D_802758E0);
D_802758E0 = NULL;
}
void func_80244BB0(s32 arg0, s32 arg1, s32 arg2, f32 arg3){
s32 i;
u8 indx;
if(func_8030ED70(func_80255D44(arg1))){
i = sfxsource_createSfxsourceAndReturnIndex();
indx = i;
if(i){
sfxsource_setSfxId(indx, func_80255D44(arg1));
sfxsource_playSfxAtVolume(indx, arg3);
sfxsource_setSampleRate(indx, arg2);
func_8030E2C4(indx);
func_80244C78(arg0);
D_802758E0[arg0] = indx;
void core1_7090_initSfxSource(s32 idx, s32 lookup_idx, s32 sample_rate, f32 volume) {
u8 sfx_source_index;
if (func_8030ED70(lookup_getSfxId(lookup_idx))) {
sfx_source_index = sfxsource_createSfxsourceAndReturnIndex();
if (sfx_source_index) {
sfxsource_setSfxId(sfx_source_index, lookup_getSfxId(lookup_idx));
sfxsource_playSfxAtVolume(sfx_source_index, volume);
sfxsource_setSampleRate(sfx_source_index, sample_rate);
func_8030E2C4(sfx_source_index);
core1_7090_freeSfxSource(idx);
D_802758E0[idx] = sfx_source_index;
}
}
else{
func_8030E6A4(func_80255D44(arg1), arg3, arg2);
else {
func_8030E6A4(lookup_getSfxId(lookup_idx), volume, sample_rate);
}
}
void func_80244C78(int arg0){
if(D_802758E0[arg0]){
sfxsource_freeSfxsourceByIndex(D_802758E0[arg0]);
void core1_7090_freeSfxSource(int idx) {
if (D_802758E0[idx]) {
sfxsource_freeSfxsourceByIndex(D_802758E0[idx]);
}
D_802758E0[arg0] = 0;
D_802758E0[idx] = 0;
}

View File

@@ -1,11 +1,11 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
int collisionTri_isHitFromAbove_actor(f32 arg0[3], Actor *arg1, s32 arg2);
extern bool func_80320DB0(f32[3], f32, f32[3], u32);
extern bool func_80323240(struct56s *, f32, f32[3]);
extern f32 ml_dotProduct_vec3f(f32[3], f32[3]);
extern BKCollisionTri *func_80320B98(f32[3], f32[3], f32[3], u32);
extern BKCollisionTri *func_80320C94(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3], s32 arg4, u32 arg5);
extern f32 func_8031C5D4(struct0*);
@@ -121,7 +121,7 @@ void func_802450DC(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3], f32 arg4[
ml_vec3f_diff_copy(sp3C, arg1, arg0);
ml_vec3f_diff_copy(sp30, arg3, arg2);
ml_vec3f_diff_copy(sp24, sp3C, sp30);
phi_f12 = -ml_dotProduct_vec3f(arg4, sp24);
phi_f12 = -ml_vec3f_dot_product(arg4, sp24);
phi_f12 = MAX(5.0f, phi_f12);
arg1[0] += phi_f12 * arg4[0];
arg1[1] += phi_f12 * arg4[1];
@@ -144,13 +144,13 @@ void func_802451A4(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3], f32 arg4[
ml_vec3f_diff_copy(sp54, sp6C, sp60);
ml_vec3f_normalize_copy(sp3C, sp54);
ml_vec3f_yaw_rotate_copy(sp30, sp3C, 90.0f);
sp28 = ml_dotProduct_vec3f(arg4, sp3C);
sp28 = ml_vec3f_dot_product(arg4, sp3C);
if (arg5 != 0) {
D_8027EF30 = ml_dotProduct_vec3f(arg4, sp30);
D_8027EF30 = ml_vec3f_dot_product(arg4, sp30);
}
phi_v0 = (D_8027EF30 < 0.0f) ? -1 : 1;
ml_vec3f_yaw_rotate_copy(sp48, arg4,(phi_v0 * sp28) * 45.0);
phi_f12 = -ml_dotProduct_vec3f(sp48, sp54);
phi_f12 = -ml_vec3f_dot_product(sp48, sp54);
phi_f12 = MAX(5.0f, phi_f12);
arg1[0] += phi_f12 * sp48[0];
arg1[1] += phi_f12 * sp48[1];
@@ -279,7 +279,7 @@ void func_8024560C(f32 arg0[3], struct0 *arg1, UNK_TYPE(s32) arg2, u8 *arg3, f32
}
BKCollisionTri *func_8024575C(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3], s32 arg4, u32 arg5){
if(arg2 < ml_distance_vec3f(arg0, arg1)){
if(arg2 < ml_vec3f_distance(arg0, arg1)){
return NULL;
}
return func_80320C94(arg0, arg1, arg2, arg3, arg4, arg5);

View File

@@ -1,4 +1,5 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "version.h"

View File

@@ -1,4 +1,5 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
#include "version.h"
@@ -120,7 +121,7 @@ void func_80246744(OSMesg arg0){
}
void func_80246794(Struct_Core1_8C50_s * arg0){
func_80255D0C(&D_80275910.t.ucode_boot, &D_80275910.t.ucode_boot_size);
ucode_getPtrAndSize(&D_80275910.t.ucode_boot, &D_80275910.t.ucode_boot_size);
D_80275910.t.ucode = n_aspMainTextStart;
D_80275910.t.ucode_data = n_aspMainDataStart;
D_80275910.t.data_ptr = (void*) arg0->unk8;
@@ -134,7 +135,7 @@ void func_80246794(Struct_Core1_8C50_s * arg0){
}
void func_80246844(Struct_Core1_8C50_s * arg0){
func_80255D0C(&D_80275950.t.ucode_boot, &D_80275950.t.ucode_boot_size);
ucode_getPtrAndSize(&D_80275950.t.ucode_boot, &D_80275950.t.ucode_boot_size);
D_80275950.t.ucode = gSPF3DEX_fifoTextStart;
D_80275950.t.ucode_data = gSPF3DEX_fifoDataStart;
D_80275950.t.data_ptr = (void*) arg0->unk8;
@@ -152,7 +153,7 @@ void func_80246844(Struct_Core1_8C50_s * arg0){
}
void func_8024692C(Struct_Core1_8C50_s * arg0){
func_80255D0C(&D_80275950.t.ucode_boot, &D_80275950.t.ucode_boot_size);
ucode_getPtrAndSize(&D_80275950.t.ucode_boot, &D_80275950.t.ucode_boot_size);
D_80275950.t.ucode = gSPL3DEX_fifoTextStart;
D_80275950.t.ucode_data = gSPL3DEX_fifoDataStart;
D_80275950.t.data_ptr = (void*) arg0->unk8;
@@ -218,7 +219,7 @@ void func_80246C2C(void){
if((D_8027FC14 << 1) < 0){
osDpSetStatus(DPC_SET_FREEZE);
D_80280688 = osViGetCurrentFramebuffer();
func_8024BFAC();
viMgr_func_8024BFAC();
}
D_8027FC14 = D_8027FC18 = 2;
D_80275998 = 0;
@@ -473,7 +474,7 @@ void func_80247560(void){
osSetEventMesg(OS_EVENT_SP, &D_8027FB60, CORE1_8C50_EVENT_SP);
osSetEventMesg(OS_EVENT_FAULT, &D_8027FB60, CORE1_8C50_EVENT_FAULT);
osSetEventMesg(OS_EVENT_PRENMI, &D_8027FB60, CORE1_8C50_EVENT_PRENMI);
func_8024BDAC(&D_8027FB60, 5);
viMgr_func_8024BDAC(&D_8027FB60, 5);
D_8027FC0C = 0;
D_8027FC10 = 0;
D_8027FC14 = D_8027FC18 = 2;

Some files were not shown because too many files have changed in this diff Show More