mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Match all libultra, and more closely match ultralib (#466)
* Massive libultra changes * Fix the build! * Remove crc comment that seemd to break the score script for some reason. * Update README score. * Apply some suggestions * rename sins and coss funcs.
This commit is contained in:
@@ -12,7 +12,7 @@ VERSION := us_1.0
|
||||
NON_MATCHING ?= 0
|
||||
$(eval $(call validate-option,NON_MATCHING,0 1))
|
||||
|
||||
LIBULTRA_VERSION_DEFINE := -DBUILD_VERSION=4 -DBUILD_VERSION_STRING=\"2.0G\" -DRAREDIFFS
|
||||
LIBULTRA_VERSION_DEFINE := -DBUILD_VERSION=4 -DBUILD_VERSION_STRING=\"2.0G\"
|
||||
|
||||
ifeq ($(VERSION),us_1.0)
|
||||
DEFINES += VERSION_US_1_0=1
|
||||
@@ -157,7 +157,7 @@ endif
|
||||
MIPSISET := -mips1
|
||||
OPT_FLAGS := -O2 -Xfullwarn #include -Xfullwarn here since it's not supported with -O3
|
||||
|
||||
INCLUDE_DIRS := include $(BUILD_DIR) $(BUILD_DIR)/include src include/libc .
|
||||
INCLUDE_DIRS := include $(BUILD_DIR) $(BUILD_DIR)/include src include/libc include/PR include/sys lib/src lib/src/audio lib/src/debug lib/src/gu lib/src/libc lib/src/os .
|
||||
|
||||
C_DEFINES := $(foreach d,$(DEFINES),-D$(d)) $(LIBULTRA_VERSION_DEFINE) -D_MIPS_SZLONG=32
|
||||
DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES)
|
||||
@@ -165,7 +165,7 @@ DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES)
|
||||
|
||||
#IDO Warnings to Ignore. These are coding style warnings we don't follow
|
||||
IDO_IGNORE_WARNINGS = -woff 838,649,624
|
||||
ASFLAGS = -mtune=vr4300 -march=vr4300 -mabi=32 $(foreach d,$(DEFINES),--defsym $(d))
|
||||
ASFLAGS = -mtune=vr4300 -march=vr4300 -mabi=32 -I include $(foreach d,$(DEFINES),--defsym $(d))
|
||||
INCLUDE_CFLAGS := -I include -I $(BUILD_DIR) -I src -I . -I include/libc
|
||||
CFLAGS = -c -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -DNDEBUG $(OPT_FLAGS) $(MIPSISET) $(INCLUDE_CFLAGS) $(DEF_INC_CFLAGS) $(IDO_IGNORE_WARNINGS)
|
||||
LDFLAGS = undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/dkr.map
|
||||
@@ -185,7 +185,7 @@ FIXCHECKSUMS = python3 $(TOOLS_DIR)/python/calc_func_checksums.py $(VERSION)
|
||||
BUILDER = $(TOOLS_DIR)/dkr_assets_tool -dkrv $(VERSION) build
|
||||
|
||||
LIB_DIRS := lib
|
||||
ASM_DIRS := asm asm/boot asm/assets lib/asm lib/asm/non_decompilable
|
||||
ASM_DIRS := asm asm/boot asm/assets lib/asm
|
||||
SRC_DIRS := $(sort $(patsubst %/,%,$(dir $(wildcard src/* src/**/* lib/src/* lib/src/**/* lib/src/**/**/*))))
|
||||
|
||||
OS := $(shell uname)
|
||||
@@ -277,25 +277,35 @@ ALL_ASSETS_BUILT += $(patsubst $(UCODE_IN_DIR)/%.bin,$(UCODE_OUT_DIR)/%.bin,$(UC
|
||||
|
||||
####################### LIBULTRA #########################
|
||||
|
||||
$(BUILD_DIR)/lib/%.o: OPT_FLAGS := -O2 -Xfullwarn
|
||||
$(BUILD_DIR)/lib/src/al/%.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/lib/src/os/%.o: OPT_FLAGS := -O1 -Xfullwarn
|
||||
$(BUILD_DIR)/lib/src/os/osViMgr.o: OPT_FLAGS := -O2 -Xfullwarn
|
||||
$(BUILD_DIR)/lib/src/os/osCreatePiManager.o: OPT_FLAGS := -O2 -Xfullwarn
|
||||
$(BUILD_DIR)/lib/src/os/osMotor.o: OPT_FLAGS := -O2 -Xfullwarn
|
||||
$(BUILD_DIR)/lib/src/libc/xprintf.o : OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/lib/src/al/env.o: OPT_FLAGS := -g
|
||||
$(BUILD_DIR)/lib/src/libc/llcvt.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/libc/llcvt.o: MIPSISET := -mips3 -32
|
||||
$(BUILD_DIR)/lib/src/libc/ll.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/libc/ll.o: MIPSISET := -mips3 -32
|
||||
$(BUILD_DIR)/lib/src/libc/ldiv.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/lib/src/libc/ldiv.o: MIPSISET := -mips2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/%.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/audio/%.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/audio/mips1/%.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/os/%.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/io/%.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/io/vimgr.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/io/pimgr.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/io/motor.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/xprintf.o : OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/audio/env.o: OPT_FLAGS := -g
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/llcvt.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/llcvt.o: MIPSISET := -mips3 -32
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/ll.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/ll.o: MIPSISET := -mips3 -32
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/ldiv.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/ldiv.o: MIPSISET := -mips2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/xldtob.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/xldtob.o: MIPSISET := -mips2
|
||||
|
||||
$(BUILD_DIR)/lib/%.o: MIPSISET := -mips2
|
||||
$(BUILD_DIR)/lib/src/mips1/%.o: MIPSISET := -mips1
|
||||
$(BUILD_DIR)/lib/src/os/osMotor.o: MIPSISET := -mips1
|
||||
$(BUILD_DIR)/lib/src/al/env.o: MIPSISET := -mips1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/%.o: MIPSISET := -mips2
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/audio/mips1/%.o: MIPSISET := -mips1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/io/pimgr.o: MIPSISET := -mips1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/sc/sched.o: MIPSISET := -mips1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/io/motor.o: MIPSISET := -mips1
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/audio/env.o: MIPSISET := -mips1
|
||||
|
||||
#Ignore warnings for libultra files
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/%.o: CC_WARNINGS := -w
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/%.o: CC_CHECK := :
|
||||
|
||||
####################### MATH UTIL #########################
|
||||
|
||||
@@ -388,12 +398,12 @@ $(BUILD_DIR)/%.o: %.c | $(ALL_ASSETS_BUILT)
|
||||
@$(CC_CHECK) $(CC_CHECK_CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
|
||||
$(V)$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD_DIR)/lib/src/libc/llcvt.o: lib/src/libc/llcvt.c | $(ALL_ASSETS_BUILT)
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/llcvt.o: $(LIB_DIRS)/src/libc/llcvt.c | $(ALL_ASSETS_BUILT)
|
||||
$(call print,Compiling mips3:,$<,$@)
|
||||
$(V)$(CC) $(CFLAGS) -o $@ $<
|
||||
$(V)python3 tools/python/patchmips3.py $@ || rm $@
|
||||
|
||||
$(BUILD_DIR)/lib/src/libc/ll.o: lib/src/libc/ll.c | $(ALL_ASSETS_BUILT)
|
||||
$(BUILD_DIR)/$(LIB_DIRS)/src/libc/ll.o: $(LIB_DIRS)/src/libc/ll.c | $(ALL_ASSETS_BUILT)
|
||||
$(call print,Compiling mips3:,$<,$@)
|
||||
$(V)$(CC) $(CFLAGS) -o $@ $<
|
||||
$(V)python3 tools/python/patchmips3.py $@ || rm $@
|
||||
|
||||
@@ -5,11 +5,11 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the
|
||||
Currently, only the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fda38e533b9fe63bb9670) of the game is supported. US 1.1, EU 1.0, EU 1.1, and JP are not supported at this time.
|
||||
|
||||
<!-- README_SCORE_SUMMARY_BEGIN -->
|
||||
As of February 18, 2025, this is our current score:
|
||||
As of February 22, 2025, this is our current score:
|
||||
|
||||
    Decomp progress: 70.26%
|
||||
    Decomp progress: 71.39%
|
||||
|
||||
    Documentation progress: 49.72%
|
||||
    Documentation progress: 50.35%
|
||||
<!-- README_SCORE_SUMMARY_END -->
|
||||
|
||||
---
|
||||
@@ -126,31 +126,31 @@ s32 is_drumstick_unlocked(void) {
|
||||
```
|
||||
|
||||
<!-- README_SCORE_BEGIN -->
|
||||
As of February 18th, 2025, this is our current score:
|
||||
As of February 22nd, 2025, this is our current score:
|
||||
```
|
||||
=============================================
|
||||
ADVENTURE ONE (ASM -> C Decompilation)
|
||||
--- 70.26% Complete (72.90% NON_MATCHING) ---
|
||||
# Decompiled functions: 1706
|
||||
# GLOBAL_ASM remaining: 139
|
||||
# NON_MATCHING functions: 15
|
||||
# NON_EQUIVALENT WIP functions: 44
|
||||
---------------- Game Status ----------------
|
||||
Balloons: 34/47, Keys: 4/4, Trophies: 3/5
|
||||
T.T. Amulets: 3/4, Wizpig Amulets: 3/4
|
||||
---------------------------------------------
|
||||
We are racing in Haunted Woods. (Lap 2/3)
|
||||
=============================================
|
||||
ADVENTURE TWO (Cleanup & Documentation)
|
||||
-------------- 49.72% Complete --------------
|
||||
# Documented functions: 1091
|
||||
# Undocumented remaining: 477
|
||||
---------------- Game Status ----------------
|
||||
Balloons: 24/47, Keys: 3/4, Trophies: 2/5
|
||||
T.T. Amulets: 2/4, Wizpig Amulets: 2/4
|
||||
---------------------------------------------
|
||||
We are racing in Pirate Lagoon. (Lap 3/3)
|
||||
=============================================
|
||||
===============================================
|
||||
ADVENTURE ONE (ASM -> C Decompilation)
|
||||
---- 71.39% Complete (74.02% NON_MATCHING) ----
|
||||
# Decompiled functions: 1726
|
||||
# GLOBAL_ASM remaining: 133
|
||||
# NON_MATCHING functions: 15
|
||||
# NON_EQUIVALENT WIP functions: 44
|
||||
----------------- Game Status -----------------
|
||||
Balloons: 35/47, Keys: 4/4, Trophies: 3/5
|
||||
T.T. Amulets: 3/4, Wizpig Amulets: 3/4
|
||||
-----------------------------------------------
|
||||
We are racing the dragon boss Smokey. (Lap 1/3)
|
||||
===============================================
|
||||
ADVENTURE TWO (Cleanup & Documentation)
|
||||
--------------- 50.35% Complete ---------------
|
||||
# Documented functions: 1091
|
||||
# Undocumented remaining: 471
|
||||
----------------- Game Status -----------------
|
||||
Balloons: 25/47, Keys: 3/4, Trophies: 2/5
|
||||
T.T. Amulets: 2/4, Wizpig Amulets: 2/4
|
||||
-----------------------------------------------
|
||||
We are racing in Treasure Caves. (Lap 1/3)
|
||||
===============================================
|
||||
```
|
||||
<!-- README_SCORE_END -->
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
glabel coss /* Official Name: mathCosInterp */
|
||||
glabel coss_s16 /* Official Name: mathCosInterp */
|
||||
/* 07142C 8007082C 24844000 */ addiu $a0, $a0, 0x4000
|
||||
glabel sins /* Official name: mathSinInterp */
|
||||
glabel sins_s16 /* Official name: mathSinInterp */
|
||||
/* 071430 80070830 00041440 */ sll $v0, $a0, 0x11
|
||||
/* 071434 80070834 04430003 */ bgezl $v0, .L80070844
|
||||
/* 071438 80070838 000450C2 */ srl $t2, $a0, 3
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
glabel coss_f
|
||||
/* 0713F8 800707F8 27BDFFF8 */ addiu $sp, $sp, -8
|
||||
/* 0713FC 800707FC FFBF0000 */ sd $ra, ($sp)
|
||||
/* 071400 80070800 0C01C20B */ jal coss
|
||||
/* 071400 80070800 0C01C20B */ jal coss_s16
|
||||
/* 071404 80070804 00000000 */ nop
|
||||
/* 071408 80070808 44820000 */ mtc1 $v0, $f0
|
||||
/* 07140C 8007080C 3C013780 */ li $at, 0x37800000 # 0.000015
|
||||
|
||||
@@ -5,13 +5,13 @@ glabel f32_matrix_from_rotation_and_scale
|
||||
/* 070D3C 8007013C FFBF0000 */ sd $ra, ($sp)
|
||||
/* 070D40 80070140 00803825 */ move $a3, $a0
|
||||
/* 070D44 80070144 44819000 */ mtc1 $at, $f18
|
||||
/* 070D48 80070148 0C01C20C */ jal sins
|
||||
/* 070D48 80070148 0C01C20C */ jal sins_s16
|
||||
/* 070D4C 8007014C 00A02025 */ move $a0, $a1
|
||||
/* 070D50 80070150 44824000 */ mtc1 $v0, $f8
|
||||
/* 070D54 80070154 00A02025 */ move $a0, $a1
|
||||
/* 070D58 80070158 46804220 */ cvt.s.w $f8, $f8
|
||||
/* 070D5C 8007015C 46124202 */ mul.s $f8, $f8, $f18
|
||||
/* 070D60 80070160 0C01C20B */ jal coss
|
||||
/* 070D60 80070160 0C01C20B */ jal coss_s16
|
||||
/* 070D64 80070164 00000000 */ nop
|
||||
/* 070D68 80070168 44825000 */ mtc1 $v0, $f10
|
||||
/* 070D6C 8007016C 44868000 */ mtc1 $a2, $f16
|
||||
|
||||
@@ -4,37 +4,37 @@ glabel func_80070058
|
||||
/* 070C60 80070060 FFBF0000 */ sd $ra, ($sp)
|
||||
/* 070C64 80070064 00803825 */ move $a3, $a0
|
||||
/* 070C68 80070068 44819000 */ mtc1 $at, $f18
|
||||
/* 070C6C 8007006C 0C01C20C */ jal sins
|
||||
/* 070C6C 8007006C 0C01C20C */ jal sins_s16
|
||||
/* 070C70 80070070 84A40000 */ lh $a0, ($a1)
|
||||
/* 070C74 80070074 44820000 */ mtc1 $v0, $f0
|
||||
/* 070C78 80070078 84A40000 */ lh $a0, ($a1)
|
||||
/* 070C7C 8007007C 46800020 */ cvt.s.w $f0, $f0
|
||||
/* 070C80 80070080 46120002 */ mul.s $f0, $f0, $f18
|
||||
/* 070C84 80070084 0C01C20B */ jal coss
|
||||
/* 070C84 80070084 0C01C20B */ jal coss_s16
|
||||
/* 070C88 80070088 00000000 */ nop
|
||||
/* 070C8C 8007008C 44821000 */ mtc1 $v0, $f2
|
||||
/* 070C90 80070090 84A40002 */ lh $a0, 2($a1)
|
||||
/* 070C94 80070094 468010A0 */ cvt.s.w $f2, $f2
|
||||
/* 070C98 80070098 46121082 */ mul.s $f2, $f2, $f18
|
||||
/* 070C9C 8007009C 0C01C20C */ jal sins
|
||||
/* 070C9C 8007009C 0C01C20C */ jal sins_s16
|
||||
/* 070CA0 800700A0 00000000 */ nop
|
||||
/* 070CA4 800700A4 44822000 */ mtc1 $v0, $f4
|
||||
/* 070CA8 800700A8 84A40002 */ lh $a0, 2($a1)
|
||||
/* 070CAC 800700AC 46802120 */ cvt.s.w $f4, $f4
|
||||
/* 070CB0 800700B0 46122102 */ mul.s $f4, $f4, $f18
|
||||
/* 070CB4 800700B4 0C01C20B */ jal coss
|
||||
/* 070CB4 800700B4 0C01C20B */ jal coss_s16
|
||||
/* 070CB8 800700B8 00000000 */ nop
|
||||
/* 070CBC 800700BC 44823000 */ mtc1 $v0, $f6
|
||||
/* 070CC0 800700C0 84A40004 */ lh $a0, 4($a1)
|
||||
/* 070CC4 800700C4 468031A0 */ cvt.s.w $f6, $f6
|
||||
/* 070CC8 800700C8 46123182 */ mul.s $f6, $f6, $f18
|
||||
/* 070CCC 800700CC 0C01C20C */ jal sins
|
||||
/* 070CCC 800700CC 0C01C20C */ jal sins_s16
|
||||
/* 070CD0 800700D0 00000000 */ nop
|
||||
/* 070CD4 800700D4 44824000 */ mtc1 $v0, $f8
|
||||
/* 070CD8 800700D8 84A40004 */ lh $a0, 4($a1)
|
||||
/* 070CDC 800700DC 46804220 */ cvt.s.w $f8, $f8
|
||||
/* 070CE0 800700E0 46124202 */ mul.s $f8, $f8, $f18
|
||||
/* 070CE4 800700E4 0C01C20B */ jal coss
|
||||
/* 070CE4 800700E4 0C01C20B */ jal coss_s16
|
||||
/* 070CE8 800700E8 00000000 */ nop
|
||||
/* 070CEC 800700EC 44825000 */ mtc1 $v0, $f10
|
||||
/* 070CF0 800700F0 3C013F80 */ li $at, 0x3F800000 # 1.000000
|
||||
|
||||
@@ -4,37 +4,37 @@ glabel object_transform_to_matrix
|
||||
/* 070838 8006FC38 FFBF0000 */ sd $ra, ($sp)
|
||||
/* 07083C 8006FC3C 00803825 */ move $a3, $a0
|
||||
/* 070840 8006FC40 44819000 */ mtc1 $at, $f18
|
||||
/* 070844 8006FC44 0C01C20C */ jal sins
|
||||
/* 070844 8006FC44 0C01C20C */ jal sins_s16
|
||||
/* 070848 8006FC48 84A40000 */ lh $a0, ($a1)
|
||||
/* 07084C 8006FC4C 44820000 */ mtc1 $v0, $f0
|
||||
/* 070850 8006FC50 84A40000 */ lh $a0, ($a1)
|
||||
/* 070854 8006FC54 46800020 */ cvt.s.w $f0, $f0
|
||||
/* 070858 8006FC58 46120002 */ mul.s $f0, $f0, $f18
|
||||
/* 07085C 8006FC5C 0C01C20B */ jal coss
|
||||
/* 07085C 8006FC5C 0C01C20B */ jal coss_s16
|
||||
/* 070860 8006FC60 00000000 */ nop
|
||||
/* 070864 8006FC64 44821000 */ mtc1 $v0, $f2
|
||||
/* 070868 8006FC68 84A40002 */ lh $a0, 2($a1)
|
||||
/* 07086C 8006FC6C 468010A0 */ cvt.s.w $f2, $f2
|
||||
/* 070870 8006FC70 46121082 */ mul.s $f2, $f2, $f18
|
||||
/* 070874 8006FC74 0C01C20C */ jal sins
|
||||
/* 070874 8006FC74 0C01C20C */ jal sins_s16
|
||||
/* 070878 8006FC78 00000000 */ nop
|
||||
/* 07087C 8006FC7C 44822000 */ mtc1 $v0, $f4
|
||||
/* 070880 8006FC80 84A40002 */ lh $a0, 2($a1)
|
||||
/* 070884 8006FC84 46802120 */ cvt.s.w $f4, $f4
|
||||
/* 070888 8006FC88 46122102 */ mul.s $f4, $f4, $f18
|
||||
/* 07088C 8006FC8C 0C01C20B */ jal coss
|
||||
/* 07088C 8006FC8C 0C01C20B */ jal coss_s16
|
||||
/* 070890 8006FC90 00000000 */ nop
|
||||
/* 070894 8006FC94 44823000 */ mtc1 $v0, $f6
|
||||
/* 070898 8006FC98 84A40004 */ lh $a0, 4($a1)
|
||||
/* 07089C 8006FC9C 468031A0 */ cvt.s.w $f6, $f6
|
||||
/* 0708A0 8006FCA0 46123182 */ mul.s $f6, $f6, $f18
|
||||
/* 0708A4 8006FCA4 0C01C20C */ jal sins
|
||||
/* 0708A4 8006FCA4 0C01C20C */ jal sins_s16
|
||||
/* 0708A8 8006FCA8 00000000 */ nop
|
||||
/* 0708AC 8006FCAC 44824000 */ mtc1 $v0, $f8
|
||||
/* 0708B0 8006FCB0 84A40004 */ lh $a0, 4($a1)
|
||||
/* 0708B4 8006FCB4 46804220 */ cvt.s.w $f8, $f8
|
||||
/* 0708B8 8006FCB8 46124202 */ mul.s $f8, $f8, $f18
|
||||
/* 0708BC 8006FCBC 0C01C20B */ jal coss
|
||||
/* 0708BC 8006FCBC 0C01C20B */ jal coss_s16
|
||||
/* 0708C0 8006FCC0 00000000 */ nop
|
||||
/* 0708C4 8006FCC4 44825000 */ mtc1 $v0, $f10
|
||||
/* 0708C8 8006FCC8 8CAA0008 */ lw $t2, 8($a1)
|
||||
|
||||
@@ -4,37 +4,37 @@ glabel object_transform_to_matrix_2
|
||||
/* 070A7C 8006FE7C FFBF0000 */ sd $ra, ($sp)
|
||||
/* 070A80 8006FE80 00803825 */ move $a3, $a0
|
||||
/* 070A84 8006FE84 44819000 */ mtc1 $at, $f18
|
||||
/* 070A88 8006FE88 0C01C20C */ jal sins
|
||||
/* 070A88 8006FE88 0C01C20C */ jal sins_s16
|
||||
/* 070A8C 8006FE8C 84A40000 */ lh $a0, ($a1)
|
||||
/* 070A90 8006FE90 44820000 */ mtc1 $v0, $f0
|
||||
/* 070A94 8006FE94 84A40000 */ lh $a0, ($a1)
|
||||
/* 070A98 8006FE98 46800020 */ cvt.s.w $f0, $f0
|
||||
/* 070A9C 8006FE9C 46120002 */ mul.s $f0, $f0, $f18
|
||||
/* 070AA0 8006FEA0 0C01C20B */ jal coss
|
||||
/* 070AA0 8006FEA0 0C01C20B */ jal coss_s16
|
||||
/* 070AA4 8006FEA4 00000000 */ nop
|
||||
/* 070AA8 8006FEA8 44821000 */ mtc1 $v0, $f2
|
||||
/* 070AAC 8006FEAC 84A40002 */ lh $a0, 2($a1)
|
||||
/* 070AB0 8006FEB0 468010A0 */ cvt.s.w $f2, $f2
|
||||
/* 070AB4 8006FEB4 46121082 */ mul.s $f2, $f2, $f18
|
||||
/* 070AB8 8006FEB8 0C01C20C */ jal sins
|
||||
/* 070AB8 8006FEB8 0C01C20C */ jal sins_s16
|
||||
/* 070ABC 8006FEBC 00000000 */ nop
|
||||
/* 070AC0 8006FEC0 44822000 */ mtc1 $v0, $f4
|
||||
/* 070AC4 8006FEC4 84A40002 */ lh $a0, 2($a1)
|
||||
/* 070AC8 8006FEC8 46802120 */ cvt.s.w $f4, $f4
|
||||
/* 070ACC 8006FECC 46122102 */ mul.s $f4, $f4, $f18
|
||||
/* 070AD0 8006FED0 0C01C20B */ jal coss
|
||||
/* 070AD0 8006FED0 0C01C20B */ jal coss_s16
|
||||
/* 070AD4 8006FED4 00000000 */ nop
|
||||
/* 070AD8 8006FED8 44823000 */ mtc1 $v0, $f6
|
||||
/* 070ADC 8006FEDC 84A40004 */ lh $a0, 4($a1)
|
||||
/* 070AE0 8006FEE0 468031A0 */ cvt.s.w $f6, $f6
|
||||
/* 070AE4 8006FEE4 46123182 */ mul.s $f6, $f6, $f18
|
||||
/* 070AE8 8006FEE8 0C01C20C */ jal sins
|
||||
/* 070AE8 8006FEE8 0C01C20C */ jal sins_s16
|
||||
/* 070AEC 8006FEEC 00000000 */ nop
|
||||
/* 070AF0 8006FEF0 44824000 */ mtc1 $v0, $f8
|
||||
/* 070AF4 8006FEF4 84A40004 */ lh $a0, 4($a1)
|
||||
/* 070AF8 8006FEF8 46804220 */ cvt.s.w $f8, $f8
|
||||
/* 070AFC 8006FEFC 46124202 */ mul.s $f8, $f8, $f18
|
||||
/* 070B00 8006FF00 0C01C20B */ jal coss
|
||||
/* 070B00 8006FF00 0C01C20B */ jal coss_s16
|
||||
/* 070B04 8006FF04 00000000 */ nop
|
||||
/* 070B08 8006FF08 44825000 */ mtc1 $v0, $f10
|
||||
/* 070B0C 8006FF0C ACE0000C */ sw $zero, 0xc($a3)
|
||||
|
||||
@@ -5,10 +5,10 @@ glabel s16_vec3_apply_object_rotation
|
||||
/* 070DF0 800701F0 84AB0000 */ lh $t3, ($a1)
|
||||
/* 070DF4 800701F4 84AC0002 */ lh $t4, 2($a1)
|
||||
/* 070DF8 800701F8 84AD0004 */ lh $t5, 4($a1)
|
||||
/* 070DFC 800701FC 0C01C20C */ jal sins
|
||||
/* 070DFC 800701FC 0C01C20C */ jal sins_s16
|
||||
/* 070E00 80070200 84C40000 */ lh $a0, ($a2)
|
||||
/* 070E04 80070204 00407025 */ move $t6, $v0
|
||||
/* 070E08 80070208 0C01C20B */ jal coss
|
||||
/* 070E08 80070208 0C01C20B */ jal coss_s16
|
||||
/* 070E0C 8007020C 84C40000 */ lh $a0, ($a2)
|
||||
/* 070E10 80070210 016E0018 */ mult $t3, $t6
|
||||
/* 070E14 80070214 00407825 */ move $t7, $v0
|
||||
@@ -27,10 +27,10 @@ glabel s16_vec3_apply_object_rotation
|
||||
/* 070E48 80070248 018F0018 */ mult $t4, $t7
|
||||
/* 070E4C 8007024C 00006012 */ mflo $t4
|
||||
/* 070E50 80070250 01886020 */ add $t4, $t4, $t0
|
||||
/* 070E54 80070254 0C01C20C */ jal sins
|
||||
/* 070E54 80070254 0C01C20C */ jal sins_s16
|
||||
/* 070E58 80070258 000C6403 */ sra $t4, $t4, 0x10
|
||||
/* 070E5C 8007025C 00407025 */ move $t6, $v0
|
||||
/* 070E60 80070260 0C01C20B */ jal coss
|
||||
/* 070E60 80070260 0C01C20B */ jal coss_s16
|
||||
/* 070E64 80070264 84C40002 */ lh $a0, 2($a2)
|
||||
/* 070E68 80070268 018E0018 */ mult $t4, $t6
|
||||
/* 070E6C 8007026C 00407825 */ move $t7, $v0
|
||||
@@ -49,10 +49,10 @@ glabel s16_vec3_apply_object_rotation
|
||||
/* 070EA0 800702A0 01AF0018 */ mult $t5, $t7
|
||||
/* 070EA4 800702A4 00006812 */ mflo $t5
|
||||
/* 070EA8 800702A8 01A86820 */ add $t5, $t5, $t0
|
||||
/* 070EAC 800702AC 0C01C20C */ jal sins
|
||||
/* 070EAC 800702AC 0C01C20C */ jal sins_s16
|
||||
/* 070EB0 800702B0 000D6C03 */ sra $t5, $t5, 0x10
|
||||
/* 070EB4 800702B4 00407025 */ move $t6, $v0
|
||||
/* 070EB8 800702B8 0C01C20B */ jal coss
|
||||
/* 070EB8 800702B8 0C01C20B */ jal coss_s16
|
||||
/* 070EBC 800702BC 84C40004 */ lh $a0, 4($a2)
|
||||
/* 070EC0 800702C0 016E0018 */ mult $t3, $t6
|
||||
/* 070EC4 800702C4 00407825 */ move $t7, $v0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
glabel sins_f
|
||||
/* 0713C4 800707C4 27BDFFF8 */ addiu $sp, $sp, -8
|
||||
/* 0713C8 800707C8 FFBF0000 */ sd $ra, ($sp)
|
||||
/* 0713CC 800707CC 0C01C20C */ jal sins
|
||||
/* 0713CC 800707CC 0C01C20C */ jal sins_s16
|
||||
/* 0713D0 800707D0 00000000 */ nop
|
||||
/* 0713D4 800707D4 44820000 */ mtc1 $v0, $f0
|
||||
/* 0713D8 800707D8 3C013780 */ li $at, 0x37800000 # 0.000015
|
||||
|
||||
@@ -102,12 +102,12 @@ glabel menu_credits_loop
|
||||
/* 09C090 8009B490 00092400 */ sll $a0, $t1, 0x10
|
||||
/* 09C094 8009B494 00045403 */ sra $t2, $a0, 0x10
|
||||
/* 09C098 8009B498 01402025 */ move $a0, $t2
|
||||
/* 09C09C 8009B49C 0C01C20C */ jal sins
|
||||
/* 09C09C 8009B49C 0C01C20C */ jal sins_s16
|
||||
/* 09C0A0 8009B4A0 01208825 */ move $s1, $t1
|
||||
/* 09C0A4 8009B4A4 00112400 */ sll $a0, $s1, 0x10
|
||||
/* 09C0A8 8009B4A8 00046403 */ sra $t4, $a0, 0x10
|
||||
/* 09C0AC 8009B4AC 01802025 */ move $a0, $t4
|
||||
/* 09C0B0 8009B4B0 0C01C20B */ jal coss
|
||||
/* 09C0B0 8009B4B0 0C01C20B */ jal coss_s16
|
||||
/* 09C0B4 8009B4B4 00409825 */ move $s3, $v0
|
||||
/* 09C0B8 8009B4B8 02740019 */ multu $s3, $s4
|
||||
/* 09C0BC 8009B4BC 8E050000 */ lw $a1, ($s0)
|
||||
|
||||
@@ -138,7 +138,7 @@ glabel func_8000B38C
|
||||
.L8000B5A8:
|
||||
/* 00C1A8 8000B5A8 00112400 */ sll $a0, $s1, 0x10
|
||||
/* 00C1AC 8000B5AC 0004C403 */ sra $t8, $a0, 0x10
|
||||
/* 00C1B0 8000B5B0 0C01C20C */ jal sins
|
||||
/* 00C1B0 8000B5B0 0C01C20C */ jal sins_s16
|
||||
/* 00C1B4 8000B5B4 03002025 */ move $a0, $t8
|
||||
/* 00C1B8 8000B5B8 00520019 */ multu $v0, $s2
|
||||
/* 00C1BC 8000B5BC 00112400 */ sll $a0, $s1, 0x10
|
||||
@@ -147,7 +147,7 @@ glabel func_8000B38C
|
||||
/* 00C1C8 8000B5C8 0000C812 */ mflo $t9
|
||||
/* 00C1CC 8000B5CC 00197403 */ sra $t6, $t9, 0x10
|
||||
/* 00C1D0 8000B5D0 01D27821 */ addu $t7, $t6, $s2
|
||||
/* 00C1D4 8000B5D4 0C01C20B */ jal coss
|
||||
/* 00C1D4 8000B5D4 0C01C20B */ jal coss_s16
|
||||
/* 00C1D8 8000B5D8 AE0F0000 */ sw $t7, ($s0)
|
||||
/* 00C1DC 8000B5DC 02C20019 */ multu $s6, $v0
|
||||
/* 00C1E0 8000B5E0 8E190000 */ lw $t9, ($s0)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
if [[ $# == 0 || (($1 != "us_1.0") && ($1 != "us_1.1") && ($1 != "eu_1.0") && ($1 != "eu_1.1") && ($1 != "jp"))]]; then
|
||||
echo 'Usage: ./generate_ld.sh <version>'
|
||||
echo 'Acceptable versions: us_1.0, us_1.1, eu_1.0, eu_1.1, jp'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
python3 ./tools/python/generate_ld.py "$1"
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 1997/02/11 08:15:34 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/R4300.h,v $
|
||||
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/R4300.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
+227
-441
File diff suppressed because it is too large
Load Diff
+231
-296
File diff suppressed because it is too large
Load Diff
+365
@@ -0,0 +1,365 @@
|
||||
|
||||
/*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* ALL RIGHTS RESERVED
|
||||
*
|
||||
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
|
||||
* States. Use of a copyright notice is precautionary only and does not
|
||||
* imply publication or disclosure.
|
||||
*
|
||||
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to restrictions
|
||||
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
|
||||
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
|
||||
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
|
||||
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
|
||||
*
|
||||
* THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
|
||||
* INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
|
||||
* DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
|
||||
* PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
|
||||
* GRAPHICS, INC.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: gt.h
|
||||
* Creator: hsa@sgi.com
|
||||
* Create Date: Thu Oct 12 15:48:14 PDT 1995
|
||||
*
|
||||
* This file defines the GBI for the TURBO 3D graphics microcode.
|
||||
* The turbo microcode is a special FEATURE-LIMITED microcode designed
|
||||
* for specific applications. It is not for general use.
|
||||
*
|
||||
* (see XXX for more information)
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.16 $
|
||||
* $Date: 1998/05/28 00:14:50 $
|
||||
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/gt.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _GT_H_
|
||||
#define _GT_H_
|
||||
|
||||
/* this file should be #included AFTER gbi.h */
|
||||
|
||||
#include "sptask.h"
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif /* _LANGUAGE_C_PLUS_PLUS */
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/* the following #defines seem out of order, but we need them
|
||||
* for the microcode.
|
||||
*/
|
||||
|
||||
/*
|
||||
* object state field: rendState
|
||||
*
|
||||
* This flag word is built up out of the bits from a
|
||||
* subset of the G_SETGEOMETRYMODE flags from gbi.h.
|
||||
*
|
||||
* When each of these bits is '1', the comments below explain
|
||||
* the effect on the triangles.
|
||||
*/
|
||||
#define GT_ZBUFFER G_ZBUFFER
|
||||
#define GT_TEXTURE G_TEXTURE_ENABLE /* texture ON */
|
||||
#define GT_CULL_BACK G_CULL_BACK /* reject backfaces */
|
||||
#define GT_SHADING_SMOOTH G_SHADING_SMOOTH /* smooth shade ON */
|
||||
|
||||
/*
|
||||
* object state field: textureState
|
||||
*
|
||||
* The lower 3 bits of this flag word contain the texture tile number
|
||||
* to be used. All triangles of an object are rendered with the same
|
||||
* texture tile.
|
||||
*/
|
||||
|
||||
/*
|
||||
* object state field: flag
|
||||
*
|
||||
* This is a group of what would be pad bits. We use them for some
|
||||
* flag bits.
|
||||
*/
|
||||
#define GT_FLAG_NOMTX 0x01 /* don't load the matrix */
|
||||
#define GT_FLAG_NO_XFM 0x02 /* load vtx, use verbatim */
|
||||
#define GT_FLAG_XFM_ONLY 0x04 /* xform vtx, write to *TriN */
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/* turbo 3D ucode: */
|
||||
extern long long int gspTurbo3DTextStart[], gspTurbo3DTextEnd[];
|
||||
extern long long int gspTurbo3DDataStart[], gspTurbo3DDataEnd[];
|
||||
extern long long int gspTurbo3D_dramTextStart[], gspTurbo3D_dramTextEnd[];
|
||||
extern long long int gspTurbo3D_dramDataStart[], gspTurbo3D_dramDataEnd[];
|
||||
extern long long int gspTurbo3D_fifoTextStart[], gspTurbo3D_fifoTextEnd[];
|
||||
extern long long int gspTurbo3D_fifoDataStart[], gspTurbo3D_fifoDataEnd[];
|
||||
|
||||
/*
|
||||
* This is the global state structure. It's definition carefully
|
||||
* matches the ucode, so if this structure changes, you must also change
|
||||
* the ucode.
|
||||
*/
|
||||
typedef struct {
|
||||
u16 perspNorm; /* persp normalization */
|
||||
u16 pad0;
|
||||
u32 flag;
|
||||
Gfx rdpOthermode;
|
||||
u32 segBases[16]; /* table of segment base addrs (SEE NOTE!) */
|
||||
Vp viewport; /* the viewport to use */
|
||||
Gfx *rdpCmds; /* block of RDP data, process if !NULL
|
||||
* block terminated by gDPEndDisplayList()
|
||||
* (This is a segment address)
|
||||
*/
|
||||
} gtGlobState_t;
|
||||
|
||||
/* NOTE:
|
||||
* Although there are 16 segment table entries, the first one (segment 0)
|
||||
* is reserved for physical memory mapping. You should not segment 0
|
||||
* to anything other than 0x0.
|
||||
*/
|
||||
|
||||
typedef union {
|
||||
gtGlobState_t sp;
|
||||
long long int force_structure_alignment;
|
||||
} gtGlobState;
|
||||
|
||||
|
||||
/*
|
||||
* This is the 'state' structure associated with each object
|
||||
* to be rendered. It's definition carefully matches the
|
||||
* ucode, so if this structure changes, you must also change
|
||||
* the gtoff.c tool and the ucode.
|
||||
*/
|
||||
typedef struct {
|
||||
u32 renderState; /* render state */
|
||||
u32 textureState; /* texture state */
|
||||
u8 vtxCount; /* how many verts? */
|
||||
u8 vtxV0; /* where to load verts? */
|
||||
u8 triCount; /* how many tris? */
|
||||
u8 flag;
|
||||
Gfx *rdpCmds; /* ptr (segment address) to RDP DL */
|
||||
Gfx rdpOthermode;
|
||||
Mtx transform; /* the transform matrix to use */
|
||||
} gtState_t;
|
||||
|
||||
typedef union {
|
||||
gtState_t sp;
|
||||
long long int force_structure_alignment;
|
||||
} gtState;
|
||||
|
||||
/* gtStateLite : same as gtState, but no matrix (see flags below) */
|
||||
/* this structure must be identical to gtState! (bad) */
|
||||
typedef struct {
|
||||
u32 renderState; /* render state */
|
||||
u32 textureState; /* texture state */
|
||||
u8 vtxCount; /* how many verts? */
|
||||
u8 vtxV0; /* where to load verts? */
|
||||
u8 triCount; /* how many tris? */
|
||||
u8 flag;
|
||||
Gfx *rdpCmds; /* ptr (segment address) to RDP DL */
|
||||
Gfx rdpOthermode;
|
||||
} gtStateL_t;
|
||||
|
||||
typedef union {
|
||||
gtStateL_t sp;
|
||||
long long int force_structure_alignment;
|
||||
} gtStateL;
|
||||
|
||||
/*
|
||||
* The vertex list for the turbo display list uses the
|
||||
* Vtx struct in gbi.h
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This structure represents a single triangle, part of the
|
||||
* triangle list of the object to be rendered.
|
||||
*
|
||||
* NOTE: The triangle list MUST be aligned to an 8-byte boundary.
|
||||
* Since this structure is only 4 bytes, we are REQUIRING that
|
||||
* this structure only be used as an array of triangles, and we
|
||||
* depend on the MIPS C compiler (which always aligns arrays to
|
||||
* 8-byte boundaries). THIS IS DANGEROUS!!!!
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
u8 v0, v1, v2, flag; /* flag is which one for flat shade */
|
||||
} gtTriN;
|
||||
|
||||
|
||||
/*
|
||||
* This structure represents the transformed points. It is the format
|
||||
* of the points written out when GT_FLAG_XFM_ONLY is set, as well as
|
||||
* the format expected when GT_FLAG_NO_XFM is used.
|
||||
*
|
||||
* NOTE: The size and layout of these points is very similar to Vtx,
|
||||
* except the screen coordinates overwrite the x,y,z,pad fields.
|
||||
* (we could consider adding to the Vtx union, but we want to keep
|
||||
* turbo stuff out of gbi.h)
|
||||
*
|
||||
* NOTE: The z is a special format. It can be used to compare vertices
|
||||
* for sorting, but it should not be used for other purposes. If modified,
|
||||
* the z-buffer hardware might not understand the data.
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
short int xscrn; /* x,y screen coordinates are SSSS10.2 */
|
||||
short int yscrn;
|
||||
int zscrn; /* z screen is S15.16 */
|
||||
|
||||
short int s; /* transformed texture coord, S10.5 */
|
||||
short int t;
|
||||
|
||||
u8 r; /* color (or normal) */
|
||||
u8 g;
|
||||
u8 b;
|
||||
u8 a;
|
||||
} gtVtxOut_t;
|
||||
|
||||
/* see "Data Structure" comment in gbi.h for information about why
|
||||
* we use this union.
|
||||
*/
|
||||
typedef union {
|
||||
gtVtxOut_t v;
|
||||
long long int force_structure_alignment;
|
||||
} gtVtxOut;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* state field: rdpOthermode
|
||||
*
|
||||
* This is one of the trickier state fields. The turbo interface
|
||||
* requires the RDP othermode command to be cached by the host,
|
||||
* therefore we provide a different interface in libultra to help cache
|
||||
* this in the gt state (this word is just bits, you could pack them
|
||||
* on your own).
|
||||
*
|
||||
* gtStateSetOthermode() accomplishs this, taking as arguments
|
||||
* the state, one of the following mode enums, and a piece of data
|
||||
* (othermode parameters from gbi.h).
|
||||
*
|
||||
* By definition, the othermode word from the gt state structure is sent
|
||||
* to the RDP *before* any RDP commands from the rdpCmds[] field. The
|
||||
* othermode is *always* sent.
|
||||
*
|
||||
* Stated another way, NONE of the gbi RDP othermode commands equivalent
|
||||
* to those listed here are allowed in the rdpCmd[] field of the
|
||||
* gt state structure.
|
||||
*
|
||||
* Notice also that many of these commands do not make sense for
|
||||
* the turbo ucode (they control features not supported, like mip-mapping).
|
||||
* They are only included here for completeness.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
GT_CLEAR, /* special gt mode, clears othermode state */
|
||||
GT_ALPHACOMPARE,
|
||||
GT_ZSRCSEL,
|
||||
GT_RENDERMODE,
|
||||
GT_ALPHADITHER,
|
||||
GT_RGBDITHER,
|
||||
GT_COMBKEY,
|
||||
GT_TEXTCONV,
|
||||
GT_TEXTFILT,
|
||||
GT_TEXTLUT,
|
||||
GT_TEXTLOD,
|
||||
GT_TEXTDETAIL,
|
||||
GT_TEXTPERSP,
|
||||
GT_CYCLETYPE,
|
||||
GT_PIPELINE
|
||||
} gtStateOthermode_t;
|
||||
|
||||
/*
|
||||
* This call builds up an othermode command word. The 'mode' is one of
|
||||
* the above modes, the 'data' field comes from gbi.h, it is the data
|
||||
* field for the equivalent gbi setothermode macro.
|
||||
*/
|
||||
extern void gtStateSetOthermode(Gfx *om, gtStateOthermode_t mode, int data);
|
||||
|
||||
/*
|
||||
* This call dumps a turbo display list for use with gbi2mem and RSPSIM
|
||||
*/
|
||||
#define GT_DUMPTURBO_HANGAFTER 64
|
||||
#define GT_DUMPTURBO_NOTEXTURES 128
|
||||
extern void gtDumpTurbo(OSTask *tp,u8 flags);
|
||||
|
||||
/*
|
||||
* Special macros to init othermode words to all 0's, a good default
|
||||
* value.
|
||||
*/
|
||||
#define gDPClearOtherMode(pkt) \
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE, 24, 8); \
|
||||
_g->words.w1 = 0x0; \
|
||||
}
|
||||
|
||||
#define gsDPClearOtherMode() \
|
||||
{ \
|
||||
_SHIFTL(G_RDPSETOTHERMODE, 24, 8), 0x0 \
|
||||
}
|
||||
|
||||
/*
|
||||
* Special macros to end DP blocks (see above). These commands
|
||||
* generate all 0's, which the turbo ucode looks for. They *aren't*
|
||||
* real DP commands!
|
||||
*/
|
||||
#define gDPEndDisplayList(pkt) gSPNoOp(pkt)
|
||||
#define gsDPEndDisplayList() gsSPNoOp()
|
||||
|
||||
/*
|
||||
* This structure is a turbo 'object', the turbo display list is
|
||||
* simply a list of these.
|
||||
*
|
||||
* NOTE: All pointers are segment addresses
|
||||
*
|
||||
* NOTE: If (statep->flag & GT_FLAG_XFM_ONLY), the trip field is
|
||||
* interpreted as a pointer to gtVtxOut[] that can be used to store
|
||||
* the transformed points. (statep->triCount should be 0, else bad
|
||||
* things could happen...)
|
||||
*
|
||||
* NOTE: If (statep->flag & GT_FLAG_NO_XFM), the vtxp field is
|
||||
* interpreted as a pointer to gtVtxOut[] that can be used to load
|
||||
* pre-transformed points.
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
gtGlobState *gstatep; /* global state, usually NULL */
|
||||
gtState *statep; /* if this is NULL, end object processing */
|
||||
Vtx *vtxp; /* if this is NULL, use points in buffer */
|
||||
gtTriN *trip; /* if this is NULL, use tris in buffer */
|
||||
} gtGfx_t;
|
||||
|
||||
typedef union {
|
||||
gtGfx_t obj;
|
||||
long long int force_structure_alignment;
|
||||
} gtGfx;
|
||||
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
#include <PR/gtoff.h>
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif /* _LANGUAGE_C_PLUS_PLUS */
|
||||
|
||||
#ifdef _LANGUAGE_MAKEROM
|
||||
#endif /* _LANGUAGE_MAKEROM */
|
||||
|
||||
#endif /* _GT_H_ */
|
||||
+265
-24
@@ -1,29 +1,270 @@
|
||||
#ifndef _ULTRA64_GU_H_
|
||||
#define _ULTRA64_GU_H_
|
||||
#ifndef _GU_H_
|
||||
#define _GU_H_
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1994, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.48 $
|
||||
* $Date: 1999/07/13 08:00:20 $
|
||||
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/gu.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include <PR/mbi.h>
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/sptask.h>
|
||||
#include <PR/os_version.h>
|
||||
|
||||
#define GU_PI 3.1415926
|
||||
/* Functions */
|
||||
|
||||
void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect,
|
||||
float near, float far, float scale);
|
||||
void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near,
|
||||
float far, float scale);
|
||||
void guOrtho(Mtx *m, float left, float right, float bottom, float top,
|
||||
float near, float far, float scale);
|
||||
void guTranslate(Mtx *m, float x, float y, float z);
|
||||
void guRotate(Mtx *m, float a, float x, float y, float z);
|
||||
void guScale(Mtx *m, float x, float y, float z);
|
||||
void guMtxF2L(float mf[4][4], Mtx *m);
|
||||
void guMtxIdent(Mtx *m);
|
||||
void guMtxIdentF(float mf[4][4]);
|
||||
void guMtxL2F(float mf[4][4], Mtx *m);
|
||||
void guNormalize(float *, float *, float *);
|
||||
|
||||
/* Used only in Fast3DEX2 */
|
||||
void guLookAtReflect (Mtx *m, LookAt *l, float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_DTOR (3.14159265358979323846/180.0)
|
||||
|
||||
#define FTOFIX32(x) (long)((x) * (float)0x00010000)
|
||||
#define FIX32TOF(x) ((float)(x) * (1.0f / (float)0x00010000))
|
||||
#define FTOFRAC8(x) ((int) MIN(((x) * (128.0f)), 127.0f) & 0xff)
|
||||
|
||||
#define FILTER_WRAP 0
|
||||
#define FILTER_CLAMP 1
|
||||
|
||||
#define RAND(x) (guRandom()%x) /* random number between 0 to x */
|
||||
|
||||
/*
|
||||
* Data Structures
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char *base;
|
||||
int fmt, siz;
|
||||
int xsize, ysize;
|
||||
int lsize;
|
||||
/* current tile info */
|
||||
int addr;
|
||||
int w, h;
|
||||
int s, t;
|
||||
} Image;
|
||||
|
||||
typedef struct {
|
||||
float col[3];
|
||||
float pos[3];
|
||||
float a1, a2; /* actual color = col/(a1*dist + a2) */
|
||||
} PositionalLight;
|
||||
|
||||
|
||||
/*
|
||||
* Function Prototypes
|
||||
*/
|
||||
|
||||
extern int guLoadTextureBlockMipMap(Gfx **glist, unsigned char *tbuf, Image *im,
|
||||
unsigned char startTile, unsigned char pal, unsigned char cms,
|
||||
unsigned char cmt, unsigned char masks, unsigned char maskt,
|
||||
unsigned char shifts, unsigned char shiftt, unsigned char cfs,
|
||||
unsigned char cft);
|
||||
|
||||
extern int guGetDPLoadTextureTileSz (int ult, int lrt);
|
||||
extern void guDPLoadTextureTile (Gfx *glistp, void *timg,
|
||||
int texl_fmt, int texl_size,
|
||||
int img_width, int img_height,
|
||||
int uls, int ult, int lrs, int lrt,
|
||||
int palette,
|
||||
int cms, int cmt,
|
||||
int masks, int maskt,
|
||||
int shifts, int shiftt);
|
||||
|
||||
|
||||
/*
|
||||
* matrix operations:
|
||||
*
|
||||
* The 'F' version is floating point, in case the application wants
|
||||
* to do matrix manipulations and convert to fixed-point at the last
|
||||
* minute.
|
||||
*/
|
||||
extern void guMtxIdent(Mtx *m);
|
||||
extern void guMtxIdentF(float mf[4][4]);
|
||||
extern void guOrtho(Mtx *m, float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guOrthoF(float mf[4][4], float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guFrustum(Mtx *m, float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guFrustumF(float mf[4][4], float l, float r, float b, float t,
|
||||
float n, float f, float scale);
|
||||
extern void guPerspective(Mtx *m, u16 *perspNorm, float fovy,
|
||||
float aspect, float near, float far, float scale);
|
||||
extern void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy,
|
||||
float aspect, float near, float far, float scale);
|
||||
extern void guLookAt(Mtx *m,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtReflect(Mtx *m, LookAt *l,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtReflectF(float mf[4][4], LookAt *l,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp);
|
||||
extern void guLookAtHilite(Mtx *m, LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float xl1, float yl1, float zl1,
|
||||
float xl2, float yl2, float zl2,
|
||||
int twidth, int theight);
|
||||
extern void guLookAtHiliteF(float mf[4][4], LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float xl1, float yl1, float zl1,
|
||||
float xl2, float yl2, float zl2,
|
||||
int twidth, int theight);
|
||||
extern void guLookAtStereo(Mtx *m,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float eyedist);
|
||||
extern void guLookAtStereoF(float mf[4][4],
|
||||
float xEye, float yEye, float zEye,
|
||||
float xAt, float yAt, float zAt,
|
||||
float xUp, float yUp, float zUp,
|
||||
float eyedist);
|
||||
extern void guRotate(Mtx *m, float a, float x, float y, float z);
|
||||
extern void guRotateF(float mf[4][4], float a, float x, float y, float z);
|
||||
extern void guRotateRPY(Mtx *m, float r, float p, float y);
|
||||
extern void guRotateRPYF(float mf[4][4], float r, float p, float h);
|
||||
extern void guAlign(Mtx *m, float a, float x, float y, float z);
|
||||
extern void guAlignF(float mf[4][4], float a, float x, float y, float z);
|
||||
extern void guScale(Mtx *m, float x, float y, float z);
|
||||
extern void guScaleF(float mf[4][4], float x, float y, float z);
|
||||
extern void guTranslate(Mtx *m, float x, float y, float z);
|
||||
extern void guTranslateF(float mf[4][4], float x, float y, float z);
|
||||
extern void guPosition(Mtx *m, float r, float p, float h, float s,
|
||||
float x, float y, float z);
|
||||
extern void guPositionF(float mf[4][4], float r, float p, float h, float s,
|
||||
float x, float y, float z);
|
||||
extern void guMtxF2L(float mf[4][4], Mtx *m);
|
||||
extern void guMtxL2F(float mf[4][4], Mtx *m);
|
||||
extern void guMtxCatF(float m[4][4], float n[4][4], float r[4][4]);
|
||||
extern void guMtxCatL(Mtx *m, Mtx *n, Mtx *res);
|
||||
extern void guMtxXFMF(float mf[4][4], float x, float y, float z,
|
||||
float *ox, float *oy, float *oz);
|
||||
extern void guMtxXFML(Mtx *m, float x, float y, float z,
|
||||
float *ox, float *oy, float *oz);
|
||||
|
||||
/* vector utility: */
|
||||
extern void guNormalize(float *x, float *y, float *z);
|
||||
|
||||
/* light utilities: */
|
||||
void guPosLight(PositionalLight *pl, Light *l,
|
||||
float xOb, float yOb, float zOb);
|
||||
void guPosLightHilite(PositionalLight *pl1, PositionalLight *pl2,
|
||||
Light *l1, Light *l2,
|
||||
LookAt *l, Hilite *h,
|
||||
float xEye, float yEye, float zEye,
|
||||
float xOb, float yOb, float zOb,
|
||||
float xUp, float yUp, float zUp,
|
||||
int twidth, int theight);
|
||||
extern int guRandom(void);
|
||||
|
||||
/*
|
||||
* Math functions
|
||||
*/
|
||||
extern float sinf(float angle);
|
||||
extern float cosf(float angle);
|
||||
extern signed short sins (unsigned short angle);
|
||||
extern signed short coss (unsigned short angle);
|
||||
extern float sqrtf(float value);
|
||||
#if defined(__sgi) && BUILD_VERSION >= VERSION_K
|
||||
#pragma intrinsic(sqrtf);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dump routines for low-level display lists
|
||||
*/
|
||||
/* flag values for guParseRdpDL() */
|
||||
#define GU_PARSERDP_VERBOSE 1
|
||||
#define GU_PARSERDP_PRAREA 2
|
||||
#define GU_PARSERDP_PRHISTO 4
|
||||
#define GU_PARSERDP_DUMPONLY 32 /* doesn't need to be same as */
|
||||
/* GU_PARSEGBI_DUMPOLNY, but this */
|
||||
/* allows app to use interchangeably */
|
||||
|
||||
extern void guParseRdpDL(u64 *rdp_dl, u64 nbytes, u8 flags);
|
||||
extern void guParseString(char *StringPointer, u64 nbytes);
|
||||
|
||||
/*
|
||||
* NO LONGER SUPPORTED,
|
||||
* use guParseRdpDL with GU_PARSERDP_DUMPONLY flags
|
||||
*/
|
||||
/* extern void guDumpRawRdpDL(u64 *rdp_dl, u64 nbytes); */
|
||||
|
||||
/* flag values for guBlinkRdpDL() */
|
||||
#define GU_BLINKRDP_HILITE 1
|
||||
#define GU_BLINKRDP_EXTRACT 2
|
||||
|
||||
extern void
|
||||
guBlinkRdpDL(u64 *rdp_dl_in, u64 nbytes_in,
|
||||
u64 *rdp_dl_out, u64 *nbytes_out,
|
||||
u32 x, u32 y, u32 radius,
|
||||
u8 red, u8 green, u8 blue,
|
||||
u8 flags);
|
||||
|
||||
/* flag values for guParseGbiDL() */
|
||||
#define GU_PARSEGBI_ROWMAJOR 1
|
||||
#define GU_PARSEGBI_NONEST 2
|
||||
#define GU_PARSEGBI_FLTMTX 4
|
||||
#define GU_PARSEGBI_SHOWDMA 8
|
||||
#define GU_PARSEGBI_ALLMTX 16
|
||||
#define GU_PARSEGBI_DUMPONLY 32
|
||||
/*
|
||||
#define GU_PARSEGBI_HANGAFTER 64
|
||||
#define GU_PARSEGBI_NOTEXTURES 128
|
||||
*/
|
||||
extern void guParseGbiDL(u64 *gbi_dl, u32 nbytes, u8 flags);
|
||||
extern void guDumpGbiDL(OSTask *tp,u8 flags);
|
||||
|
||||
#define GU_PARSE_GBI_TYPE 1
|
||||
#define GU_PARSE_RDP_TYPE 2
|
||||
#define GU_PARSE_READY 3
|
||||
#define GU_PARSE_MEM_BLOCK 4
|
||||
#define GU_PARSE_ABI_TYPE 5
|
||||
#define GU_PARSE_STRING_TYPE 6
|
||||
|
||||
typedef struct {
|
||||
int dataSize;
|
||||
int dlType;
|
||||
int flags;
|
||||
u32 paddr;
|
||||
} guDLPrintCB;
|
||||
|
||||
void guSprite2DInit(uSprite *SpritePointer,
|
||||
void *SourceImagePointer,
|
||||
void *TlutPointer,
|
||||
int Stride,
|
||||
int SubImageWidth,
|
||||
int SubImageHeight,
|
||||
int SourceImageType,
|
||||
int SourceImageBitSize,
|
||||
int SourceImageOffsetS,
|
||||
int SourceImageOffsetT);
|
||||
|
||||
#endif /* !_GU_H_ */
|
||||
|
||||
+182
-111
@@ -1,13 +1,40 @@
|
||||
#ifndef _ULTRA64_LIBAUDIO_H_
|
||||
#define _ULTRA64_LIBAUDIO_H_
|
||||
/*====================================================================
|
||||
* libaudio.h
|
||||
*
|
||||
* Copyright 1993, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.173 $
|
||||
* $Date: 1997/12/01 12:42:21 $
|
||||
* $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/libaudio.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __LIB_AUDIO__
|
||||
#define __LIB_AUDIO__
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
#include "mbi.h"
|
||||
#include "abi.h"
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/mbi.h>
|
||||
|
||||
/***********************************************************************
|
||||
* misc defines
|
||||
@@ -88,7 +115,6 @@ typedef struct ALLink_s {
|
||||
struct ALLink_s *prev;
|
||||
} ALLink;
|
||||
|
||||
|
||||
void alUnlink(ALLink *element);
|
||||
void alLink(ALLink *element, ALLink *after);
|
||||
|
||||
@@ -108,7 +134,10 @@ typedef struct {
|
||||
#define AL_HEAP_MAGIC 0x20736a73
|
||||
#define AL_HEAP_INIT 0
|
||||
|
||||
void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size);
|
||||
void alHeapInit(ALHeap *hp, u8 *base, s32 len);
|
||||
void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size);
|
||||
s32 alHeapCheck(ALHeap *hp);
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define alHeapAlloc(hp, elem ,size) alHeapDBAlloc((u8 *) __FILE__,__LINE__,(hp),(elem),(size))
|
||||
#else
|
||||
@@ -222,7 +251,6 @@ typedef struct {
|
||||
ALSound *soundArray[1];
|
||||
} ALInstrument;
|
||||
|
||||
/* Size: 0x10 bytes */
|
||||
typedef struct ALBank_s {
|
||||
s16 instCount; /* number of programs in this bank */
|
||||
u8 flags;
|
||||
@@ -238,6 +266,7 @@ typedef struct { /* Note: sizeof won't be correct */
|
||||
ALBank *bankArray[1]; /* ARRAY of bank offsets */
|
||||
} ALBankFile;
|
||||
|
||||
void alBnkfNew(ALBankFile *f, u8 *table);
|
||||
|
||||
/***********************************************************************
|
||||
* Sequence Files
|
||||
@@ -255,6 +284,7 @@ typedef struct { /* Note: sizeof won't be correct */
|
||||
ALSeqData seqArray[1]; /* ARRAY of sequence info */
|
||||
} ALSeqFile;
|
||||
|
||||
void alSeqFileNew(ALSeqFile *f, u8 *base);
|
||||
|
||||
/***********************************************************************
|
||||
* Synthesis driver stuff
|
||||
@@ -273,7 +303,6 @@ typedef struct {
|
||||
s32 *params;
|
||||
} ALSynConfig;
|
||||
|
||||
/* Size: 0x14 bytes */
|
||||
typedef struct ALPlayer_s {
|
||||
struct ALPlayer_s *next;
|
||||
void *clientData; /* storage for client callback */
|
||||
@@ -299,7 +328,6 @@ typedef struct ALVoiceConfig_s {
|
||||
u8 unityPitch; /* unity pitch flag */
|
||||
} ALVoiceConfig;
|
||||
|
||||
/* Size: 0x4C bytes */
|
||||
typedef struct {
|
||||
ALPlayer *head; /* client list head */
|
||||
ALLink pFreeList; /* list of free physical voices */
|
||||
@@ -350,7 +378,6 @@ ALFxRef alSynGetFXRef(ALSynth *s, s16 bus, s16 index);
|
||||
void alSynFreeFX(ALSynth *s, ALFxRef *fx);
|
||||
void alSynSetFXParam(ALSynth *s, ALFxRef fx, s16 paramID, void *param);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Audio Library (AL) stuff
|
||||
***********************************************************************/
|
||||
@@ -360,6 +387,11 @@ typedef struct {
|
||||
|
||||
extern ALGlobals *alGlobals;
|
||||
|
||||
void alInit(ALGlobals *glob, ALSynConfig *c);
|
||||
void alClose(ALGlobals *glob);
|
||||
|
||||
Acmd *alAudioFrame(Acmd *cmdList, s32 *cmdLen, s16 *outBuf, s32 outLen);
|
||||
|
||||
/***********************************************************************
|
||||
* Sequence Player stuff
|
||||
***********************************************************************/
|
||||
@@ -468,7 +500,10 @@ enum AL_MIDIctrl {
|
||||
AL_MIDI_FX_CTRL_9 = 0x1D,
|
||||
AL_MIDI_SUSTAIN_CTRL = 0x40,
|
||||
AL_MIDI_FX1_CTRL = 0x5B,
|
||||
AL_MIDI_FX3_CTRL = 0x5D
|
||||
AL_MIDI_FX3_CTRL = 0x5D,
|
||||
AL_MIDI_UNK_5F = 0x5F,
|
||||
AL_MIDI_UNK_6A = 0x6A, /* channel off? */
|
||||
AL_MIDI_UNK_6C = 0x6C /* channel on? */
|
||||
};
|
||||
|
||||
enum AL_MIDImeta {
|
||||
@@ -556,7 +591,6 @@ typedef struct {
|
||||
u8 chan;
|
||||
} ALOscEvent;
|
||||
|
||||
/* Size: 0x10 bytes */
|
||||
typedef struct {
|
||||
s16 type;
|
||||
union {
|
||||
@@ -567,9 +601,9 @@ typedef struct {
|
||||
ALVolumeEvent vol;
|
||||
ALSeqpLoopEvent loop;
|
||||
ALSeqpVolEvent spvol;
|
||||
ALSeqpPriorityEvent sppriority;
|
||||
ALSeqpSeqEvent spseq;
|
||||
ALSeqpBankEvent spbank;
|
||||
ALSeqpPriorityEvent sppriority;
|
||||
ALSeqpSeqEvent spseq;
|
||||
ALSeqpBankEvent spbank;
|
||||
ALOscEvent osc;
|
||||
} msg;
|
||||
} ALEvent;
|
||||
@@ -580,7 +614,6 @@ typedef struct {
|
||||
ALEvent evt;
|
||||
} ALEventListItem;
|
||||
|
||||
/* Size: 0x14 bytes */
|
||||
typedef struct {
|
||||
ALLink freeList;
|
||||
ALLink allocList;
|
||||
@@ -595,6 +628,7 @@ void alEvtqPostEvent(ALEventQueue *evtq, ALEvent *evt,
|
||||
void alEvtqFlush(ALEventQueue *evtq);
|
||||
void alEvtqFlushType(ALEventQueue *evtq, s16 type);
|
||||
|
||||
|
||||
#define AL_PHASE_ATTACK 0
|
||||
#define AL_PHASE_NOTEON 0
|
||||
#define AL_PHASE_DECAY 1
|
||||
@@ -632,7 +666,7 @@ typedef struct {
|
||||
f32 pitchBend; /* current pitch bend val in cents */
|
||||
} ALChanState;
|
||||
|
||||
// Can't just replace the original with this, because alCSPGetChlVol won't match.
|
||||
/* Can't just replace the original with this, because alCSPGetChlVol won't match. */
|
||||
typedef struct {
|
||||
ALInstrument *instrument; /* instrument assigned to this chan */
|
||||
s16 bendRange; /* pitch bend range in cents */
|
||||
@@ -647,7 +681,6 @@ typedef struct {
|
||||
u8 unk11;
|
||||
} ALChanState_Custom;
|
||||
|
||||
/* Size: 0x1C bytes */
|
||||
typedef struct ALSeq_s {
|
||||
u8 *base; /* ptr to start of sequence file */
|
||||
u8 *trackStart; /* ptr to first MIDI event */
|
||||
@@ -664,7 +697,6 @@ typedef struct {
|
||||
u32 division;
|
||||
} ALCMidiHdr;
|
||||
|
||||
/* size 0x20 */
|
||||
typedef struct ALCSeq_s {
|
||||
ALCMidiHdr *base; /* ptr to start of sequence file */
|
||||
u32 validTracks; /* set of flags, showing valid tracks */
|
||||
@@ -713,72 +745,66 @@ typedef ALMicroTime (*ALOscInit)(void **oscState,f32 *initVal, u8 oscType,
|
||||
typedef ALMicroTime (*ALOscUpdate)(void *oscState, f32 *updateVal);
|
||||
typedef void (*ALOscStop)(void *oscState);
|
||||
|
||||
/**
|
||||
* Has an extra two bytes for the voice limit not found in standard implementations
|
||||
* Size: 0x92 */
|
||||
typedef struct {
|
||||
/* 0x00 */ ALPlayer node; /* note: must be first in structure */
|
||||
/* 0x14 */ ALSynth *drvr; /* reference to the client driver */
|
||||
/* 0x18 */ ALSeq *target; /* current sequence */
|
||||
/* 0x1C */ ALMicroTime curTime;
|
||||
/* 0x20 */ ALBank *bank; /* current ALBank */
|
||||
/* 0x24 */ s32 uspt; /* microseconds per tick */
|
||||
/* 0x28 */ s32 nextDelta; /* microseconds to next callback */
|
||||
/* 0x2C */ s32 state;
|
||||
/* 0x30 */ u16 chanMask; /* active channels */
|
||||
/* 0x32 */ s16 vol; /* overall sequence volume */
|
||||
/* 0x34 */ u8 maxChannels; /* number of MIDI channels */
|
||||
/* 0x35 */ u8 debugFlags; /* control which error get reported */
|
||||
/* 0x36 */ ALEvent nextEvent;
|
||||
/* 0x48 */ ALEventQueue evtq;
|
||||
/* 0x5C */ ALMicroTime frameTime;
|
||||
/* 0x60 */ ALChanState *chanState; /* 16 channels for MIDI */
|
||||
/* 0x64 */ ALVoiceState *vAllocHead; /* list head for allocated voices */
|
||||
/* 0x68 */ ALVoiceState *vAllocTail; /* list tail for allocated voices */
|
||||
/* 0x6C */ ALVoiceState *vFreeList; /* list of free voice state structs */
|
||||
/* 0x70 */ u8 voiceLimit;
|
||||
/* 0x71 */ u8 mappedVoices;
|
||||
/* 0x72 */ u16 unk72; /* Might just be padding? */
|
||||
/* 0x74 */ ALOscInit initOsc;
|
||||
/* 0x78 */ ALOscUpdate updateOsc;
|
||||
/* 0x7C */ ALOscStop stopOsc;
|
||||
/* 0x80 */ ALSeqMarker *loopStart;
|
||||
/* 0x84 */ ALSeqMarker *loopEnd;
|
||||
/* 0x88 */ s32 loopCount; /* -1 = loop forever, 0 = no loop */
|
||||
ALPlayer node; /* note: must be first in structure */
|
||||
ALSynth *drvr; /* reference to the client driver */
|
||||
ALSeq *target; /* current sequence */
|
||||
ALMicroTime curTime;
|
||||
ALBank *bank; /* current ALBank */
|
||||
s32 uspt; /* microseconds per tick */
|
||||
s32 nextDelta; /* microseconds to next callback */
|
||||
s32 state;
|
||||
u16 chanMask; /* active channels */
|
||||
s16 vol; /* overall sequence volume */
|
||||
u8 maxChannels; /* number of MIDI channels */
|
||||
u8 debugFlags; /* control which error get reported */
|
||||
ALEvent nextEvent;
|
||||
ALEventQueue evtq;
|
||||
ALMicroTime frameTime;
|
||||
ALChanState *chanState; /* 16 channels for MIDI */
|
||||
ALVoiceState *vAllocHead; /* list head for allocated voices */
|
||||
ALVoiceState *vAllocTail; /* list tail for allocated voices */
|
||||
ALVoiceState *vFreeList; /* list of free voice state structs */
|
||||
u8 voiceLimit;
|
||||
u8 mappedVoices;
|
||||
u16 unk72; /* Might just be padding? */
|
||||
ALOscInit initOsc;
|
||||
ALOscUpdate updateOsc;
|
||||
ALOscStop stopOsc;
|
||||
ALSeqMarker *loopStart;
|
||||
ALSeqMarker *loopEnd;
|
||||
s32 loopCount; /* -1 = loop forever, 0 = no loop */
|
||||
} ALSeqPlayer;
|
||||
|
||||
/**
|
||||
* This struct was modified by Rare with a few new fields
|
||||
* Size: 0x80 bytes */
|
||||
typedef struct {
|
||||
/* 0x00 */ ALPlayer node; /* note: must be first in structure */
|
||||
/* 0x14 */ ALSynth *drvr; /* reference to the client driver */
|
||||
/* 0x18 */ ALCSeq *target; /* current sequence */
|
||||
/* 0x1C */ ALMicroTime curTime;
|
||||
/* 0x20 */ ALBank *bank; /* current ALBank */
|
||||
/* 0x24 */ s32 uspt; /* microseconds per tick */
|
||||
/* 0x28 */ s32 nextDelta; /* microseconds to next callback */
|
||||
/* 0x2C */ s32 state;
|
||||
/* 0x30 */ u16 chanMask; /* active channels */
|
||||
/* 0x32 */ s16 vol; /* overall sequence volume */
|
||||
/* 0x34 */ u8 maxChannels; /* number of MIDI channels */
|
||||
/* 0x35 */ u8 debugFlags; /* control which error get reported */
|
||||
/* 0x36 */ u8 unk36;
|
||||
/* 0x37 */ u8 unk37;
|
||||
/* 0x38 */ ALEvent nextEvent;
|
||||
/* 0x48 */ ALEventQueue evtq;
|
||||
/* 0x5C */ ALMicroTime frameTime;
|
||||
/* 0x60 */ ALChanState *chanState; /* 16 channels for MIDI */
|
||||
/* 0x64 */ ALVoiceState *vAllocHead; /* list head for allocated voices */
|
||||
/* 0x68 */ ALVoiceState *vAllocTail; /* list tail for allocated voices */
|
||||
/* 0x6C */ ALVoiceState *vFreeList; /* list of free voice state structs */
|
||||
/* 0x70 */ s8 unk70;
|
||||
/* 0x71 */ s8 unk71;
|
||||
/* 0x72 */ s8 unk72;
|
||||
/* 0x73 */ s8 unk73;
|
||||
/* 0x74 */ ALOscInit initOsc;
|
||||
/* 0x78 */ ALOscUpdate updateOsc;
|
||||
/* 0x7C */ ALOscStop stopOsc;
|
||||
ALPlayer node; /* note: must be first in structure */
|
||||
ALSynth *drvr; /* reference to the client driver */
|
||||
ALCSeq *target; /* current sequence */
|
||||
ALMicroTime curTime;
|
||||
ALBank *bank; /* current ALBank */
|
||||
s32 uspt; /* microseconds per tick */
|
||||
s32 nextDelta; /* microseconds to next callback */
|
||||
s32 state;
|
||||
u16 chanMask; /* active channels */
|
||||
s16 vol; /* overall sequence volume */
|
||||
u8 maxChannels; /* number of MIDI channels */
|
||||
u8 debugFlags; /* control which error get reported */
|
||||
u8 unk36;
|
||||
u8 unk37;
|
||||
ALEvent nextEvent;
|
||||
ALEventQueue evtq;
|
||||
ALMicroTime frameTime;
|
||||
ALChanState *chanState; /* 16 channels for MIDI */
|
||||
ALVoiceState *vAllocHead; /* list head for allocated voices */
|
||||
ALVoiceState *vAllocTail; /* list tail for allocated voices */
|
||||
ALVoiceState *vFreeList; /* list of free voice state structs */
|
||||
s8 unk70;
|
||||
s8 unk71;
|
||||
s8 unk72;
|
||||
s8 unk73;
|
||||
ALOscInit initOsc;
|
||||
ALOscUpdate updateOsc;
|
||||
ALOscStop stopOsc;
|
||||
} ALCSPlayer;
|
||||
|
||||
/**
|
||||
@@ -815,35 +841,6 @@ typedef struct {
|
||||
/* 0x7C */ ALOscStop stopOsc;
|
||||
} ALCSPlayer_Custom;
|
||||
|
||||
/*
|
||||
* Compressed Sequence Player routines
|
||||
*/
|
||||
void alCSPNew(ALCSPlayer *seqp, ALSeqpConfig *config);
|
||||
void alCSPDelete(ALCSPlayer *seqp);
|
||||
void alCSPSetSeq(ALCSPlayer *seqp, ALCSeq *seq);
|
||||
ALCSeq *alCSPGetSeq(ALCSPlayer *seqp);
|
||||
void alCSPPlay(ALCSPlayer *seqp);
|
||||
void alCSPStop(ALCSPlayer *seqp);
|
||||
s32 alCSPGetState(ALCSPlayer *seqp);
|
||||
void alCSPSetBank(ALCSPlayer *seqp, ALBank *b);
|
||||
void alCSPSetTempo(ALCSPlayer *seqp, s32 tempo);
|
||||
s32 alCSPGetTempo(ALCSPlayer *seqp);
|
||||
s16 alCSPGetVol(ALCSPlayer *seqp);
|
||||
void alCSPSetVol(ALCSPlayer *seqp, s16 vol);
|
||||
|
||||
void alCSPSetChlProgram(ALCSPlayer *seqp, u8 chan, u8 prog);
|
||||
s32 alCSPGetChlProgram(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlFXMix(ALCSPlayer *seqp, u8 chan, u8 fxmix);
|
||||
u8 alCSPGetChlFXMix(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlPan(ALCSPlayer *seqp, u8 chan, ALPan pan);
|
||||
ALPan alCSPGetChlPan(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlVol(ALCSPlayer *seqp, u8 chan, u8 vol);
|
||||
u8 alCSPGetChlVol(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlPriority(ALCSPlayer *seqp, u8 chan, u8 priority);
|
||||
u8 alCSPGetChlPriority(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSendMidi(ALCSPlayer *seqp, s32 ticks, u8 status,
|
||||
u8 byte1, u8 byte2);
|
||||
|
||||
/*
|
||||
* Sequence data representation routines
|
||||
*/
|
||||
@@ -898,6 +895,49 @@ void alSeqpSetChlPriority(ALSeqPlayer *seqp, u8 chan, u8 priority);
|
||||
u8 alSeqpGetChlPriority(ALSeqPlayer *seqp, u8 chan);
|
||||
void alSeqpSendMidi(ALSeqPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byte2);
|
||||
|
||||
|
||||
/* Maintain backwards compatibility with old routine names. */
|
||||
#define alSeqpSetProgram alSeqpSetChlProgram
|
||||
#define alSeqpGetProgram alSeqpGetChlProgram
|
||||
#define alSeqpSetFXMix alSeqpSetChlFXMix
|
||||
#define alSeqpGetFXMix alSeqpGetChlFXMix
|
||||
#define alSeqpSetPan alSeqpSetChlPan
|
||||
#define alSeqpGetPan alSeqpGetChlPan
|
||||
#define alSeqpSetChannelPriority alSeqpSetChlPriority
|
||||
#define alSeqpGetChannelPriority alSeqpGetChlPriority
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Compressed Sequence Player routines
|
||||
*/
|
||||
void alCSPNew(ALCSPlayer *seqp, ALSeqpConfig *config);
|
||||
void alCSPDelete(ALCSPlayer *seqp);
|
||||
void alCSPSetSeq(ALCSPlayer *seqp, ALCSeq *seq);
|
||||
ALCSeq *alCSPGetSeq(ALCSPlayer *seqp);
|
||||
void alCSPPlay(ALCSPlayer *seqp);
|
||||
void alCSPStop(ALCSPlayer *seqp);
|
||||
s32 alCSPGetState(ALCSPlayer *seqp);
|
||||
void alCSPSetBank(ALCSPlayer *seqp, ALBank *b);
|
||||
void alCSPSetTempo(ALCSPlayer *seqp, s32 tempo);
|
||||
s32 alCSPGetTempo(ALCSPlayer *seqp);
|
||||
s16 alCSPGetVol(ALCSPlayer *seqp);
|
||||
void alCSPSetVol(ALCSPlayer *seqp, s16 vol);
|
||||
|
||||
void alCSPSetChlProgram(ALCSPlayer *seqp, u8 chan, u8 prog);
|
||||
s32 alCSPGetChlProgram(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlFXMix(ALCSPlayer *seqp, u8 chan, u8 fxmix);
|
||||
u8 alCSPGetChlFXMix(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlPan(ALCSPlayer *seqp, u8 chan, ALPan pan);
|
||||
ALPan alCSPGetChlPan(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlVol(ALCSPlayer *seqp, u8 chan, u8 vol);
|
||||
u8 alCSPGetChlVol(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSetChlPriority(ALCSPlayer *seqp, u8 chan, u8 priority);
|
||||
u8 alCSPGetChlPriority(ALCSPlayer *seqp, u8 chan);
|
||||
void alCSPSendMidi(ALCSPlayer *seqp, s32 ticks, u8 status,
|
||||
u8 byte1, u8 byte2);
|
||||
|
||||
|
||||
/* Maintain backwards compatibility with old routine names. */
|
||||
#define alCSPSetProgram alCSPSetChlProgram
|
||||
#define alCSPGetProgram alCSPGetChlProgram
|
||||
@@ -909,6 +949,7 @@ void alSeqpSendMidi(ALSeqPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byt
|
||||
#define alCSPGetChannelPriority alCSPGetChlPriority
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Sound Player stuff
|
||||
***********************************************************************/
|
||||
@@ -934,5 +975,35 @@ typedef struct {
|
||||
|
||||
typedef s16 ALSndId;
|
||||
|
||||
void alSndpNew(ALSndPlayer *sndp, ALSndpConfig *c);
|
||||
void alSndpDelete(ALSndPlayer *sndp);
|
||||
|
||||
ALSndId alSndpAllocate(ALSndPlayer *sndp, ALSound *sound);
|
||||
void alSndpDeallocate(ALSndPlayer *sndp, ALSndId id);
|
||||
|
||||
void alSndpSetSound(ALSndPlayer *sndp, ALSndId id);
|
||||
ALSndId alSndpGetSound(ALSndPlayer *sndp);
|
||||
|
||||
void alSndpPlay(ALSndPlayer *sndp);
|
||||
void alSndpPlayAt(ALSndPlayer *sndp, ALMicroTime delta);
|
||||
void alSndpStop(ALSndPlayer *sndp);
|
||||
|
||||
void alSndpSetVol(ALSndPlayer *sndp, s16 vol);
|
||||
void alSndpSetPitch(ALSndPlayer *sndp, f32 pitch);
|
||||
void alSndpSetPan(ALSndPlayer *sndp, ALPan pan);
|
||||
void alSndpSetPriority(ALSndPlayer *sndp, ALSndId id, u8 priority);
|
||||
|
||||
void alSndpSetFXMix(ALSndPlayer *sndp, u8 mix);
|
||||
s32 alSndpGetState(ALSndPlayer *sndp);
|
||||
|
||||
#ifndef _FINALROM
|
||||
void alParseAbiCL(Acmd *cmdList, u32 nbytes);
|
||||
#endif
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !__LIB_AUDIO__ */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef _LIBULTRA_H
|
||||
#define _LIBULTRA_H
|
||||
|
||||
#define TV_TYPE_NTSC 1
|
||||
#define TV_TYPE_PAL 0
|
||||
#define TV_TYPE_MPAL 2
|
||||
|
||||
#define OS_TV_TYPE_PAL 0
|
||||
#define OS_TV_TYPE_NTSC 1
|
||||
#define OS_TV_TYPE_MPAL 2
|
||||
|
||||
#define RESET_TYPE_COLD_RESET 0
|
||||
#define RESET_TYPE_NMI 1
|
||||
#define RESET_TYPE_BOOT_DISK 2
|
||||
|
||||
extern u32 osTvType;
|
||||
extern u32 osRomBase;
|
||||
extern u32 osResetType;
|
||||
extern u32 osMemSize;
|
||||
extern u8 osAppNmiBuffer[64];
|
||||
|
||||
#endif /* _LIBULTRA_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user