This commit is contained in:
Derek Hensley 2024-05-21 18:12:27 -07:00
parent e2b4b1bbd1
commit b4527cc5c7
89 changed files with 109 additions and 108 deletions

View File

@ -120,7 +120,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 $@

View File

@ -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/",

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -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 {

View File

@ -3,7 +3,7 @@
#include "ultratypes.h"
#include "os_pi.h"
#include "libc/stdint.h"
#include "stdint.h"
#define LEO_BASE_REG 0x05000000

View File

@ -2,7 +2,7 @@
#define PR_XSTDIO_H
#include "ultratypes.h"
#include "libc/stdarg.h"
#include "stdarg.h"
typedef struct {
/* 0x0 */ union {

View File

@ -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 {

View File

@ -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);

View File

@ -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"

View File

@ -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"

View File

@ -1,7 +1,7 @@
#ifndef ICHAIN_H
#define ICHAIN_H
#include "libc/stddef.h"
#include "stddef.h"
typedef struct InitChainEntry {
u32 cont: 1;

View File

@ -1,7 +1,7 @@
#ifndef LIBC_STDLIB_H
#define LIBC_STDLIB_H
#include "libc/stddef.h"
#include "stddef.h"
typedef struct {
/* 0x0 */ int quot;

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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"

View File

@ -2,7 +2,7 @@
#define ROMFILE_H
#include "ultra64.h"
#include "libc/stdint.h"
#include "stdint.h"
typedef struct {
/* 0x00 */ uintptr_t vromStart;

View File

@ -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"

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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"

View File

@ -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.

View File

@ -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"

View File

@ -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"

View File

@ -2,7 +2,7 @@
#define Z64FONT_H
#include "PR/ultratypes.h"
#include "libc/stdint.h"
#include "stdint.h"
struct PlayState;

View File

@ -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"

View File

@ -2,7 +2,7 @@
#define Z64MATH_H
#include "ultra64.h"
#include "libc/math.h"
#include "math.h"
#include "libc64/math64.h"

View File

@ -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"

View File

@ -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,

View File

@ -3,7 +3,7 @@
#include "ultra64.h"
#include "libc/stdint.h"
#include "stdint.h"
#include "unk.h"
#include "romfile.h"

View File

@ -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

View File

@ -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;

View File

@ -34,7 +34,7 @@
*/
#include "irqmgr.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "macros.h"
#include "scheduler.h"

View File

@ -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;

View File

@ -1,4 +1,4 @@
#include "libc/string.h"
#include "string.h"
void* memset(void* ptr, int val, size_t size) {
unsigned char* dst = ptr;

View File

@ -1,4 +1,4 @@
#include "libc/string.h"
#include "string.h"
int strcmp(const char* str1, const char* str2) {
unsigned char c1;

View File

@ -1,4 +1,4 @@
#include "libc/string.h"
#include "string.h"
char* strcpy(char* dst, const char* src) {
char* _dst = dst;

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -1,4 +1,4 @@
#include "libc/math.h"
#include "math.h"
float fmodf(float dividend, float divisor) {
int quotient;

View File

@ -1,6 +1,6 @@
#include "viconfig.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "idle.h"
void ViConfig_UpdateVi(u32 black) {

View File

@ -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"

View File

@ -1,6 +1,6 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#include "libc/string.h"
#include "string.h"
CutsceneCamera* sCurCsCamera;

View File

@ -1,5 +1,5 @@
#include "z64jpeg.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "macros.h"
u8* sJpegBitStreamPtr;

View File

@ -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) {

View File

@ -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"

View File

@ -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"

View File

@ -2,7 +2,7 @@
#include "alignment.h"
#include "sequence.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "z64environment.h"
#include "z64transition.h"

View File

@ -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"

View File

@ -6,7 +6,7 @@
#include "global.h"
#include "z64shrink_window.h"
#include "libc/string.h"
#include "string.h"
CutsceneEntry sGlobalCutsceneList[] = {
// CS_ID_GLOBAL_78

View File

@ -1,6 +1,6 @@
#include "z64transition.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "gfx.h"
#include "regs.h"
#include "z64math.h"

View File

@ -27,7 +27,7 @@
#include "z64curve.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "z64actor.h"
#include "z64animation.h"
#include "z64curve.h"

View File

@ -1,6 +1,6 @@
#include "z64jpeg.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "main.h"
#include "sys_ucode.h"
#include "macros.h"

View File

@ -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"

View File

@ -20,7 +20,7 @@
*/
#include "z64frameadvance.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "padutils.h"
#include "macros.h"

View File

@ -1,6 +1,6 @@
#include "z64quake.h"
#include "libc/string.h"
#include "string.h"
#include "global.h"
#include "z64view.h"

View File

@ -1,6 +1,6 @@
#include "z64skin.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "global.h"
#include "gfx.h"

View File

@ -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.

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/math.h"
#include "math.h"
#include "macros.h"
#pragma weak cosf = __cosf

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/math.h"
#include "math.h"
/**
* guPositionF

View File

@ -1,5 +1,5 @@
#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 = F_PI / 180.0f;

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/math.h"
#include "math.h"
#include "macros.h"
#pragma weak sinf = __sinf

View File

@ -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,

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "alignment.h"
OSPiHandle __CartRomHandle ALIGNED(8);

View File

@ -1,6 +1,6 @@
#include "ultra64.h"
#include "PR/controller.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "alignment.h"
#include "macros.h"

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/stdbool.h"
#include "stdbool.h"
void __osDevMgrMain(void* arg) {
OSIoMesg* ioMesg;

View File

@ -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;

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/stdbool.h"
#include "stdbool.h"
s32 __osSiDeviceBusy() {
register u32 status = IO_READ(SI_STATUS_REG);

View File

@ -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);

View File

@ -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"

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/stdlib.h"
#include "stdlib.h"
ldiv_t ldiv(long numer, long denom) {
ldiv_t val;

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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++) \

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#define COLD_RESET 0

View File

@ -1,6 +1,6 @@
#include "ultra64.h"
#include "PR/osint.h"
#include "libc/stdbool.h"
#include "stdbool.h"
#include "alignment.h"
u32 __osPreNMI = false;

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/stdbool.h"
#include "stdbool.h"
OSTimer __osBaseTimer;
OSTime __osCurrentTime;

View File

@ -1,5 +1,5 @@
#include "ultra64.h"
#include "libc/stdint.h"
#include "stdint.h"
uintptr_t osVirtualToPhysical(void* addr) {
if (IS_KSEG0(addr)) {

View File

@ -6,7 +6,7 @@
*/
#include "ultra64.h"
#include "libc/stddef.h"
#include "stddef.h"
#define VOICE_CRC_LENGTH 8
#define VOICE_CRC_GENERATOR 0x85

View File

@ -6,7 +6,7 @@
#include "z_en_door.h"
#include "libc/assert.h"
#include "assert.h"
#include "objects/object_kinsta2_obj/object_kinsta2_obj.h"
#include "objects/object_dor01/object_dor01.h"

View File

@ -7,7 +7,7 @@
#include "z_select.h"
#include "z64shrink_window.h"
#include "z64view.h"
#include "libc/alloca.h"
#include "alloca.h"
#include "overlays/gamestates/ovl_title/z_title.h"
void MapSelect_LoadConsoleLogo(MapSelectState* this, u32 entrance, s32 spawn) {