mirror of
https://github.com/zeldaret/oot.git
synced 2025-06-08 01:21:52 +00:00
[ntsc-1.2] Match N64 libultra (#2081)
* Match N64 libultra * INITIALIZE_FUNC -> OSINITIALIZE_FUNC * Document osGetIntMask * Refer readers of osGetIntMask to osSetIntMask comment * Whitelist new static functions in disasm unksyms check
This commit is contained in:
parent
6e8b820184
commit
7079005c83
31 changed files with 344 additions and 42 deletions
54
Makefile
54
Makefile
|
@ -451,6 +451,9 @@ ifeq ($(PLATFORM),N64)
|
||||||
$(BUILD_DIR)/src/code/z_rumble.o: CFLAGS += -DNO_SQRTF_INTRINSIC
|
$(BUILD_DIR)/src/code/z_rumble.o: CFLAGS += -DNO_SQRTF_INTRINSIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$(BUILD_DIR)/src/code/jpegutils.o: CC := $(CC_OLD)
|
||||||
|
$(BUILD_DIR)/src/code/jpegdecoder.o: CC := $(CC_OLD)
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
$(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -g
|
$(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -g
|
||||||
else
|
else
|
||||||
|
@ -470,28 +473,57 @@ endif
|
||||||
$(BUILD_DIR)/src/audio/sfx.o: CFLAGS += -use_readwrite_const
|
$(BUILD_DIR)/src/audio/sfx.o: CFLAGS += -use_readwrite_const
|
||||||
$(BUILD_DIR)/src/audio/sequence.o: CFLAGS += -use_readwrite_const
|
$(BUILD_DIR)/src/audio/sequence.o: CFLAGS += -use_readwrite_const
|
||||||
|
|
||||||
|
$(BUILD_DIR)/src/libultra/%.o: CC := $(CC_OLD)
|
||||||
|
|
||||||
$(BUILD_DIR)/src/libultra/libc/ll.o: OPTFLAGS := -O1
|
$(BUILD_DIR)/src/libultra/libc/ll.o: OPTFLAGS := -O1
|
||||||
$(BUILD_DIR)/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32
|
$(BUILD_DIR)/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32
|
||||||
$(BUILD_DIR)/src/libultra/libc/llcvt.o: OPTFLAGS := -O1
|
$(BUILD_DIR)/src/libultra/libc/llcvt.o: OPTFLAGS := -O1
|
||||||
$(BUILD_DIR)/src/libultra/libc/llcvt.o: MIPS_VERSION := -mips3 -32
|
$(BUILD_DIR)/src/libultra/libc/llcvt.o: MIPS_VERSION := -mips3 -32
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM),N64)
|
||||||
|
$(BUILD_DIR)/src/libultra/gu/%.o: OPTFLAGS := -O3
|
||||||
|
$(BUILD_DIR)/src/libultra/io/%.o: OPTFLAGS := -O1
|
||||||
|
$(BUILD_DIR)/src/libultra/libc/%.o: OPTFLAGS := -O3
|
||||||
$(BUILD_DIR)/src/libultra/os/%.o: OPTFLAGS := -O1
|
$(BUILD_DIR)/src/libultra/os/%.o: OPTFLAGS := -O1
|
||||||
|
|
||||||
|
$(BUILD_DIR)/src/libultra/io/aisetfreq.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/cartrominit.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/contpfs.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/contramread.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/contramwrite.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/contreaddata.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/crc.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/devmgr.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/epiread.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/epiwrite.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/epirawdma.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/epirawread.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/epirawwrite.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/motor.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/pfsselectbank.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/pimgr.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/pirawdma.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/sirawdma.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/sirawread.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/sirawwrite.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/sprawdma.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/vimgr.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/visetspecial.o: OPTFLAGS := -O2
|
||||||
|
$(BUILD_DIR)/src/libultra/io/viswapcontext.o: OPTFLAGS := -O2
|
||||||
|
|
||||||
|
$(BUILD_DIR)/src/libultra/gu/lookat.o: CFLAGS += -DNO_SQRTF_INTRINSIC
|
||||||
|
$(BUILD_DIR)/src/libultra/gu/lookathil.o: CFLAGS += -DNO_SQRTF_INTRINSIC
|
||||||
|
$(BUILD_DIR)/src/libultra/gu/normalize.o: CFLAGS += -DNO_SQRTF_INTRINSIC
|
||||||
|
else
|
||||||
|
$(BUILD_DIR)/src/libultra/gu/%.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/libultra/io/%.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/libultra/io/%.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/libultra/libc/%.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/libultra/libc/%.o: OPTFLAGS := -O2
|
||||||
$(BUILD_DIR)/src/libultra/rmon/%.o: OPTFLAGS := -O2
|
$(BUILD_DIR)/src/libultra/os/%.o: OPTFLAGS := -O1
|
||||||
$(BUILD_DIR)/src/libultra/gu/%.o: OPTFLAGS := -O2
|
endif
|
||||||
|
|
||||||
$(BUILD_DIR)/assets/misc/z_select_static/%.o: GBI_DEFINES := -DF3DEX_GBI
|
$(BUILD_DIR)/assets/misc/z_select_static/%.o: GBI_DEFINES := -DF3DEX_GBI
|
||||||
|
|
||||||
$(BUILD_DIR)/src/libultra/gu/%.o: CC := $(CC_OLD)
|
|
||||||
$(BUILD_DIR)/src/libultra/io/%.o: CC := $(CC_OLD)
|
|
||||||
$(BUILD_DIR)/src/libultra/libc/%.o: CC := $(CC_OLD)
|
|
||||||
$(BUILD_DIR)/src/libultra/os/%.o: CC := $(CC_OLD)
|
|
||||||
$(BUILD_DIR)/src/libultra/rmon/%.o: CC := $(CC_OLD)
|
|
||||||
|
|
||||||
$(BUILD_DIR)/src/code/jpegutils.o: CC := $(CC_OLD)
|
|
||||||
$(BUILD_DIR)/src/code/jpegdecoder.o: CC := $(CC_OLD)
|
|
||||||
|
|
||||||
# For using asm_processor on some files:
|
# For using asm_processor on some files:
|
||||||
#$(BUILD_DIR)/.../%.o: CC := $(PYTHON) tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
#$(BUILD_DIR)/.../%.o: CC := $(PYTHON) tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||||
|
|
||||||
|
|
|
@ -1677,7 +1677,7 @@ s32 __osCheckPackId(OSPfs* pfs, __OSPackId* check);
|
||||||
s32 __osGetId(OSPfs* pfs);
|
s32 __osGetId(OSPfs* pfs);
|
||||||
s32 __osCheckId(OSPfs* pfs);
|
s32 __osCheckId(OSPfs* pfs);
|
||||||
s32 __osPfsRWInode(OSPfs* pfs, __OSInode* inode, u8 flag, u8 bank);
|
s32 __osPfsRWInode(OSPfs* pfs, __OSInode* inode, u8 flag, u8 bank);
|
||||||
void guMtxL2F(MtxF* m1, Mtx* m2);
|
void guMtxL2F(f32 mf[4][4], Mtx* m);
|
||||||
s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo);
|
s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo);
|
||||||
s32 osAfterPreNMI(void);
|
s32 osAfterPreNMI(void);
|
||||||
s32 osContStartQuery(OSMesgQueue* mq);
|
s32 osContStartQuery(OSMesgQueue* mq);
|
||||||
|
@ -1728,7 +1728,7 @@ u32 __osSpGetStatus(void);
|
||||||
void __osSpSetStatus(u32 status);
|
void __osSpSetStatus(u32 status);
|
||||||
void osWritebackDCacheAll(void);
|
void osWritebackDCacheAll(void);
|
||||||
OSThread* __osGetCurrFaultedThread(void);
|
OSThread* __osGetCurrFaultedThread(void);
|
||||||
void guMtxF2L(MtxF* m1, Mtx* m2);
|
void guMtxF2L(f32 mf[4][4], Mtx* m);
|
||||||
// ? __d_to_ll(?);
|
// ? __d_to_ll(?);
|
||||||
// ? __f_to_ll(?);
|
// ? __f_to_ll(?);
|
||||||
// ? __d_to_ull(?);
|
// ? __d_to_ull(?);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
|
|
||||||
#define GU_PI 3.1415926
|
#define GU_PI 3.1415926
|
||||||
|
|
||||||
|
#define FTOFIX32(x) (s32)((x) * (f32)0x00010000)
|
||||||
|
#define FIX32TOF(x) ((f32)(x) * (1.0f / (f32)0x00010000))
|
||||||
|
|
||||||
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
|
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
|
||||||
|
|
||||||
typedef union du {
|
typedef union du {
|
||||||
|
|
29
spec
29
spec
|
@ -589,7 +589,14 @@ beginseg
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
include "$(BUILD_DIR)/src/libultra/io/pfsfreeblocks.o"
|
include "$(BUILD_DIR)/src/libultra/io/pfsfreeblocks.o"
|
||||||
#endif
|
#endif
|
||||||
|
#if PLATFORM_N64
|
||||||
|
include "$(BUILD_DIR)/src/libultra/os/getintmask.o"
|
||||||
|
#endif
|
||||||
|
#if PLATFORM_N64
|
||||||
|
include "$(BUILD_DIR)/src/libultra/gu/scale.o"
|
||||||
|
#else
|
||||||
include "$(BUILD_DIR)/src/libultra/mgu/scale.o"
|
include "$(BUILD_DIR)/src/libultra/mgu/scale.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/sinf.o"
|
include "$(BUILD_DIR)/src/libultra/gu/sinf.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/sins.o"
|
include "$(BUILD_DIR)/src/libultra/gu/sins.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/io/sptask.o"
|
include "$(BUILD_DIR)/src/libultra/io/sptask.o"
|
||||||
|
@ -605,7 +612,12 @@ beginseg
|
||||||
include "$(BUILD_DIR)/src/libultra/io/pfsreadwritefile.o"
|
include "$(BUILD_DIR)/src/libultra/io/pfsreadwritefile.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o"
|
include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o"
|
||||||
#endif
|
#endif
|
||||||
|
#if PLATFORM_N64
|
||||||
|
include "$(BUILD_DIR)/src/libultra/gu/mtxutil.o"
|
||||||
|
#endif
|
||||||
|
#if !PLATFORM_N64
|
||||||
include "$(BUILD_DIR)/src/libultra/mgu/mtxidentf.o"
|
include "$(BUILD_DIR)/src/libultra/mgu/mtxidentf.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/lookat.o"
|
include "$(BUILD_DIR)/src/libultra/gu/lookat.o"
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
include "$(BUILD_DIR)/src/libultra/io/pfsallocatefile.o"
|
include "$(BUILD_DIR)/src/libultra/io/pfsallocatefile.o"
|
||||||
|
@ -613,7 +625,9 @@ beginseg
|
||||||
include "$(BUILD_DIR)/src/libultra/os/stoptimer.o"
|
include "$(BUILD_DIR)/src/libultra/os/stoptimer.o"
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
include "$(BUILD_DIR)/src/libultra/io/contpfs.o"
|
include "$(BUILD_DIR)/src/libultra/io/contpfs.o"
|
||||||
|
#if !PLATFORM_N64
|
||||||
include "$(BUILD_DIR)/src/libultra/mgu/mtxl2f.o"
|
include "$(BUILD_DIR)/src/libultra/mgu/mtxl2f.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/io/pfsfindfile.o"
|
include "$(BUILD_DIR)/src/libultra/io/pfsfindfile.o"
|
||||||
#endif
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/sqrtf.o"
|
include "$(BUILD_DIR)/src/libultra/gu/sqrtf.o"
|
||||||
|
@ -627,13 +641,19 @@ beginseg
|
||||||
include "$(BUILD_DIR)/src/libultra/libc/string.o"
|
include "$(BUILD_DIR)/src/libultra/libc/string.o"
|
||||||
#endif
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/io/sp.o"
|
include "$(BUILD_DIR)/src/libultra/io/sp.o"
|
||||||
|
#if !PLATFORM_N64
|
||||||
include "$(BUILD_DIR)/src/libultra/mgu/mtxident.o"
|
include "$(BUILD_DIR)/src/libultra/mgu/mtxident.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/position.o"
|
include "$(BUILD_DIR)/src/libultra/gu/position.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/io/sptaskyielded.o"
|
include "$(BUILD_DIR)/src/libultra/io/sptaskyielded.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/rotate.o"
|
include "$(BUILD_DIR)/src/libultra/gu/rotate.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/io/aisetfreq.o"
|
include "$(BUILD_DIR)/src/libultra/io/aisetfreq.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/os/getactivequeue.o"
|
include "$(BUILD_DIR)/src/libultra/os/getactivequeue.o"
|
||||||
|
#if PLATFORM_N64
|
||||||
|
include "$(BUILD_DIR)/src/libultra/gu/normalize.o"
|
||||||
|
#else
|
||||||
include "$(BUILD_DIR)/src/libultra/mgu/normalize.o"
|
include "$(BUILD_DIR)/src/libultra/mgu/normalize.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/io/dpgetstat.o"
|
include "$(BUILD_DIR)/src/libultra/io/dpgetstat.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/io/dpsetstat.o"
|
include "$(BUILD_DIR)/src/libultra/io/dpsetstat.o"
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
|
@ -643,6 +663,9 @@ beginseg
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/cosf.o"
|
include "$(BUILD_DIR)/src/libultra/gu/cosf.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/libm_vals.o"
|
include "$(BUILD_DIR)/src/libultra/gu/libm_vals.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/gu/coss.o"
|
include "$(BUILD_DIR)/src/libultra/gu/coss.o"
|
||||||
|
#if PLATFORM_N64
|
||||||
|
include "$(BUILD_DIR)/src/libultra/os/settime.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/io/visetevent.o"
|
include "$(BUILD_DIR)/src/libultra/io/visetevent.o"
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o"
|
include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o"
|
||||||
|
@ -656,7 +679,11 @@ beginseg
|
||||||
include "$(BUILD_DIR)/src/libultra/io/pfschecker.o"
|
include "$(BUILD_DIR)/src/libultra/io/pfschecker.o"
|
||||||
#endif
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/io/aigetlen.o"
|
include "$(BUILD_DIR)/src/libultra/io/aigetlen.o"
|
||||||
|
#if PLATFORM_N64
|
||||||
|
include "$(BUILD_DIR)/src/libultra/gu/translate.o"
|
||||||
|
#else
|
||||||
include "$(BUILD_DIR)/src/libultra/mgu/translate.o"
|
include "$(BUILD_DIR)/src/libultra/mgu/translate.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/io/contramwrite.o"
|
include "$(BUILD_DIR)/src/libultra/io/contramwrite.o"
|
||||||
#if !OOT_DEBUG
|
#if !OOT_DEBUG
|
||||||
include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o"
|
include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o"
|
||||||
|
@ -678,7 +705,9 @@ beginseg
|
||||||
include "$(BUILD_DIR)/src/libultra/io/spsetstat.o"
|
include "$(BUILD_DIR)/src/libultra/io/spsetstat.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/os/writebackdcacheall.o"
|
include "$(BUILD_DIR)/src/libultra/os/writebackdcacheall.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/os/getcurrfaultedthread.o"
|
include "$(BUILD_DIR)/src/libultra/os/getcurrfaultedthread.o"
|
||||||
|
#if !PLATFORM_N64
|
||||||
include "$(BUILD_DIR)/src/libultra/mgu/mtxf2l.o"
|
include "$(BUILD_DIR)/src/libultra/mgu/mtxf2l.o"
|
||||||
|
#endif
|
||||||
include "$(BUILD_DIR)/src/libultra/libc/llcvt.o"
|
include "$(BUILD_DIR)/src/libultra/libc/llcvt.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/io/vigetcurrframebuf.o"
|
include "$(BUILD_DIR)/src/libultra/io/vigetcurrframebuf.o"
|
||||||
include "$(BUILD_DIR)/src/libultra/io/spsetpc.o"
|
include "$(BUILD_DIR)/src/libultra/io/spsetpc.o"
|
||||||
|
|
|
@ -20,5 +20,5 @@ void MtxConv_F2L(Mtx* m1, MtxF* m2) {
|
||||||
void MtxConv_L2F(MtxF* m1, Mtx* m2) {
|
void MtxConv_L2F(MtxF* m1, Mtx* m2) {
|
||||||
LOG_UTILS_CHECK_NULL_POINTER("m1", m1, "../mtxuty-cvt.c", 55);
|
LOG_UTILS_CHECK_NULL_POINTER("m1", m1, "../mtxuty-cvt.c", 55);
|
||||||
LOG_UTILS_CHECK_NULL_POINTER("m2", m2, "../mtxuty-cvt.c", 56);
|
LOG_UTILS_CHECK_NULL_POINTER("m2", m2, "../mtxuty-cvt.c", 56);
|
||||||
guMtxL2F(m1, m2);
|
guMtxL2F(m1->mf, m2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1020,7 +1020,7 @@ void Matrix_SetTranslateUniformScaleMtx(Mtx* mtx, f32 scale, f32 translateX, f32
|
||||||
MtxF mf;
|
MtxF mf;
|
||||||
|
|
||||||
Matrix_SetTranslateUniformScaleMtxF(&mf, scale, translateX, translateY, translateZ);
|
Matrix_SetTranslateUniformScaleMtxF(&mf, scale, translateX, translateY, translateZ);
|
||||||
guMtxF2L(&mf, mtx);
|
guMtxF2L(mf.mf, mtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_SetTranslateUniformScaleMtx2(Mtx* mtx, f32 scale, f32 translateX, f32 translateY, f32 translateZ) {
|
void Matrix_SetTranslateUniformScaleMtx2(Mtx* mtx, f32 scale, f32 translateX, f32 translateY, f32 translateZ) {
|
||||||
|
|
|
@ -61,5 +61,5 @@ void guLookAt(Mtx* m, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f
|
||||||
|
|
||||||
guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp);
|
guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp);
|
||||||
|
|
||||||
guMtxF2L((MtxF*)mf, m);
|
guMtxF2L(mf, m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,5 +157,5 @@ void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye,
|
||||||
guLookAtHiliteF(mf, l, h, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp, xl1, yl1, zl1, xl2, yl2, zl2, hiliteWidth,
|
guLookAtHiliteF(mf, l, h, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp, xl1, yl1, zl1, xl2, yl2, zl2, hiliteWidth,
|
||||||
hiliteHeight);
|
hiliteHeight);
|
||||||
|
|
||||||
guMtxF2L((MtxF*)mf, m);
|
guMtxF2L(mf, m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,63 @@
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void guMtxF2L(f32 mf[4][4], Mtx* m) {
|
||||||
|
s32 i, j;
|
||||||
|
s32 e1, e2;
|
||||||
|
s32 *ai, *af;
|
||||||
|
|
||||||
|
ai = (s32*)&m->m[0][0];
|
||||||
|
af = (s32*)&m->m[2][0];
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
for (j = 0; j < 2; j++) {
|
||||||
|
e1 = FTOFIX32(mf[i][j * 2]);
|
||||||
|
e2 = FTOFIX32(mf[i][j * 2 + 1]);
|
||||||
|
*(ai++) = (e1 & 0xFFFF0000) | ((e2 >> 16) & 0xFFFF);
|
||||||
|
*(af++) = ((e1 << 16) & 0xFFFF0000) | (e2 & 0xFFFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void guMtxL2F(f32 mf[4][4], Mtx* m) {
|
||||||
|
s32 i, j;
|
||||||
|
u32 e1, e2;
|
||||||
|
u32 *ai, *af;
|
||||||
|
s32 q1, q2;
|
||||||
|
|
||||||
|
ai = (u32*)&m->m[0][0];
|
||||||
|
af = (u32*)&m->m[2][0];
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
for (j = 0; j < 2; j++) {
|
||||||
|
e1 = (*ai & 0xFFFF0000) | ((*af >> 16) & 0xFFFF);
|
||||||
|
e2 = ((*(ai++) << 16) & 0xFFFF0000) | (*(af++) & 0xFFFF);
|
||||||
|
q1 = *((s32*)&e1);
|
||||||
|
q2 = *((s32*)&e2);
|
||||||
|
|
||||||
|
mf[i][j * 2] = FIX32TOF(q1);
|
||||||
|
mf[i][j * 2 + 1] = FIX32TOF(q2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void guMtxIdentF(f32 mf[4][4]) {
|
||||||
|
s32 i, j;
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++) {
|
||||||
|
for (j = 0; j < 4; j++) {
|
||||||
|
if (i == j) {
|
||||||
|
mf[i][j] = 1.0;
|
||||||
|
} else {
|
||||||
|
mf[i][j] = 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void guMtxIdent(Mtx* m) {
|
||||||
|
f32 mf[4][4];
|
||||||
|
|
||||||
|
guMtxIdentF(mf);
|
||||||
|
|
||||||
|
guMtxF2L(mf, m);
|
||||||
|
}
|
||||||
|
|
9
src/libultra/gu/normalize.c
Normal file
9
src/libultra/gu/normalize.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void guNormalize(f32* x, f32* y, f32* z) {
|
||||||
|
f32 m = 1 / sqrtf(SQ(*x) + SQ(*y) + SQ(*z));
|
||||||
|
|
||||||
|
*x *= m;
|
||||||
|
*y *= m;
|
||||||
|
*z *= m;
|
||||||
|
}
|
|
@ -25,5 +25,5 @@ void guOrtho(Mtx* mtx, f32 left, f32 right, f32 bottom, f32 top, f32 near, f32 f
|
||||||
|
|
||||||
guOrthoF(mf, left, right, bottom, top, near, far, scale);
|
guOrthoF(mf, left, right, bottom, top, near, far, scale);
|
||||||
|
|
||||||
guMtxF2L((MtxF*)mf, mtx);
|
guMtxF2L(mf, mtx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,5 +38,6 @@ void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 f
|
||||||
f32 mf[4][4];
|
f32 mf[4][4];
|
||||||
|
|
||||||
guPerspectiveF(mf, perspNorm, fovy, aspect, near, far, scale);
|
guPerspectiveF(mf, perspNorm, fovy, aspect, near, far, scale);
|
||||||
guMtxF2L((MtxF*)mf, m);
|
|
||||||
|
guMtxF2L(mf, m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,5 +50,5 @@ void guPosition(Mtx* m, f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f3
|
||||||
|
|
||||||
guPositionF(mf, rot, pitch, yaw, scale, x, y, z);
|
guPositionF(mf, rot, pitch, yaw, scale, x, y, z);
|
||||||
|
|
||||||
guMtxF2L((MtxF*)mf, m);
|
guMtxF2L(mf, m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,11 @@ void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) {
|
||||||
f32 bc;
|
f32 bc;
|
||||||
f32 ca;
|
f32 ca;
|
||||||
f32 t;
|
f32 t;
|
||||||
|
#if !PLATFORM_N64
|
||||||
f32 xs;
|
f32 xs;
|
||||||
f32 ys;
|
f32 ys;
|
||||||
f32 zs;
|
f32 zs;
|
||||||
|
#endif
|
||||||
|
|
||||||
guNormalize(&x, &y, &z);
|
guNormalize(&x, &y, &z);
|
||||||
|
|
||||||
|
@ -25,9 +27,15 @@ void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) {
|
||||||
|
|
||||||
guMtxIdentF(m);
|
guMtxIdentF(m);
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
#define xs (x * sine)
|
||||||
|
#define ys (y * sine)
|
||||||
|
#define zs (z * sine)
|
||||||
|
#else
|
||||||
xs = x * sine;
|
xs = x * sine;
|
||||||
ys = y * sine;
|
ys = y * sine;
|
||||||
zs = z * sine;
|
zs = z * sine;
|
||||||
|
#endif
|
||||||
|
|
||||||
t = x * x;
|
t = x * x;
|
||||||
m[0][0] = (1 - t) * cosine + t;
|
m[0][0] = (1 - t) * cosine + t;
|
||||||
|
@ -47,5 +55,6 @@ void guRotate(Mtx* m, f32 a, f32 x, f32 y, f32 z) {
|
||||||
f32 mf[4][4];
|
f32 mf[4][4];
|
||||||
|
|
||||||
guRotateF(mf, a, x, y, z);
|
guRotateF(mf, a, x, y, z);
|
||||||
guMtxF2L((MtxF*)mf, m);
|
|
||||||
|
guMtxF2L(mf, m);
|
||||||
}
|
}
|
||||||
|
|
18
src/libultra/gu/scale.c
Normal file
18
src/libultra/gu/scale.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void guScaleF(f32 m[4][4], f32 x, f32 y, f32 z) {
|
||||||
|
guMtxIdentF(m);
|
||||||
|
|
||||||
|
m[0][0] = x;
|
||||||
|
m[1][1] = y;
|
||||||
|
m[2][2] = z;
|
||||||
|
m[3][3] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void guScale(Mtx* m, f32 x, f32 y, f32 z) {
|
||||||
|
f32 mf[4][4];
|
||||||
|
|
||||||
|
guScaleF(mf, x, y, z);
|
||||||
|
|
||||||
|
guMtxF2L(mf, m);
|
||||||
|
}
|
17
src/libultra/gu/translate.c
Normal file
17
src/libultra/gu/translate.c
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void guTranslateF(f32 m[4][4], f32 x, f32 y, f32 z) {
|
||||||
|
guMtxIdentF(m);
|
||||||
|
|
||||||
|
m[3][0] = x;
|
||||||
|
m[3][1] = y;
|
||||||
|
m[3][2] = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
void guTranslate(Mtx* m, f32 x, f32 y, f32 z) {
|
||||||
|
f32 mf[4][4];
|
||||||
|
|
||||||
|
guTranslateF(mf, x, y, z);
|
||||||
|
|
||||||
|
guMtxF2L(mf, m);
|
||||||
|
}
|
|
@ -7,6 +7,8 @@
|
||||||
* direct SI devices.
|
* direct SI devices.
|
||||||
*/
|
*/
|
||||||
s32 osContSetCh(u8 ch) {
|
s32 osContSetCh(u8 ch) {
|
||||||
|
s32 ret = 0;
|
||||||
|
|
||||||
__osSiGetAccess();
|
__osSiGetAccess();
|
||||||
|
|
||||||
if (ch > MAXCONTROLLERS) {
|
if (ch > MAXCONTROLLERS) {
|
||||||
|
@ -17,5 +19,5 @@ s32 osContSetCh(u8 ch) {
|
||||||
|
|
||||||
__osContLastCmd = CONT_CMD_END;
|
__osContLastCmd = CONT_CMD_END;
|
||||||
__osSiRelAccess();
|
__osSiRelAccess();
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "ultra64/internal.h"
|
#include "ultra64/internal.h"
|
||||||
|
|
||||||
s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) {
|
s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) {
|
||||||
s32 ret;
|
register s32 ret;
|
||||||
|
|
||||||
if (!__osPiDevMgr.active) {
|
if (!__osPiDevMgr.active) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
u32 osSpTaskYielded(OSTask* task) {
|
u32 osSpTaskYielded(OSTask* task) {
|
||||||
u32 ret;
|
|
||||||
u32 status = __osSpGetStatus();
|
u32 status = __osSpGetStatus();
|
||||||
|
u32 ret;
|
||||||
|
|
||||||
if (status & SP_STATUS_YIELDED) {
|
if (status & SP_STATUS_YIELDED) {
|
||||||
ret = OS_TASK_YIELDED;
|
ret = OS_TASK_YIELDED;
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#define BUFF_LEN 0x20
|
#define BUFF_LEN 0x20
|
||||||
|
|
||||||
short _Ldunscale(short*, _Pft*);
|
static short _Ldunscale(short*, _Pft*);
|
||||||
void _Genld(_Pft*, char, char*, short, short);
|
static void _Genld(_Pft*, char, char*, short, short);
|
||||||
|
|
||||||
static const double pows[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L, 10e127L, 10e255L };
|
static const double pows[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L, 10e127L, 10e255L };
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ void _Ldtob(_Pft* args, char code) {
|
||||||
_Genld((_Pft*)args, code, ptr, nsig, exp);
|
_Genld((_Pft*)args, code, ptr, nsig, exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
short _Ldunscale(short* pex, _Pft* px) {
|
static short _Ldunscale(short* pex, _Pft* px) {
|
||||||
unsigned short* ps = (unsigned short*)px;
|
unsigned short* ps = (unsigned short*)px;
|
||||||
short xchar = (ps[_D0] & _DMASK) >> _DOFF;
|
short xchar = (ps[_D0] & _DMASK) >> _DOFF;
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ short _Ldunscale(short* pex, _Pft* px) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _Genld(_Pft* px, char code, char* p, short nsig, short xexp) {
|
static void _Genld(_Pft* px, char code, char* p, short nsig, short xexp) {
|
||||||
const char point = '.';
|
const char point = '.';
|
||||||
|
|
||||||
if (nsig <= 0) {
|
if (nsig <= 0) {
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
char spaces[] = " ";
|
char spaces[] = " ";
|
||||||
char zeroes[] = "00000000000000000000000000000000";
|
char zeroes[] = "00000000000000000000000000000000";
|
||||||
|
|
||||||
void _Putfld(_Pft*, va_list*, char, char*);
|
static void _Putfld(_Pft*, va_list*, char, char*);
|
||||||
|
|
||||||
int _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap) {
|
int _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap) {
|
||||||
_Pft x;
|
_Pft x;
|
||||||
|
@ -121,7 +121,7 @@ int _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _Putfld(_Pft* px, va_list* pap, char code, char* ac) {
|
static void _Putfld(_Pft* px, va_list* pap, char code, char* ac) {
|
||||||
px->n0 = px->nz0 = px->n1 = px->nz1 = px->n2 = px->nz2 = 0;
|
px->n0 = px->nz0 = px->n1 = px->nz1 = px->n2 = px->nz2 = 0;
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
|
|
|
@ -448,6 +448,13 @@ pi:
|
||||||
andi $t1, $s1, MI_INTR_PI
|
andi $t1, $s1, MI_INTR_PI
|
||||||
beqz $t1, dp
|
beqz $t1, dp
|
||||||
nop
|
nop
|
||||||
|
#if PLATFORM_N64
|
||||||
|
// Clear interrupt and mask out pi interrupt
|
||||||
|
li $t1, PI_STATUS_CLR_INTR
|
||||||
|
lui $at, %hi(PHYS_TO_K1(PI_STATUS_REG))
|
||||||
|
andi $s1, $s1, (MI_INTR_SP | MI_INTR_SI | MI_INTR_AI | MI_INTR_VI | MI_INTR_DP)
|
||||||
|
sw $t1, %lo(PHYS_TO_K1(PI_STATUS_REG))($at)
|
||||||
|
#else
|
||||||
// Clear interrupt
|
// Clear interrupt
|
||||||
li $t1, PI_STATUS_CLR_INTR
|
li $t1, PI_STATUS_CLR_INTR
|
||||||
lui $at, %hi(PHYS_TO_K1(PI_STATUS_REG))
|
lui $at, %hi(PHYS_TO_K1(PI_STATUS_REG))
|
||||||
|
@ -468,6 +475,7 @@ pi:
|
||||||
// If the callback returns non-zero, don't post a pi event message
|
// If the callback returns non-zero, don't post a pi event message
|
||||||
bnez $v0, skip_pi_mesg
|
bnez $v0, skip_pi_mesg
|
||||||
nop
|
nop
|
||||||
|
#endif
|
||||||
no_pi_callback:
|
no_pi_callback:
|
||||||
// Post pi event message
|
// Post pi event message
|
||||||
jal send_mesg
|
jal send_mesg
|
||||||
|
@ -847,10 +855,12 @@ LEAF(__osPopThread)
|
||||||
sw $t9, ($a0)
|
sw $t9, ($a0)
|
||||||
END(__osPopThread)
|
END(__osPopThread)
|
||||||
|
|
||||||
|
#if !PLATFORM_N64
|
||||||
LEAF(__osNop)
|
LEAF(__osNop)
|
||||||
jr $ra
|
jr $ra
|
||||||
nop
|
nop
|
||||||
END(__osNop)
|
END(__osNop)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* void __osDispatchThread(void);
|
* void __osDispatchThread(void);
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
#include "ultra64/asm.h"
|
||||||
|
#include "ultra64/R4300.h"
|
||||||
|
#include "ultra64/rcp.h"
|
||||||
|
#include "ultra64/exception.h"
|
||||||
|
|
||||||
|
.set noat
|
||||||
|
.set noreorder
|
||||||
|
|
||||||
|
.section .text
|
||||||
|
|
||||||
|
.balign 16
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OSIntMask osGetIntMask(void);
|
||||||
|
*
|
||||||
|
* Gets the interrupt enable mask for the current thread.
|
||||||
|
* Interrupts that are not enabled in the global interrupt mask __OSGlobalIntMask
|
||||||
|
* are not returned here. The global interrupt mask is OS-internal and is not
|
||||||
|
* expected to change during runtime.
|
||||||
|
*
|
||||||
|
* @bug Some usage of the global interrupt mask is broken both in the
|
||||||
|
* get/set interrupt mask routines and in the exception handler routines.
|
||||||
|
* See the comment for osSetIntMask for more details.
|
||||||
|
*/
|
||||||
|
LEAF(osGetIntMask)
|
||||||
|
// Extract interrupt enable bits from current SR
|
||||||
|
mfc0 $v0, C0_SR
|
||||||
|
andi $v0, $v0, (SR_IMASK | SR_IE)
|
||||||
|
// Get value of __OSGlobalIntMask
|
||||||
|
lui $t0, %hi(__OSGlobalIntMask)
|
||||||
|
addiu $t0, %lo(__OSGlobalIntMask)
|
||||||
|
lw $t1, 0($t0)
|
||||||
|
// Bitwise-OR in the disabled CPU bits of __OSGlobalIntMask
|
||||||
|
li $at, ~0
|
||||||
|
xor $t0, $t1, $at
|
||||||
|
andi $t0, $t0, SR_IMASK
|
||||||
|
or $v0, $v0, $t0
|
||||||
|
// Fetch MI_INTR_MASK_REG
|
||||||
|
lui $t1, %hi(PHYS_TO_K1(MI_INTR_MASK_REG))
|
||||||
|
lw $t1, %lo(PHYS_TO_K1(MI_INTR_MASK_REG))($t1)
|
||||||
|
// If there are RCP interrupts masked
|
||||||
|
beqz $t1, 1f
|
||||||
|
// Get value of __OSGlobalIntMask
|
||||||
|
lui $t0, %hi(__OSGlobalIntMask)
|
||||||
|
addiu $t0, %lo(__OSGlobalIntMask)
|
||||||
|
lw $t0, 0($t0)
|
||||||
|
// Bitwise-OR in the disabled RCP bits of __OSGlobalIntMask
|
||||||
|
srl $t0, $t0, RCP_IMASKSHIFT
|
||||||
|
li $at, ~0
|
||||||
|
xor $t0, $t0, $at
|
||||||
|
andi $t0, $t0, (RCP_IMASK >> RCP_IMASKSHIFT)
|
||||||
|
or $t1, $t1, $t0
|
||||||
|
1:
|
||||||
|
// Shift the RCP bits to not conflict with the CPU bits
|
||||||
|
sll $t2, $t1, RCP_IMASKSHIFT
|
||||||
|
// OR the CPU and RCP bits together
|
||||||
|
or $v0, $v0, $t2
|
||||||
|
jr $ra
|
||||||
|
nop
|
||||||
|
END(osGetIntMask)
|
|
@ -16,7 +16,19 @@ OSHWIntr __OSGlobalIntMask = OS_IM_ALL;
|
||||||
|
|
||||||
u32 __osFinalrom;
|
u32 __osFinalrom;
|
||||||
|
|
||||||
void __createSpeedParam(void) {
|
#if PLATFORM_N64
|
||||||
|
|
||||||
|
#define OSINITIALIZE_FUNC osInitialize
|
||||||
|
#define SPEED_PARAM_FUNC createSpeedParam
|
||||||
|
|
||||||
|
static void SPEED_PARAM_FUNC(void);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define OSINITIALIZE_FUNC __osInitialize_common
|
||||||
|
#define SPEED_PARAM_FUNC __createSpeedParam
|
||||||
|
|
||||||
|
void SPEED_PARAM_FUNC(void) {
|
||||||
__Dom1SpeedParam.type = DEVICE_TYPE_INIT;
|
__Dom1SpeedParam.type = DEVICE_TYPE_INIT;
|
||||||
__Dom1SpeedParam.latency = IO_READ(PI_BSD_DOM1_LAT_REG);
|
__Dom1SpeedParam.latency = IO_READ(PI_BSD_DOM1_LAT_REG);
|
||||||
__Dom1SpeedParam.pulse = IO_READ(PI_BSD_DOM1_PWD_REG);
|
__Dom1SpeedParam.pulse = IO_READ(PI_BSD_DOM1_PWD_REG);
|
||||||
|
@ -30,13 +42,20 @@ void __createSpeedParam(void) {
|
||||||
__Dom2SpeedParam.relDuration = IO_READ(PI_BSD_DOM2_RLS_REG);
|
__Dom2SpeedParam.relDuration = IO_READ(PI_BSD_DOM2_RLS_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __osInitialize_common(void) {
|
#endif
|
||||||
|
|
||||||
|
void OSINITIALIZE_FUNC(void) {
|
||||||
u32 pifdata;
|
u32 pifdata;
|
||||||
|
#if PLATFORM_N64
|
||||||
|
u32 clock = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
__osFinalrom = true;
|
__osFinalrom = true;
|
||||||
__osSetSR(__osGetSR() | SR_CU1);
|
__osSetSR(__osGetSR() | SR_CU1);
|
||||||
__osSetFpcCsr(FPCSR_FS | FPCSR_EV);
|
__osSetFpcCsr(FPCSR_FS | FPCSR_EV);
|
||||||
|
#if !PLATFORM_N64
|
||||||
__osSetWatchLo(0x04900000);
|
__osSetWatchLo(0x04900000);
|
||||||
|
#endif
|
||||||
|
|
||||||
while (__osSiRawReadIo((void*)(PIF_RAM_END - 3), &pifdata)) {
|
while (__osSiRawReadIo((void*)(PIF_RAM_END - 3), &pifdata)) {
|
||||||
;
|
;
|
||||||
|
@ -52,7 +71,7 @@ void __osInitialize_common(void) {
|
||||||
|
|
||||||
osWritebackDCache((void*)K0BASE, E_VEC - K0BASE + sizeof(__osExceptionVector));
|
osWritebackDCache((void*)K0BASE, E_VEC - K0BASE + sizeof(__osExceptionVector));
|
||||||
osInvalICache((void*)K0BASE, E_VEC - K0BASE + sizeof(__osExceptionVector));
|
osInvalICache((void*)K0BASE, E_VEC - K0BASE + sizeof(__osExceptionVector));
|
||||||
__createSpeedParam();
|
SPEED_PARAM_FUNC();
|
||||||
osUnmapTLBAll();
|
osUnmapTLBAll();
|
||||||
osMapTLBRdb();
|
osMapTLBRdb();
|
||||||
|
|
||||||
|
@ -82,5 +101,21 @@ void __osInitialize_common(void) {
|
||||||
IO_WRITE(AI_BITRATE_REG, AI_MAX_BIT_RATE - 1);
|
IO_WRITE(AI_BITRATE_REG, AI_MAX_BIT_RATE - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
static void SPEED_PARAM_FUNC(void) {
|
||||||
|
__Dom1SpeedParam.type = DEVICE_TYPE_INIT;
|
||||||
|
__Dom1SpeedParam.latency = IO_READ(PI_BSD_DOM1_LAT_REG);
|
||||||
|
__Dom1SpeedParam.pulse = IO_READ(PI_BSD_DOM1_PWD_REG);
|
||||||
|
__Dom1SpeedParam.pageSize = IO_READ(PI_BSD_DOM1_PGS_REG);
|
||||||
|
__Dom1SpeedParam.relDuration = IO_READ(PI_BSD_DOM1_RLS_REG);
|
||||||
|
|
||||||
|
__Dom2SpeedParam.type = DEVICE_TYPE_INIT;
|
||||||
|
__Dom2SpeedParam.latency = IO_READ(PI_BSD_DOM2_LAT_REG);
|
||||||
|
__Dom2SpeedParam.pulse = IO_READ(PI_BSD_DOM2_PWD_REG);
|
||||||
|
__Dom2SpeedParam.pageSize = IO_READ(PI_BSD_DOM2_PGS_REG);
|
||||||
|
__Dom2SpeedParam.relDuration = IO_READ(PI_BSD_DOM2_RLS_REG);
|
||||||
|
}
|
||||||
|
#else
|
||||||
void __osInitialize_autodetect(void) {
|
void __osInitialize_autodetect(void) {
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -99,8 +99,8 @@ ENDDATA(__osRcpImTable)
|
||||||
* The returned value is the previous interrupt enable mask so that it can be
|
* The returned value is the previous interrupt enable mask so that it can be
|
||||||
* restored later.
|
* restored later.
|
||||||
*
|
*
|
||||||
* @bug Some usage of the global interrupt mask is broken both in here and in the
|
* @bug Some usage of the global interrupt mask is broken both in the
|
||||||
* exception handler routines.
|
* get/set interrupt mask routines and in the exception handler routines.
|
||||||
* While a thread is running, the C0_SR interrupt enable bits contain the
|
* While a thread is running, the C0_SR interrupt enable bits contain the
|
||||||
* interrupt enable bits for the current thread masked by the global
|
* interrupt enable bits for the current thread masked by the global
|
||||||
* interrupt mask. There is an attempt to recover only the original interrupt
|
* interrupt mask. There is an attempt to recover only the original interrupt
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void osSetTime(OSTime time) {
|
||||||
|
__osCurrentTime = time;
|
||||||
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg) {
|
s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg) {
|
||||||
UNUSED OSTime time;
|
OSTime time;
|
||||||
|
#if !PLATFORM_N64
|
||||||
OSTimer* next;
|
OSTimer* next;
|
||||||
u32 count;
|
u32 count;
|
||||||
u32 value;
|
u32 value;
|
||||||
u32 prevInt;
|
u32 prevInt;
|
||||||
|
#endif
|
||||||
|
|
||||||
timer->next = NULL;
|
timer->next = NULL;
|
||||||
timer->prev = NULL;
|
timer->prev = NULL;
|
||||||
|
@ -19,6 +21,12 @@ s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* m
|
||||||
timer->mq = mq;
|
timer->mq = mq;
|
||||||
timer->msg = msg;
|
timer->msg = msg;
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
time = __osInsertTimer(timer);
|
||||||
|
if (__osTimerList->next == timer) {
|
||||||
|
__osSetTimerIntr(time);
|
||||||
|
}
|
||||||
|
#else
|
||||||
prevInt = __osDisableInt();
|
prevInt = __osDisableInt();
|
||||||
if (__osTimerList->next != __osTimerList) {
|
if (__osTimerList->next != __osTimerList) {
|
||||||
if (1) {}
|
if (1) {}
|
||||||
|
@ -38,6 +46,7 @@ s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* m
|
||||||
__osSetTimerIntr(__osTimerList->next->value);
|
__osSetTimerIntr(__osTimerList->next->value);
|
||||||
|
|
||||||
__osRestoreInt(prevInt);
|
__osRestoreInt(prevInt);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,9 +63,11 @@ void __osSetTimerIntr(OSTime time) {
|
||||||
OSTime newTime;
|
OSTime newTime;
|
||||||
u32 prevInt;
|
u32 prevInt;
|
||||||
|
|
||||||
|
#if !PLATFORM_N64
|
||||||
if (time < 468) {
|
if (time < 468) {
|
||||||
time = 468;
|
time = 468;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
prevInt = __osDisableInt();
|
prevInt = __osDisableInt();
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ AudioDebug_ProcessInput
|
||||||
func_800FF334
|
func_800FF334
|
||||||
n64dd_SetDiskVersion
|
n64dd_SetDiskVersion
|
||||||
sJpegTask _n64ddSegmentRomStart _n64ddSegmentRomEnd _n64ddSegmentStart _string_n64dd_c
|
sJpegTask _n64ddSegmentRomStart _n64ddSegmentRomEnd _n64ddSegmentStart _string_n64dd_c
|
||||||
|
_Putfld _Ldunscale _Genld
|
||||||
""".split()
|
""".split()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ BD970,800CF050,src/code/printutils
|
||||||
BD9D0,800CF0B0,src/code/jpegutils
|
BD9D0,800CF0B0,src/code/jpegutils
|
||||||
BDEE0,800CF5C0,src/code/jpegdecoder
|
BDEE0,800CF5C0,src/code/jpegdecoder
|
||||||
BE4D0,800CFBB0,src/libultra/os/getintmask
|
BE4D0,800CFBB0,src/libultra/os/getintmask
|
||||||
BE530,800CFC10,src/libultra/mgu/scale
|
BE530,800CFC10,src/libultra/gu/scale
|
||||||
BE5D0,800CFCB0,src/libultra/gu/sinf
|
BE5D0,800CFCB0,src/libultra/gu/sinf
|
||||||
BE790,800CFE70,src/libultra/gu/sins
|
BE790,800CFE70,src/libultra/gu/sins
|
||||||
BE800,800CFEE0,src/libultra/io/sptask
|
BE800,800CFEE0,src/libultra/io/sptask
|
||||||
|
@ -165,7 +165,7 @@ C17A0,800D2E80,src/libultra/io/sptaskyielded
|
||||||
C1820,800D2F00,src/libultra/gu/rotate
|
C1820,800D2F00,src/libultra/gu/rotate
|
||||||
C1A10,800D30F0,src/libultra/io/aisetfreq
|
C1A10,800D30F0,src/libultra/io/aisetfreq
|
||||||
C1B60,800D3240,src/libultra/os/getactivequeue
|
C1B60,800D3240,src/libultra/os/getactivequeue
|
||||||
C1B70,800D3250,src/libultra/mgu/normalize
|
C1B70,800D3250,src/libultra/gu/normalize
|
||||||
C1C00,800D32E0,src/libultra/io/dpgetstat
|
C1C00,800D32E0,src/libultra/io/dpgetstat
|
||||||
C1C10,800D32F0,src/libultra/io/dpsetstat
|
C1C10,800D32F0,src/libultra/io/dpsetstat
|
||||||
C1C20,800D3300,src/libultra/gu/ortho
|
C1C20,800D3300,src/libultra/gu/ortho
|
||||||
|
@ -177,7 +177,7 @@ C2020,800D3700,src/libultra/gu/us2dex
|
||||||
C21A0,800D3880,src/libultra/io/pfsselectbank
|
C21A0,800D3880,src/libultra/io/pfsselectbank
|
||||||
C2220,800D3900,src/libultra/io/contsetch
|
C2220,800D3900,src/libultra/io/contsetch
|
||||||
C2290,800D3970,src/libultra/io/aigetlen
|
C2290,800D3970,src/libultra/io/aigetlen
|
||||||
C22A0,800D3980,src/libultra/mgu/translate
|
C22A0,800D3980,src/libultra/gu/translate
|
||||||
C2340,800D3A20,src/libultra/io/contramwrite
|
C2340,800D3A20,src/libultra/io/contramwrite
|
||||||
C2590,800D3C70,src/libultra/io/pfsgetstatus
|
C2590,800D3C70,src/libultra/io/pfsgetstatus
|
||||||
C27C0,800D3EA0,src/libultra/io/contpfs
|
C27C0,800D3EA0,src/libultra/io/contpfs
|
||||||
|
|
|
|
@ -14,7 +14,6 @@ D_06000000 = 0x06000000;
|
||||||
|
|
||||||
// boot_main.c
|
// boot_main.c
|
||||||
func_80001720 = 0x80001720;
|
func_80001720 = 0x80001720;
|
||||||
osInitialize = 0x80003230;
|
|
||||||
|
|
||||||
// cic6105.c
|
// cic6105.c
|
||||||
cic6105ucodeTextStart = 0x80006720;
|
cic6105ucodeTextStart = 0x80006720;
|
||||||
|
@ -22,8 +21,8 @@ func_800AE258_unknown = 0x800AE258;
|
||||||
func_800AE1E0_unknown = 0x800AE1E0;
|
func_800AE1E0_unknown = 0x800AE1E0;
|
||||||
|
|
||||||
// code_n64dd_800AD410.c
|
// code_n64dd_800AD410.c
|
||||||
osGetIntMask = 0x800CFBB0;
|
func_800ADCD8_unknown = 0x800ADCD8;
|
||||||
osSetTime = 0x800D3660;
|
func_800AE170_unknown = 0x800AE170;
|
||||||
func_801C7740_unknown = 0x801C7740;
|
func_801C7740_unknown = 0x801C7740;
|
||||||
func_801C8510_unknown = 0x801C8510;
|
func_801C8510_unknown = 0x801C8510;
|
||||||
D_801DA410 = 0x801DA410;
|
D_801DA410 = 0x801DA410;
|
||||||
|
|
Loading…
Add table
Reference in a new issue