mirror of https://github.com/zeldaret/mm.git
More General Cleanup (#1638)
* LINKER_FILES in makefile
* COLPOLY_GET_NORMAL
* math header
* libc
* M_PI for cosf and sinf files
* MAXFLOAT
* Revert "MAXFLOAT"
This reverts commit 96b75ffaa8
.
* Remove SHT_MINV
* SHRT_MAX
* Add M_PI
* Angle macros
* f suffix
* Format
This commit is contained in:
parent
312b65d5e3
commit
f26e77ba40
8
Makefile
8
Makefile
|
@ -114,7 +114,7 @@ NM := $(MIPS_BINUTILS_PREFIX)nm
|
|||
OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
|
||||
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
|
||||
|
||||
IINC := -Iinclude -Isrc -Iassets -I$(BUILD_DIR) -I.
|
||||
IINC := -Iinclude -Iinclude/libc -Isrc -Iassets -I$(BUILD_DIR) -I.
|
||||
|
||||
ifeq ($(KEEP_MDEBUG),0)
|
||||
RM_MDEBUG = $(OBJCOPY) --remove-section .mdebug $@
|
||||
|
@ -241,6 +241,8 @@ OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | $(SPEC_REPLACE_VARS) | g
|
|||
|
||||
SCHEDULE_INC_FILES := $(foreach f,$(SCHEDULE_FILES:.schl=.schl.inc),$(BUILD_DIR)/$f)
|
||||
|
||||
LD_FILES := $(foreach f,$(shell find linker_scripts/*.ld),$(BUILD_DIR)/$f)
|
||||
|
||||
# Automatic dependency files
|
||||
# (Only asm_processor dependencies and reloc dependencies are handled for now)
|
||||
DEP_FILES := $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d)
|
||||
|
@ -326,8 +328,8 @@ $(ROMC): $(ROM) $(ELF) $(BUILD_DIR)/dmadata/compress_ranges.txt
|
|||
$(PYTHON) tools/buildtools/compress.py --in $(ROM) --out $@ --dma-start `tools/buildtools/dmadata_start.sh $(NM) $(ELF)` --compress `cat $(BUILD_DIR)/dmadata/compress_ranges.txt` --threads $(N_THREADS)
|
||||
$(PYTHON) -m ipl3checksum sum --cic 6105 --update $@
|
||||
|
||||
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(LDSCRIPT) $(BUILD_DIR)/linker_scripts/undefined_syms.ld $(BUILD_DIR)/linker_scripts/extra.ld
|
||||
$(LD) -T $(LDSCRIPT) -T $(BUILD_DIR)/linker_scripts/undefined_syms.ld -T $(BUILD_DIR)/linker_scripts/extra.ld --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(MAP) -o $@
|
||||
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(LDSCRIPT) $(LD_FILES)
|
||||
$(LD) -T $(LDSCRIPT) -T $(LD_FILES) --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(MAP) -o $@
|
||||
|
||||
## Order-only prerequisites
|
||||
# These ensure e.g. the O_FILES are built before the OVL_RELOC_FILES.
|
||||
|
|
|
@ -47,6 +47,7 @@ You can create a `.vscode/c_cpp_properties.json` file with `C/C++: Edit Configur
|
|||
"intelliSenseMode": "${default}", // Shouldn't matter
|
||||
"includePath": [ // Matches makefile's includes
|
||||
"include",
|
||||
"include/libc",
|
||||
"src",
|
||||
"assets",
|
||||
"build/n64-us/",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "ultratypes.h"
|
||||
#include "os_voice.h"
|
||||
#include "os_message.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 dummy;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define PR_OS_CACHE_H
|
||||
|
||||
#include "ultratypes.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
|
||||
void osInvalDCache(void* vaddr, size_t nbytes);
|
||||
void osInvalICache(void* vaddr, size_t nbytes);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PR_CONVERT_H
|
||||
#define PR_CONVERT_H
|
||||
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#define OS_CLOCK_RATE 62500000LL
|
||||
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define PR_OS_INTERNAL_SI_H
|
||||
|
||||
#include "ultratypes.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
|
||||
s32 __osSiRawWriteIo(uintptr_t devAddr, u32 data);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PR_OS_LIBC_H
|
||||
#define PR_OS_LIBC_H
|
||||
|
||||
#include "libc/stdarg.h"
|
||||
#include "stdarg.h"
|
||||
|
||||
|
||||
void bcopy(void* __src, void* __dest, int __n);
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include "ultratypes.h"
|
||||
#include "os_message.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "ultratypes.h"
|
||||
#include "os_pi.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#define LEO_BASE_REG 0x05000000
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define PR_XSTDIO_H
|
||||
|
||||
#include "ultratypes.h"
|
||||
#include "libc/stdarg.h"
|
||||
#include "stdarg.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ union {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define AUDIO_HEAP_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
#include "unk.h"
|
||||
|
||||
typedef struct AudioHeapInitSizes {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#include "PR/os.h"
|
||||
#include "PR/os_message.h"
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
#include "unk.h"
|
||||
|
||||
typedef s32 (*DmaHandler)(OSPiHandle* handle, OSIoMesg* mb, s32 direction);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef BUFFERS_H
|
||||
#define BUFFERS_H
|
||||
|
||||
#include "libc/assert.h"
|
||||
#include "assert.h"
|
||||
#include "gfx.h"
|
||||
#include "macros.h"
|
||||
#include "stack.h"
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include "ultra64.h"
|
||||
|
||||
#include "libc/stdarg.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdarg.h"
|
||||
#include "stdint.h"
|
||||
#include "PR/controller.h"
|
||||
|
||||
#include "padmgr.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef ICHAIN_H
|
||||
#define ICHAIN_H
|
||||
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
|
||||
typedef struct InitChainEntry {
|
||||
u32 cont: 1;
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#ifndef LIBC_MATH_H
|
||||
#define LIBC_MATH_H
|
||||
|
||||
#define M_PI 3.14159265358979323846f
|
||||
#define M_SQRT2 1.41421356237309504880f
|
||||
#define M_SQRT1_2 0.70710678118654752440f /* 1/sqrt(2) */
|
||||
#define FLT_MAX 340282346638528859811704183484516925440.0f
|
||||
#define SHT_MAX 32767.0f
|
||||
#define SHT_MINV (1.0f / SHT_MAX)
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_PIf 3.14159265358979323846f
|
||||
#define M_SQRT2f 1.41421356237309504880f
|
||||
#define M_SQRT1_2f 0.70710678118654752440f /* 1/sqrt(2) */
|
||||
|
||||
#define FLT_MAX 3.40282347e+38f
|
||||
#define SHRT_MAX 32767.0f
|
||||
|
||||
float fabsf(float f);
|
||||
#pragma intrinsic(fabsf)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef LIBC_STDLIB_H
|
||||
#define LIBC_STDLIB_H
|
||||
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ int quot;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef LIBC_STRING_H
|
||||
#define LIBC_STRING_H
|
||||
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
|
||||
const char* strchr(const char* s, int c);
|
||||
size_t strlen(const char* s);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define LIBC64_OS_MALLOC_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
|
||||
typedef struct ArenaNode {
|
||||
/* 0x0 */ s16 magic; // Should always be 0x7373
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#define LOADFRAGMENT_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stdint.h"
|
||||
#include "stddef.h"
|
||||
|
||||
extern s32 gOverlayLogSeverity;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MACROS_H
|
||||
#define MACROS_H
|
||||
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
#include "PR/os_convert.h"
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef PADMGR_H
|
||||
#define PADMGR_H
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "ultra64.h"
|
||||
#include "irqmgr.h"
|
||||
#include "padutils.h"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define ROMFILE_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ uintptr_t vromStart;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef SEGMENT_SYMBOLS_H
|
||||
#define SEGMENT_SYMBOLS_H
|
||||
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
#include "romfile.h"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define SYS_CPMDMA_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
void CmpDma_LoadFile(uintptr_t segmentVrom, s32 id, void* dst, size_t size);
|
||||
void CmpDma_LoadAllFiles(uintptr_t segmentVrom, void* dst, size_t size);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef SYSTEM_HEAP_H
|
||||
#define SYSTEM_HEAP_H
|
||||
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
void* SystemHeap_Malloc(size_t size);
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#define THA_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stdint.h"
|
||||
#include "stddef.h"
|
||||
|
||||
typedef struct TwoHeadArena {
|
||||
/* 0x0 */ size_t size;
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
#include "ultra64.h"
|
||||
|
||||
#include "libc/math.h"
|
||||
#include "libc/stdarg.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "libc/stdlib.h"
|
||||
#include "math.h"
|
||||
#include "stdarg.h"
|
||||
#include "stdbool.h"
|
||||
#include "stddef.h"
|
||||
#include "stdint.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
#include "libc64/qrand.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define Z64ACTOR_DLFTBLS_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
#include "segment_symbols.h"
|
||||
|
||||
// This value is hardcoded to be the size of ovl_Arrow_Fire which currently is the biggest actor that uses the AM_FIELD.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "PR/ultratypes.h"
|
||||
#include "PR/os_voice.h"
|
||||
#include "audiothread_cmd.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
#include "unk.h"
|
||||
|
||||
#include "audio/heap.h"
|
||||
|
|
|
@ -11,8 +11,8 @@ struct DynaPolyActor;
|
|||
|
||||
#define SS_NULL 0xFFFF
|
||||
|
||||
#define COLPOLY_NORMAL_FRAC (1.0f / SHT_MAX)
|
||||
#define COLPOLY_SNORMAL(x) ((s16)((x) * SHT_MAX))
|
||||
#define COLPOLY_NORMAL_FRAC (1.0f / SHRT_MAX)
|
||||
#define COLPOLY_SNORMAL(x) ((s16)((x) * SHRT_MAX))
|
||||
#define COLPOLY_GET_NORMAL(n) ((n)*COLPOLY_NORMAL_FRAC)
|
||||
#define COLPOLY_VIA_FLAG_TEST(vIA, flags) ((vIA) & (((flags)&7) << 13))
|
||||
#define COLPOLY_VTX_INDEX(vI) ((vI)&0x1FFF)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define Z64EFFECT_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
#include "color.h"
|
||||
#include "z64light.h"
|
||||
#include "z64math.h"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define Z64FONT_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
struct PlayState;
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include "ultra64.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdbool.h"
|
||||
#include "stdint.h"
|
||||
#include "gamealloc.h"
|
||||
#include "padmgr.h"
|
||||
#include "padutils.h"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define Z64MATH_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libc/math.h"
|
||||
#include "math.h"
|
||||
|
||||
#include "libc64/math64.h"
|
||||
|
||||
|
@ -168,21 +168,21 @@ typedef union {
|
|||
#define TRUNCF_BINANG(f) (s16)(s32)(f)
|
||||
|
||||
// Angle conversion macros
|
||||
#define DEG_TO_RAD(degrees) ((degrees) * (M_PI / 180.0f))
|
||||
#define DEG_TO_RAD(degrees) ((degrees) * (M_PIf / 180.0f))
|
||||
#define DEG_TO_BINANG(degrees) TRUNCF_BINANG((degrees) * (0x8000 / 180.0f))
|
||||
#define DEG_TO_BINANG_ALT(degrees) TRUNCF_BINANG(((degrees) / 180.0f) * 0x8000)
|
||||
#define DEG_TO_BINANG_ALT2(degrees) TRUNCF_BINANG(((degrees) * 0x10000) / 360.0f)
|
||||
#define DEG_TO_BINANG_ALT3(degrees) ((degrees) * (0x8000 / 180.0f))
|
||||
|
||||
#define RAD_TO_DEG(radians) ((radians) * (180.0f / M_PI))
|
||||
#define RAD_TO_BINANG(radians) TRUNCF_BINANG((radians) * (0x8000 / M_PI))
|
||||
#define RAD_TO_BINANG_ALT(radians) TRUNCF_BINANG(((radians) / M_PI) * 0x8000)
|
||||
#define RAD_TO_BINANG_ALT2(radians) TRUNCF_BINANG(((radians) * 0x8000) / M_PI)
|
||||
#define RAD_TO_DEG(radians) ((radians) * (180.0f / M_PIf))
|
||||
#define RAD_TO_BINANG(radians) TRUNCF_BINANG((radians) * (0x8000 / M_PIf))
|
||||
#define RAD_TO_BINANG_ALT(radians) TRUNCF_BINANG(((radians) / M_PIf) * 0x8000)
|
||||
#define RAD_TO_BINANG_ALT2(radians) TRUNCF_BINANG(((radians) * 0x8000) / M_PIf)
|
||||
|
||||
#define BINANG_TO_DEG(binang) ((f32)(binang) * (180.0f / 0x8000))
|
||||
#define BINANG_TO_RAD(binang) ((f32)(binang) * (M_PI / 0x8000))
|
||||
#define BINANG_TO_RAD_ALT(binang) (((f32)(binang) / 0x8000) * M_PI)
|
||||
#define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * M_PI) / 0x8000)
|
||||
#define BINANG_TO_RAD(binang) ((f32)(binang) * (M_PIf / 0x8000))
|
||||
#define BINANG_TO_RAD_ALT(binang) (((f32)(binang) / 0x8000) * M_PIf)
|
||||
#define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * M_PIf) / 0x8000)
|
||||
|
||||
// Angle arithmetic macros
|
||||
#define BINANG_ROT180(angle) ((s16)(angle + 0x8000))
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define Z64MESSAGE_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
#include "z64bombers_notebook.h"
|
||||
#include "z64font.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef Z64OBJECT_H
|
||||
#define Z64OBJECT_H
|
||||
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#define DEFINE_OBJECT(_name, enumValue) enumValue,
|
||||
#define DEFINE_OBJECT_UNSET(enumValue) enumValue,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "ultra64.h"
|
||||
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
#include "unk.h"
|
||||
|
||||
#include "romfile.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "z64voice.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "libc/string.h"
|
||||
#include "stdbool.h"
|
||||
#include "string.h"
|
||||
#include "padmgr.h"
|
||||
|
||||
// internal voice functions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "stackcheck.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdbool.h"
|
||||
#include "stdint.h"
|
||||
|
||||
StackEntry* sStackInfoListStart = NULL;
|
||||
StackEntry* sStackInfoListEnd = NULL;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
#include "irqmgr.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
#include "macros.h"
|
||||
#include "scheduler.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
void* memmove(void* dst, const void* src, size_t size) {
|
||||
unsigned char* _dst = dst;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
void* memset(void* ptr, int val, size_t size) {
|
||||
unsigned char* dst = ptr;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
int strcmp(const char* str1, const char* str2) {
|
||||
unsigned char c1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
char* strcpy(char* dst, const char* src) {
|
||||
char* _dst = dst;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "libc64/os_malloc.h"
|
||||
|
||||
#include "alignment.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "libc/string.h"
|
||||
#include "stdbool.h"
|
||||
#include "stdint.h"
|
||||
#include "string.h"
|
||||
#include "macros.h"
|
||||
|
||||
#define FILL_ALLOCBLOCK (1 << 0)
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#include "libc64/math64.h"
|
||||
|
||||
#include "libc64/fixed_point.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "libc/math.h"
|
||||
#include "stdbool.h"
|
||||
#include "math.h"
|
||||
|
||||
s32 gUseAtanContFrac;
|
||||
|
||||
|
@ -91,14 +91,14 @@ f32 Math_FAtanTaylorF(f32 x) {
|
|||
return qNaN0x10000;
|
||||
}
|
||||
|
||||
if (t <= M_SQRT2 - 1.0f) {
|
||||
if (t <= M_SQRT2f - 1.0f) {
|
||||
return Math_FAtanTaylorQF(x);
|
||||
}
|
||||
|
||||
if (t >= M_SQRT2 + 1.0f) {
|
||||
q = M_PI / 2 - Math_FAtanTaylorQF(1.0f / t);
|
||||
if (t >= M_SQRT2f + 1.0f) {
|
||||
q = M_PIf / 2 - Math_FAtanTaylorQF(1.0f / t);
|
||||
} else { // in the interval (\sqrt{2} - 1, \sqrt{2} + 1)
|
||||
q = M_PI / 4 - Math_FAtanTaylorQF((1.0f - t) / (1.0f + t));
|
||||
q = M_PIf / 4 - Math_FAtanTaylorQF((1.0f - t) / (1.0f + t));
|
||||
}
|
||||
|
||||
if (x > 0.0f) {
|
||||
|
@ -145,9 +145,9 @@ f32 Math_FAtanContFracF(f32 x) {
|
|||
if (sector == 0) {
|
||||
return conv;
|
||||
} else if (sector > 0) {
|
||||
return M_PI / 2 - conv;
|
||||
return M_PIf / 2 - conv;
|
||||
} else {
|
||||
return -M_PI / 2 - conv;
|
||||
return -M_PIf / 2 - conv;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,18 +171,18 @@ f32 Math_FAtan2F(f32 y, f32 x) {
|
|||
if (y == 0.0f) {
|
||||
return 0.0f;
|
||||
} else if (y > 0.0f) {
|
||||
return M_PI / 2;
|
||||
return M_PIf / 2;
|
||||
} else if (y < 0.0f) {
|
||||
return -M_PI / 2;
|
||||
return -M_PIf / 2;
|
||||
} else {
|
||||
return qNaN0x10000;
|
||||
}
|
||||
} else if (x >= 0.0f) {
|
||||
return Math_FAtanF(y / x);
|
||||
} else if (y < 0.0f) {
|
||||
return Math_FAtanF(y / x) - M_PI;
|
||||
return Math_FAtanF(y / x) - M_PIf;
|
||||
} else {
|
||||
return M_PI - Math_FAtanF(-(y / x));
|
||||
return M_PIf - Math_FAtanF(-(y / x));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,5 +191,5 @@ f32 Math_FAsinF(f32 x) {
|
|||
}
|
||||
|
||||
f32 Math_FAcosF(f32 x) {
|
||||
return M_PI / 2 - Math_FAsinF(x);
|
||||
return M_PIf / 2 - Math_FAsinF(x);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "libc64/sprintf.h"
|
||||
|
||||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
void* proutPrintf(void* dst, const char* fmt, size_t size) {
|
||||
return (void*)((uintptr_t)memcpy(dst, fmt, size) + size);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "libc/math.h"
|
||||
#include "math.h"
|
||||
|
||||
float fmodf(float dividend, float divisor) {
|
||||
int quotient;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "viconfig.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "idle.h"
|
||||
|
||||
void ViConfig_UpdateVi(u32 black) {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
#include "z64prerender.h"
|
||||
|
||||
#include "libc/alloca.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "alloca.h"
|
||||
#include "stdbool.h"
|
||||
#include "PR/gs2dex.h"
|
||||
|
||||
#include "global.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
CutsceneCamera* sCurCsCamera;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "z64jpeg.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "macros.h"
|
||||
|
||||
u8* sJpegBitStreamPtr;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "z64jpeg.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "macros.h"
|
||||
|
||||
void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count) {
|
||||
|
|
|
@ -34,7 +34,7 @@ s16 gCfbUpperAdjust;
|
|||
u8 gSysCfbHiResEnabled;
|
||||
|
||||
#include "sys_cfb.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "buffers.h"
|
||||
#include "libc64/malloc.h"
|
||||
#include "z64vimode.h"
|
||||
|
|
|
@ -71,7 +71,7 @@ f32 Math_PowF(f32 base, s32 exp) {
|
|||
* @remark original name: "sinf_table"
|
||||
*/
|
||||
f32 Math_SinF(f32 rad) {
|
||||
return sins(RAD_TO_BINANG(rad)) * SHT_MINV;
|
||||
return sins(RAD_TO_BINANG(rad)) * (1.0f / SHRT_MAX);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,7 +80,7 @@ f32 Math_SinF(f32 rad) {
|
|||
* @remark original name: "cosf_table"
|
||||
*/
|
||||
f32 Math_CosF(f32 rad) {
|
||||
return coss(RAD_TO_BINANG(rad)) * SHT_MINV;
|
||||
return coss(RAD_TO_BINANG(rad)) * (1.0f / SHRT_MAX);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -448,8 +448,8 @@ void Matrix_RotateXFApply(f32 x) {
|
|||
if (x != 0.0f) {
|
||||
cmf = sCurrentMatrix;
|
||||
|
||||
sin = sins(RAD_TO_BINANG(x)) * SHT_MINV;
|
||||
cos = coss(RAD_TO_BINANG(x)) * SHT_MINV;
|
||||
sin = sins(RAD_TO_BINANG(x)) * (1.0f / SHRT_MAX);
|
||||
cos = coss(RAD_TO_BINANG(x)) * (1.0f / SHRT_MAX);
|
||||
|
||||
tempY = cmf->xy;
|
||||
tempZ = cmf->xz;
|
||||
|
|
|
@ -4064,7 +4064,7 @@ void Actor_DrawDoorLock(PlayState* play, s32 frame, s32 type) {
|
|||
if ((i % 2) != 0) {
|
||||
rotZStep = 2.0f * entry->chainAngle;
|
||||
} else {
|
||||
rotZStep = M_PI - (2.0f * entry->chainAngle);
|
||||
rotZStep = M_PIf - (2.0f * entry->chainAngle);
|
||||
}
|
||||
|
||||
chainRotZ += rotZStep;
|
||||
|
@ -4902,11 +4902,11 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
|
|||
Matrix_Scale(frozenScale, frozenScale, frozenScale, MTXMODE_APPLY);
|
||||
|
||||
if (bodyPartIndex & 1) {
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PIf, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
if (bodyPartIndex & 2) {
|
||||
Matrix_RotateZF(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(M_PIf, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
|
@ -4984,7 +4984,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
|
|||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0,
|
||||
((bodyPartIndex * 10 + gameplayFrames) * -20) & 0x1FF, 32, 128));
|
||||
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PIf, MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = bodyPartsPos->x;
|
||||
currentMatrix->mf[3][1] = bodyPartsPos->y;
|
||||
currentMatrix->mf[3][2] = bodyPartsPos->z;
|
||||
|
@ -5026,7 +5026,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
|
|||
|
||||
// Apply and draw a light orb over each body part of frozen actor
|
||||
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
|
||||
Matrix_RotateZF(Rand_CenteredFloat(2 * M_PI), MTXMODE_APPLY);
|
||||
Matrix_RotateZF(Rand_CenteredFloat(2 * M_PIf), MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = bodyPartsPos->x;
|
||||
currentMatrix->mf[3][1] = bodyPartsPos->y;
|
||||
currentMatrix->mf[3][2] = bodyPartsPos->z;
|
||||
|
@ -5065,8 +5065,8 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
|
|||
// Every body part draws two electric sparks at random orientations
|
||||
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
|
||||
// first electric spark
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PIf));
|
||||
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PIf), MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->x;
|
||||
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->y;
|
||||
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->z;
|
||||
|
@ -5077,8 +5077,8 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[]
|
|||
gSPDisplayList(POLY_XLU_DISP++, gElectricSparkModelDL);
|
||||
|
||||
// second electric spark
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
|
||||
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PIf));
|
||||
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PIf), MTXMODE_APPLY);
|
||||
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->x;
|
||||
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->y;
|
||||
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->z;
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
#include "z64malloc.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
@ -1536,10 +1536,10 @@ s32 Camera_CalcAtForFriendlyLockOn(Camera* camera, VecGeo* eyeAtDir, Vec3f* targ
|
|||
deltaY = focalActorPosRot->pos.y - *yPosOffset;
|
||||
temp_f0_6 = Math_FAtan2F(deltaY, OLib_Vec3fDistXZ(at, &camera->eye));
|
||||
|
||||
if (temp_f0_6 > 0.34906584f) { // (M_PI / 9)
|
||||
phi_f16 = 1.0f - Math_SinF(temp_f0_6 - 0.34906584f);
|
||||
} else if (temp_f0_6 < -0.17453292f) { // (M_PI / 18)
|
||||
phi_f16 = 1.0f - Math_SinF(-0.17453292f - temp_f0_6);
|
||||
if (temp_f0_6 > (f32)(M_PI / 9)) {
|
||||
phi_f16 = 1.0f - Math_SinF(temp_f0_6 - (f32)(M_PI / 9));
|
||||
} else if (temp_f0_6 < -(f32)(M_PI / 18)) {
|
||||
phi_f16 = 1.0f - Math_SinF(-(f32)(M_PI / 18) - temp_f0_6);
|
||||
} else {
|
||||
phi_f16 = 1.0f;
|
||||
}
|
||||
|
@ -1616,10 +1616,10 @@ s32 Camera_CalcAtForEnemyLockOn(Camera* camera, VecGeo* arg1, Vec3f* arg2, f32 y
|
|||
|
||||
focalActorAtOffsetTarget.y -= deltaY;
|
||||
} else {
|
||||
if (temp_f0_3 > 0.34906584f) { // (M_PI / 9)
|
||||
temp = 1.0f - Math_SinF(temp_f0_3 - 0.34906584f);
|
||||
} else if (temp_f0_3 < -0.17453292f) { // (M_PI / 18)
|
||||
temp = 1.0f - Math_SinF(-0.17453292f - temp_f0_3);
|
||||
if (temp_f0_3 > (f32)(M_PI / 9)) {
|
||||
temp = 1.0f - Math_SinF(temp_f0_3 - (f32)(M_PI / 9));
|
||||
} else if (temp_f0_3 < -(f32)(M_PI / 18)) {
|
||||
temp = 1.0f - Math_SinF(-(f32)(M_PI / 18) - temp_f0_3);
|
||||
} else {
|
||||
temp = 1.0f;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "alignment.h"
|
||||
#include "sequence.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "z64environment.h"
|
||||
#include "z64transition.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "z64eff_blure.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "gfx.h"
|
||||
#include "macros.h"
|
||||
#include "sys_matrix.h"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
CutsceneEntry sGlobalCutsceneList[] = {
|
||||
// CS_ID_GLOBAL_78
|
||||
|
@ -173,7 +173,7 @@ s16 CutsceneManager_MarkNextCutscenes(void) {
|
|||
s32 j;
|
||||
s32 count = 0;
|
||||
s16 csIdMax = CS_ID_NONE;
|
||||
s16 priorityMax = SHT_MAX; // lower number means higher priority
|
||||
s16 priorityMax = SHRT_MAX; // lower number means higher priority
|
||||
s16 csId;
|
||||
s16 priority;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "z64transition.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "gfx.h"
|
||||
#include "regs.h"
|
||||
#include "z64math.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "z64curve.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "z64actor.h"
|
||||
#include "z64animation.h"
|
||||
#include "z64curve.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "z64jpeg.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "main.h"
|
||||
#include "sys_ucode.h"
|
||||
#include "macros.h"
|
||||
|
|
|
@ -62,7 +62,7 @@ Gfx* sSkyboxStarsDList;
|
|||
#include "z64environment.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
#include "sys_cfb.h"
|
||||
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
|
|
@ -32,11 +32,11 @@ void* Lib_MemSet(void* buffer, s32 value, size_t size) {
|
|||
}
|
||||
|
||||
f32 Math_CosS(s16 angle) {
|
||||
return coss(angle) * SHT_MINV;
|
||||
return coss(angle) * (1.0f / SHRT_MAX);
|
||||
}
|
||||
|
||||
f32 Math_SinS(s16 angle) {
|
||||
return sins(angle) * SHT_MINV;
|
||||
return sins(angle) * (1.0f / SHRT_MAX);
|
||||
}
|
||||
|
||||
s32 Math_StepToIImpl(s32 start, s32 target, s32 step) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
|
||||
#include "z64frameadvance.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "padutils.h"
|
||||
#include "macros.h"
|
||||
|
||||
|
|
|
@ -1812,9 +1812,9 @@ void Player_AdjustSingleLeg(PlayState* play, Player* player, SkelAnime* skelAnim
|
|||
temp_f20 = (temp_f20 < 0.0f) ? 0.0f : sqrtf(temp_f20);
|
||||
|
||||
sp48 = Math_FAtan2F(temp_f20, sp58);
|
||||
phi_t1 = (M_PI - (Math_FAtan2F(sp54, temp_f20) + ((M_PI / 2.0f) - sp48))) * (0x8000 / M_PI);
|
||||
phi_t1 = RAD_TO_BINANG(M_PIf - (Math_FAtan2F(sp54, temp_f20) + ((M_PIf / 2) - sp48)));
|
||||
phi_t1 = -skelAnime->jointTable[shinLimbIndex].z + phi_t1;
|
||||
temp_f8 = (sp48 - sp4C) * (0x8000 / M_PI);
|
||||
temp_f8 = RAD_TO_BINANG(sp48 - sp4C);
|
||||
|
||||
if ((s16)(ABS_ALT(skelAnime->jointTable[shinLimbIndex].x) + ABS_ALT(skelAnime->jointTable[shinLimbIndex].y)) <
|
||||
0) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "z64quake.h"
|
||||
|
||||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "z64view.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "z64skin.h"
|
||||
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "gfx.h"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "z64vis.h"
|
||||
#include "global.h"
|
||||
#include "sys_cfb.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
// Height of the fragments the z-buffer is split into.
|
||||
// It is the maximum amount of lines such that all rgba16 SCREEN_WIDTH-long lines fit into TMEM.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/math.h"
|
||||
#include "math.h"
|
||||
#include "macros.h"
|
||||
|
||||
#pragma weak cosf = __cosf
|
||||
|
@ -14,7 +14,7 @@ static const du P[] = {
|
|||
{ 0.000002605780637968037 },
|
||||
};
|
||||
|
||||
static const du rpi = { 1 / 3.14159265358979323846 }; // 1/M_PI, "reciprocal of pi"
|
||||
static const du rpi = { 1 / M_PI }; // "reciprocal of pi"
|
||||
|
||||
// pihi + pilo is the closest double to pi, this representation allows more precise calculations since pi itself is not
|
||||
// an exact float
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/math.h"
|
||||
#include "math.h"
|
||||
|
||||
/**
|
||||
* guPositionF
|
||||
* Creates a rotation/parallel translation modelling matrix (floating point)
|
||||
*/
|
||||
void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z) {
|
||||
static f32 D_80134D00 = M_PI / 180.0f;
|
||||
static f32 D_80134D00 = M_PIf / 180.0f;
|
||||
f32 sinr;
|
||||
f32 sinp;
|
||||
f32 sinh;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/math.h"
|
||||
#include "math.h"
|
||||
|
||||
void guRotateF(float m[4][4], float a, float x, float y, float z) {
|
||||
static float dtor = M_PI / 180.0f;
|
||||
static float dtor = M_PIf / 180.0f;
|
||||
float sine;
|
||||
float cosine;
|
||||
float ab;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/math.h"
|
||||
#include "math.h"
|
||||
#include "macros.h"
|
||||
|
||||
#pragma weak sinf = __sinf
|
||||
|
@ -14,7 +14,7 @@ static const du P[] = {
|
|||
{ 0.000002605780637968037 },
|
||||
};
|
||||
|
||||
static const du rpi = { 1 / 3.14159265358979323846 }; // 1/M_PI, "reciprocal of pi"
|
||||
static const du rpi = { 1 / M_PI }; // "reciprocal of pi"
|
||||
|
||||
// pihi + pilo is the closest double to pi, this representation allows more precise calculations since pi itself is not
|
||||
// an exact float
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/math.h"
|
||||
#include "math.h"
|
||||
|
||||
static s16 sintable[0x400] = {
|
||||
0x0000, 0x0032, 0x0064, 0x0096, 0x00C9, 0x00FB, 0x012D, 0x0160, 0x0192, 0x01C4, 0x01F7, 0x0229, 0x025B, 0x028E,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "alignment.h"
|
||||
|
||||
OSPiHandle __CartRomHandle ALIGNED(8);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "PR/controller.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "alignment.h"
|
||||
#include "macros.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
void __osDevMgrMain(void* arg) {
|
||||
OSIoMesg* ioMesg;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "PR/controller.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state) {
|
||||
s32 ret;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
s32 __osSiDeviceBusy() {
|
||||
register u32 status = IO_READ(SI_STATUS_REG);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
s32 __osSpDeviceBusy(void) {
|
||||
register u32 status = IO_READ(SP_STATUS_REG);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "PR/osint.h"
|
||||
#include "stack.h"
|
||||
#include "PR/osint.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "macros.h"
|
||||
#include "alignment.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdlib.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
ldiv_t ldiv(long numer, long denom) {
|
||||
ldiv_t val;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdlib.h"
|
||||
#include "libc/string.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
const char* strchr(const char* s, int c) {
|
||||
const unsigned char ch = c;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdlib.h"
|
||||
#include "libc/string.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
#define BUFF_LEN 0x20
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdlib.h"
|
||||
#include "libc/string.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
#define BUFF_LEN 0x18
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/string.h"
|
||||
#include "string.h"
|
||||
|
||||
#define ATOI(i, a) \
|
||||
for (i = 0; (*a >= '0') && (*a <= '9'); a++) \
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
#define COLD_RESET 0
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "ultra64.h"
|
||||
#include "PR/osint.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
#include "alignment.h"
|
||||
|
||||
u32 __osPreNMI = false;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdbool.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
OSTimer __osBaseTimer;
|
||||
OSTime __osCurrentTime;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "ultra64.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "stdint.h"
|
||||
|
||||
uintptr_t osVirtualToPhysical(void* addr) {
|
||||
if (IS_KSEG0(addr)) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libc/stddef.h"
|
||||
#include "stddef.h"
|
||||
|
||||
#define VOICE_CRC_LENGTH 8
|
||||
#define VOICE_CRC_GENERATOR 0x85
|
||||
|
|
|
@ -64,11 +64,10 @@ void func_808D75F0(BgF40Flift* this, PlayState* play) {
|
|||
}
|
||||
this->timer--;
|
||||
if (this->dyna.actor.params == 1) {
|
||||
this->dyna.actor.world.pos.y =
|
||||
(Math_SinF(this->timer * (M_PI / 24.0f)) * 5.0f) + this->dyna.actor.home.pos.y;
|
||||
this->dyna.actor.world.pos.y = (Math_SinF(this->timer * (M_PIf / 24)) * 5.0f) + this->dyna.actor.home.pos.y;
|
||||
} else {
|
||||
this->dyna.actor.world.pos.y =
|
||||
(Math_SinF(this->timer * (M_PI / 24.0f)) * 5.0f) + (926.8f + this->dyna.actor.home.pos.y);
|
||||
(Math_SinF(this->timer * (M_PIf / 24)) * 5.0f) + (926.8f + this->dyna.actor.home.pos.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +76,7 @@ void func_808D7714(BgF40Flift* this, PlayState* play) {
|
|||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
this->dyna.actor.world.pos.y =
|
||||
(((Math_CosF(this->timer * (M_PI / 96.0f)) * this->dyna.actor.params) + 1.0f) * 463.4f) +
|
||||
(((Math_CosF(this->timer * (M_PIf / 96)) * this->dyna.actor.params) + 1.0f) * 463.4f) +
|
||||
this->dyna.actor.home.pos.y;
|
||||
} else {
|
||||
this->dyna.actor.params = -this->dyna.actor.params;
|
||||
|
|
|
@ -105,7 +105,7 @@ void BgF40Swlift_Update(Actor* thisx, PlayState* play2) {
|
|||
}
|
||||
this->timer--;
|
||||
this->dyna.actor.world.pos.y =
|
||||
sHeights[this->dyna.actor.params] + (Math_SinF(this->timer * (M_PI / 24.0f)) * 5.0f);
|
||||
sHeights[this->dyna.actor.params] + (Math_SinF(this->timer * (M_PIf / 24)) * 5.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ void func_80AC4C34(BgIcefloe* this, PlayState* play) {
|
|||
func_80AC4CF0(this);
|
||||
} else {
|
||||
this->dyna.actor.world.pos.y =
|
||||
(Math_SinF(this->timer * (M_PI / 30.0f)) * 3.0f) + (this->dyna.actor.home.pos.y + 10.0f);
|
||||
(Math_SinF(this->timer * (M_PIf / 30)) * 3.0f) + (this->dyna.actor.home.pos.y + 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void func_80AD6830(BgLotus* this) {
|
|||
f32 temp_fv1;
|
||||
|
||||
if (this->dyna.actor.params == 0) {
|
||||
temp_fv1 = Math_SinF(this->unk166 * (M_PI / 4)) * ((0.014f * (this->unk166 / (80.0f * 0.1f))) + 0.01f);
|
||||
temp_fv1 = Math_SinF(this->unk166 * (M_PIf / 4)) * ((0.014f * (this->unk166 / (80.0f * 0.1f))) + 0.01f);
|
||||
this->dyna.actor.scale.x = (1.0f + temp_fv1) * 0.1f;
|
||||
this->dyna.actor.scale.z = (1.0f - temp_fv1) * 0.1f;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ void func_80AD68DC(BgLotus* this, PlayState* play) {
|
|||
f32 sp34;
|
||||
|
||||
this->unk168--;
|
||||
sp34 = Math_SinF(this->unk168 * (M_PI / 48)) * 6.0f;
|
||||
sp34 = Math_SinF(this->unk168 * (M_PIf / 48)) * 6.0f;
|
||||
|
||||
if (this->dyna.actor.params == 0) {
|
||||
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * sp34) + this->dyna.actor.home.pos.x;
|
||||
|
|
|
@ -324,7 +324,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) {
|
|||
}
|
||||
|
||||
this->dyna.actor.world.pos.y =
|
||||
(Math_SinF(this->unk_162 * (M_PI / 6)) * this->unk_164) + this->dyna.actor.home.pos.y;
|
||||
(Math_SinF(this->unk_162 * (M_PIf / 6)) * this->unk_164) + this->dyna.actor.home.pos.y;
|
||||
Math_ApproachZeroF(&this->unk_164, 1.0f, 0.8f);
|
||||
|
||||
if (this->unk_162 == 4) {
|
||||
|
|
|
@ -205,7 +205,7 @@ static Vec3f sFallingBlockSfxPos = { 0.0f, 1000.0f, 0.0f };
|
|||
/**
|
||||
* Odolwa's sword trail is a circular arc, and this variable is used to determine the angular range of this arc (and
|
||||
* thus the total size of the trail). The trail consists of 10 segments in an arc, and the angle of each of those
|
||||
* segments is M_PI / sSwordTrailAngularRangeDivisor; in other words, as this variable decreases, Odolwa's sword trail
|
||||
* segments is M_PIf / sSwordTrailAngularRangeDivisor; in other words, as this variable decreases, Odolwa's sword trail
|
||||
* covers a larger angular range, and as it increaes, the sword trail covers a smaller angular range.
|
||||
*/
|
||||
static f32 sSwordTrailAngularRangeDivisor = 10.0f;
|
||||
|
@ -1723,7 +1723,7 @@ void Boss01_VerticalSlash(Boss01* this, PlayState* play) {
|
|||
sOdolwaSwordTrailPosY = 90.0f;
|
||||
sOdolwaSwordTrailPosZ = -70.0f;
|
||||
sOdolwaSwordTrailRotX = 0.4712388f;
|
||||
sOdolwaSwordTrailRotY = M_PI;
|
||||
sOdolwaSwordTrailRotY = M_PIf;
|
||||
sOdolwaSwordTrailRotZ = 1.7278761f;
|
||||
|
||||
if (Animation_OnFrame(&this->skelAnime, 12.0f)) {
|
||||
|
@ -2614,13 +2614,13 @@ void Boss01_DrawSwordTrail(Boss01* this, PlayState* play) {
|
|||
vtx = Lib_SegmentedToVirtual(&gOdolwaSwordTrailVtx);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sSwordTrailOuterVertexIndices); i++) {
|
||||
vtx[sSwordTrailOuterVertexIndices[i]].v.ob[0] = cosf((i * M_PI) / sSwordTrailAngularRangeDivisor) * 200.0f;
|
||||
vtx[sSwordTrailOuterVertexIndices[i]].v.ob[0] = cosf((i * M_PIf) / sSwordTrailAngularRangeDivisor) * 200.0f;
|
||||
vtx[sSwordTrailOuterVertexIndices[i]].v.ob[1] = 0;
|
||||
vtx[sSwordTrailOuterVertexIndices[i]].v.ob[2] = sinf((i * M_PI) / sSwordTrailAngularRangeDivisor) * 200.0f;
|
||||
vtx[sSwordTrailOuterVertexIndices[i]].v.ob[2] = sinf((i * M_PIf) / sSwordTrailAngularRangeDivisor) * 200.0f;
|
||||
|
||||
vtx[sSwordTrailInnerVertexIndices[i]].v.ob[0] = cosf((i * M_PI) / sSwordTrailAngularRangeDivisor) * 100.0f;
|
||||
vtx[sSwordTrailInnerVertexIndices[i]].v.ob[0] = cosf((i * M_PIf) / sSwordTrailAngularRangeDivisor) * 100.0f;
|
||||
vtx[sSwordTrailInnerVertexIndices[i]].v.ob[1] = 0;
|
||||
vtx[sSwordTrailInnerVertexIndices[i]].v.ob[2] = sinf((i * M_PI) / sSwordTrailAngularRangeDivisor) * 100.0f;
|
||||
vtx[sSwordTrailInnerVertexIndices[i]].v.ob[2] = sinf((i * M_PIf) / sSwordTrailAngularRangeDivisor) * 100.0f;
|
||||
}
|
||||
|
||||
gSPSegment(
|
||||
|
@ -3571,11 +3571,11 @@ void Boss01_DrawEffects(PlayState* play) {
|
|||
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 64, 1, 0,
|
||||
((effect->timer + (i * 10)) * -20) & 0x1FF, 32, 128));
|
||||
|
||||
Matrix_RotateYF(i * (M_PI / 16.0f), MTXMODE_APPLY);
|
||||
Matrix_RotateYF(i * (M_PIf / 16), MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 0.0f, KREG(49) + 200.0f, MTXMODE_APPLY);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
if (Boss01_RandZeroOne() < 0.5f) {
|
||||
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
|
||||
Matrix_RotateYF(M_PIf, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
Matrix_Scale(KREG(48) * 0.0001f + 0.018f,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue