Merge branch 'DavidSM64:master' into main

This commit is contained in:
Fazana
2021-12-16 18:57:13 +00:00
committed by GitHub
73 changed files with 518 additions and 714 deletions
+5 -2
View File
@@ -153,7 +153,7 @@ DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES)
ASFLAGS = -mtune=vr4300 -march=vr4300 -mabi=32 $(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 -Xfullwarn -signed $(OPT_FLAGS) $(MIPSISET) $(INCLUDE_CFLAGS) $(DEF_INC_CFLAGS)
CFLAGS = -c -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed -DNDEBUG $(OPT_FLAGS) $(MIPSISET) $(INCLUDE_CFLAGS) $(DEF_INC_CFLAGS)
LDFLAGS = undefined_syms.txt -T $(LD_SCRIPT) -Map $(BUILD_DIR)/dkr.map
####################### Other Tools #########################
@@ -195,7 +195,10 @@ ifeq ($(shell getconf LONG_BIT), 64)
# Ensure that gcc treats the code as 32-bit
CC_CHECK_CFLAGS += -m32
endif
CC_CHECK_CFLAGS := -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) $(DEF_INC_CFLAGS) -std=gnu90 -Wall -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB -D_LANGUAGE_C
CC_CHECK_CFLAGS := -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) $(DEF_INC_CFLAGS) -std=gnu90 -Wall -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB -D_LANGUAGE_C -DNDEBUG
#Warnings to ignore
CC_CHECK_CFLAGS += -Wno-builtin-declaration-mismatch -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
####################### ASSETS #########################
@@ -1,29 +0,0 @@
glabel func_80076924
/* 077524 80076924 00047880 */ sll $t7, $a0, 2
/* 077528 80076928 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 07752C 8007692C 01E47823 */ subu $t7, $t7, $a0
/* 077530 80076930 000F7880 */ sll $t7, $t7, 2
/* 077534 80076934 AFBF0014 */ sw $ra, 0x14($sp)
/* 077538 80076938 AFA60040 */ sw $a2, 0x40($sp)
/* 07753C 8007693C 01E47821 */ addu $t7, $t7, $a0
/* 077540 80076940 3C188012 */ lui $t8, %hi(pfs) # $t8, 0x8012
/* 077544 80076944 ACC00000 */ sw $zero, ($a2)
/* 077548 80076948 27184018 */ addiu $t8, %lo(pfs) # addiu $t8, $t8, 0x4018
/* 07754C 8007694C 000F78C0 */ sll $t7, $t7, 3
/* 077550 80076950 01F82021 */ addu $a0, $t7, $t8
/* 077554 80076954 0C034160 */ jal osPfsFileState
/* 077558 80076958 27A60018 */ addiu $a2, $sp, 0x18
/* 07755C 8007695C 14400007 */ bnez $v0, .L8007697C
/* 077560 80076960 24020009 */ li $v0, 9
/* 077564 80076964 8FB90018 */ lw $t9, 0x18($sp)
/* 077568 80076968 8FA80040 */ lw $t0, 0x40($sp)
/* 07756C 8007696C 00001025 */ move $v0, $zero
/* 077570 80076970 10000002 */ b .L8007697C
/* 077574 80076974 AD190000 */ sw $t9, ($t0)
/* 077578 80076978 24020009 */ li $v0, 9
.L8007697C:
/* 07757C 8007697C 8FBF0014 */ lw $ra, 0x14($sp)
/* 077580 80076980 27BD0038 */ addiu $sp, $sp, 0x38
/* 077584 80076984 03E00008 */ jr $ra
/* 077588 80076988 00000000 */ nop
@@ -150,8 +150,8 @@ glabel audioNewThread
/* 003498 80002898 AE420010 */ sw $v0, 0x10($s2)
/* 00349C 8000289C 25AD9808 */ addiu $t5, %lo(func_80019808) # addiu $t5, $t5, -0x67f8
/* 0034A0 800028A0 A1000000 */ sb $zero, ($t0)
/* 0034A4 800028A4 3C05800E */ lui $a1, %hi(D_800DC694) # $a1, 0x800e
/* 0034A8 800028A8 8CA5C694 */ lw $a1, %lo(D_800DC694)($a1)
/* 0034A4 800028A4 3C05800E */ lui $a1, %hi(gFunc80019808Length) # $a1, 0x800e
/* 0034A8 800028A8 8CA5C694 */ lw $a1, %lo(gFunc80019808Length)($a1)
/* 0034AC 800028AC 01A61823 */ subu $v1, $t5, $a2
/* 0034B0 800028B0 00C33821 */ addu $a3, $a2, $v1
/* 0034B4 800028B4 00008825 */ move $s1, $zero
@@ -169,8 +169,8 @@ glabel audioNewThread
/* 0034E0 800028E0 1420FFF8 */ bnez $at, .L800028C4
/* 0034E4 800028E4 006E1821 */ addu $v1, $v1, $t6
.L800028E8:
/* 0034E8 800028E8 3C19800E */ lui $t9, %hi(D_800DC690) # $t9, 0x800e
/* 0034EC 800028EC 8F39C690 */ lw $t9, %lo(D_800DC690)($t9)
/* 0034E8 800028E8 3C19800E */ lui $t9, %hi(gFunc80019808Checksum) # $t9, 0x800e
/* 0034EC 800028EC 8F39C690 */ lw $t9, %lo(gFunc80019808Checksum)($t9)
/* 0034F0 800028F0 3C108011 */ lui $s0, %hi(D_80115F98) # $s0, 0x8011
/* 0034F4 800028F4 10790003 */ beq $v1, $t9, .L80002904
/* 0034F8 800028F8 26105F98 */ addiu $s0, %lo(D_80115F98) # addiu $s0, $s0, 0x5f98
@@ -1,104 +0,0 @@
glabel func_8003DFCC
/* 03EBCC 8003DFCC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 03EBD0 8003DFD0 AFBF0014 */ sw $ra, 0x14($sp)
/* 03EBD4 8003DFD4 8C8F004C */ lw $t7, 0x4c($a0)
/* 03EBD8 8003DFD8 240E0002 */ li $t6, 2
/* 03EBDC 8003DFDC A5EE0014 */ sh $t6, 0x14($t7)
/* 03EBE0 8003DFE0 8C99004C */ lw $t9, 0x4c($a0)
/* 03EBE4 8003DFE4 24180004 */ li $t8, 4
/* 03EBE8 8003DFE8 A3380011 */ sb $t8, 0x11($t9)
/* 03EBEC 8003DFEC 8C89004C */ lw $t1, 0x4c($a0)
/* 03EBF0 8003DFF0 24080014 */ li $t0, 20
/* 03EBF4 8003DFF4 A1280010 */ sb $t0, 0x10($t1)
/* 03EBF8 8003DFF8 AFA5001C */ sw $a1, 0x1c($sp)
/* 03EBFC 8003DFFC 0C0270C3 */ jal get_filtered_cheats
/* 03EC00 8003E000 AFA40018 */ sw $a0, 0x18($sp)
/* 03EC04 8003E004 8FA40018 */ lw $a0, 0x18($sp)
/* 03EC08 8003E008 8FA5001C */ lw $a1, 0x1c($sp)
/* 03EC0C 8003E00C 00025380 */ sll $t2, $v0, 0xe
/* 03EC10 8003E010 05410003 */ bgez $t2, .L8003E020
/* 03EC14 8003E014 304B8000 */ andi $t3, $v0, 0x8000
/* 03EC18 8003E018 10000013 */ b .L8003E068
/* 03EC1C 8003E01C A0A00009 */ sb $zero, 9($a1)
.L8003E020:
/* 03EC20 8003E020 11600004 */ beqz $t3, .L8003E034
/* 03EC24 8003E024 00026BC0 */ sll $t5, $v0, 0xf
/* 03EC28 8003E028 240C0001 */ li $t4, 1
/* 03EC2C 8003E02C 1000000E */ b .L8003E068
/* 03EC30 8003E030 A0AC0009 */ sb $t4, 9($a1)
.L8003E034:
/* 03EC34 8003E034 05A10004 */ bgez $t5, .L8003E048
/* 03EC38 8003E038 00027B40 */ sll $t7, $v0, 0xd
/* 03EC3C 8003E03C 240E0002 */ li $t6, 2
/* 03EC40 8003E040 10000009 */ b .L8003E068
/* 03EC44 8003E044 A0AE0009 */ sb $t6, 9($a1)
.L8003E048:
/* 03EC48 8003E048 05E10004 */ bgez $t7, .L8003E05C
/* 03EC4C 8003E04C 0002CB00 */ sll $t9, $v0, 0xc
/* 03EC50 8003E050 24180003 */ li $t8, 3
/* 03EC54 8003E054 10000004 */ b .L8003E068
/* 03EC58 8003E058 A0B80009 */ sb $t8, 9($a1)
.L8003E05C:
/* 03EC5C 8003E05C 07210002 */ bgez $t9, .L8003E068
/* 03EC60 8003E060 24080004 */ li $t0, 4
/* 03EC64 8003E064 A0A80009 */ sb $t0, 9($a1)
.L8003E068:
/* 03EC68 8003E068 90A90008 */ lbu $t1, 8($a1)
/* 03EC6C 8003E06C 00000000 */ nop
/* 03EC70 8003E070 29210006 */ slti $at, $t1, 6
/* 03EC74 8003E074 14200002 */ bnez $at, .L8003E080
/* 03EC78 8003E078 00000000 */ nop
/* 03EC7C 8003E07C A0A00008 */ sb $zero, 8($a1)
.L8003E080:
/* 03EC80 8003E080 8C8B0040 */ lw $t3, 0x40($a0)
/* 03EC84 8003E084 808A003A */ lb $t2, 0x3a($a0)
/* 03EC88 8003E088 816C0055 */ lb $t4, 0x55($t3)
/* 03EC8C 8003E08C 00000000 */ nop
/* 03EC90 8003E090 014C082A */ slt $at, $t2, $t4
/* 03EC94 8003E094 14200002 */ bnez $at, .L8003E0A0
/* 03EC98 8003E098 00000000 */ nop
/* 03EC9C 8003E09C A080003A */ sb $zero, 0x3a($a0)
.L8003E0A0:
/* 03ECA0 8003E0A0 90AD0009 */ lbu $t5, 9($a1)
/* 03ECA4 8003E0A4 3C014120 */ li $at, 0x41200000 # 10.000000
/* 03ECA8 8003E0A8 A08D003A */ sb $t5, 0x3a($a0)
/* 03ECAC 8003E0AC 808E003A */ lb $t6, 0x3a($a0)
/* 03ECB0 8003E0B0 44811000 */ mtc1 $at, $f2
/* 03ECB4 8003E0B4 AC8E0078 */ sw $t6, 0x78($a0)
/* 03ECB8 8003E0B8 90B8000A */ lbu $t8, 0xa($a1)
/* 03ECBC 8003E0BC 3C014280 */ li $at, 0x42800000 # 64.000000
/* 03ECC0 8003E0C0 44982000 */ mtc1 $t8, $f4
/* 03ECC4 8003E0C4 44813000 */ mtc1 $at, $f6
/* 03ECC8 8003E0C8 46802020 */ cvt.s.w $f0, $f4
/* 03ECCC 8003E0CC 4602003C */ c.lt.s $f0, $f2
/* 03ECD0 8003E0D0 00000000 */ nop
/* 03ECD4 8003E0D4 45000003 */ bc1f .L8003E0E4
/* 03ECD8 8003E0D8 00000000 */ nop
/* 03ECDC 8003E0DC 46001006 */ mov.s $f0, $f2
/* 03ECE0 8003E0E0 00000000 */ nop
.L8003E0E4:
/* 03ECE4 8003E0E4 46060003 */ div.s $f0, $f0, $f6
/* 03ECE8 8003E0E8 8C990040 */ lw $t9, 0x40($a0)
/* 03ECEC 8003E0EC 8C820064 */ lw $v0, 0x64($a0)
/* 03ECF0 8003E0F0 C728000C */ lwc1 $f8, 0xc($t9)
/* 03ECF4 8003E0F4 00000000 */ nop
/* 03ECF8 8003E0F8 46004282 */ mul.s $f10, $f8, $f0
/* 03ECFC 8003E0FC E48A0008 */ swc1 $f10, 8($a0)
/* 03ED00 8003E100 C4900008 */ lwc1 $f16, 8($a0)
/* 03ED04 8003E104 A4400004 */ sh $zero, 4($v0)
/* 03ED08 8003E108 E4500000 */ swc1 $f16, ($v0)
/* 03ED0C 8003E10C AC80007C */ sw $zero, 0x7c($a0)
/* 03ED10 8003E110 0C0270C3 */ jal get_filtered_cheats
/* 03ED14 8003E114 AFA40018 */ sw $a0, 0x18($sp)
/* 03ED18 8003E118 8FA40018 */ lw $a0, 0x18($sp)
/* 03ED1C 8003E11C 30480800 */ andi $t0, $v0, 0x800
/* 03ED20 8003E120 11000004 */ beqz $t0, .L8003E134
/* 03ED24 8003E124 8FBF0014 */ lw $ra, 0x14($sp)
/* 03ED28 8003E128 0C003FEE */ jal gParticlePtrList_addObject
/* 03ED2C 8003E12C 00000000 */ nop
/* 03ED30 8003E130 8FBF0014 */ lw $ra, 0x14($sp)
.L8003E134:
/* 03ED34 8003E134 27BD0018 */ addiu $sp, $sp, 0x18
/* 03ED38 8003E138 03E00008 */ jr $ra
/* 03ED3C 8003E13C 00000000 */ nop
-1
View File
@@ -2,7 +2,6 @@
#define _OS_LIBC_H_
#include "ultratypes.h"
// Old deprecated functions from strings.h, replaced by memcpy/memset.
extern void bcopy(const void *, void *, size_t);
extern void bzero(void *, size_t);
+2
View File
@@ -94,4 +94,6 @@ s32 osPiRawReadIo(u32 devAddr, u32 *data);
s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size);
s32 osEPiRawStartDma(OSPiHandle *piHandle, s32 dir, u32 cart_addr, void *dram_addr, size_t size);
s32 osEPiRawWriteIo(OSPiHandle *, u32 , u32);
#endif
+1
View File
@@ -87,6 +87,7 @@ void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount);
void osViBlack(u8 active);
void osViSetSpecialFeatures(u32 func);
void osViSwapBuffer(void *vaddr);
void osYieldThread(void);
#define OS_VI_NTSC_LPN1 0 /* NTSC */
+32
View File
@@ -122,6 +122,8 @@ typedef struct ALFilter_s {
s32 type;
} ALFilter;
void alFilterNew(ALFilter *f, ALCmdHandler h, ALSetParam s, s32 type);
#define AL_MAX_ADPCM_STATES 3 /* Depends on number of subframes
* per frame and loop length
*/
@@ -140,6 +142,11 @@ typedef struct {
s32 memin;
} ALLoadFilter;
void alLoadNew(ALLoadFilter *f, ALDMANew dma, ALHeap *hp);
Acmd *alAdpcmPull(void *f, s16 *outp, s32 byteCount, s32 sampleOffset, Acmd *p);
Acmd *alRaw16Pull(void *f, s16 *outp, s32 byteCount, s32 sampleOffset, Acmd *p);
s32 alLoadParam(void *filter, s32 paramID, void *param);
typedef struct ALResampler_s {
ALFilter filter;
RESAMPLE_STATE *state;
@@ -188,6 +195,11 @@ typedef struct {
ALSetFXParam paramHdl;
} ALFx;
void alFxNew(ALFx *r, ALSynConfig *c, s16 bus, ALHeap *hp);
Acmd *alFxPull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p);
s32 alFxParam(void *filter, s32 paramID, void *param);
s32 alFxParamHdl(void *filter, s32 paramID, void *param);
#define AL_MAX_MAIN_BUS_SOURCES 1
typedef struct ALMainBus_s {
ALFilter filter;
@@ -196,6 +208,10 @@ typedef struct ALMainBus_s {
ALFilter **sources;
} ALMainBus;
void alMainBusNew(ALMainBus *m, void *ptr, s32 len);
Acmd *alMainBusPull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p);
s32 alMainBusParam(void *filter, s32 paramID, void *param);
#define AL_MAX_AUX_BUS_SOURCES 8
#define AL_MAX_AUX_BUS_FX 1
typedef struct ALAuxBus_s {
@@ -206,12 +222,24 @@ typedef struct ALAuxBus_s {
ALFx fx[AL_MAX_AUX_BUS_FX];
} ALAuxBus;
void alAuxBusNew(ALAuxBus *m, void *ptr, s32 len);
Acmd *alAuxBusPull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p);
s32 alAuxBusParam(void *filter, s32 paramID, void *param);
void alResampleNew(ALResampler *r, ALHeap *hp);
Acmd *alResamplePull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p);
s32 alResampleParam(void *f, s32 paramID, void *param);
typedef struct ALSave_s {
ALFilter filter;
s32 dramout;
s32 first;
} ALSave;
void alSaveNew(ALSave *r);
Acmd *alSavePull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p);
s32 alSaveParam(void *f, s32 paramID, void *param);
typedef struct ALEnvMixer_s {
ALFilter filter;
ENVMIX_STATE *state;
@@ -236,6 +264,10 @@ typedef struct ALEnvMixer_s {
s32 motion;
} ALEnvMixer;
void alEnvmixerNew(ALEnvMixer *e, ALHeap *hp);
Acmd *alEnvmixerPull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p);
s32 alEnvmixerParam(void *filter, s32 paramID, void *param);
/*
* heap stuff
*/
+54
View File
@@ -0,0 +1,54 @@
#ifndef __ASSERT_H__
#define __ASSERT_H__
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************
* *
* Copyright (C) 1984, 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. *
* *
**************************************************************************/
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ident "$Revision: 1.17 $"
/* ANSI C Notes:
*
* - THE IDENTIFIERS APPEARING OUTSIDE OF #ifdef __EXTENSIONS__ IN THIS
* standard header ARE SPECIFIED BY ANSI! CONFORMANCE WILL BE ALTERED
* IF ANY NEW IDENTIFIERS ARE ADDED TO THIS AREA UNLESS THEY ARE IN ANSI's
* RESERVED NAMESPACE. (i.e., unless they are prefixed by __[a-z] or
* _[A-Z]. For external objects, identifiers with the prefix _[a-z]
* are also reserved.)
*/
#ifdef NDEBUG
#undef assert
#define assert(EX) ((void)0)
#else
extern void __assert(const char *, const char *, int);
#ifdef __ANSI_CPP__
#define assert(EX) ((EX)?((void)0):__assert( # EX , __FILE__, __LINE__))
#else
#define assert(EX) ((EX)?((void)0):__assert("EX", __FILE__, __LINE__))
#endif
#endif /* NDEBUG */
#ifdef __cplusplus
}
#endif
#endif /* !__ASSERT_H__ */
-2
View File
@@ -100,7 +100,6 @@ extern OSViMode osViModeTable[];
/*******************************/
void __scYield(OSSched *sc);
static void __scMain(void *arg);
void __scExec(OSSched *sc, OSScTask *sp, OSScTask *dp);
void osCreateScheduler(OSSched *sc, void *stack, OSPri priority, u8 mode, u8 numFields);
void osScAddClient(OSSched *sc, OSScClient *c, OSMesgQueue *msgQ, u8 arg3);
@@ -116,6 +115,5 @@ s32 __scTaskComplete(OSSched *sc, OSScTask *t);
void __scAppendList(OSSched *sc, OSScTask *t);
void __scExec(OSSched *sc, OSScTask *sp, OSScTask *dp);
void __scHandleRetrace(OSSched *sc);
static s32 __scSchedule(OSSched *sc, OSScTask **sp, OSScTask **dp, s32 availRCP);
#endif
+2
View File
@@ -68,4 +68,6 @@ extern __OSViContext *__osViCurr;
extern __OSViContext *__osViNext;
__OSViContext *__osViGetCurrentContext(void);
void __osViInit(void);
void *osViGetCurrentFramebuffer(void);
void *osViGetNextFramebuffer(void);
#endif
-303
View File
@@ -1,303 +0,0 @@
.late_rodata
glabel jpt_800E6EA0
.word L80064AD8, L80064AE4, L80064AFC, L80064B08, L80064AF0, L80064B14
glabel D_800E6EB8
.float 8.320827
glabel D_800E6EBC
.float 0.04680453
.text
glabel alFxNew
/* 065608 80064A08 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 06560C 80064A0C AFB00038 */ sw $s0, 0x38($sp)
/* 065610 80064A10 00068400 */ sll $s0, $a2, 0x10
/* 065614 80064A14 AFA60068 */ sw $a2, 0x68($sp)
/* 065618 80064A18 00107403 */ sra $t6, $s0, 0x10
/* 06561C 80064A1C AFBF005C */ sw $ra, 0x5c($sp)
/* 065620 80064A20 AFB60050 */ sw $s6, 0x50($sp)
/* 065624 80064A24 AFA50064 */ sw $a1, 0x64($sp)
/* 065628 80064A28 AFA7006C */ sw $a3, 0x6c($sp)
/* 06562C 80064A2C 3C068006 */ lui $a2, %hi(alFxParam) # $a2, 0x8006
/* 065630 80064A30 0080B025 */ move $s6, $a0
/* 065634 80064A34 01C08025 */ move $s0, $t6
/* 065638 80064A38 AFBE0058 */ sw $fp, 0x58($sp)
/* 06563C 80064A3C AFB70054 */ sw $s7, 0x54($sp)
/* 065640 80064A40 AFB5004C */ sw $s5, 0x4c($sp)
/* 065644 80064A44 AFB40048 */ sw $s4, 0x48($sp)
/* 065648 80064A48 AFB30044 */ sw $s3, 0x44($sp)
/* 06564C 80064A4C AFB20040 */ sw $s2, 0x40($sp)
/* 065650 80064A50 AFB1003C */ sw $s1, 0x3c($sp)
/* 065654 80064A54 E7BB0030 */ swc1 $f27, 0x30($sp)
/* 065658 80064A58 E7BA0034 */ swc1 $f26, 0x34($sp)
/* 06565C 80064A5C E7B90028 */ swc1 $f25, 0x28($sp)
/* 065660 80064A60 E7B8002C */ swc1 $f24, 0x2c($sp)
/* 065664 80064A64 E7B70020 */ swc1 $f23, 0x20($sp)
/* 065668 80064A68 E7B60024 */ swc1 $f22, 0x24($sp)
/* 06566C 80064A6C E7B50018 */ swc1 $f21, 0x18($sp)
/* 065670 80064A70 E7B4001C */ swc1 $f20, 0x1c($sp)
/* 065674 80064A74 24C63F94 */ addiu $a2, %lo(alFxParam) # addiu $a2, $a2, 0x3f94
/* 065678 80064A78 24070005 */ li $a3, 5
/* 06567C 80064A7C 0C03282C */ jal alFilterNew
/* 065680 80064A80 00002825 */ move $a1, $zero
/* 065684 80064A84 8FA20064 */ lw $v0, 0x64($sp)
/* 065688 80064A88 3C0F8006 */ lui $t7, %hi(alFxPull) # $t7, 0x8006
/* 06568C 80064A8C 3C188006 */ lui $t8, %hi(alFxParamHdl) # $t8, 0x8006
/* 065690 80064A90 25EF3C30 */ addiu $t7, %lo(alFxPull) # addiu $t7, $t7, 0x3c30
/* 065694 80064A94 27183FAC */ addiu $t8, %lo(alFxParamHdl) # addiu $t8, $t8, 0x3fac
/* 065698 80064A98 AECF0004 */ sw $t7, 4($s6)
/* 06569C 80064A9C AED80028 */ sw $t8, 0x28($s6)
/* 0656A0 80064AA0 0050C821 */ addu $t9, $v0, $s0
/* 0656A4 80064AA4 9328001C */ lbu $t0, 0x1c($t9)
/* 0656A8 80064AA8 3C13800E */ lui $s3, %hi(NULL_PARAMS) # $s3, 0x800e
/* 0656AC 80064AAC 2509FFFF */ addiu $t1, $t0, -1
/* 0656B0 80064AB0 2D210006 */ sltiu $at, $t1, 6
/* 0656B4 80064AB4 1020001C */ beqz $at, .L80064B28
/* 0656B8 80064AB8 2673D028 */ addiu $s3, %lo(NULL_PARAMS) # addiu $s3, $s3, -0x2fd8
/* 0656BC 80064ABC 00094880 */ sll $t1, $t1, 2
/* 0656C0 80064AC0 3C01800E */ lui $at, %hi(jpt_800E6EA0) # $at, 0x800e
/* 0656C4 80064AC4 00290821 */ addu $at, $at, $t1
/* 0656C8 80064AC8 8C296EA0 */ lw $t1, %lo(jpt_800E6EA0)($at)
/* 0656CC 80064ACC 00000000 */ nop
/* 0656D0 80064AD0 01200008 */ jr $t1
/* 0656D4 80064AD4 00000000 */ nop
glabel L80064AD8
/* 0656D8 80064AD8 3C13800E */ lui $s3, %hi(SMALLROOM_PARAMS) # $s3, 0x800e
/* 0656DC 80064ADC 10000012 */ b .L80064B28
/* 0656E0 80064AE0 2673CEC0 */ addiu $s3, %lo(SMALLROOM_PARAMS) # addiu $s3, $s3, -0x3140
glabel L80064AE4
/* 0656E4 80064AE4 3C13800E */ lui $s3, %hi(BIGROOM_PARAMS) # $s3, 0x800e
/* 0656E8 80064AE8 1000000F */ b .L80064B28
/* 0656EC 80064AEC 2673CF28 */ addiu $s3, %lo(BIGROOM_PARAMS) # addiu $s3, $s3, -0x30d8
glabel L80064AF0
/* 0656F0 80064AF0 3C13800E */ lui $s3, %hi(ECHO_PARAMS) # $s3, 0x800e
/* 0656F4 80064AF4 1000000C */ b .L80064B28
/* 0656F8 80064AF8 2673CFB0 */ addiu $s3, %lo(ECHO_PARAMS) # addiu $s3, $s3, -0x3050
glabel L80064AFC
/* 0656FC 80064AFC 3C13800E */ lui $s3, %hi(CHORUS_PARAMS) # $s3, 0x800e
/* 065700 80064B00 10000009 */ b .L80064B28
/* 065704 80064B04 2673CFD8 */ addiu $s3, %lo(CHORUS_PARAMS) # addiu $s3, $s3, -0x3028
glabel L80064B08
/* 065708 80064B08 3C13800E */ lui $s3, %hi(FLANGE_PARAMS) # $s3, 0x800e
/* 06570C 80064B0C 10000006 */ b .L80064B28
/* 065710 80064B10 2673D000 */ addiu $s3, %lo(FLANGE_PARAMS) # addiu $s3, $s3, -0x3000
glabel L80064B14
/* 065714 80064B14 00105080 */ sll $t2, $s0, 2
/* 065718 80064B18 004A5821 */ addu $t3, $v0, $t2
/* 06571C 80064B1C 8D730020 */ lw $s3, 0x20($t3)
/* 065720 80064B20 10000002 */ b .L80064B2C
/* 065724 80064B24 8E6C0000 */ lw $t4, ($s3)
.L80064B28:
/* 065728 80064B28 8E6C0000 */ lw $t4, ($s3)
.L80064B2C:
/* 06572C 80064B2C 241E0028 */ li $fp, 40
/* 065730 80064B30 318E00FF */ andi $t6, $t4, 0xff
/* 065734 80064B34 01DE0019 */ multu $t6, $fp
/* 065738 80064B38 A2CC0024 */ sb $t4, 0x24($s6)
/* 06573C 80064B3C 8E6D0004 */ lw $t5, 4($s3)
/* 065740 80064B40 3C1500FF */ lui $s5, (0x00FFFFFF >> 16) # lui $s5, 0xff
/* 065744 80064B44 36B5FFFF */ ori $s5, (0x00FFFFFF & 0xFFFF) # ori $s5, $s5, 0xffff
/* 065748 80064B48 24110002 */ li $s1, 2
/* 06574C 80064B4C 02A02825 */ move $a1, $s5
/* 065750 80064B50 AECD001C */ sw $t5, 0x1c($s6)
/* 065754 80064B54 00002012 */ mflo $a0
/* 065758 80064B58 0C01C327 */ jal allocate_from_main_pool_safe
/* 06575C 80064B5C 00000000 */ nop
/* 065760 80064B60 8EC4001C */ lw $a0, 0x1c($s6)
/* 065764 80064B64 AEC20020 */ sw $v0, 0x20($s6)
/* 065768 80064B68 00047840 */ sll $t7, $a0, 1
/* 06576C 80064B6C 01E02025 */ move $a0, $t7
/* 065770 80064B70 0C01C327 */ jal allocate_from_main_pool_safe
/* 065774 80064B74 02A02825 */ move $a1, $s5
/* 065778 80064B78 8ED8001C */ lw $t8, 0x1c($s6)
/* 06577C 80064B7C AEC20014 */ sw $v0, 0x14($s6)
/* 065780 80064B80 AEC20018 */ sw $v0, 0x18($s6)
/* 065784 80064B84 1300000B */ beqz $t8, .L80064BB4
/* 065788 80064B88 00001825 */ move $v1, $zero
.L80064B8C:
/* 06578C 80064B8C 8ED90014 */ lw $t9, 0x14($s6)
/* 065790 80064B90 00034040 */ sll $t0, $v1, 1
/* 065794 80064B94 03284821 */ addu $t1, $t9, $t0
/* 065798 80064B98 A5200000 */ sh $zero, ($t1)
/* 06579C 80064B9C 8ECB001C */ lw $t3, 0x1c($s6)
/* 0657A0 80064BA0 24630001 */ addiu $v1, $v1, 1
/* 0657A4 80064BA4 306AFFFF */ andi $t2, $v1, 0xffff
/* 0657A8 80064BA8 014B082B */ sltu $at, $t2, $t3
/* 0657AC 80064BAC 1420FFF7 */ bnez $at, .L80064B8C
/* 0657B0 80064BB0 01401825 */ move $v1, $t2
.L80064BB4:
/* 0657B4 80064BB4 92CC0024 */ lbu $t4, 0x24($s6)
/* 0657B8 80064BB8 0000A025 */ move $s4, $zero
/* 0657BC 80064BBC 19800091 */ blez $t4, .L80064E04
/* 0657C0 80064BC0 3C013F80 */ li $at, 0x3F800000 # 1.000000
/* 0657C4 80064BC4 4481C000 */ mtc1 $at, $f24
/* 0657C8 80064BC8 3C01447A */ li $at, 0x447A0000 # 1000.000000
/* 0657CC 80064BCC 4481B000 */ mtc1 $at, $f22
/* 0657D0 80064BD0 3C01800E */ lui $at, %hi(D_800E6EBC) # $at, 0x800e
/* 0657D4 80064BD4 C4356EB8 */ lwc1 $f21, %lo(D_800E6EB8)($at)
/* 0657D8 80064BD8 C4346EBC */ lwc1 $f20, %lo(D_800E6EBC)($at)
/* 0657DC 80064BDC 4480D000 */ mtc1 $zero, $f26
/* 0657E0 80064BE0 24170001 */ li $s7, 1
.L80064BE4:
/* 0657E4 80064BE4 029E0019 */ multu $s4, $fp
/* 0657E8 80064BE8 00117880 */ sll $t7, $s1, 2
/* 0657EC 80064BEC 8ECD0020 */ lw $t5, 0x20($s6)
/* 0657F0 80064BF0 026FC021 */ addu $t8, $s3, $t7
/* 0657F4 80064BF4 26310001 */ addiu $s1, $s1, 1
/* 0657F8 80064BF8 8F190000 */ lw $t9, ($t8)
/* 0657FC 80064BFC 3228FFFF */ andi $t0, $s1, 0xffff
/* 065800 80064C00 00084880 */ sll $t1, $t0, 2
/* 065804 80064C04 02695021 */ addu $t2, $s3, $t1
/* 065808 80064C08 25110001 */ addiu $s1, $t0, 1
/* 06580C 80064C0C 322CFFFF */ andi $t4, $s1, 0xffff
/* 065810 80064C10 25910001 */ addiu $s1, $t4, 1
/* 065814 80064C14 00007012 */ mflo $t6
/* 065818 80064C18 01AE8021 */ addu $s0, $t5, $t6
/* 06581C 80064C1C AE190000 */ sw $t9, ($s0)
/* 065820 80064C20 8D4B0000 */ lw $t3, ($t2)
/* 065824 80064C24 000C6880 */ sll $t5, $t4, 2
/* 065828 80064C28 026D7021 */ addu $t6, $s3, $t5
/* 06582C 80064C2C AE0B0004 */ sw $t3, 4($s0)
/* 065830 80064C30 8DCF0000 */ lw $t7, ($t6)
/* 065834 80064C34 3238FFFF */ andi $t8, $s1, 0xffff
/* 065838 80064C38 0018C880 */ sll $t9, $t8, 2
/* 06583C 80064C3C 02794021 */ addu $t0, $s3, $t9
/* 065840 80064C40 27110001 */ addiu $s1, $t8, 1
/* 065844 80064C44 A60F000A */ sh $t7, 0xa($s0)
/* 065848 80064C48 8D090000 */ lw $t1, ($t0)
/* 06584C 80064C4C 322AFFFF */ andi $t2, $s1, 0xffff
/* 065850 80064C50 000A5880 */ sll $t3, $t2, 2
/* 065854 80064C54 026B6021 */ addu $t4, $s3, $t3
/* 065858 80064C58 25510001 */ addiu $s1, $t2, 1
/* 06585C 80064C5C A6090008 */ sh $t1, 8($s0)
/* 065860 80064C60 8D8D0000 */ lw $t5, ($t4)
/* 065864 80064C64 322EFFFF */ andi $t6, $s1, 0xffff
/* 065868 80064C68 000E7880 */ sll $t7, $t6, 2
/* 06586C 80064C6C 026FC021 */ addu $t8, $s3, $t7
/* 065870 80064C70 A60D000C */ sh $t5, 0xc($s0)
/* 065874 80064C74 8F020000 */ lw $v0, ($t8)
/* 065878 80064C78 01C08825 */ move $s1, $t6
/* 06587C 80064C7C 1040003B */ beqz $v0, .L80064D6C
/* 065880 80064C80 02205025 */ move $t2, $s1
/* 065884 80064C84 44822000 */ mtc1 $v0, $f4
/* 065888 80064C88 8FB90064 */ lw $t9, 0x64($sp)
/* 06588C 80064C8C 468021A0 */ cvt.s.w $f6, $f4
/* 065890 80064C90 8F280018 */ lw $t0, 0x18($t9)
/* 065894 80064C94 8E0A0004 */ lw $t2, 4($s0)
/* 065898 80064C98 46163203 */ div.s $f8, $f6, $f22
/* 06589C 80064C9C 44888000 */ mtc1 $t0, $f16
/* 0658A0 80064CA0 8E0B0000 */ lw $t3, ($s0)
/* 0658A4 80064CA4 468084A1 */ cvt.d.w $f18, $f16
/* 0658A8 80064CA8 25D10001 */ addiu $s1, $t6, 1
/* 0658AC 80064CAC 3229FFFF */ andi $t1, $s1, 0xffff
/* 0658B0 80064CB0 014B6023 */ subu $t4, $t2, $t3
/* 0658B4 80064CB4 01208825 */ move $s1, $t1
/* 0658B8 80064CB8 00116880 */ sll $t5, $s1, 2
/* 0658BC 80064CBC 026D7021 */ addu $t6, $s3, $t5
/* 0658C0 80064CC0 3C0141F0 */ li $at, 0x41F00000 # 30.000000
/* 0658C4 80064CC4 46004021 */ cvt.d.s $f0, $f8
/* 0658C8 80064CC8 46200280 */ add.d $f10, $f0, $f0
/* 0658CC 80064CCC 448C4000 */ mtc1 $t4, $f8
/* 0658D0 80064CD0 46325103 */ div.d $f4, $f10, $f18
/* 0658D4 80064CD4 46804421 */ cvt.d.w $f16, $f8
/* 0658D8 80064CD8 462021A0 */ cvt.s.d $f6, $f4
/* 0658DC 80064CDC 05810005 */ bgez $t4, .L80064CF4
/* 0658E0 80064CE0 E6060010 */ swc1 $f6, 0x10($s0)
/* 0658E4 80064CE4 44815800 */ mtc1 $at, $f11
/* 0658E8 80064CE8 44805000 */ mtc1 $zero, $f10
/* 0658EC 80064CEC 00000000 */ nop
/* 0658F0 80064CF0 462A8400 */ add.d $f16, $f16, $f10
.L80064CF4:
/* 0658F4 80064CF4 8DCF0000 */ lw $t7, ($t6)
/* 0658F8 80064CF8 26310001 */ addiu $s1, $s1, 1
/* 0658FC 80064CFC 448F9000 */ mtc1 $t7, $f18
/* 065900 80064D00 3238FFFF */ andi $t8, $s1, 0xffff
/* 065904 80064D04 46809120 */ cvt.s.w $f4, $f18
/* 065908 80064D08 03008825 */ move $s1, $t8
/* 06590C 80064D0C E6180014 */ swc1 $f24, 0x14($s0)
/* 065910 80064D10 460021A1 */ cvt.d.s $f6, $f4
/* 065914 80064D14 00000000 */ nop
/* 065918 80064D18 46343203 */ div.d $f8, $f6, $f20
/* 06591C 80064D1C AE000018 */ sw $zero, 0x18($s0)
/* 065920 80064D20 24040034 */ li $a0, 52
/* 065924 80064D24 02A02825 */ move $a1, $s5
/* 065928 80064D28 46304282 */ mul.d $f10, $f8, $f16
/* 06592C 80064D2C 462054A0 */ cvt.s.d $f18, $f10
/* 065930 80064D30 0C01C327 */ jal allocate_from_main_pool_safe
/* 065934 80064D34 E612001C */ swc1 $f18, 0x1c($s0)
/* 065938 80064D38 AE020024 */ sw $v0, 0x24($s0)
/* 06593C 80064D3C 24040020 */ li $a0, 32
/* 065940 80064D40 0C01C327 */ jal allocate_from_main_pool_safe
/* 065944 80064D44 02A02825 */ move $a1, $s5
/* 065948 80064D48 8E190024 */ lw $t9, 0x24($s0)
/* 06594C 80064D4C 00000000 */ nop
/* 065950 80064D50 AF220014 */ sw $v0, 0x14($t9)
/* 065954 80064D54 8E080024 */ lw $t0, 0x24($s0)
/* 065958 80064D58 00000000 */ nop
/* 06595C 80064D5C E51A0020 */ swc1 $f26, 0x20($t0)
/* 065960 80064D60 8E090024 */ lw $t1, 0x24($s0)
/* 065964 80064D64 10000005 */ b .L80064D7C
/* 065968 80064D68 AD370024 */ sw $s7, 0x24($t1)
.L80064D6C:
/* 06596C 80064D6C 25510002 */ addiu $s1, $t2, 2
/* 065970 80064D70 322BFFFF */ andi $t3, $s1, 0xffff
/* 065974 80064D74 AE000024 */ sw $zero, 0x24($s0)
/* 065978 80064D78 01608825 */ move $s1, $t3
.L80064D7C:
/* 06597C 80064D7C 00116080 */ sll $t4, $s1, 2
/* 065980 80064D80 026C9021 */ addu $s2, $s3, $t4
/* 065984 80064D84 8E4D0000 */ lw $t5, ($s2)
/* 065988 80064D88 24040030 */ li $a0, 48
/* 06598C 80064D8C 11A00013 */ beqz $t5, .L80064DDC
/* 065990 80064D90 00000000 */ nop
/* 065994 80064D94 0C01C327 */ jal allocate_from_main_pool_safe
/* 065998 80064D98 02A02825 */ move $a1, $s5
/* 06599C 80064D9C AE020020 */ sw $v0, 0x20($s0)
/* 0659A0 80064DA0 24040008 */ li $a0, 8
/* 0659A4 80064DA4 0C01C327 */ jal allocate_from_main_pool_safe
/* 0659A8 80064DA8 02A02825 */ move $a1, $s5
/* 0659AC 80064DAC 8E0E0020 */ lw $t6, 0x20($s0)
/* 0659B0 80064DB0 26310001 */ addiu $s1, $s1, 1
/* 0659B4 80064DB4 ADC20028 */ sw $v0, 0x28($t6)
/* 0659B8 80064DB8 8E180020 */ lw $t8, 0x20($s0)
/* 0659BC 80064DBC 8E4F0000 */ lw $t7, ($s2)
/* 0659C0 80064DC0 3239FFFF */ andi $t9, $s1, 0xffff
/* 0659C4 80064DC4 A70F0000 */ sh $t7, ($t8)
/* 0659C8 80064DC8 8E040020 */ lw $a0, 0x20($s0)
/* 0659CC 80064DCC 0C019254 */ jal init_lpfilter
/* 0659D0 80064DD0 03208825 */ move $s1, $t9
/* 0659D4 80064DD4 10000006 */ b .L80064DF0
/* 0659D8 80064DD8 92CA0024 */ lbu $t2, 0x24($s6)
.L80064DDC:
/* 0659DC 80064DDC 26310001 */ addiu $s1, $s1, 1
/* 0659E0 80064DE0 3228FFFF */ andi $t0, $s1, 0xffff
/* 0659E4 80064DE4 AE000020 */ sw $zero, 0x20($s0)
/* 0659E8 80064DE8 01008825 */ move $s1, $t0
/* 0659EC 80064DEC 92CA0024 */ lbu $t2, 0x24($s6)
.L80064DF0:
/* 0659F0 80064DF0 26940001 */ addiu $s4, $s4, 1
/* 0659F4 80064DF4 3289FFFF */ andi $t1, $s4, 0xffff
/* 0659F8 80064DF8 012A082A */ slt $at, $t1, $t2
/* 0659FC 80064DFC 1420FF79 */ bnez $at, .L80064BE4
/* 065A00 80064E00 0120A025 */ move $s4, $t1
.L80064E04:
/* 065A04 80064E04 8FBF005C */ lw $ra, 0x5c($sp)
/* 065A08 80064E08 C7B50018 */ lwc1 $f21, 0x18($sp)
/* 065A0C 80064E0C C7B4001C */ lwc1 $f20, 0x1c($sp)
/* 065A10 80064E10 C7B70020 */ lwc1 $f23, 0x20($sp)
/* 065A14 80064E14 C7B60024 */ lwc1 $f22, 0x24($sp)
/* 065A18 80064E18 C7B90028 */ lwc1 $f25, 0x28($sp)
/* 065A1C 80064E1C C7B8002C */ lwc1 $f24, 0x2c($sp)
/* 065A20 80064E20 C7BB0030 */ lwc1 $f27, 0x30($sp)
/* 065A24 80064E24 C7BA0034 */ lwc1 $f26, 0x34($sp)
/* 065A28 80064E28 8FB00038 */ lw $s0, 0x38($sp)
/* 065A2C 80064E2C 8FB1003C */ lw $s1, 0x3c($sp)
/* 065A30 80064E30 8FB20040 */ lw $s2, 0x40($sp)
/* 065A34 80064E34 8FB30044 */ lw $s3, 0x44($sp)
/* 065A38 80064E38 8FB40048 */ lw $s4, 0x48($sp)
/* 065A3C 80064E3C 8FB5004C */ lw $s5, 0x4c($sp)
/* 065A40 80064E40 8FB60050 */ lw $s6, 0x50($sp)
/* 065A44 80064E44 8FB70054 */ lw $s7, 0x54($sp)
/* 065A48 80064E48 8FBE0058 */ lw $fp, 0x58($sp)
/* 065A4C 80064E4C 03E00008 */ jr $ra
/* 065A50 80064E50 27BD0060 */ addiu $sp, $sp, 0x60
@@ -1,4 +1,4 @@
glabel alLoadPull
glabel alAdpcmPull
/* 0CC7EC 800CBBEC 27BDFF50 */ addiu $sp, $sp, -0xb0
/* 0CC7F0 800CBBF0 AFB70044 */ sw $s7, 0x44($sp)
/* 0CC7F4 800CBBF4 AFA700BC */ sw $a3, 0xbc($sp)
@@ -17,7 +17,7 @@ glabel jpt_800E95B0
.word L800CA870, L800CA8C4, L800CA8C4, L800CA8C4, L800CA8C4, L800CA8C4, L800CA8C4, L800CA8C4, L800CA8C4, L800CA8C4, L800CA8C4, L800CA460, L800CA460, L800CA22C, L800CA7A8, L800CA828, L800CA460
.text
glabel alEnvMixerPull
glabel alEnvmixerPull
/* 0CACD0 800CA0D0 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 0CACD4 800CA0D4 AFBF001C */ sw $ra, 0x1c($sp)
/* 0CACD8 800CA0D8 AFA40060 */ sw $a0, 0x60($sp)
@@ -10,7 +10,7 @@ glabel alLoadParam
/* 0CC160 800CB560 AC860028 */ sw $a2, 0x28($a0)
/* 0CC164 800CB564 8CCE0000 */ lw $t6, ($a2)
/* 0CC168 800CB568 AC800038 */ sw $zero, 0x38($a0)
/* 0CC16C 800CB56C 3C0F800D */ lui $t7, %hi(alLoadPull) # $t7, 0x800d
/* 0CC16C 800CB56C 3C0F800D */ lui $t7, %hi(alAdpcmPull) # $t7, 0x800d
/* 0CC170 800CB570 AC8E0044 */ sw $t6, 0x44($a0)
/* 0CC174 800CB574 90C20008 */ lbu $v0, 8($a2)
/* 0CC178 800CB578 50400007 */ beql $v0, $zero, .L800CB598
@@ -22,7 +22,7 @@ glabel alLoadParam
/* 0CC190 800CB590 8FBF0014 */ lw $ra, 0x14($sp)
/* 0CC194 800CB594 8CE20028 */ lw $v0, 0x28($a3)
.L800CB598:
/* 0CC198 800CB598 25EFBBEC */ addiu $t7, %lo(alLoadPull) # addiu $t7, $t7, -0x4414
/* 0CC198 800CB598 25EFBBEC */ addiu $t7, %lo(alAdpcmPull) # addiu $t7, $t7, -0x4414
/* 0CC19C 800CB59C ACEF0004 */ sw $t7, 4($a3)
/* 0CC1A0 800CB5A0 8C580004 */ lw $t8, 4($v0)
/* 0CC1A4 800CB5A4 24050009 */ li $a1, 9
+2 -2
View File
@@ -41,8 +41,8 @@ GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/func_800CB2D4.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/func_800CB498.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/alLoadParam.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/alRaw16Pull.s")
//Called by alLoadPull
//Called by alAdpcmPull. _decodeChunk?
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/func_800CBAC0.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/alLoadPull.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/alAdpcmPull.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/alResampleParam.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/alResamplePull.s")
+1 -1
View File
@@ -3,7 +3,7 @@
#include "macros.h"
#include <stdlib.h>
#ifdef NON_MATCHING
#ifdef NON_EQUIVALENT
//This needs to be compiled with mips3, which isn't yet supported
ldiv_t ldiv(long num, long denom)
{
+156 -42
View File
@@ -1,10 +1,31 @@
/* The comment below is needed for this file to be picked up by generate_ld */
/* RAM_POS: 0x80064950 */
/*====================================================================
* drvrNew.c
*
* 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.
*====================================================================*/
#include "types.h"
#include "macros.h"
#include "libultra_internal.h"
#include "audio_internal.h"
#include "audio.h"
#include "src/memory.h"
/*
* WARNING: THE FOLLOWING CONSTANT MUST BE KEPT IN SYNC
@@ -18,7 +39,8 @@
*/
#define ms *(((s32)((f32)44.1))&~0x7)
s32 SMALLROOM_PARAMS[26] = {
static s32 SMALLROOM_PARAMS[26] = {
/* sections length */
3, 100 ms,
/* chorus chorus filter
@@ -28,7 +50,7 @@ s32 SMALLROOM_PARAMS[26] = {
0, 60 ms, 5000, 0, 0, 0, 0, 0x5000
};
s32 BIGROOM_PARAMS[34] = {
static s32 BIGROOM_PARAMS[34] = {
/* sections length */
4, 100 ms,
/* chorus chorus filter
@@ -39,7 +61,7 @@ s32 BIGROOM_PARAMS[34] = {
0, 94 ms, 8000, 0, 0, 0, 0, 0x5000
};
s32 ECHO_PARAMS[10] = {
static s32 ECHO_PARAMS[10] = {
/* sections length */
1, 200 ms,
/* chorus chorus filter
@@ -47,7 +69,7 @@ s32 ECHO_PARAMS[10] = {
0, 179 ms, 12000, 0, 0x7fff, 0, 0, 0
};
s32 CHORUS_PARAMS[10] = {
static s32 CHORUS_PARAMS[10] = {
/* sections length */
1, 20 ms,
/* chorus chorus filter
@@ -55,7 +77,7 @@ s32 CHORUS_PARAMS[10] = {
0, 5 ms, 0x4000, 0, 0x7fff, 7600, 700, 0
};
s32 FLANGE_PARAMS[10] = {
static s32 FLANGE_PARAMS[10] = {
/* sections length */
1, 20 ms,
/* chorus chorus filter
@@ -63,26 +85,13 @@ s32 FLANGE_PARAMS[10] = {
0, 5 ms, 0, 0x5fff, 0x7fff, 380, 500, 0
};
s32 NULL_PARAMS[10] = {
static s32 NULL_PARAMS[10] = {
0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
extern s32 alAuxBusPull;
extern s32 alAuxBusParam;
extern s32 alEnvMixerPull;
extern s32 alEnvmixerParam;
extern s32 alLoadParam;
extern s32 alLoadPull;
extern s32 alResampleParam;
extern s32 alResamplePull;
extern s32 alMainBusParam;
extern s32 alMainBusPull;
extern s32 alSaveParam;
extern s32 alSavePull;
void init_lpfilter(ALLowPass *lp)
{
void init_lpfilter(ALLowPass *lp) {
s32 i, temp;
s16 fc;
f64 ffc, fcoef;
@@ -104,11 +113,86 @@ void init_lpfilter(ALLowPass *lp)
}
}
GLOBAL_ASM("lib/asm/non_matchings/alFxNew/alFxNew.s")
//This function differs from libreultra's, but still mostly the same
void alFxNew(ALFx *r, ALSynConfig *c, s16 bus, UNUSED ALHeap *hp) {
u16 i, j, k;
s32 *param = 0;
ALFilter *f = (ALFilter *) r;
ALDelay *d;
alFilterNew(f, 0, alFxParam, AL_FX);
f->handler = alFxPull;
r->paramHdl = (ALSetFXParam)alFxParamHdl;
switch (c->fxType[bus]) {
case AL_FX_SMALLROOM: param = SMALLROOM_PARAMS; break;
case AL_FX_BIGROOM: param = BIGROOM_PARAMS; break;
case AL_FX_ECHO: param = ECHO_PARAMS; break;
case AL_FX_CHORUS: param = CHORUS_PARAMS; break;
case AL_FX_FLANGE: param = FLANGE_PARAMS; break;
case AL_FX_CUSTOM: param = (&c->params)[bus]; break;
default: param = NULL_PARAMS; break;
}
j = 0;
r->section_count = param[j++];
r->length = param[j++];
r->delay = allocate_from_main_pool_safe(sizeof(ALDelay) * r->section_count, COLOR_TAG_CYAN);
r->base = allocate_from_main_pool_safe(sizeof(s16) * r->length, COLOR_TAG_CYAN);
r->input = r->base;
for ( k=0; k < r->length; k++)
r->base[k] = 0;
for ( i=0; i<r->section_count; i++ ) {
d = &r->delay[i];
d->input = param[j++];
d->output = param[j++];
d->fbcoef = param[j++];
d->ffcoef = param[j++];
d->gain = param[j++];
if (param[j]) {
#define RANGE 2.0
//d->rsinc = ((f32) param[j++])/0xffffff;
d->rsinc = ((((f32)param[j++])/1000) * RANGE)/c->outputRate;
/*
* the following constant is derived from:
*
* ratio = 2^(cents/1200)
*
* and therefore for hundredths of a cent
* x
* ln(ratio) = ---------------
* (120,000)/ln(2)
* where
* 120,000/ln(2) = 173123.40...
*/
#define CONVERT 173123.404906676
#define LENGTH (d->output - d->input)
d->rsgain = (((f32) param[j++])/CONVERT) * LENGTH;
d->rsval = 1.0;
d->rsdelta = 0.0;
d->rs = allocate_from_main_pool_safe(sizeof(ALResampler), COLOR_TAG_CYAN);
d->rs->state = allocate_from_main_pool_safe(sizeof(RESAMPLE_STATE), COLOR_TAG_CYAN);
d->rs->delta = 0.0;
d->rs->first = 1;
} else {
d->rs = 0;
j++;
j++;
}
if (param[j]) {
d->lp = allocate_from_main_pool_safe(sizeof(ALLowPass), COLOR_TAG_CYAN);
d->lp->fstate = allocate_from_main_pool_safe(sizeof(POLEF_STATE), COLOR_TAG_CYAN);
d->lp->fc = param[j++];
init_lpfilter(d->lp);
} else {
d->lp = 0;
j++;
}
}
}
void alEnvmixerNew(ALEnvMixer *e, ALHeap *hp) {
alFilterNew((ALFilter *) e, alEnvmixerPull, alEnvmixerParam, AL_ENVMIX);
e->state = alHeapAlloc(hp, 1, sizeof(ENVMIX_STATE));
void alEnvmixerNew(ALEnvMixer *e, s32 arg1) {
alFilterNew(e, &alEnvMixerPull, &alEnvmixerParam, 4);
e->state = alHeapDBAlloc(0, 0, arg1, 1, 0x50);
e->first = 1;
e->motion = AL_STOPPED;
e->volume = 1;
@@ -120,6 +204,8 @@ void alEnvmixerNew(ALEnvMixer *e, s32 arg1) {
e->wetamt = 0;
e->lratm = 1;
e->lratl = 0;
e->lratm = 1;
e->lratl = 0;
e->delta = 0;
e->segEnd = 0;
e->pan = 0;
@@ -128,44 +214,72 @@ void alEnvmixerNew(ALEnvMixer *e, s32 arg1) {
e->sources = 0;
}
void alLoadNew(ALLoadFilter *arg0, s32 (*arg1)(s32*), s32 arg2) {
alFilterNew(arg0, &alLoadPull, &alLoadParam, 0);
arg0->state = alHeapDBAlloc(0, 0, arg2, 1, 0x20);
arg0->lstate = alHeapDBAlloc(0, 0, arg2, 1, 0x20);
arg0->dma = arg1(&arg0->dmaState);
arg0->lastsam = 0;
arg0->first = 1;
arg0->memin = 0;
void alLoadNew(ALLoadFilter *f, ALDMANew dmaNew, ALHeap *hp) {
UNUSED s32 i;
/*
* init filter superclass
*/
alFilterNew((ALFilter *) f, alAdpcmPull, alLoadParam, AL_ADPCM);
f->state = alHeapAlloc(hp, 1, sizeof(ADPCM_STATE));
f->lstate = alHeapAlloc(hp, 1, sizeof(ADPCM_STATE));
f->dma = dmaNew(&f->dmaState);
/*
* init the adpcm state
*/
f->lastsam = 0;
f->first = 1;
f->memin = 0;
}
void alResampleNew(ALResampler *r, ALHeap *hp) {
alFilterNew(r, &alResamplePull, &alResampleParam, 1);
r->state = alHeapDBAlloc(0, 0, hp, 1, 0x20);
r->first = 1;
alFilterNew((ALFilter *) r, alResamplePull, alResampleParam, AL_RESAMPLE);
/*
* Init resampler state
*/
r->state = alHeapAlloc(hp, 1, sizeof(RESAMPLE_STATE));
r->delta = 0.0;
r->first = 1;
r->motion = AL_STOPPED;
r->ratio = 1.0;
r->upitch = 0;
r->ctrlList = 0;
r->ctrlTail = 0;
r->delta = 0.0f;
r->ratio = 1.0f;
/* state in the ucode is initialized by the A_INIT flag */
}
void alAuxBusNew(ALAuxBus *m, void *sources, s32 maxSources) {
alFilterNew(m, &alAuxBusPull, &alAuxBusParam, 6);
alFilterNew((ALFilter *) m, alAuxBusPull, alAuxBusParam, AL_AUXBUS);
m->sourceCount = 0;
m->maxSources = maxSources;
m->sources = sources;
m->sources = (ALFilter **)sources;
}
void alMainBusNew(ALMainBus *m, void *sources, s32 maxSources) {
alFilterNew(m, &alMainBusPull, &alMainBusParam, 7);
alFilterNew((ALFilter *) m, alMainBusPull, alMainBusParam, AL_MAINBUS);
m->sourceCount = 0;
m->maxSources = maxSources;
m->sources = sources;
m->sources = (ALFilter **)sources;
}
void alSaveNew(ALSave *f) {
alFilterNew(f, &alSavePull, &alSaveParam, AL_SAVE);
/*
* init filter superclass
*/
alFilterNew((ALFilter *) f, alSavePull, alSaveParam, AL_SAVE);
/*
* init the save state, which is a virtual dram address
*/
f->dramout = 0;
f->first = 1;
}
+2 -5
View File
@@ -5,14 +5,11 @@
#include "macros.h"
#include "audio_internal.h"
#ifdef NON_MATCHING
void alFxNew(ALFx *r, ALSynConfig *c, s16 bus);
s32 alFxParam(void *filter, s32 paramID, void *param);
s32 alMainBusParam(void *filter, s32 paramID, void *param);
#ifdef NON_EQUIVALENT
// This is very close to matching.
ALFxRef *alSynAllocFX(ALSynth *s, s16 bus, ALSynConfig *c, ALHeap *hp)
{
alFxNew(s->auxBus[bus].fx, c, bus);
alFxNew(s->auxBus[bus].fx, c, bus, hp);
alFxParam(s->auxBus[bus].fx, AL_FILTER_SET_SOURCE,
&s->auxBus[bus]);
alMainBusParam(s->mainBus, AL_FILTER_ADD_SOURCE, s->auxBus[bus].fx);
+1 -1
View File
@@ -5,7 +5,7 @@
#include "audio_internal.h"
#include "macros.h"
#ifdef NON_MATCHING
#ifdef NON_EQUIVALENT
s32 __nextSampleTime(ALSynth *drvr, ALPlayer **client);
s32 _timeToSamplesNoRound(ALSynth *ALSynth, s32 micros);

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