Compare commits
9 Commits
fd11813208
...
latest
| Author | SHA1 | Date | |
|---|---|---|---|
| 40bee0f224 | |||
| ede2099ff5 | |||
| b096207a10 | |||
| d6bafb4403 | |||
| a499b4f032 | |||
| bd3dd8f523 | |||
| d3ea4e5e99 | |||
| 4328104536 | |||
| aa092bebfe |
@@ -1,6 +1,6 @@
|
||||
name: Build libsm64
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
@@ -13,8 +13,6 @@ jobs:
|
||||
os: ubuntu-latest
|
||||
- identifier: windows
|
||||
os: ubuntu-latest
|
||||
- identifier: macos
|
||||
os: macos-latest
|
||||
- identifier: web
|
||||
os: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -27,9 +25,13 @@ jobs:
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: (Windows) Set up MinGW
|
||||
- name: (Windows) Install MinGW
|
||||
if: ${{ startsWith(matrix.identifier, 'windows') }}
|
||||
uses: egor-tensin/setup-mingw@v2
|
||||
run: |
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install -y mingw-w64
|
||||
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
|
||||
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
|
||||
|
||||
- name: (Windows) Prepare cross compilation
|
||||
if: ${{ startsWith(matrix.identifier, 'windows') }}
|
||||
@@ -42,16 +44,21 @@ jobs:
|
||||
run: |
|
||||
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install libsdl2-dev libglew-dev
|
||||
sudo apt-get install -y libsdl2-dev libglew-dev
|
||||
|
||||
- name: (Web) Set up Emscripten
|
||||
if: ${{ startsWith(matrix.identifier, 'web') }}
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
|
||||
- name: Build shared library
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "${{ matrix.identifier }}" == "web" ]]; then
|
||||
emmake make lib -j $(nproc) CC=emcc
|
||||
elif [[ "${{ matrix.identifier }}" == "windows" ]]; then
|
||||
make lib -j $(nproc 2>/dev/null || sysctl -n hw.ncpu) \
|
||||
CC=x86_64-w64-mingw32-gcc \
|
||||
CXX=x86_64-w64-mingw32-g++
|
||||
else
|
||||
make lib -j $(nproc 2>/dev/null || sysctl -n hw.ncpu)
|
||||
fi
|
||||
@@ -62,7 +69,7 @@ jobs:
|
||||
make test -j`nproc`
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: libsm64_${{ matrix.identifier }}
|
||||
path: |
|
||||
|
||||
Generated
+10
@@ -0,0 +1,10 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Ignored default folder with query files
|
||||
/queries/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
+5
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
Generated
+393
@@ -0,0 +1,393 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefinitionsOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppModulePartitionWithSeveralPartitionUnits/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOverrideWithDifferentVisibility/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppCodeStyle/BracesInForStatement/@EntryValue" value="Required" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppCodeStyle/BracesInIfStatement/@EntryValue" value="Required" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppCodeStyle/BracesInWhileStatement/@EntryValue" value="Required" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppCodeStyle/UseAutoCommonCase/@EntryValue" value="Never" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALLOW_COMMENT_AFTER_LBRACE/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="NEXT_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FUNCTION_DECLARATION_RETURN_TYPE_STYLE/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FUNCTION_DEFINITION_RETURN_TYPE_STYLE/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_PREPROCESSOR_DIRECTIVES/@EntryValue" value="Normal" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_EXISTING_ENUM_ARRANGEMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LABELED_STATEMENT_STYLE/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_DEREF_IN_TRAILING_RETURN_TYPES/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_INIT_STATEMENT/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_BEFORE_DEREF_IN_TRAILING_RETURN_TYPES/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_BEFORE_FUNCTION_TRY_BLOCK/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_BEFORE_REQUIRES_CLAUSE/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINKAGE_SPECIFICATION_BRACES/@EntryValue" value="NEXT_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINKAGE_SPECIFICATION_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_CASE_STATEMENT_STYLE/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TOPLEVEL_FUNCTION_DECLARATION_RETURN_TYPE_STYLE/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TOPLEVEL_FUNCTION_DEFINITION_RETURN_TYPE_STYLE/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ENUMERATION_STYLE/@EntryValue" value="CHOP_ALWAYS" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_LINES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=05D45346A5B5B54F93A9F94C46B14079/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=05D45346A5B5B54F93A9F94C46B14079/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0AFB7787612DF743B09AD9412E48D4CC/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0AFB7787612DF743B09AD9412E48D4CC/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0B82708A1BA7774EB13D27F245698A56/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0B82708A1BA7774EB13D27F245698A56/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=0CBD9263BD435842828596291C4FE4B4/@EntryIndexedValue" value="<NamingElement Priority="2" Title="Fields"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="struct field" /><type Name="union member" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1350D079A82E0740947E85445B5AF47C/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1350D079A82E0740947E85445B5AF47C/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=18392FF80FA40749AA8CC53981A32AE0/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=18392FF80FA40749AA8CC53981A32AE0/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1CBDD658AEE8EA4382EE1F914B5B3314/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=1CBDD658AEE8EA4382EE1F914B5B3314/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2229A2BE1AA9214483A51F028530E042/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2229A2BE1AA9214483A51F028530E042/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2AD8EC23F81C6F4AB06852FBF796A3D1/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2AD8EC23F81C6F4AB06852FBF796A3D1/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2B232F1067F0324F8FF4B9D63ACECDB2/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=2B232F1067F0324F8FF4B9D63ACECDB2/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=4203BE6F332C5149B409B4D5F7197E54/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=4203BE6F332C5149B409B4D5F7197E54/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=4F91A7364D7B63479FCEA1D063EAEA19/@EntryIndexedValue" value="<NamingElement Priority="13" Title="Non-Type Template Parameters"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="non-type template parameter" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=5653BA7B6222F349B94149A2A53C35B8/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=5653BA7B6222F349B94149A2A53C35B8/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=6513EEED32DF014BB4F3706393117465/@EntryIndexedValue" value="<NamingElement Priority="8" Title="Enumerators"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="scoped enumerator" /><type Name="unscoped enumerator" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=72514D5DF422D442B71A277F97B72887/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=72514D5DF422D442B71A277F97B72887/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=821F3C5CF47D5640AD3511BCBADE17C4/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=821F3C5CF47D5640AD3511BCBADE17C4/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=8B1F7EC98488B349961668DA5758DC54/@EntryIndexedValue" value="<NamingElement Priority="5" Title="Functions"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global function" /><type Name="member function" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=8F69F48E2532F54CBAA0039D4557825E/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=8F69F48E2532F54CBAA0039D4557825E/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=97F66D4C2F93FF418F4AE9D29638A2F8/@EntryIndexedValue" value="<NamingElement Priority="9" Title="Namespaces"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="namespace" /><type Name="namespace alias" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9E4D28CA929F6B4AB5F6F3FEB9E69A47/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=9E4D28CA929F6B4AB5F6F3FEB9E69A47/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A229B5AAD2B3D44A9E9AFBB9F61DEEB3/@EntryIndexedValue" value="<NamingElement Priority="11" Title="Properties"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="property" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A42D627FA43B054F91D1E1C4281D8896/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A42D627FA43B054F91D1E1C4281D8896/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A4FAA2257682A94F8C2C93E123FAFC7A/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A4FAA2257682A94F8C2C93E123FAFC7A/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A7EBF16DA3BDCB42A0B710704BC8A053/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A7EBF16DA3BDCB42A0B710704BC8A053/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=A87CB78D825AFA439AD708500DC7732B/@EntryIndexedValue" value="<NamingElement Priority="4" Title="Parameters"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="function parameter" /><type Name="lambda parameter" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B28E74445B5ADE46BB06B8B2E7AF0B10/@EntryIndexedValue" value="<NamingElement Priority="3" Title="Variables"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /><type Name="lambda" /><type Name="local variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B6E900853D6D05429D8C57765B2E546A/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B6E900853D6D05429D8C57765B2E546A/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B82A063F0DDD98498A70D8D7EBB97F8D/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=B82A063F0DDD98498A70D8D7EBB97F8D/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BBE8AA08E662BF409B2CB08EC597C493/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BBE8AA08E662BF409B2CB08EC597C493/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BF0D1AE66D64FE4FAF613448A12051A0/@EntryIndexRemoved" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=BF0D1AE66D64FE4FAF613448A12051A0/@EntryIndexedValue" value="" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=C0DE3DAEDDF0744889F41BE5BEA903AC/@EntryIndexedValue" value="<NamingElement Priority="1" Title="Types"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="__interface" /><type Name="class" /><type Name="concept" /><type Name="enum" /><type Name="struct" /><type Name="type alias" /><type Name="type template parameter" /><type Name="typedef" /><type Name="union" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=C2FB8C7FF23D70478D17C7DAF4AC9E4D/@EntryIndexedValue" value="<NamingElement Priority="12" Title="Events"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="event" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=DA7983C3DEA2E84CA44F3B120F90B3CC/@EntryIndexedValue" value="<NamingElement Priority="10" Title="Macros"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="macro" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AA_BB" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=FAAD8F52D9EFD84E8894C7AAE4F72FCA/@EntryIndexedValue" value="<NamingElement Priority="7" Title="Global constants"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="True" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AA_BB" /></NamingElement>" type="string" />
|
||||
<option name="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=FBDB26623C05204BA0FA28B9017D7101/@EntryIndexedValue" value="<NamingElement Priority="6" Title="Other constants"><Descriptor Static="True" Constexpr="Indeterminate" Const="True" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="local variable" /><type Name="struct field" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AA_BB" /></NamingElement>" type="string" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+4
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="ClangTidy" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="clangTidyChecks" value="-*,bugprone-argument-comment,bugprone-assert-side-effect,bugprone-bad-signal-to-kill-thread,bugprone-branch-clone,bugprone-copy-constructor-init,bugprone-dangling-handle,bugprone-dynamic-static-initializers,bugprone-fold-init-type,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-inaccurate-erase,bugprone-incorrect-roundings,bugprone-integer-division,bugprone-lambda-function-name,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-misplaced-operator-in-strlen-in-alloc,bugprone-misplaced-pointer-arithmetic-in-alloc,bugprone-misplaced-widening-cast,bugprone-move-forwarding-reference,bugprone-multiple-statement-macro,bugprone-no-escape,bugprone-parent-virtual-call,bugprone-posix-return,bugprone-reserved-identifier,bugprone-sizeof-container,bugprone-sizeof-expression,bugprone-spuriously-wake-up-functions,bugprone-string-constructor,bugprone-string-integer-assignment,bugprone-string-literal-with-embedded-nul,bugprone-suspicious-enum-usage,bugprone-suspicious-include,bugprone-suspicious-memset-usage,bugprone-suspicious-missing-comma,bugprone-suspicious-semicolon,bugprone-suspicious-string-compare,bugprone-suspicious-memory-comparison,bugprone-suspicious-realloc-usage,bugprone-swapped-arguments,bugprone-terminating-continue,bugprone-throw-keyword-missing,bugprone-too-small-loop-variable,bugprone-undefined-memory-manipulation,bugprone-undelegated-constructor,bugprone-unhandled-self-assignment,bugprone-unused-raii,bugprone-unused-return-value,bugprone-use-after-move,bugprone-virtual-near-miss,cert-dcl21-cpp,cert-dcl58-cpp,cert-err34-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,cert-msc50-cpp,cert-msc51-cpp,cert-str34-c,cppcoreguidelines-interfaces-global-init,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-pro-type-member-init,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-default-arguments,google-runtime-operator,hicpp-exception-baseclass,hicpp-multiway-paths-covered,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,misc-uniqueptr-reset-release,modernize-avoid-bind,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-disallow-copy-and-assign-macro,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nodiscard,modernize-use-noexcept,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,mpi-buffer-deref,mpi-type-mismatch,openmp-use-default-none,performance-faster-string-find,performance-for-range-copy,performance-implicit-conversion-in-loop,performance-inefficient-algorithm,performance-inefficient-string-concatenation,performance-inefficient-vector-operation,performance-move-const-arg,performance-move-constructor-init,performance-no-automatic-move,performance-noexcept-move-constructor,performance-trivially-destructible,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,portability-simd-intrinsics,readability-avoid-const-params-in-decls,readability-const-return-type,readability-container-size-empty,readability-convert-member-functions-to-static,readability-delete-null-pointer,readability-deleted-default,readability-inconsistent-declaration-parameter-name,readability-make-member-function-const,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-use-anyofallof" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="CppCStyleCast" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
Generated
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MakefileSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<MakefileProjectSettings>
|
||||
<option name="buildTarget" value="run" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="version" value="2" />
|
||||
</MakefileProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="MakefileWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
+71
-71
@@ -38,84 +38,84 @@ terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
|
||||
@@ -15,14 +15,14 @@ else
|
||||
CXX := c++
|
||||
LDFLAGS := -lm -shared
|
||||
endif
|
||||
CFLAGS := -fno-strict-aliasing -g -Wall -Wno-unused-function -fPIC -fvisibility=hidden -DSM64_LIB_EXPORT -DGBI_FLOATS -DVERSION_US -DNO_SEGMENTED_MEMORY
|
||||
CFLAGS := -fno-strict-aliasing -g -Wall -Wno-unused-function -fPIC -fvisibility=hidden -DSM64_LIB_EXPORT -DGBI_FLOATS -DVERSION_US -DENABLE_RUMBLE -DNO_SEGMENTED_MEMORY
|
||||
|
||||
SRC_DIRS := src src/decomp src/decomp/engine src/decomp/include/PR src/decomp/game src/decomp/pc src/decomp/pc/audio src/decomp/mario src/decomp/tools src/decomp/audio
|
||||
BUILD_DIR := build
|
||||
DIST_DIR := dist
|
||||
ALL_DIRS := $(addprefix $(BUILD_DIR)/,$(SRC_DIRS))
|
||||
|
||||
LIB_FILE := $(DIST_DIR)/libsm64.so
|
||||
LIB_FILE := $(DIST_DIR)/sm64.so
|
||||
LIB_H_FILE := $(DIST_DIR)/include/libsm64.h
|
||||
TEST_FILE := run-test
|
||||
|
||||
@@ -40,18 +40,25 @@ else
|
||||
DEP_FILES := $(O_FILES:.o=.d)
|
||||
endif
|
||||
|
||||
TEST_SRCS_C := test/context.c test/level.c test/gl33core/gl33core_renderer.c test/gl20/gl20_renderer.c
|
||||
TEST_SRCS_CPP := test/main.cpp test/audio.cpp
|
||||
TEST_SRCS_C := test/level.c test/gl33core/gl33core_renderer.c test/gl20/gl20_renderer.c
|
||||
TEST_SRCS_CPP := test/main.cpp test/audio.cpp test/context.cpp \
|
||||
test/imgui/imgui.cpp \
|
||||
test/imgui/imgui_demo.cpp \
|
||||
test/imgui/imgui_draw.cpp \
|
||||
test/imgui/imgui_tables.cpp \
|
||||
test/imgui/imgui_widgets.cpp \
|
||||
test/imgui/backends/imgui_impl_sdl2.cpp \
|
||||
test/imgui/backends/imgui_impl_opengl3.cpp
|
||||
TEST_OBJS := $(foreach file,$(TEST_SRCS_C),$(BUILD_DIR)/$(file:.c=.o)) $(foreach file,$(TEST_SRCS_CPP),$(BUILD_DIR)/$(file:.cpp=.o))
|
||||
|
||||
ifdef WINDOWS_BUILD
|
||||
LIB_FILE := $(DIST_DIR)/sm64.dll
|
||||
TEST_FILE := $(DIST_DIR)/run-test.exe
|
||||
else ifdef MACOS_BUILD
|
||||
LIB_FILE := $(DIST_DIR)/libsm64.dylib
|
||||
LIB_FILE := $(DIST_DIR)/sm64.dylib
|
||||
endif
|
||||
|
||||
DUMMY := $(shell mkdir -p $(ALL_DIRS) build/test build/test/gl33core build/test/gl20 src/decomp/mario $(DIST_DIR)/include)
|
||||
DUMMY := $(shell mkdir -p $(ALL_DIRS) build/test build/test/gl33core build/test/gl20 build/test/imgui build/test/imgui/backends src/decomp/mario $(DIST_DIR)/include)
|
||||
|
||||
$(filter-out src/decomp/mario/geo.inc.c,$(IMPORTED)): src/decomp/mario/geo.inc.c
|
||||
src/decomp/mario/geo.inc.c: ./import-mario-geo.py
|
||||
@@ -88,21 +95,22 @@ test/level.c: ./import-test-collision.py
|
||||
|
||||
test/main.cpp test/gl20/gl20_renderer.c test/gl33core/gl33core_renderer.c: test/level.c
|
||||
|
||||
SDL2_RAW_CFLAGS := $(shell sdl2-config --cflags)
|
||||
SDL2_CFLAGS := $(filter-out -Dmain=SDL_main,$(SDL2_RAW_CFLAGS))
|
||||
|
||||
$(BUILD_DIR)/test/%.o: test/%.c
|
||||
@$(CC) $(CFLAGS) -MM -MP -MT $@ -MF $(BUILD_DIR)/test/$*.d $<
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
$(CC) -c $(CFLAGS) $(SDL2_CFLAGS) -I src/decomp/include -o $@ $<
|
||||
|
||||
$(BUILD_DIR)/test/%.o: test/%.cpp
|
||||
@$(CXX) $(CFLAGS) -MM -MP -MT $@ -MF $(BUILD_DIR)/test/$*.d $<
|
||||
$(CXX) -c $(CFLAGS) -o $@ $<
|
||||
$(CXX) -c $(CFLAGS) $(SDL2_CFLAGS) -I src/decomp/include -std=c++17 -o $@ $<
|
||||
|
||||
$(TEST_FILE): $(LIB_FILE) $(TEST_OBJS)
|
||||
ifdef WINDOWS_BUILD
|
||||
$(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -lglew32 -lopengl32 -lSDL2 -lSDL2main -lm
|
||||
$(CXX) -o $@ $(TEST_OBJS) $(LIB_FILE) -lglew32 -lopengl32 -lSDL2 -lm
|
||||
else ifdef MACOS_BUILD
|
||||
$(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -framework OpenGL -lGLEW -lSDL2 -lSDL2main -lm -lpthread
|
||||
$(CXX) -o $@ $(TEST_OBJS) $(LIB_FILE) -framework OpenGL -lGLEW -lSDL2 -lSDL2main -lm -lpthread
|
||||
else
|
||||
$(CC) -o $@ $(TEST_OBJS) $(LIB_FILE) -lGLEW -lGL -lSDL2 -lSDL2main -lm -lpthread
|
||||
$(CXX) -o $@ $(TEST_OBJS) $(LIB_FILE) -lGLEW -lGL $(shell sdl2-config --libs) -lm -lpthread
|
||||
endif
|
||||
|
||||
lib: $(LIB_FILE) $(LIB_H_FILE)
|
||||
|
||||
@@ -31,10 +31,11 @@ project under the `test` directory as well, demonstrating usage of the library.
|
||||
- To run the test program you'll need a SM64 US ROM in the root of the repository with the name `baserom.us.z64`.
|
||||
|
||||
## Building on Windows
|
||||
|
||||
- [Follow steps 1-4 for setting up MSYS2 MinGW 64 here](https://github.com/sm64-port/sm64-port#windows), but replace the repository URL with `https://github.com/libsm64/libsm64.git`
|
||||
- Ensure the SDL2 and GLEW libraries are installed if you're building the test program.
|
||||
- 64 bits: `pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew`.
|
||||
- 32 bits: `pacman -S mingw-w64-i686-SDL2 mingw-w64-i686-glew`.
|
||||
- 64 bits: `pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew`.
|
||||
- 32 bits: `pacman -S mingw-w64-i686-SDL2 mingw-w64-i686-glew`.
|
||||
- Run `make` to build
|
||||
- To run the test program you'll need a SM64 US ROM in the root of the repository with the name `baserom.us.z64`.
|
||||
|
||||
|
||||
+2
-1
@@ -54,6 +54,7 @@ model_inc_h = """
|
||||
#include "../include/PR/gbi.h"
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
global model_inc_h
|
||||
|
||||
@@ -82,7 +83,6 @@ def main():
|
||||
lines.insert(0, "#include \"../../load_tex_data.h\"")
|
||||
model_inc_c = "\n".join(lines)
|
||||
|
||||
|
||||
with open("src/decomp/mario/geo.inc.c", "w") as file:
|
||||
file.write(geo_inc_c_header + geo_inc_c + geo_inc_c_footer)
|
||||
|
||||
@@ -95,5 +95,6 @@ def main():
|
||||
with open("src/decomp/mario/geo.inc.h", "w") as file:
|
||||
file.write(geo_inc_h)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
+85
-27
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import shutil
|
||||
import urllib.request
|
||||
import re
|
||||
|
||||
COLLISION_URL = "https://raw.githubusercontent.com/n64decomp/sm64/06ec56df7f951f88da05f468cdcacecba496145a/levels/bob/areas/1/collision.inc.c"
|
||||
SCRIPT_URL = "https://raw.githubusercontent.com/n64decomp/sm64/06ec56df7f951f88da05f468cdcacecba496145a/levels/bob/script.c"
|
||||
|
||||
BOB_COLLISION_URL = "https://raw.githubusercontent.com/n64decomp/sm64/06ec56df7f951f88da05f468cdcacecba496145a/levels/bob/areas/1/collision.inc.c"
|
||||
|
||||
LEVEL_H = """#pragma once
|
||||
|
||||
@@ -13,46 +14,103 @@ extern const struct SM64Surface surfaces[];
|
||||
extern const size_t surfaces_count;
|
||||
"""
|
||||
|
||||
def main():
|
||||
print("Downloading " + BOB_COLLISION_URL)
|
||||
in_lines = urllib.request.urlopen(BOB_COLLISION_URL).read().decode('utf8').splitlines()
|
||||
|
||||
def extract_surface(token):
|
||||
token = token.strip()
|
||||
if "SURFACE_" in token:
|
||||
token = token[token.find("SURFACE_"):]
|
||||
if "," in token:
|
||||
token = token.split(",")[0].strip()
|
||||
return token
|
||||
|
||||
|
||||
def parse_collision(raw):
|
||||
verts = []
|
||||
tris = []
|
||||
mode = ""
|
||||
current_surface = "SURFACE_DEFAULT"
|
||||
|
||||
for line in in_lines:
|
||||
if not line.strip().startswith("COL_"):
|
||||
continue;
|
||||
for line in raw:
|
||||
line = line.strip()
|
||||
|
||||
tokens = line.strip().replace("(", ",").replace(")", "").split(",")
|
||||
if "COL_VERTEX(" in line:
|
||||
inside = line[line.find("(") + 1:line.rfind(")")]
|
||||
t = [x.strip() for x in inside.split(",")]
|
||||
verts.append((int(t[0]), int(t[1]), int(t[2])))
|
||||
|
||||
if tokens[0] == "COL_VERTEX":
|
||||
verts.append([ int(tokens[1]), int(tokens[2]), int(tokens[3]) ])
|
||||
elif tokens[0] == "COL_TRI_INIT":
|
||||
mode = tokens[1]
|
||||
elif tokens[0] == "COL_TRI":
|
||||
tris.append([ int(tokens[1]), int(tokens[2]), int(tokens[3]), mode ])
|
||||
elif "COL_TRI_INIT(" in line:
|
||||
inside = line[line.find("(") + 1:line.rfind(")")]
|
||||
t = [x.strip() for x in inside.split(",")]
|
||||
current_surface = extract_surface(t[0])
|
||||
|
||||
elif "COL_TRI(" in line:
|
||||
inside = line[line.find("(") + 1:line.rfind(")")]
|
||||
t = [x.strip() for x in inside.split(",")]
|
||||
tris.append((int(t[0]), int(t[1]), int(t[2]), current_surface))
|
||||
|
||||
return verts, tris
|
||||
|
||||
|
||||
def parse_script(raw):
|
||||
current_area = None
|
||||
area_terrain = {}
|
||||
|
||||
for line in raw:
|
||||
line = line.strip()
|
||||
|
||||
m_area = re.search(r"AREA\s*\(\s*(\d+)", line)
|
||||
if m_area:
|
||||
current_area = int(m_area.group(1))
|
||||
|
||||
m_terrain = re.search(r"TERRAIN_TYPE\s*\(\s*([A-Z_0-9]+)\s*\)", line)
|
||||
if m_terrain and current_area is not None:
|
||||
area_terrain[current_area] = m_terrain.group(1)
|
||||
|
||||
return area_terrain
|
||||
|
||||
|
||||
def main():
|
||||
print("Downloading collision...")
|
||||
collision_raw = urllib.request.urlopen(COLLISION_URL).read().decode("utf8").splitlines()
|
||||
|
||||
print("Downloading script...")
|
||||
script_raw = urllib.request.urlopen(SCRIPT_URL).read().decode("utf8").splitlines()
|
||||
|
||||
verts, tris = parse_collision(collision_raw)
|
||||
area_terrain = parse_script(script_raw)
|
||||
|
||||
current_terrain = area_terrain.get(1, "TERRAIN_GRASS")
|
||||
|
||||
out_lines = []
|
||||
|
||||
for tri in tris:
|
||||
out_lines.append("{%s,0,TERRAIN_SNOW,{{%s,%s,%s},{%s,%s,%s},{%s,%s,%s}}}"%(tri[3], \
|
||||
verts[tri[0]][0], verts[tri[0]][1], verts[tri[0]][2], \
|
||||
verts[tri[1]][0], verts[tri[1]][1], verts[tri[1]][2], \
|
||||
verts[tri[2]][0], verts[tri[2]][1], verts[tri[2]][2]))
|
||||
v1 = verts[tri[0]]
|
||||
v2 = verts[tri[1]]
|
||||
v3 = verts[tri[2]]
|
||||
surf = tri[3]
|
||||
|
||||
out_lines.append(
|
||||
"{%s,0,%s,0,{{%d,%d,%d},{%d,%d,%d},{%d,%d,%d}}}" % (
|
||||
surf,
|
||||
current_terrain,
|
||||
v1[0], v1[1], v1[2],
|
||||
v2[0], v2[1], v2[2],
|
||||
v3[0], v3[1], v3[2],
|
||||
)
|
||||
)
|
||||
|
||||
out_str = ",\n".join(out_lines)
|
||||
out_str = "const struct SM64Surface surfaces[] = {\n" + out_str + "};\n\n"
|
||||
out_str += "const size_t surfaces_count = sizeof( surfaces ) / sizeof( surfaces[0] );"
|
||||
|
||||
out_str = "const struct SM64Surface surfaces[] = {\n" + out_str + "\n};\n\n"
|
||||
out_str += "const size_t surfaces_count = sizeof(surfaces) / sizeof(surfaces[0]);\n"
|
||||
out_str = '#include "../src/decomp/include/surface_terrains.h"\n' + out_str
|
||||
out_str = '#include "level.h"\n' + out_str
|
||||
|
||||
with open("test/level.c", "w") as file:
|
||||
file.write(out_str)
|
||||
with open("test/level.c", "w") as f:
|
||||
f.write(out_str)
|
||||
|
||||
with open("test/level.h", "w") as f:
|
||||
f.write(LEVEL_H)
|
||||
|
||||
with open("test/level.h", "w") as file:
|
||||
file.write(LEVEL_H)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
//
|
||||
// Created by nepushiro on 5/29/26.
|
||||
//
|
||||
|
||||
#include "FakeObject.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "decomp/global_state.h"
|
||||
#include "decomp/engine/math_util.h"
|
||||
#include "decomp/game/interaction.h"
|
||||
#include "decomp/game/object_stuff.h"
|
||||
#include "decomp/include/object_fields.h"
|
||||
#include "libsm64.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void fake_object_init(struct FakeObject *fake, float x, float y, float z)
|
||||
{
|
||||
memset(fake, 0, sizeof(*fake));
|
||||
|
||||
struct Object *obj = &fake->object;
|
||||
obj->activeFlags = ACTIVE_FLAG_ACTIVE | ACTIVE_FLAG_UNK8;
|
||||
obj->parentObj = NULL;
|
||||
obj->prevObj = NULL;
|
||||
obj->collidedObjInteractTypes = 0;
|
||||
obj->numCollidedObjs = 0;
|
||||
|
||||
for (s32 i = 0; i < 0x50; i++)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
obj->rawData.asS32[i] = 0;
|
||||
#endif
|
||||
#ifdef _WIN64
|
||||
obj->ptrData.asVoidPtr[i] = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
obj->unused1 = 0;
|
||||
obj->bhvStackIndex = 0;
|
||||
obj->bhvDelayTimer = 0;
|
||||
|
||||
obj->hitboxRadius = 50.0f;
|
||||
obj->hitboxHeight = 100.0f;
|
||||
obj->hurtboxRadius = 0.0f;
|
||||
obj->hurtboxHeight = 0.0f;
|
||||
obj->hitboxDownOffset = 0.0f;
|
||||
obj->unused2 = 0;
|
||||
|
||||
obj->platform = NULL;
|
||||
obj->collisionData = NULL;
|
||||
obj->oIntangibleTimer = -1;
|
||||
obj->oDamageOrCoinValue = 0;
|
||||
obj->oHealth = 2048;
|
||||
|
||||
obj->oCollisionDistance = 1000.0f;
|
||||
obj->oDrawingDistance = 4000.0f;
|
||||
|
||||
mtxf_identity(obj->transform);
|
||||
|
||||
obj->respawnInfoType = RESPAWN_INFO_TYPE_NULL;
|
||||
obj->respawnInfo = NULL;
|
||||
|
||||
obj->oDistanceToMario = 19000.0f;
|
||||
obj->oRoom = -1;
|
||||
obj->oInteractType = 0;
|
||||
obj->oInteractionSubtype = 0;
|
||||
obj->oHeldState = 0;
|
||||
obj->oAction = 0;
|
||||
|
||||
obj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
|
||||
obj->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
|
||||
obj->header.gfx.node.flags &= ~GRAPH_RENDER_BILLBOARD;
|
||||
obj->header.gfx.pos[0] = x;
|
||||
obj->header.gfx.pos[1] = y;
|
||||
obj->header.gfx.pos[2] = z;
|
||||
obj->header.gfx.angle[0] = 0;
|
||||
obj->header.gfx.angle[1] = 0;
|
||||
obj->header.gfx.angle[2] = 0;
|
||||
obj->header.gfx.throwMatrix = NULL;
|
||||
obj->header.gfx.sharedChild = NULL;
|
||||
obj->header.gfx.animInfo.curAnim = NULL;
|
||||
obj->header.gfx.animInfo.animID = 0;
|
||||
obj->header.gfx.animInfo.animFrame = 0;
|
||||
obj->header.gfx.animInfo.animTimer = 0;
|
||||
|
||||
obj->oPosX = x;
|
||||
obj->oPosY = y;
|
||||
obj->oPosZ = z;
|
||||
obj->oMoveAnglePitch = 0;
|
||||
obj->oMoveAngleYaw = 0;
|
||||
obj->oMoveAngleRoll = 0;
|
||||
obj->oFaceAnglePitch = 0;
|
||||
obj->oFaceAngleYaw = 0;
|
||||
obj->oFaceAngleRoll = 0;
|
||||
}
|
||||
|
||||
void fake_object_sync_position(struct FakeObject *fake)
|
||||
{
|
||||
struct Object *obj = &fake->object;
|
||||
obj->header.gfx.pos[0] = obj->oPosX;
|
||||
obj->header.gfx.pos[1] = obj->oPosY;
|
||||
obj->header.gfx.pos[2] = obj->oPosZ;
|
||||
}
|
||||
|
||||
bool fake_object_overlaps_mario(struct FakeObject *fake, struct MarioState *m)
|
||||
{
|
||||
struct Object *obj = &fake->object;
|
||||
float dx = obj->oPosX - m->pos[0];
|
||||
float dz = obj->oPosZ - m->pos[2];
|
||||
float radius = obj->hitboxRadius;
|
||||
float top = obj->oPosY + obj->hitboxHeight;
|
||||
float bottom = obj->oPosY - obj->hitboxDownOffset;
|
||||
|
||||
if ((dx * dx) + (dz * dz) > radius * radius)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m->pos[1] < bottom || m->pos[1] > top)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void fake_object_add_collision(struct FakeObject *fake, struct MarioState *m)
|
||||
{
|
||||
struct Object *obj = &fake->object;
|
||||
|
||||
if (obj->oHeldState != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m->marioObj->collidedObjInteractTypes |= obj->oInteractType;
|
||||
if (m->marioObj->numCollidedObjs < 4)
|
||||
{
|
||||
m->marioObj->collidedObjs[m->marioObj->numCollidedObjs++] = obj;
|
||||
}
|
||||
}
|
||||
|
||||
void fake_object_apply_pole(struct FakeObject *fake)
|
||||
{
|
||||
(void)fake;
|
||||
}
|
||||
|
||||
void fake_object_set_preset(struct FakeObject *fake, uint32_t preset)
|
||||
{
|
||||
struct Object *obj = &fake->object;
|
||||
|
||||
switch (preset)
|
||||
{
|
||||
case 1:
|
||||
obj->oInteractType = INTERACT_POLE;
|
||||
obj->oInteractionSubtype = 0;
|
||||
obj->hitboxRadius = 60.0f;
|
||||
obj->hitboxHeight = 1000.0f;
|
||||
obj->hitboxDownOffset = 0.0f;
|
||||
break;
|
||||
case 0: default:
|
||||
obj->oInteractType = 0;
|
||||
obj->oInteractionSubtype = 0;
|
||||
obj->hitboxRadius = 50.0f;
|
||||
obj->hitboxHeight = 100.0f;
|
||||
obj->hitboxDownOffset = 0.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by nepushiro on 5/29/26.
|
||||
//
|
||||
|
||||
#ifndef LIBSM64_FAKEOBJECT_H
|
||||
#define LIBSM64_FAKEOBJECT_H
|
||||
|
||||
#endif //LIBSM64_FAKEOBJECT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <types.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct FakeObject
|
||||
{
|
||||
struct Object object;
|
||||
};
|
||||
|
||||
void fake_object_init(struct FakeObject *fake, float x, float y, float z);
|
||||
void fake_object_sync_position(struct FakeObject *fake);
|
||||
|
||||
bool fake_object_overlaps_mario(struct FakeObject *fake, struct MarioState *m);
|
||||
void fake_object_add_collision(struct FakeObject *fake, struct MarioState *m);
|
||||
void fake_object_apply_pole(struct FakeObject *fake);
|
||||
void fake_object_set_preset(struct FakeObject *fake, uint32_t preset);
|
||||
@@ -114,8 +114,9 @@ struct Instrument **instOut = _instOut;\
|
||||
}
|
||||
#endif
|
||||
|
||||
void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
struct SequencePlayer *seqPlayer; // sp5C, t4
|
||||
void seq_channel_layer_process_script(struct SequenceChannelLayer *layer)
|
||||
{
|
||||
struct SequencePlayer *seqPlayer; // sp5C, t4
|
||||
struct SequenceChannel *seqChannel; // sp58, t5
|
||||
struct M64ScriptState *state;
|
||||
struct Portamento *portamento;
|
||||
@@ -124,51 +125,57 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
struct Drum *drum;
|
||||
s32 temp_a0_5;
|
||||
u8 sameSound;
|
||||
u8 cmd; // a0 sp3E, EU s2
|
||||
u8 cmdSemitone; // sp3D, t0
|
||||
u16 sp3A; // t2, a0, a1
|
||||
f32 tuning; // f0
|
||||
s32 vel; // sp30, t3
|
||||
s32 usedSemitone; // a1
|
||||
f32 freqScale; // sp28, f0
|
||||
u8 cmd; // a0 sp3E, EU s2
|
||||
u8 cmdSemitone; // sp3D, t0
|
||||
u16 sp3A; // t2, a0, a1
|
||||
f32 tuning; // f0
|
||||
s32 vel; // sp30, t3
|
||||
s32 usedSemitone; // a1
|
||||
f32 freqScale; // sp28, f0
|
||||
f32 sp24;
|
||||
f32 temp_f12;
|
||||
f32 temp_f2;
|
||||
|
||||
//! Copt: manually inline these functions in the scope of this routine
|
||||
#ifdef __sgi
|
||||
#pragma inline routine(m64_read_u8)
|
||||
#pragma inline routine(m64_read_compressed_u16)
|
||||
#pragma inline routine(m64_read_s16)
|
||||
#pragma inline routine(get_instrument)
|
||||
#endif
|
||||
//! Copt: manually inline these functions in the scope of this routine
|
||||
#ifdef __sgi
|
||||
#pragma inline routine(m64_read_u8)
|
||||
#pragma inline routine(m64_read_compressed_u16)
|
||||
#pragma inline routine(m64_read_s16)
|
||||
#pragma inline routine(get_instrument)
|
||||
#endif
|
||||
|
||||
sameSound = TRUE;
|
||||
if ((*layer).enabled == FALSE) {
|
||||
if ((*layer).enabled == FALSE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((*layer).delay > 1) {
|
||||
if ((*layer).delay > 1)
|
||||
{
|
||||
(*layer).delay--;
|
||||
if (!layer->stopSomething && layer->delay <= layer->duration) {
|
||||
if (!layer->stopSomething && layer->delay <= layer->duration)
|
||||
{
|
||||
seq_channel_layer_note_decay(layer);
|
||||
layer->stopSomething = TRUE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!layer->continuousNotes) {
|
||||
if (!layer->continuousNotes)
|
||||
{
|
||||
seq_channel_layer_note_decay(layer);
|
||||
}
|
||||
|
||||
if (PORTAMENTO_MODE(layer->portamento) == PORTAMENTO_MODE_1 ||
|
||||
PORTAMENTO_MODE(layer->portamento) == PORTAMENTO_MODE_2) {
|
||||
PORTAMENTO_MODE(layer->portamento) == PORTAMENTO_MODE_2)
|
||||
{
|
||||
layer->portamento.mode = 0;
|
||||
}
|
||||
|
||||
seqChannel = (*layer).seqChannel;
|
||||
seqPlayer = (*seqChannel).seqPlayer;
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
state = &layer->scriptState;
|
||||
//M64_READ_U8(state, cmd);
|
||||
{
|
||||
@@ -177,13 +184,16 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
cmd = *_ptr_pc;
|
||||
}
|
||||
|
||||
if (cmd <= 0xc0) {
|
||||
if (cmd <= 0xc0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
switch (cmd)
|
||||
{
|
||||
case 0xff: // layer_end; function return or end of script
|
||||
if (state->depth == 0) {
|
||||
if (state->depth == 0)
|
||||
{
|
||||
// N.B. this function call is *not* inlined even though it's
|
||||
// within the same file, unlike in the rest of this function.
|
||||
seq_channel_layer_disable(layer);
|
||||
@@ -204,9 +214,12 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
break;
|
||||
|
||||
case 0xf7: // layer_loopend
|
||||
if (--state->remLoopIters[state->depth - 1] != 0) {
|
||||
if (--state->remLoopIters[state->depth - 1] != 0)
|
||||
{
|
||||
state->pc = state->stack[state->depth - 1];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
state->depth--;
|
||||
}
|
||||
break;
|
||||
@@ -219,19 +232,25 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
case 0xc1: // layer_setshortnotevelocity
|
||||
case 0xca: // layer_setpan
|
||||
temp_a0_5 = *(state->pc++);
|
||||
if (cmd == 0xc1) {
|
||||
if (cmd == 0xc1)
|
||||
{
|
||||
layer->velocitySquare = (f32)(temp_a0_5 * temp_a0_5);
|
||||
} else {
|
||||
layer->pan = (f32) temp_a0_5 / US_FLOAT(128.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer->pan = (f32)temp_a0_5 / US_FLOAT(128.0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xc2: // layer_transpose; set transposition in semitones
|
||||
case 0xc9: // layer_setshortnoteduration
|
||||
temp_a0_5 = *(state->pc++);
|
||||
if (cmd == 0xc9) {
|
||||
if (cmd == 0xc9)
|
||||
{
|
||||
layer->noteDuration = temp_a0_5;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
layer->transposition = temp_a0_5;
|
||||
}
|
||||
break;
|
||||
@@ -240,17 +259,20 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
case 0xc5: // layer_somethingoff
|
||||
//! copt needs a ternary:
|
||||
//layer->continuousNotes = (cmd == 0xc4) ? TRUE : FALSE;
|
||||
{
|
||||
u8 setting;
|
||||
if (cmd == 0xc4)
|
||||
{
|
||||
u8 setting;
|
||||
if (cmd == 0xc4) {
|
||||
setting = TRUE;
|
||||
} else {
|
||||
setting = FALSE;
|
||||
}
|
||||
layer->continuousNotes = setting;
|
||||
seq_channel_layer_note_decay(layer);
|
||||
setting = TRUE;
|
||||
}
|
||||
break;
|
||||
else
|
||||
{
|
||||
setting = FALSE;
|
||||
}
|
||||
layer->continuousNotes = setting;
|
||||
seq_channel_layer_note_decay(layer);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xc3: // layer_setshortnotedefaultplaypercentage
|
||||
M64_READ_COMPRESSED_U16(state, sp3A);
|
||||
@@ -260,7 +282,8 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
case 0xc6: // layer_setinstr
|
||||
M64_READ_U8(state, cmdSemitone);
|
||||
|
||||
if (cmdSemitone < 127) {
|
||||
if (cmdSemitone < 127)
|
||||
{
|
||||
GET_INSTRUMENT(seqChannel, cmdSemitone, &(*layer).instrument, &(*layer).adsr, cmdSemitone, 1);
|
||||
}
|
||||
break;
|
||||
@@ -273,13 +296,15 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
cmdSemitone += (*layer).transposition;
|
||||
cmdSemitone += (*seqPlayer).transposition;
|
||||
|
||||
if (cmdSemitone >= 0x80) {
|
||||
if (cmdSemitone >= 0x80)
|
||||
{
|
||||
cmdSemitone = 0;
|
||||
}
|
||||
layer->portamentoTargetNote = cmdSemitone;
|
||||
|
||||
// If special, the next param is u8 instead of var
|
||||
if (PORTAMENTO_IS_SPECIAL((*layer).portamento)) {
|
||||
if (PORTAMENTO_IS_SPECIAL((*layer).portamento))
|
||||
{
|
||||
layer->portamentoTime = *((state)->pc++);
|
||||
break;
|
||||
}
|
||||
@@ -293,7 +318,8 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
break;
|
||||
|
||||
default:
|
||||
switch (cmd & 0xf0) {
|
||||
switch (cmd & 0xf0)
|
||||
{
|
||||
case 0xd0: // layer_setshortnotevelocityfromtable
|
||||
sp3A = seqPlayer->shortNoteVelocityTable[cmd & 0xf];
|
||||
(*layer).velocitySquare = (f32)(sp3A * sp3A);
|
||||
@@ -305,14 +331,19 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd == 0xc0) { // layer_delay
|
||||
if (cmd == 0xc0)
|
||||
{ // layer_delay
|
||||
M64_READ_COMPRESSED_U16(state, layer->delay);
|
||||
layer->stopSomething = TRUE;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
layer->stopSomething = FALSE;
|
||||
|
||||
if (seqChannel->largeNotes == TRUE) {
|
||||
switch (cmd & 0xc0) {
|
||||
if (seqChannel->largeNotes == TRUE)
|
||||
{
|
||||
switch (cmd & 0xc0)
|
||||
{
|
||||
case 0x00: // layer_note0 (play percentage, velocity, duration)
|
||||
M64_READ_COMPRESSED_U16(state, sp3A);
|
||||
vel = *((*state).pc++);
|
||||
@@ -333,11 +364,13 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
|
||||
layer->noteDuration = *((*state).pc++);
|
||||
goto l1090;
|
||||
}
|
||||
l1090:
|
||||
cmdSemitone = cmd - (cmd & 0xc0);
|
||||
l1090: cmdSemitone = cmd - (cmd & 0xc0);
|
||||
layer->velocitySquare = vel * vel;
|
||||
} else {
|
||||
switch (cmd & 0xc0) {
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (cmd & 0xc0)
|
||||
{
|
||||
case 0x00: // play note, type 0 (play percentage)
|
||||
M64_READ_COMPRESSED_U16(state, sp3A);
|
||||
layer->playPercentage = sp3A;
|
||||
@@ -351,9 +384,7 @@ l1090:
|
||||
sp3A = layer->playPercentage;
|
||||
goto l1138;
|
||||
}
|
||||
l1138:
|
||||
|
||||
cmdSemitone = cmd - (cmd & 0xc0);
|
||||
l1138: cmdSemitone = cmd - (cmd & 0xc0);
|
||||
}
|
||||
|
||||
layer->delay = sp3A;
|
||||
@@ -361,14 +392,20 @@ l1138:
|
||||
if ((seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_STOP_NOTES) != 0)
|
||||
|| seqChannel->stopSomething2
|
||||
|| !seqChannel->hasInstrument
|
||||
) {
|
||||
)
|
||||
{
|
||||
layer->stopSomething = TRUE;
|
||||
} else {
|
||||
if (seqChannel->instOrWave == 0) { // drum
|
||||
}
|
||||
else
|
||||
{
|
||||
if (seqChannel->instOrWave == 0)
|
||||
{ // drum
|
||||
cmdSemitone += (*seqChannel).transposition + (*layer).transposition;
|
||||
if (cmdSemitone >= gCtlEntries[seqChannel->bankId].numDrums) {
|
||||
if (cmdSemitone >= gCtlEntries[seqChannel->bankId].numDrums)
|
||||
{
|
||||
cmdSemitone = gCtlEntries[seqChannel->bankId].numDrums;
|
||||
if (cmdSemitone == 0) {
|
||||
if (cmdSemitone == 0)
|
||||
{
|
||||
// this goto looks a bit like a function return...
|
||||
layer->stopSomething = TRUE;
|
||||
goto skip;
|
||||
@@ -378,9 +415,12 @@ l1138:
|
||||
}
|
||||
|
||||
drum = gCtlEntries[seqChannel->bankId].drums[cmdSemitone];
|
||||
if (drum == NULL) {
|
||||
if (drum == NULL)
|
||||
{
|
||||
layer->stopSomething = TRUE;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
layer->adsr.envelope = drum->envelope;
|
||||
layer->adsr.releaseRate = drum->releaseRate;
|
||||
layer->pan = FLOAT_CAST(drum->pan) / US_FLOAT(128.0);
|
||||
@@ -389,34 +429,49 @@ l1138:
|
||||
}
|
||||
|
||||
skip:;
|
||||
} else { // instrument
|
||||
}
|
||||
else
|
||||
{ // instrument
|
||||
cmdSemitone += (*seqPlayer).transposition + (*seqChannel).transposition + (*layer).transposition;
|
||||
if (cmdSemitone >= 0x80) {
|
||||
if (cmdSemitone >= 0x80)
|
||||
{
|
||||
layer->stopSomething = TRUE;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
instrument = layer->instrument;
|
||||
if (instrument == NULL) {
|
||||
if (instrument == NULL)
|
||||
{
|
||||
instrument = seqChannel->instrument;
|
||||
}
|
||||
|
||||
if (layer->portamento.mode != 0) {
|
||||
if (layer->portamento.mode != 0)
|
||||
{
|
||||
//! copt needs a ternary:
|
||||
//usedSemitone = (layer->portamentoTargetNote < cmdSemitone) ? cmdSemitone : layer->portamentoTargetNote;
|
||||
if (layer->portamentoTargetNote < cmdSemitone) {
|
||||
if (layer->portamentoTargetNote < cmdSemitone)
|
||||
{
|
||||
usedSemitone = cmdSemitone;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
usedSemitone = layer->portamentoTargetNote;
|
||||
}
|
||||
|
||||
if (instrument != NULL) {
|
||||
sound = (u8) usedSemitone < instrument->normalRangeLo ? &instrument->lowNotesSound
|
||||
: (u8) usedSemitone <= instrument->normalRangeHi ?
|
||||
&instrument->normalNotesSound : &instrument->highNotesSound;
|
||||
if (instrument != NULL)
|
||||
{
|
||||
sound = (u8)usedSemitone < instrument->normalRangeLo
|
||||
? &instrument->lowNotesSound
|
||||
: (u8)usedSemitone <= instrument->normalRangeHi
|
||||
? &instrument->normalNotesSound
|
||||
: &instrument->highNotesSound;
|
||||
|
||||
sameSound = (sound == (*layer).sound);
|
||||
layer->sound = sound;
|
||||
tuning = (*sound).tuning;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
layer->sound = NULL;
|
||||
tuning = 1.0f;
|
||||
}
|
||||
@@ -425,7 +480,8 @@ l1138:
|
||||
temp_f12 = gNoteFrequencies[layer->portamentoTargetNote] * tuning;
|
||||
|
||||
portamento = &layer->portamento;
|
||||
switch (PORTAMENTO_MODE(layer->portamento)) {
|
||||
switch (PORTAMENTO_MODE(layer->portamento))
|
||||
{
|
||||
case PORTAMENTO_MODE_1:
|
||||
case PORTAMENTO_MODE_3:
|
||||
case PORTAMENTO_MODE_5:
|
||||
@@ -439,29 +495,34 @@ l1138:
|
||||
sp24 = temp_f12;
|
||||
goto l13cc;
|
||||
}
|
||||
l13cc:
|
||||
portamento->extent = sp24 / freqScale - US_FLOAT(1.0);
|
||||
if (PORTAMENTO_IS_SPECIAL((*layer).portamento)) {
|
||||
l13cc: portamento->extent = sp24 / freqScale - US_FLOAT(1.0);
|
||||
if (PORTAMENTO_IS_SPECIAL((*layer).portamento))
|
||||
{
|
||||
portamento->speed = US_FLOAT(32512.0) * FLOAT_CAST((*seqPlayer).tempo)
|
||||
/ ((f32)(*layer).delay * (f32) gTempoInternalToExternal
|
||||
/ ((f32)(*layer).delay * (f32)gTempoInternalToExternal
|
||||
* FLOAT_CAST((*layer).portamentoTime));
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
portamento->speed = US_FLOAT(127.0) / FLOAT_CAST((*layer).portamentoTime);
|
||||
}
|
||||
portamento->cur = 0.0f;
|
||||
layer->freqScale = freqScale;
|
||||
if (PORTAMENTO_MODE((*layer).portamento) == PORTAMENTO_MODE_5) {
|
||||
if (PORTAMENTO_MODE((*layer).portamento) == PORTAMENTO_MODE_5)
|
||||
{
|
||||
layer->portamentoTargetNote = cmdSemitone;
|
||||
}
|
||||
} else if (instrument != NULL) {
|
||||
sound = cmdSemitone < instrument->normalRangeLo ?
|
||||
&instrument->lowNotesSound : cmdSemitone <= instrument->normalRangeHi ?
|
||||
&instrument->normalNotesSound : &instrument->highNotesSound;
|
||||
}
|
||||
else if (instrument != NULL)
|
||||
{
|
||||
sound = cmdSemitone < instrument->normalRangeLo ? &instrument->lowNotesSound : cmdSemitone <= instrument->normalRangeHi ? &instrument->normalNotesSound : &instrument->highNotesSound;
|
||||
|
||||
sameSound = (sound == (*layer).sound);
|
||||
layer->sound = sound;
|
||||
layer->freqScale = gNoteFrequencies[cmdSemitone] * (*sound).tuning;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
layer->sound = NULL;
|
||||
layer->freqScale = gNoteFrequencies[cmdSemitone];
|
||||
}
|
||||
@@ -471,30 +532,41 @@ l13cc:
|
||||
}
|
||||
}
|
||||
|
||||
if (layer->stopSomething == TRUE) {
|
||||
if (layer->note != NULL || layer->continuousNotes) {
|
||||
if (layer->stopSomething == TRUE)
|
||||
{
|
||||
if (layer->note != NULL || layer->continuousNotes)
|
||||
{
|
||||
seq_channel_layer_note_decay(layer);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
cmdSemitone = FALSE;
|
||||
if (!layer->continuousNotes) {
|
||||
if (!layer->continuousNotes)
|
||||
{
|
||||
cmdSemitone = TRUE;
|
||||
} else if (layer->note == NULL || layer->status == SOUND_LOAD_STATUS_NOT_LOADED) {
|
||||
}
|
||||
else if (layer->note == NULL || layer->status == SOUND_LOAD_STATUS_NOT_LOADED)
|
||||
{
|
||||
cmdSemitone = TRUE;
|
||||
} else if (sameSound == FALSE) {
|
||||
}
|
||||
else if (sameSound == FALSE)
|
||||
{
|
||||
seq_channel_layer_note_decay(layer);
|
||||
cmdSemitone = TRUE;
|
||||
} else if (layer->sound == NULL) {
|
||||
}
|
||||
else if (layer->sound == NULL)
|
||||
{
|
||||
init_synthetic_wave(layer->note, layer);
|
||||
}
|
||||
|
||||
if (cmdSemitone != FALSE) {
|
||||
if (cmdSemitone != FALSE)
|
||||
{
|
||||
(*layer).note = alloc_note(layer);
|
||||
}
|
||||
|
||||
if (layer->note != NULL && layer->note->parentLayer == layer) {
|
||||
if (layer->note != NULL && layer->note->parentLayer == layer)
|
||||
{
|
||||
note_vibrato_init(layer->note);
|
||||
}
|
||||
}
|
||||
|
||||
+249
-233
@@ -10,30 +10,46 @@ extern struct OSMesgQueue OSMesgQueue3;
|
||||
|
||||
#ifdef VERSION_EU
|
||||
struct ReverbSettingsEU sReverbSettings[] = {
|
||||
{ 0x04, 0x0c, 0x2fff },
|
||||
{ 0x04, 0x0a, 0x47ff },
|
||||
{ 0x04, 0x10, 0x2fff },
|
||||
{ 0x04, 0x0e, 0x3fff },
|
||||
{ 0x04, 0x0c, 0x4fff },
|
||||
{ 0x04, 0x0a, 0x37ff }
|
||||
{0x04, 0x0c, 0x2fff},
|
||||
{0x04, 0x0a, 0x47ff},
|
||||
{0x04, 0x10, 0x2fff},
|
||||
{0x04, 0x0e, 0x3fff},
|
||||
{0x04, 0x0c, 0x4fff},
|
||||
{0x04, 0x0a, 0x37ff}
|
||||
};
|
||||
struct AudioSessionSettingsEU gAudioSessionPresets[] = {
|
||||
{ 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00 },
|
||||
{ 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00 },
|
||||
{ 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[2], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00 },
|
||||
{ 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[3], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00 },
|
||||
{ 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[4], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00 },
|
||||
{ 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00004000, 0x00006e00,
|
||||
0x00003f00, 0x00002a00 },
|
||||
{ 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00004100, 0x00006e00,
|
||||
0x00004400, 0x00002a80 },
|
||||
{ 0x00007d00, 0x01, 0x14, 0x01, 0x00, &sReverbSettings[5], 0x7fff, 0x0000, 0x00003500, 0x00006280,
|
||||
0x00004000, 0x00001b00 }
|
||||
{
|
||||
0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00
|
||||
},
|
||||
{
|
||||
0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00
|
||||
},
|
||||
{
|
||||
0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[2], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00
|
||||
},
|
||||
{
|
||||
0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[3], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00
|
||||
},
|
||||
{
|
||||
0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[4], 0x7fff, 0x0000, 0x00003a40, 0x00006d00,
|
||||
0x00004400, 0x00002a00
|
||||
},
|
||||
{
|
||||
0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00004000, 0x00006e00,
|
||||
0x00003f00, 0x00002a00
|
||||
},
|
||||
{
|
||||
0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00004100, 0x00006e00,
|
||||
0x00004400, 0x00002a80
|
||||
},
|
||||
{
|
||||
0x00007d00, 0x01, 0x14, 0x01, 0x00, &sReverbSettings[5], 0x7fff, 0x0000, 0x00003500, 0x00006280,
|
||||
0x00004000, 0x00001b00
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -51,7 +67,7 @@ struct AudioSessionSettingsEU gAudioSessionPresets[] = {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
struct AudioSessionSettings gAudioSessionPresets[18] = {
|
||||
#ifdef VERSION_JP
|
||||
{ 32000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x3900, 0x6000, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x3900, 0x6000, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x3900, 0x6000, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x3900, 0x6000, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0E00, 0x3FFF, 0x7FFF, 0x3900, 0x6000, 0x4400, 0x2A00 },
|
||||
@@ -60,7 +76,7 @@ struct AudioSessionSettings gAudioSessionPresets[18] = {
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x3F00, 0x6200, 0x4400, 0x2A80 },
|
||||
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x3300, 0x5500, 0x4000, 0x1B00 },
|
||||
#else
|
||||
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0E00, 0x3FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
@@ -69,7 +85,7 @@ struct AudioSessionSettings gAudioSessionPresets[18] = {
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x4100, 0x6E00, 0x4400, 0x2A80 },
|
||||
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x34C0, 0x6280, 0x4000, 0x1B00 },
|
||||
#endif
|
||||
{ 27000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x0800, 0x3FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x1000, 0x3FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
@@ -85,15 +101,15 @@ struct AudioSessionSettings gAudioSessionPresets[18] = {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
u16 gAudioCosineTable[128] = {
|
||||
0x7FFF, 32764, 32757, 32744, 32727, 32704, 32677, 32644, 32607, 32564, 32517, 32464, 32407,
|
||||
32344, 32277, 32205, 32127, 32045, 31958, 31866, 31770, 31668, 31561, 31450, 31334, 31213,
|
||||
31087, 30957, 30822, 30682, 30537, 30388, 30234, 30075, 29912, 29744, 29572, 29395, 29214,
|
||||
29028, 28838, 28643, 28444, 28241, 28033, 27821, 27605, 27385, 27160, 26931, 26698, 26461,
|
||||
26220, 25975, 25726, 25473, 25216, 24956, 24691, 24423, 24151, 23875, 23596, 23313, 23026,
|
||||
22736, 22442, 22145, 21845, 21541, 21234, 20924, 20610, 20294, 19974, 19651, 19325, 18997,
|
||||
18665, 18331, 17993, 17653, 17310, 16965, 16617, 16266, 15913, 15558, 15200, 14840, 14477,
|
||||
14113, 13746, 13377, 13006, 12633, 12258, 11881, 11503, 11122, 10740, 10357, 9971, 9584,
|
||||
9196, 8806, 8415, 8023, 7630, 7235, 6839, 6442, 6044, 5646, 5246, 4845, 4444,
|
||||
4042, 3640, 3237, 2833, 2429, 2025, 1620, 1216, 810, 405, 0,
|
||||
32344, 32277, 32205, 32127, 32045, 31958, 31866, 31770, 31668, 31561, 31450, 31334, 31213,
|
||||
31087, 30957, 30822, 30682, 30537, 30388, 30234, 30075, 29912, 29744, 29572, 29395, 29214,
|
||||
29028, 28838, 28643, 28444, 28241, 28033, 27821, 27605, 27385, 27160, 26931, 26698, 26461,
|
||||
26220, 25975, 25726, 25473, 25216, 24956, 24691, 24423, 24151, 23875, 23596, 23313, 23026,
|
||||
22736, 22442, 22145, 21845, 21541, 21234, 20924, 20610, 20294, 19974, 19651, 19325, 18997,
|
||||
18665, 18331, 17993, 17653, 17310, 16965, 16617, 16266, 15913, 15558, 15200, 14840, 14477,
|
||||
14113, 13746, 13377, 13006, 12633, 12258, 11881, 11503, 11122, 10740, 10357, 9971, 9584,
|
||||
9196, 8806, 8415, 8023, 7630, 7235, 6839, 6442, 6044, 5646, 5246, 4845, 4444,
|
||||
4042, 3640, 3237, 2833, 2429, 2025, 1620, 1216, 810, 405, 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -106,8 +122,8 @@ f32 gPitchBendFrequencyScale[256] = {
|
||||
0.5f,
|
||||
#else
|
||||
f32 gPitchBendFrequencyScale[255] = {
|
||||
#endif
|
||||
0.5f, 0.502736f, 0.505488f, 0.508254f, 0.511036f, 0.513833f, 0.516645f, 0.519472f, 0.522315f,
|
||||
#endif
|
||||
0.5f, 0.502736f, 0.505488f, 0.508254f, 0.511036f, 0.513833f, 0.516645f, 0.519472f, 0.522315f,
|
||||
0.525174f, 0.528048f, 0.530938f, 0.533843f, 0.536765f, 0.539702f, 0.542656f, 0.545626f, 0.548612f,
|
||||
0.551614f, 0.554633f, 0.557669f, 0.560721f, 0.563789f, 0.566875f, 0.569977f, 0.573097f, 0.576233f,
|
||||
0.579387f, 0.582558f, 0.585746f, 0.588951f, 0.592175f, 0.595415f, 0.598674f, 0.601950f, 0.605245f,
|
||||
@@ -121,7 +137,7 @@ f32 gPitchBendFrequencyScale[255] = {
|
||||
0.858284f, 0.862982f, 0.867704f, 0.872453f, 0.877228f, 0.882029f, 0.886856f, 0.891709f, 0.896590f,
|
||||
0.901496f, 0.906430f, 0.911391f, 0.916379f, 0.921394f, 0.926436f, 0.931507f, 0.936604f, 0.941730f,
|
||||
0.946884f, 0.952066f, 0.957277f, 0.962516f, 0.967783f, 0.973080f, 0.978405f, 0.983760f, 0.989144f,
|
||||
0.994557f, 1.0f, 1.005473f, 1.010975f, 1.016508f, 1.022071f, 1.027665f, 1.033289f, 1.038944f,
|
||||
0.994557f, 1.0f, 1.005473f, 1.010975f, 1.016508f, 1.022071f, 1.027665f, 1.033289f, 1.038944f,
|
||||
1.044630f, 1.050347f, 1.056095f, 1.061875f, 1.067687f, 1.073530f, 1.079405f, 1.085312f, 1.091252f,
|
||||
1.097224f, 1.103229f, 1.109267f, 1.115337f, 1.121441f, 1.127579f, 1.133750f, 1.139955f, 1.146193f,
|
||||
1.152466f, 1.158773f, 1.165115f, 1.171491f, 1.177903f, 1.184349f, 1.190831f, 1.197348f, 1.203901f,
|
||||
@@ -171,30 +187,30 @@ u8 gDefaultShortNoteDurationTable[16] = {
|
||||
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
// gVibratoCurve[k] = k*8
|
||||
s8 gVibratoCurve[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 };
|
||||
s8 gVibratoCurve[16] = {0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120};
|
||||
#endif
|
||||
|
||||
struct AdsrEnvelope gDefaultEnvelope[] = {
|
||||
{ BSWAP16(4), BSWAP16(32000) }, // go from 0 to 32000 over the course of 16ms
|
||||
{ BSWAP16(1000), BSWAP16(32000) }, // stay there for 4.16 seconds
|
||||
{ BSWAP16(ADSR_HANG), 0 } // then continue staying there
|
||||
{BSWAP16(4), BSWAP16(32000)}, // go from 0 to 32000 over the course of 16ms
|
||||
{BSWAP16(1000), BSWAP16(32000)}, // stay there for 4.16 seconds
|
||||
{BSWAP16(ADSR_HANG), 0} // then continue staying there
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_EU
|
||||
struct NoteSubEu gZeroNoteSub = { 0 };
|
||||
struct NoteSubEu gDefaultNoteSub = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL } };
|
||||
struct NoteSubEu gZeroNoteSub = {0};
|
||||
struct NoteSubEu gDefaultNoteSub = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {NULL}};
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
s16 sSawtoothWaves[256] = {
|
||||
0, 1023, 2047, 3071, 4095, 5119, 6143, 7167, 8191, 9215, 10239,
|
||||
11263, 0x2FFF, 13311, 0x37FF, 15359, 0x3FFF, 17407, 0x47FF, 19455, 0x4FFF, 21503,
|
||||
22527, 23551, 24575, 25599, 26623, 27647, 28671, 29695, 30719, 31743, -0x7FFF,
|
||||
-31743, -30719, -29695, -28671, -27647, -26623, -25599, -24575, -23551, -22527, -21503,
|
||||
0, 1023, 2047, 3071, 4095, 5119, 6143, 7167, 8191, 9215, 10239,
|
||||
11263, 0x2FFF, 13311, 0x37FF, 15359, 0x3FFF, 17407, 0x47FF, 19455, 0x4FFF, 21503,
|
||||
22527, 23551, 24575, 25599, 26623, 27647, 28671, 29695, 30719, 31743, -0x7FFF,
|
||||
-31743, -30719, -29695, -28671, -27647, -26623, -25599, -24575, -23551, -22527, -21503,
|
||||
-0x4FFF, -19455, -0x47FF, -17407, -0x3FFF, -15359, -0x37FF, -13311, -0x2FFF, -11263, -10239,
|
||||
-9215, -8191, -7167, -6143, -5119, -4095, -3071, -2047, -1023,
|
||||
0, 0x7FF, 0xFFF, 0x17FF, 0x1FFF, 0x27FF, 0x2FFF, 0x37FF, 0x3FFF, 0x47FF, 0x4FFF,
|
||||
-9215, -8191, -7167, -6143, -5119, -4095, -3071, -2047, -1023,
|
||||
0, 0x7FF, 0xFFF, 0x17FF, 0x1FFF, 0x27FF, 0x2FFF, 0x37FF, 0x3FFF, 0x47FF, 0x4FFF,
|
||||
0x57FF, 0x5FFF, 0x67FF, 0x6FFF, 0x77FF, 0x8001, 0x8801, 0x9001, 0x9801, 0xa001, 0xa801,
|
||||
0xb001, 0xb801, 0xc001, 0xc801, 0xd001, 0xd801, 0xe001, 0xe801, 0xf001, 0xf801, 0x0000,
|
||||
0x07ff, 0x0fff, 0x17ff, 0x1fff, 0x27ff, 0x2fff, 0x37ff, 0x3fff, 0x47ff, 0x4fff, 0x57ff,
|
||||
@@ -337,52 +353,52 @@ s16 gEuUnknownWave7[256] = {
|
||||
0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e,
|
||||
0x0000, 0x1eb2, 0xb1e0, 0x72d2,
|
||||
};
|
||||
s16 *gWaveSamples[6] = { sSawtoothWaves, sTriangleWaves, sSineWaves, sSquareWaves, sEuUnknownWave6, gEuUnknownWave7 };
|
||||
s16 *gWaveSamples[6] = {sSawtoothWaves, sTriangleWaves, sSineWaves, sSquareWaves, sEuUnknownWave6, gEuUnknownWave7};
|
||||
|
||||
#else
|
||||
// !VERSION_EU
|
||||
|
||||
s16 sSineWave[0x40] = {
|
||||
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244,
|
||||
28897, 30272, 31356, 32137, 32609, 0x7FFF, 32609, 32137, 31356, 30272, 28897,
|
||||
27244, 25329, 23169, 20787, 18204, 15446, 12539, 9511, 6392, 3211, 0,
|
||||
-3211, -6392, -9511, -12539, -15446, -18204, -20787, -23169, -25329, -27244, -28897,
|
||||
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244,
|
||||
28897, 30272, 31356, 32137, 32609, 0x7FFF, 32609, 32137, 31356, 30272, 28897,
|
||||
27244, 25329, 23169, 20787, 18204, 15446, 12539, 9511, 6392, 3211, 0,
|
||||
-3211, -6392, -9511, -12539, -15446, -18204, -20787, -23169, -25329, -27244, -28897,
|
||||
-30272, -31356, -32137, -32609, -0x7FFF, -32609, -32137, -31356, -30272, -28897, -27244,
|
||||
-25329, -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211,
|
||||
-25329, -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211,
|
||||
};
|
||||
|
||||
s16 sSquareWave[0x40] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF,
|
||||
0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF,
|
||||
0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF,
|
||||
-0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF,
|
||||
};
|
||||
s16 sTriangleWave[0x40] = {
|
||||
0, 0x7FF, 0xFFF, 0x17FF, 0x1FFF, 0x27FF, 0x2FFF, 0x37FF, 0x3FFF, 0x47FF, 0x4FFF,
|
||||
0x57FF, 0x5FFF, 0x67FF, 0x6FFF, 0x77FF, 0x7FFF, 0x77FF, 0x6FFF, 0x67FF, 0x5FFF, 0x57FF,
|
||||
0x4FFF, 0x47FF, 0x3FFF, 0x37FF, 0x2FFF, 0x27FF, 0x1FFF, 0x17FF, 0xFFF, 0x7FF, 0,
|
||||
-0x7FF, -0xFFF, -0x17FF, -0x1FFF, -10239, -0x2FFF, -0x37FF, -0x3FFF, -0x47FF, -0x4FFF, -22527,
|
||||
-24575, -26623, -28671, -30719, -0x7FFF, -30719, -28671, -26623, -24575, -22527, -0x4FFF,
|
||||
-0x47FF, -0x3FFF, -0x37FF, -0x2FFF, -0x27FF, -0x1FFF, -0x17FF, -0xFFF, -0x7FF,
|
||||
0, 0x7FF, 0xFFF, 0x17FF, 0x1FFF, 0x27FF, 0x2FFF, 0x37FF, 0x3FFF, 0x47FF, 0x4FFF,
|
||||
0x57FF, 0x5FFF, 0x67FF, 0x6FFF, 0x77FF, 0x7FFF, 0x77FF, 0x6FFF, 0x67FF, 0x5FFF, 0x57FF,
|
||||
0x4FFF, 0x47FF, 0x3FFF, 0x37FF, 0x2FFF, 0x27FF, 0x1FFF, 0x17FF, 0xFFF, 0x7FF, 0,
|
||||
-0x7FF, -0xFFF, -0x17FF, -0x1FFF, -10239, -0x2FFF, -0x37FF, -0x3FFF, -0x47FF, -0x4FFF, -22527,
|
||||
-24575, -26623, -28671, -30719, -0x7FFF, -30719, -28671, -26623, -24575, -22527, -0x4FFF,
|
||||
-0x47FF, -0x3FFF, -0x37FF, -0x2FFF, -0x27FF, -0x1FFF, -0x17FF, -0xFFF, -0x7FF,
|
||||
};
|
||||
|
||||
s16 sSawtoothWave[0x40] = {
|
||||
0, 1023, 2047, 3071, 4095, 5119, 6143, 7167, 8191, 9215, 10239,
|
||||
11263, 0x2FFF, 13311, 0x37FF, 15359, 0x3FFF, 17407, 0x47FF, 19455, 0x4FFF, 21503,
|
||||
22527, 23551, 24575, 25599, 26623, 27647, 28671, 29695, 30719, 31743, -0x7FFF,
|
||||
-31743, -30719, -29695, -28671, -27647, -26623, -25599, -24575, -23551, -22527, -21503,
|
||||
0, 1023, 2047, 3071, 4095, 5119, 6143, 7167, 8191, 9215, 10239,
|
||||
11263, 0x2FFF, 13311, 0x37FF, 15359, 0x3FFF, 17407, 0x47FF, 19455, 0x4FFF, 21503,
|
||||
22527, 23551, 24575, 25599, 26623, 27647, 28671, 29695, 30719, 31743, -0x7FFF,
|
||||
-31743, -30719, -29695, -28671, -27647, -26623, -25599, -24575, -23551, -22527, -21503,
|
||||
-0x4FFF, -19455, -0x47FF, -17407, -0x3FFF, -15359, -0x37FF, -13311, -0x2FFF, -11263, -10239,
|
||||
-9215, -8191, -7167, -6143, -5119, -4095, -3071, -2047, -1023,
|
||||
-9215, -8191, -7167, -6143, -5119, -4095, -3071, -2047, -1023,
|
||||
};
|
||||
s16 *gWaveSamples[4] = { sSawtoothWave, sTriangleWave, sSineWave, sSquareWave };
|
||||
s16 *gWaveSamples[4] = {sSawtoothWave, sTriangleWave, sSineWave, sSquareWave};
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
s32 unk_sh_data_0[2] = {0, 0};
|
||||
f32 gPitchBendFrequencyScale[256] = {
|
||||
0.5f, 0.5f, 0.502736f, 0.505488f, 0.508254f, 0.511036f, 0.513833f, 0.516645f, 0.519472f,
|
||||
0.5f, 0.5f, 0.502736f, 0.505488f, 0.508254f, 0.511036f, 0.513833f, 0.516645f, 0.519472f,
|
||||
0.522315f, 0.525174f, 0.528048f, 0.530938f, 0.533843f, 0.536765f, 0.539702f, 0.542656f, 0.545626f,
|
||||
0.548612f, 0.551614f, 0.554633f, 0.557669f, 0.560721f, 0.563789f, 0.566875f, 0.569977f, 0.573097f,
|
||||
0.576233f, 0.579387f, 0.582558f, 0.585746f, 0.588951f, 0.592175f, 0.595415f, 0.598674f, 0.601950f,
|
||||
@@ -396,7 +412,7 @@ f32 gPitchBendFrequencyScale[256] = {
|
||||
0.853613f, 0.858284f, 0.862982f, 0.867704f, 0.872453f, 0.877228f, 0.882029f, 0.886856f, 0.891709f,
|
||||
0.896590f, 0.901496f, 0.906430f, 0.911391f, 0.916379f, 0.921394f, 0.926436f, 0.931507f, 0.936604f,
|
||||
0.941730f, 0.946884f, 0.952066f, 0.957277f, 0.962516f, 0.967783f, 0.973080f, 0.978405f, 0.983760f,
|
||||
0.989144f, 0.994557f, 1.0f, 1.005473f, 1.010975f, 1.016508f, 1.022071f, 1.027665f, 1.033289f,
|
||||
0.989144f, 0.994557f, 1.0f, 1.005473f, 1.010975f, 1.016508f, 1.022071f, 1.027665f, 1.033289f,
|
||||
1.038944f, 1.044630f, 1.050347f, 1.056095f, 1.061875f, 1.067687f, 1.073530f, 1.079405f, 1.085312f,
|
||||
1.091252f, 1.097224f, 1.103229f, 1.109267f, 1.115337f, 1.121441f, 1.127579f, 1.133750f, 1.139955f,
|
||||
1.146193f, 1.152466f, 1.158773f, 1.165115f, 1.171491f, 1.177903f, 1.184349f, 1.190831f, 1.197348f,
|
||||
@@ -416,38 +432,38 @@ f32 gPitchBendFrequencyScale[256] = {
|
||||
|
||||
#ifdef VERSION_SH
|
||||
f32 unk_sh_data_1[] = {
|
||||
0.890899f, 0.890899f, 0.89171f, 0.892521f, 0.893333f, 0.894146f, 0.89496f, 0.895774f,
|
||||
0.89659f, 0.897406f, 0.898222f, 0.89904f, 0.899858f, 0.900677f, 0.901496f, 0.902317f,
|
||||
0.903138f, 0.90396f, 0.904783f, 0.905606f, 0.90643f, 0.907255f, 0.908081f, 0.908907f,
|
||||
0.909734f, 0.910562f, 0.911391f, 0.91222f, 0.91305f, 0.913881f, 0.914713f, 0.915545f,
|
||||
0.916379f, 0.917213f, 0.918047f, 0.918883f, 0.919719f, 0.920556f, 0.921394f, 0.922232f,
|
||||
0.923072f, 0.923912f, 0.924752f, 0.925594f, 0.926436f, 0.927279f, 0.928123f, 0.928968f,
|
||||
0.929813f, 0.93066f, 0.931507f, 0.932354f, 0.933203f, 0.934052f, 0.934902f, 0.935753f,
|
||||
0.936604f, 0.937457f, 0.93831f, 0.939164f, 0.940019f, 0.940874f, 0.94173f, 0.942587f,
|
||||
0.943445f, 0.944304f, 0.945163f, 0.946023f, 0.946884f, 0.947746f, 0.948608f, 0.949472f,
|
||||
0.950336f, 0.951201f, 0.952066f, 0.952933f, 0.9538f, 0.954668f, 0.955537f, 0.956406f,
|
||||
0.957277f, 0.958148f, 0.95902f, 0.959893f, 0.960766f, 0.961641f, 0.962516f, 0.963392f,
|
||||
0.964268f, 0.965146f, 0.966024f, 0.966903f, 0.967783f, 0.968664f, 0.969546f, 0.970428f,
|
||||
0.971311f, 0.972195f, 0.97308f, 0.973965f, 0.974852f, 0.975739f, 0.976627f, 0.977516f,
|
||||
0.978405f, 0.979296f, 0.980187f, 0.981079f, 0.981972f, 0.982865f, 0.98376f, 0.984655f,
|
||||
0.985551f, 0.986448f, 0.987346f, 0.988244f, 0.989144f, 0.990044f, 0.990945f, 0.991847f,
|
||||
0.992749f, 0.993653f, 0.994557f, 0.995462f, 0.996368f, 0.997275f, 0.998182f, 0.999091f,
|
||||
1.0f, 1.00091f, 1.001821f, 1.002733f, 1.003645f, 1.004559f, 1.005473f, 1.006388f,
|
||||
1.007304f, 1.00822f, 1.009138f, 1.010056f, 1.010975f, 1.011896f, 1.012816f, 1.013738f,
|
||||
1.014661f, 1.015584f, 1.016508f, 1.017433f, 1.018359f, 1.019286f, 1.020214f, 1.021142f,
|
||||
1.022071f, 1.023002f, 1.023933f, 1.024864f, 1.025797f, 1.026731f, 1.027665f, 1.0286f,
|
||||
1.029536f, 1.030473f, 1.031411f, 1.03235f, 1.033289f, 1.03423f, 1.035171f, 1.036113f,
|
||||
1.037056f, 1.038f, 1.038944f, 1.03989f, 1.040836f, 1.041783f, 1.042731f, 1.04368f,
|
||||
1.04463f, 1.045581f, 1.046532f, 1.047485f, 1.048438f, 1.049392f, 1.050347f, 1.051303f,
|
||||
1.05226f, 1.053217f, 1.054176f, 1.055135f, 1.056095f, 1.057056f, 1.058018f, 1.058981f,
|
||||
1.059945f, 1.06091f, 1.061875f, 1.062842f, 1.063809f, 1.064777f, 1.065746f, 1.066716f,
|
||||
1.067687f, 1.068658f, 1.069631f, 1.070604f, 1.071578f, 1.072554f, 1.07353f, 1.074507f,
|
||||
1.075485f, 1.076463f, 1.077443f, 1.078424f, 1.079405f, 1.080387f, 1.08137f, 1.082355f,
|
||||
1.08334f, 1.084325f, 1.085312f, 1.0863f, 1.087289f, 1.088278f, 1.089268f, 1.09026f,
|
||||
1.091252f, 1.092245f, 1.093239f, 1.094234f, 1.09523f, 1.096226f, 1.097224f, 1.098223f,
|
||||
1.099222f, 1.100222f, 1.101224f, 1.102226f, 1.103229f, 1.104233f, 1.105238f, 1.106244f,
|
||||
1.10725f, 1.108258f, 1.109267f, 1.110276f, 1.111287f, 1.112298f, 1.11331f, 1.114323f,
|
||||
1.115337f, 1.116352f, 1.117368f, 1.118385f, 1.119403f, 1.120422f, 1.121441f, 1.122462f,
|
||||
0.890899f, 0.890899f, 0.89171f, 0.892521f, 0.893333f, 0.894146f, 0.89496f, 0.895774f,
|
||||
0.89659f, 0.897406f, 0.898222f, 0.89904f, 0.899858f, 0.900677f, 0.901496f, 0.902317f,
|
||||
0.903138f, 0.90396f, 0.904783f, 0.905606f, 0.90643f, 0.907255f, 0.908081f, 0.908907f,
|
||||
0.909734f, 0.910562f, 0.911391f, 0.91222f, 0.91305f, 0.913881f, 0.914713f, 0.915545f,
|
||||
0.916379f, 0.917213f, 0.918047f, 0.918883f, 0.919719f, 0.920556f, 0.921394f, 0.922232f,
|
||||
0.923072f, 0.923912f, 0.924752f, 0.925594f, 0.926436f, 0.927279f, 0.928123f, 0.928968f,
|
||||
0.929813f, 0.93066f, 0.931507f, 0.932354f, 0.933203f, 0.934052f, 0.934902f, 0.935753f,
|
||||
0.936604f, 0.937457f, 0.93831f, 0.939164f, 0.940019f, 0.940874f, 0.94173f, 0.942587f,
|
||||
0.943445f, 0.944304f, 0.945163f, 0.946023f, 0.946884f, 0.947746f, 0.948608f, 0.949472f,
|
||||
0.950336f, 0.951201f, 0.952066f, 0.952933f, 0.9538f, 0.954668f, 0.955537f, 0.956406f,
|
||||
0.957277f, 0.958148f, 0.95902f, 0.959893f, 0.960766f, 0.961641f, 0.962516f, 0.963392f,
|
||||
0.964268f, 0.965146f, 0.966024f, 0.966903f, 0.967783f, 0.968664f, 0.969546f, 0.970428f,
|
||||
0.971311f, 0.972195f, 0.97308f, 0.973965f, 0.974852f, 0.975739f, 0.976627f, 0.977516f,
|
||||
0.978405f, 0.979296f, 0.980187f, 0.981079f, 0.981972f, 0.982865f, 0.98376f, 0.984655f,
|
||||
0.985551f, 0.986448f, 0.987346f, 0.988244f, 0.989144f, 0.990044f, 0.990945f, 0.991847f,
|
||||
0.992749f, 0.993653f, 0.994557f, 0.995462f, 0.996368f, 0.997275f, 0.998182f, 0.999091f,
|
||||
1.0f, 1.00091f, 1.001821f, 1.002733f, 1.003645f, 1.004559f, 1.005473f, 1.006388f,
|
||||
1.007304f, 1.00822f, 1.009138f, 1.010056f, 1.010975f, 1.011896f, 1.012816f, 1.013738f,
|
||||
1.014661f, 1.015584f, 1.016508f, 1.017433f, 1.018359f, 1.019286f, 1.020214f, 1.021142f,
|
||||
1.022071f, 1.023002f, 1.023933f, 1.024864f, 1.025797f, 1.026731f, 1.027665f, 1.0286f,
|
||||
1.029536f, 1.030473f, 1.031411f, 1.03235f, 1.033289f, 1.03423f, 1.035171f, 1.036113f,
|
||||
1.037056f, 1.038f, 1.038944f, 1.03989f, 1.040836f, 1.041783f, 1.042731f, 1.04368f,
|
||||
1.04463f, 1.045581f, 1.046532f, 1.047485f, 1.048438f, 1.049392f, 1.050347f, 1.051303f,
|
||||
1.05226f, 1.053217f, 1.054176f, 1.055135f, 1.056095f, 1.057056f, 1.058018f, 1.058981f,
|
||||
1.059945f, 1.06091f, 1.061875f, 1.062842f, 1.063809f, 1.064777f, 1.065746f, 1.066716f,
|
||||
1.067687f, 1.068658f, 1.069631f, 1.070604f, 1.071578f, 1.072554f, 1.07353f, 1.074507f,
|
||||
1.075485f, 1.076463f, 1.077443f, 1.078424f, 1.079405f, 1.080387f, 1.08137f, 1.082355f,
|
||||
1.08334f, 1.084325f, 1.085312f, 1.0863f, 1.087289f, 1.088278f, 1.089268f, 1.09026f,
|
||||
1.091252f, 1.092245f, 1.093239f, 1.094234f, 1.09523f, 1.096226f, 1.097224f, 1.098223f,
|
||||
1.099222f, 1.100222f, 1.101224f, 1.102226f, 1.103229f, 1.104233f, 1.105238f, 1.106244f,
|
||||
1.10725f, 1.108258f, 1.109267f, 1.110276f, 1.111287f, 1.112298f, 1.11331f, 1.114323f,
|
||||
1.115337f, 1.116352f, 1.117368f, 1.118385f, 1.119403f, 1.120422f, 1.121441f, 1.122462f,
|
||||
};
|
||||
|
||||
// Shindou moved these variables down here. :/
|
||||
@@ -476,43 +492,43 @@ u8 gDefaultShortNoteDurationTable[16] = {
|
||||
};
|
||||
|
||||
struct AdsrEnvelope gDefaultEnvelope[] = {
|
||||
{ BSWAP16(4), BSWAP16(32000) }, // go from 0 to 32000 over the course of 16ms
|
||||
{ BSWAP16(1000), BSWAP16(32000) }, // stay there for 4.16 seconds
|
||||
{ BSWAP16(ADSR_HANG), 0 } // then continue staying there
|
||||
{BSWAP16(4), BSWAP16(32000)}, // go from 0 to 32000 over the course of 16ms
|
||||
{BSWAP16(1000), BSWAP16(32000)}, // stay there for 4.16 seconds
|
||||
{BSWAP16(ADSR_HANG), 0} // then continue staying there
|
||||
};
|
||||
|
||||
u8 unk_sh_data2[4] = { 0, 0, 0, 0 };
|
||||
u8 unk_sh_data2[4] = {0, 0, 0, 0};
|
||||
|
||||
struct NoteSubEu gZeroNoteSub = { 0 };
|
||||
struct NoteSubEu gZeroNoteSub = {0};
|
||||
struct NoteSubEu gDefaultNoteSub = {
|
||||
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL },
|
||||
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {NULL},
|
||||
#ifdef VERSION_SH
|
||||
0
|
||||
0
|
||||
#endif
|
||||
};
|
||||
|
||||
u16 gHeadsetPanQuantization[0x40] = {
|
||||
0x3C, 0x3A, 0x38, 0x36, 0x34, 0x32, 0x30, 0x2E,
|
||||
0x2C, 0x2A, 0x28, 0x26, 0x24, 0x22, 0x20, 0x1E,
|
||||
0x1C, 0x1A, 0x18, 0x16, 0x14, 0x12, 0x10, 0x0E,
|
||||
0x0C, 0x0A, 0x08, 0x06, 0x04, 0x02,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0x3C, 0x3A, 0x38, 0x36, 0x34, 0x32, 0x30, 0x2E,
|
||||
0x2C, 0x2A, 0x28, 0x26, 0x24, 0x22, 0x20, 0x1E,
|
||||
0x1C, 0x1A, 0x18, 0x16, 0x14, 0x12, 0x10, 0x0E,
|
||||
0x0C, 0x0A, 0x08, 0x06, 0x04, 0x02,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_EU
|
||||
u8 euUnknownData_8030194c[4] = { 0x40, 0x20, 0x10, 0x08 };
|
||||
u8 euUnknownData_8030194c[4] = {0x40, 0x20, 0x10, 0x08};
|
||||
u16 gHeadsetPanQuantization[0x10] = {
|
||||
0x40, 0x40, 0x30, 0x30, 0x20, 0x20, 0x10, 0, 0, 0,
|
||||
};
|
||||
#elif !defined(VERSION_SH)
|
||||
u16 gHeadsetPanQuantization[10] = { 0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0 };
|
||||
u16 gHeadsetPanQuantization[10] = {0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0};
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
s16 euUnknownData_80301950[64] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0,
|
||||
};
|
||||
#endif
|
||||
@@ -522,21 +538,21 @@ s16 euUnknownData_80301950[64] = {
|
||||
// f(1/2 * 127) = 1/sqrt(2)
|
||||
// f(2/2 * 127) = 0
|
||||
f32 gHeadsetPanVolume[128] = {
|
||||
1.0f, 0.995386f, 0.990772f, 0.986157f, 0.981543f, 0.976929f, 0.972315f, 0.967701f, 0.963087f,
|
||||
0.958472f, 0.953858f, 0.949244f, 0.94463f, 0.940016f, 0.935402f, 0.930787f, 0.926173f, 0.921559f,
|
||||
0.916945f, 0.912331f, 0.907717f, 0.903102f, 0.898488f, 0.893874f, 0.88926f, 0.884646f, 0.880031f,
|
||||
1.0f, 0.995386f, 0.990772f, 0.986157f, 0.981543f, 0.976929f, 0.972315f, 0.967701f, 0.963087f,
|
||||
0.958472f, 0.953858f, 0.949244f, 0.94463f, 0.940016f, 0.935402f, 0.930787f, 0.926173f, 0.921559f,
|
||||
0.916945f, 0.912331f, 0.907717f, 0.903102f, 0.898488f, 0.893874f, 0.88926f, 0.884646f, 0.880031f,
|
||||
0.875417f, 0.870803f, 0.866189f, 0.861575f, 0.856961f, 0.852346f, 0.847732f, 0.843118f, 0.838504f,
|
||||
0.83389f, 0.829276f, 0.824661f, 0.820047f, 0.815433f, 0.810819f, 0.806205f, 0.801591f, 0.796976f,
|
||||
0.792362f, 0.787748f, 0.783134f, 0.77852f, 0.773906f, 0.769291f, 0.764677f, 0.760063f, 0.755449f,
|
||||
0.750835f, 0.74622f, 0.741606f, 0.736992f, 0.732378f, 0.727764f, 0.72315f, 0.718535f, 0.713921f,
|
||||
0.709307f, 0.70537f, 0.70211f, 0.69885f, 0.695591f, 0.692331f, 0.689071f, 0.685811f, 0.682551f,
|
||||
0.83389f, 0.829276f, 0.824661f, 0.820047f, 0.815433f, 0.810819f, 0.806205f, 0.801591f, 0.796976f,
|
||||
0.792362f, 0.787748f, 0.783134f, 0.77852f, 0.773906f, 0.769291f, 0.764677f, 0.760063f, 0.755449f,
|
||||
0.750835f, 0.74622f, 0.741606f, 0.736992f, 0.732378f, 0.727764f, 0.72315f, 0.718535f, 0.713921f,
|
||||
0.709307f, 0.70537f, 0.70211f, 0.69885f, 0.695591f, 0.692331f, 0.689071f, 0.685811f, 0.682551f,
|
||||
0.679291f, 0.676031f, 0.672772f, 0.669512f, 0.666252f, 0.662992f, 0.659732f, 0.656472f, 0.653213f,
|
||||
0.649953f, 0.646693f, 0.643433f, 0.640173f, 0.636913f, 0.633654f, 0.630394f, 0.627134f, 0.623874f,
|
||||
0.620614f, 0.617354f, 0.614094f, 0.610835f, 0.607575f, 0.604315f, 0.601055f, 0.597795f, 0.594535f,
|
||||
0.591276f, 0.588016f, 0.584756f, 0.581496f, 0.578236f, 0.574976f, 0.571717f, 0.568457f, 0.565197f,
|
||||
0.561937f, 0.558677f, 0.555417f, 0.552157f, 0.548898f, 0.545638f, 0.542378f, 0.539118f, 0.535858f,
|
||||
0.532598f, 0.529339f, 0.526079f, 0.522819f, 0.519559f, 0.516299f, 0.513039f, 0.50978f, 0.50652f,
|
||||
0.50326f, 0.5f
|
||||
0.532598f, 0.529339f, 0.526079f, 0.522819f, 0.519559f, 0.516299f, 0.513039f, 0.50978f, 0.50652f,
|
||||
0.50326f, 0.5f
|
||||
};
|
||||
|
||||
// Linearly interpolated between
|
||||
@@ -546,165 +562,165 @@ f32 gHeadsetPanVolume[128] = {
|
||||
// f(3/4 * 127) = 0
|
||||
// f(4/4 * 127) = 1/sqrt(8)
|
||||
f32 gStereoPanVolume[128] = {
|
||||
0.707f, 0.716228f, 0.725457f, 0.734685f, 0.743913f, 0.753142f, 0.76237f, 0.771598f, 0.780827f,
|
||||
0.790055f, 0.799283f, 0.808512f, 0.81774f, 0.826968f, 0.836197f, 0.845425f, 0.854654f, 0.863882f,
|
||||
0.87311f, 0.882339f, 0.891567f, 0.900795f, 0.910024f, 0.919252f, 0.92848f, 0.937709f, 0.946937f,
|
||||
0.956165f, 0.965394f, 0.974622f, 0.98385f, 0.993079f, 0.997693f, 0.988465f, 0.979236f, 0.970008f,
|
||||
0.707f, 0.716228f, 0.725457f, 0.734685f, 0.743913f, 0.753142f, 0.76237f, 0.771598f, 0.780827f,
|
||||
0.790055f, 0.799283f, 0.808512f, 0.81774f, 0.826968f, 0.836197f, 0.845425f, 0.854654f, 0.863882f,
|
||||
0.87311f, 0.882339f, 0.891567f, 0.900795f, 0.910024f, 0.919252f, 0.92848f, 0.937709f, 0.946937f,
|
||||
0.956165f, 0.965394f, 0.974622f, 0.98385f, 0.993079f, 0.997693f, 0.988465f, 0.979236f, 0.970008f,
|
||||
0.960779f, 0.951551f, 0.942323f, 0.933095f, 0.923866f, 0.914638f, 0.905409f, 0.896181f, 0.886953f,
|
||||
0.877724f, 0.868496f, 0.859268f, 0.850039f, 0.840811f, 0.831583f, 0.822354f, 0.813126f, 0.803898f,
|
||||
0.794669f, 0.785441f, 0.776213f, 0.766984f, 0.757756f, 0.748528f, 0.739299f, 0.730071f, 0.720843f,
|
||||
0.711614f, 0.695866f, 0.673598f, 0.651331f, 0.629063f, 0.606795f, 0.584528f, 0.56226f, 0.539992f,
|
||||
0.517724f, 0.495457f, 0.473189f, 0.450921f, 0.428654f, 0.406386f, 0.384118f, 0.36185f, 0.339583f,
|
||||
0.317315f, 0.295047f, 0.27278f, 0.250512f, 0.228244f, 0.205976f, 0.183709f, 0.161441f, 0.139173f,
|
||||
0.116905f, 0.094638f, 0.07237f, 0.050102f, 0.027835f, 0.005567f, 0.00835f, 0.019484f, 0.030618f,
|
||||
0.041752f, 0.052886f, 0.06402f, 0.075154f, 0.086287f, 0.097421f, 0.108555f, 0.119689f, 0.130823f,
|
||||
0.141957f, 0.153091f, 0.164224f, 0.175358f, 0.186492f, 0.197626f, 0.20876f, 0.219894f, 0.231028f,
|
||||
0.711614f, 0.695866f, 0.673598f, 0.651331f, 0.629063f, 0.606795f, 0.584528f, 0.56226f, 0.539992f,
|
||||
0.517724f, 0.495457f, 0.473189f, 0.450921f, 0.428654f, 0.406386f, 0.384118f, 0.36185f, 0.339583f,
|
||||
0.317315f, 0.295047f, 0.27278f, 0.250512f, 0.228244f, 0.205976f, 0.183709f, 0.161441f, 0.139173f,
|
||||
0.116905f, 0.094638f, 0.07237f, 0.050102f, 0.027835f, 0.005567f, 0.00835f, 0.019484f, 0.030618f,
|
||||
0.041752f, 0.052886f, 0.06402f, 0.075154f, 0.086287f, 0.097421f, 0.108555f, 0.119689f, 0.130823f,
|
||||
0.141957f, 0.153091f, 0.164224f, 0.175358f, 0.186492f, 0.197626f, 0.20876f, 0.219894f, 0.231028f,
|
||||
0.242161f, 0.253295f, 0.264429f, 0.275563f, 0.286697f, 0.297831f, 0.308965f, 0.320098f, 0.331232f,
|
||||
0.342366f, 0.3535f
|
||||
};
|
||||
|
||||
// gDefaultVolume[k] = cos(pi/2 * k / 127)
|
||||
f32 gDefaultPanVolume[128] = {
|
||||
1.0f, 0.999924f, 0.999694f, 0.999312f, 0.998776f, 0.998088f, 0.997248f, 0.996254f, 0.995109f,
|
||||
1.0f, 0.999924f, 0.999694f, 0.999312f, 0.998776f, 0.998088f, 0.997248f, 0.996254f, 0.995109f,
|
||||
0.993811f, 0.992361f, 0.990759f, 0.989006f, 0.987101f, 0.985045f, 0.982839f, 0.980482f, 0.977976f,
|
||||
0.97532f, 0.972514f, 0.96956f, 0.966457f, 0.963207f, 0.959809f, 0.956265f, 0.952574f, 0.948737f,
|
||||
0.944755f, 0.940629f, 0.936359f, 0.931946f, 0.92739f, 0.922692f, 0.917853f, 0.912873f, 0.907754f,
|
||||
0.97532f, 0.972514f, 0.96956f, 0.966457f, 0.963207f, 0.959809f, 0.956265f, 0.952574f, 0.948737f,
|
||||
0.944755f, 0.940629f, 0.936359f, 0.931946f, 0.92739f, 0.922692f, 0.917853f, 0.912873f, 0.907754f,
|
||||
0.902497f, 0.897101f, 0.891567f, 0.885898f, 0.880093f, 0.874153f, 0.868079f, 0.861873f, 0.855535f,
|
||||
0.849066f, 0.842467f, 0.835739f, 0.828884f, 0.821901f, 0.814793f, 0.807561f, 0.800204f, 0.792725f,
|
||||
0.785125f, 0.777405f, 0.769566f, 0.76161f, 0.753536f, 0.745348f, 0.737045f, 0.72863f, 0.720103f,
|
||||
0.711466f, 0.70272f, 0.693867f, 0.684908f, 0.675843f, 0.666676f, 0.657406f, 0.648036f, 0.638567f,
|
||||
0.629f, 0.619337f, 0.609579f, 0.599728f, 0.589785f, 0.579752f, 0.56963f, 0.559421f, 0.549126f,
|
||||
0.538748f, 0.528287f, 0.517745f, 0.507124f, 0.496425f, 0.485651f, 0.474802f, 0.46388f, 0.452888f,
|
||||
0.785125f, 0.777405f, 0.769566f, 0.76161f, 0.753536f, 0.745348f, 0.737045f, 0.72863f, 0.720103f,
|
||||
0.711466f, 0.70272f, 0.693867f, 0.684908f, 0.675843f, 0.666676f, 0.657406f, 0.648036f, 0.638567f,
|
||||
0.629f, 0.619337f, 0.609579f, 0.599728f, 0.589785f, 0.579752f, 0.56963f, 0.559421f, 0.549126f,
|
||||
0.538748f, 0.528287f, 0.517745f, 0.507124f, 0.496425f, 0.485651f, 0.474802f, 0.46388f, 0.452888f,
|
||||
0.441826f, 0.430697f, 0.419502f, 0.408243f, 0.396921f, 0.385538f, 0.374097f, 0.362598f, 0.351044f,
|
||||
0.339436f, 0.327776f, 0.316066f, 0.304308f, 0.292503f, 0.280653f, 0.268761f, 0.256827f, 0.244854f,
|
||||
0.232844f, 0.220798f, 0.208718f, 0.196606f, 0.184465f, 0.172295f, 0.160098f, 0.147877f, 0.135634f,
|
||||
0.12337f, 0.111087f, 0.098786f, 0.086471f, 0.074143f, 0.061803f, 0.049454f, 0.037097f, 0.024734f,
|
||||
0.12337f, 0.111087f, 0.098786f, 0.086471f, 0.074143f, 0.061803f, 0.049454f, 0.037097f, 0.024734f,
|
||||
0.012368f, 0.0f
|
||||
};
|
||||
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
// gVolRampingLhs136[k] = 2^16 * max(1, (256*k)^(1/17)
|
||||
f32 gVolRampingLhs136[128] = {
|
||||
65536.0f, 90811.555f, 94590.766f, 96873.96f, 98527.26f, 99829.06f, 100905.47f,
|
||||
101824.61f, 102627.57f, 103341.086f, 103983.55f, 104568.164f, 105104.75f, 105600.8f,
|
||||
106062.14f, 106493.46f, 106898.52f, 107280.414f, 107641.73f, 107984.62f, 108310.93f,
|
||||
108622.23f, 108919.875f, 109205.055f, 109478.8f, 109742.0f, 109995.48f, 110239.94f,
|
||||
110476.02f, 110704.305f, 110925.3f, 111139.45f, 111347.21f, 111548.945f, 111745.0f,
|
||||
111935.7f, 112121.35f, 112302.2f, 112478.51f, 112650.51f, 112818.4f, 112982.38f,
|
||||
113142.66f, 113299.37f, 113452.69f, 113602.766f, 113749.734f, 113893.73f, 114034.87f,
|
||||
114173.26f, 114309.02f, 114442.26f, 114573.055f, 114701.5f, 114827.69f, 114951.695f,
|
||||
115073.6f, 115193.47f, 115311.375f, 115427.39f, 115541.56f, 115653.96f, 115764.63f,
|
||||
115873.64f, 115981.04f, 116086.86f, 116191.164f, 116293.99f, 116395.38f, 116495.38f,
|
||||
116594.02f, 116691.34f, 116787.39f, 116882.19f, 116975.77f, 117068.17f, 117159.414f,
|
||||
117249.54f, 117338.57f, 117426.53f, 117513.45f, 117599.35f, 117684.266f, 117768.2f,
|
||||
117851.195f, 117933.266f, 118014.44f, 118094.72f, 118174.14f, 118252.71f, 118330.46f,
|
||||
118407.4f, 118483.55f, 118558.914f, 118633.53f, 118707.4f, 118780.54f, 118852.97f,
|
||||
118924.695f, 118995.74f, 119066.11f, 119135.82f, 119204.88f, 119273.31f, 119341.125f,
|
||||
119408.32f, 119474.92f, 119540.93f, 119606.36f, 119671.22f, 119735.52f, 119799.28f,
|
||||
119862.5f, 119925.195f, 119987.36f, 120049.02f, 120110.18f, 120170.84f, 120231.016f,
|
||||
120290.71f, 120349.945f, 120408.7f, 120467.016f, 120524.875f, 120582.3f, 120639.28f,
|
||||
120695.84f, 120751.984f
|
||||
65536.0f, 90811.555f, 94590.766f, 96873.96f, 98527.26f, 99829.06f, 100905.47f,
|
||||
101824.61f, 102627.57f, 103341.086f, 103983.55f, 104568.164f, 105104.75f, 105600.8f,
|
||||
106062.14f, 106493.46f, 106898.52f, 107280.414f, 107641.73f, 107984.62f, 108310.93f,
|
||||
108622.23f, 108919.875f, 109205.055f, 109478.8f, 109742.0f, 109995.48f, 110239.94f,
|
||||
110476.02f, 110704.305f, 110925.3f, 111139.45f, 111347.21f, 111548.945f, 111745.0f,
|
||||
111935.7f, 112121.35f, 112302.2f, 112478.51f, 112650.51f, 112818.4f, 112982.38f,
|
||||
113142.66f, 113299.37f, 113452.69f, 113602.766f, 113749.734f, 113893.73f, 114034.87f,
|
||||
114173.26f, 114309.02f, 114442.26f, 114573.055f, 114701.5f, 114827.69f, 114951.695f,
|
||||
115073.6f, 115193.47f, 115311.375f, 115427.39f, 115541.56f, 115653.96f, 115764.63f,
|
||||
115873.64f, 115981.04f, 116086.86f, 116191.164f, 116293.99f, 116395.38f, 116495.38f,
|
||||
116594.02f, 116691.34f, 116787.39f, 116882.19f, 116975.77f, 117068.17f, 117159.414f,
|
||||
117249.54f, 117338.57f, 117426.53f, 117513.45f, 117599.35f, 117684.266f, 117768.2f,
|
||||
117851.195f, 117933.266f, 118014.44f, 118094.72f, 118174.14f, 118252.71f, 118330.46f,
|
||||
118407.4f, 118483.55f, 118558.914f, 118633.53f, 118707.4f, 118780.54f, 118852.97f,
|
||||
118924.695f, 118995.74f, 119066.11f, 119135.82f, 119204.88f, 119273.31f, 119341.125f,
|
||||
119408.32f, 119474.92f, 119540.93f, 119606.36f, 119671.22f, 119735.52f, 119799.28f,
|
||||
119862.5f, 119925.195f, 119987.36f, 120049.02f, 120110.18f, 120170.84f, 120231.016f,
|
||||
120290.71f, 120349.945f, 120408.7f, 120467.016f, 120524.875f, 120582.3f, 120639.28f,
|
||||
120695.84f, 120751.984f
|
||||
};
|
||||
|
||||
// gVolRampingRhs136[k] = 1 / max(1, (256*k)^(1/17))
|
||||
f32 gVolRampingRhs136[128] = {
|
||||
1.0f, 0.72167f, 0.692837f, 0.676508f, 0.665156f, 0.656482f, 0.649479f, 0.643616f, 0.638581f,
|
||||
0.634172f, 0.630254f, 0.62673f, 0.62353f, 0.620601f, 0.617902f, 0.615399f, 0.613067f, 0.610885f,
|
||||
0.608835f, 0.606901f, 0.605073f, 0.603339f, 0.60169f, 0.600119f, 0.598618f, 0.597183f, 0.595806f,
|
||||
1.0f, 0.72167f, 0.692837f, 0.676508f, 0.665156f, 0.656482f, 0.649479f, 0.643616f, 0.638581f,
|
||||
0.634172f, 0.630254f, 0.62673f, 0.62353f, 0.620601f, 0.617902f, 0.615399f, 0.613067f, 0.610885f,
|
||||
0.608835f, 0.606901f, 0.605073f, 0.603339f, 0.60169f, 0.600119f, 0.598618f, 0.597183f, 0.595806f,
|
||||
0.594485f, 0.593215f, 0.591991f, 0.590812f, 0.589674f, 0.588573f, 0.587509f, 0.586478f, 0.585479f,
|
||||
0.58451f, 0.583568f, 0.582654f, 0.581764f, 0.580898f, 0.580055f, 0.579233f, 0.578432f, 0.57765f,
|
||||
0.58451f, 0.583568f, 0.582654f, 0.581764f, 0.580898f, 0.580055f, 0.579233f, 0.578432f, 0.57765f,
|
||||
0.576887f, 0.576142f, 0.575414f, 0.574701f, 0.574005f, 0.573323f, 0.572656f, 0.572002f, 0.571361f,
|
||||
0.570733f, 0.570118f, 0.569514f, 0.568921f, 0.568339f, 0.567768f, 0.567207f, 0.566656f, 0.566114f,
|
||||
0.565582f, 0.565058f, 0.564543f, 0.564036f, 0.563537f, 0.563046f, 0.562563f, 0.562087f, 0.561618f,
|
||||
0.561156f, 0.560701f, 0.560253f, 0.559811f, 0.559375f, 0.558945f, 0.558521f, 0.558102f, 0.557689f,
|
||||
0.557282f, 0.55688f, 0.556483f, 0.556091f, 0.555704f, 0.555322f, 0.554944f, 0.554571f, 0.554203f,
|
||||
0.553839f, 0.553479f, 0.553123f, 0.552772f, 0.552424f, 0.55208f, 0.55174f, 0.551404f, 0.551071f,
|
||||
0.557282f, 0.55688f, 0.556483f, 0.556091f, 0.555704f, 0.555322f, 0.554944f, 0.554571f, 0.554203f,
|
||||
0.553839f, 0.553479f, 0.553123f, 0.552772f, 0.552424f, 0.55208f, 0.55174f, 0.551404f, 0.551071f,
|
||||
0.550742f, 0.550417f, 0.550095f, 0.549776f, 0.549461f, 0.549148f, 0.548839f, 0.548534f, 0.548231f,
|
||||
0.547931f, 0.547634f, 0.54734f, 0.547048f, 0.54676f, 0.546474f, 0.546191f, 0.54591f, 0.545632f,
|
||||
0.545357f, 0.545084f, 0.544813f, 0.544545f, 0.54428f, 0.544016f, 0.543755f, 0.543496f, 0.543239f,
|
||||
0.547931f, 0.547634f, 0.54734f, 0.547048f, 0.54676f, 0.546474f, 0.546191f, 0.54591f, 0.545632f,
|
||||
0.545357f, 0.545084f, 0.544813f, 0.544545f, 0.54428f, 0.544016f, 0.543755f, 0.543496f, 0.543239f,
|
||||
0.542985f, 0.542732f
|
||||
};
|
||||
|
||||
// gVolRampingLhs144[k] = 2^16 * max(1, (256*k)^(1/18))
|
||||
f32 gVolRampingLhs144[128] = {
|
||||
65536.0f, 89180.734f, 92681.9f, 94793.33f, 96320.52f, 97522.02f, 98514.84f,
|
||||
99362.14f, 100101.99f, 100759.16f, 101350.664f, 101888.74f, 102382.46f, 102838.75f,
|
||||
103263.016f, 103659.58f, 104031.914f, 104382.89f, 104714.88f, 105029.89f, 105329.61f,
|
||||
105615.5f, 105888.81f, 106150.63f, 106401.914f, 106643.49f, 106876.12f, 107100.44f,
|
||||
107317.05f, 107526.47f, 107729.17f, 107925.6f, 108116.125f, 108301.12f, 108480.88f,
|
||||
108655.72f, 108825.91f, 108991.68f, 109153.28f, 109310.914f, 109464.77f, 109615.04f,
|
||||
109761.88f, 109905.46f, 110045.92f, 110183.41f, 110318.02f, 110449.91f, 110579.17f,
|
||||
110705.914f, 110830.234f, 110952.234f, 111071.99f, 111189.59f, 111305.12f, 111418.64f,
|
||||
111530.23f, 111639.95f, 111747.875f, 111854.05f, 111958.54f, 112061.4f, 112162.67f,
|
||||
112262.42f, 112360.68f, 112457.51f, 112552.93f, 112647.0f, 112739.76f, 112831.23f,
|
||||
112921.46f, 113010.484f, 113098.33f, 113185.02f, 113270.61f, 113355.11f, 113438.555f,
|
||||
113520.97f, 113602.375f, 113682.805f, 113762.27f, 113840.81f, 113918.44f, 113995.18f,
|
||||
114071.055f, 114146.08f, 114220.266f, 114293.65f, 114366.24f, 114438.06f, 114509.12f,
|
||||
114579.44f, 114649.02f, 114717.91f, 114786.086f, 114853.586f, 114920.42f, 114986.6f,
|
||||
115052.14f, 115117.055f, 115181.34f, 115245.04f, 115308.13f, 115370.65f, 115432.59f,
|
||||
115493.98f, 115554.81f, 115615.11f, 115674.875f, 115734.12f, 115792.85f, 115851.08f,
|
||||
115908.82f, 115966.07f, 116022.85f, 116079.16f, 116135.01f, 116190.4f, 116245.35f,
|
||||
116299.87f, 116353.945f, 116407.6f, 116460.84f, 116513.67f, 116566.09f, 116618.125f,
|
||||
116669.76f, 116721.01f
|
||||
65536.0f, 89180.734f, 92681.9f, 94793.33f, 96320.52f, 97522.02f, 98514.84f,
|
||||
99362.14f, 100101.99f, 100759.16f, 101350.664f, 101888.74f, 102382.46f, 102838.75f,
|
||||
103263.016f, 103659.58f, 104031.914f, 104382.89f, 104714.88f, 105029.89f, 105329.61f,
|
||||
105615.5f, 105888.81f, 106150.63f, 106401.914f, 106643.49f, 106876.12f, 107100.44f,
|
||||
107317.05f, 107526.47f, 107729.17f, 107925.6f, 108116.125f, 108301.12f, 108480.88f,
|
||||
108655.72f, 108825.91f, 108991.68f, 109153.28f, 109310.914f, 109464.77f, 109615.04f,
|
||||
109761.88f, 109905.46f, 110045.92f, 110183.41f, 110318.02f, 110449.91f, 110579.17f,
|
||||
110705.914f, 110830.234f, 110952.234f, 111071.99f, 111189.59f, 111305.12f, 111418.64f,
|
||||
111530.23f, 111639.95f, 111747.875f, 111854.05f, 111958.54f, 112061.4f, 112162.67f,
|
||||
112262.42f, 112360.68f, 112457.51f, 112552.93f, 112647.0f, 112739.76f, 112831.23f,
|
||||
112921.46f, 113010.484f, 113098.33f, 113185.02f, 113270.61f, 113355.11f, 113438.555f,
|
||||
113520.97f, 113602.375f, 113682.805f, 113762.27f, 113840.81f, 113918.44f, 113995.18f,
|
||||
114071.055f, 114146.08f, 114220.266f, 114293.65f, 114366.24f, 114438.06f, 114509.12f,
|
||||
114579.44f, 114649.02f, 114717.91f, 114786.086f, 114853.586f, 114920.42f, 114986.6f,
|
||||
115052.14f, 115117.055f, 115181.34f, 115245.04f, 115308.13f, 115370.65f, 115432.59f,
|
||||
115493.98f, 115554.81f, 115615.11f, 115674.875f, 115734.12f, 115792.85f, 115851.08f,
|
||||
115908.82f, 115966.07f, 116022.85f, 116079.16f, 116135.01f, 116190.4f, 116245.35f,
|
||||
116299.87f, 116353.945f, 116407.6f, 116460.84f, 116513.67f, 116566.09f, 116618.125f,
|
||||
116669.76f, 116721.01f
|
||||
};
|
||||
|
||||
// gVolRampingRhs144[k] = 1 / max(1, (256*k)^(1/18))
|
||||
f32 gVolRampingRhs144[128] = {
|
||||
1.0f, 0.734867f, 0.707107f, 0.691357f, 0.680395f, 0.672012f, 0.66524f, 0.659567f, 0.654692f,
|
||||
0.650422f, 0.646626f, 0.643211f, 0.64011f, 0.637269f, 0.634651f, 0.632223f, 0.629961f, 0.627842f,
|
||||
1.0f, 0.734867f, 0.707107f, 0.691357f, 0.680395f, 0.672012f, 0.66524f, 0.659567f, 0.654692f,
|
||||
0.650422f, 0.646626f, 0.643211f, 0.64011f, 0.637269f, 0.634651f, 0.632223f, 0.629961f, 0.627842f,
|
||||
0.625852f, 0.623975f, 0.622199f, 0.620515f, 0.618913f, 0.617387f, 0.615929f, 0.614533f, 0.613196f,
|
||||
0.611912f, 0.610677f, 0.609487f, 0.60834f, 0.607233f, 0.606163f, 0.605128f, 0.604125f, 0.603153f,
|
||||
0.60221f, 0.601294f, 0.600403f, 0.599538f, 0.598695f, 0.597874f, 0.597074f, 0.596294f, 0.595533f,
|
||||
0.59479f, 0.594064f, 0.593355f, 0.592661f, 0.591983f, 0.591319f, 0.590669f, 0.590032f, 0.589408f,
|
||||
0.588796f, 0.588196f, 0.587608f, 0.58703f, 0.586463f, 0.585906f, 0.58536f, 0.584822f, 0.584294f,
|
||||
0.611912f, 0.610677f, 0.609487f, 0.60834f, 0.607233f, 0.606163f, 0.605128f, 0.604125f, 0.603153f,
|
||||
0.60221f, 0.601294f, 0.600403f, 0.599538f, 0.598695f, 0.597874f, 0.597074f, 0.596294f, 0.595533f,
|
||||
0.59479f, 0.594064f, 0.593355f, 0.592661f, 0.591983f, 0.591319f, 0.590669f, 0.590032f, 0.589408f,
|
||||
0.588796f, 0.588196f, 0.587608f, 0.58703f, 0.586463f, 0.585906f, 0.58536f, 0.584822f, 0.584294f,
|
||||
0.583775f, 0.583265f, 0.582762f, 0.582268f, 0.581782f, 0.581303f, 0.580832f, 0.580368f, 0.579911f,
|
||||
0.57946f, 0.579017f, 0.578579f, 0.578148f, 0.577722f, 0.577303f, 0.576889f, 0.576481f, 0.576078f,
|
||||
0.575681f, 0.575289f, 0.574902f, 0.574519f, 0.574142f, 0.573769f, 0.5734f, 0.573036f, 0.572677f,
|
||||
0.572321f, 0.57197f, 0.571623f, 0.57128f, 0.57094f, 0.570605f, 0.570273f, 0.569945f, 0.56962f,
|
||||
0.57946f, 0.579017f, 0.578579f, 0.578148f, 0.577722f, 0.577303f, 0.576889f, 0.576481f, 0.576078f,
|
||||
0.575681f, 0.575289f, 0.574902f, 0.574519f, 0.574142f, 0.573769f, 0.5734f, 0.573036f, 0.572677f,
|
||||
0.572321f, 0.57197f, 0.571623f, 0.57128f, 0.57094f, 0.570605f, 0.570273f, 0.569945f, 0.56962f,
|
||||
0.569299f, 0.568981f, 0.568667f, 0.568355f, 0.568047f, 0.567743f, 0.567441f, 0.567142f, 0.566846f,
|
||||
0.566553f, 0.566263f, 0.565976f, 0.565692f, 0.56541f, 0.565131f, 0.564854f, 0.56458f, 0.564309f,
|
||||
0.56404f, 0.563773f, 0.563509f, 0.563247f, 0.562987f, 0.56273f, 0.562475f, 0.562222f, 0.561971f,
|
||||
0.566553f, 0.566263f, 0.565976f, 0.565692f, 0.56541f, 0.565131f, 0.564854f, 0.56458f, 0.564309f,
|
||||
0.56404f, 0.563773f, 0.563509f, 0.563247f, 0.562987f, 0.56273f, 0.562475f, 0.562222f, 0.561971f,
|
||||
0.561722f, 0.561476f
|
||||
};
|
||||
|
||||
// gVolRampingLhs128[k] = 2^16 * max(1, (256*k)^(1/16))
|
||||
f32 gVolRampingLhs128[128] = {
|
||||
65536.0f, 92681.9f, 96785.28f, 99269.31f, 101070.33f, 102489.78f, 103664.336f,
|
||||
104667.914f, 105545.09f, 106324.92f, 107027.39f, 107666.84f, 108253.95f, 108796.87f,
|
||||
109301.95f, 109774.29f, 110217.98f, 110636.39f, 111032.33f, 111408.164f, 111765.9f,
|
||||
112107.234f, 112433.66f, 112746.46f, 113046.766f, 113335.555f, 113613.72f, 113882.02f,
|
||||
114141.164f, 114391.77f, 114634.414f, 114869.58f, 115097.74f, 115319.31f, 115534.68f,
|
||||
115744.19f, 115948.16f, 116146.875f, 116340.625f, 116529.66f, 116714.195f, 116894.46f,
|
||||
117070.64f, 117242.945f, 117411.52f, 117576.55f, 117738.17f, 117896.54f, 118051.77f,
|
||||
118204.0f, 118353.35f, 118499.92f, 118643.83f, 118785.16f, 118924.01f, 119060.47f,
|
||||
119194.625f, 119326.555f, 119456.336f, 119584.03f, 119709.71f, 119833.445f, 119955.29f,
|
||||
120075.31f, 120193.555f, 120310.08f, 120424.94f, 120538.17f, 120649.836f, 120759.97f,
|
||||
120868.62f, 120975.82f, 121081.62f, 121186.05f, 121289.14f, 121390.94f, 121491.47f,
|
||||
121590.766f, 121688.87f, 121785.79f, 121881.57f, 121976.24f, 122069.82f, 122162.33f,
|
||||
122253.805f, 122344.266f, 122433.73f, 122522.23f, 122609.77f, 122696.4f, 122782.11f,
|
||||
122866.93f, 122950.89f, 123033.99f, 123116.26f, 123197.72f, 123278.37f, 123358.24f,
|
||||
123437.34f, 123515.69f, 123593.3f, 123670.19f, 123746.36f, 123821.84f, 123896.63f,
|
||||
123970.76f, 124044.23f, 124117.04f, 124189.23f, 124260.78f, 124331.73f, 124402.07f,
|
||||
124471.83f, 124540.99f, 124609.59f, 124677.63f, 124745.12f, 124812.055f, 124878.47f,
|
||||
124944.34f, 125009.71f, 125074.57f, 125138.92f, 125202.79f, 125266.164f, 125329.06f,
|
||||
125391.5f, 125453.47f
|
||||
65536.0f, 92681.9f, 96785.28f, 99269.31f, 101070.33f, 102489.78f, 103664.336f,
|
||||
104667.914f, 105545.09f, 106324.92f, 107027.39f, 107666.84f, 108253.95f, 108796.87f,
|
||||
109301.95f, 109774.29f, 110217.98f, 110636.39f, 111032.33f, 111408.164f, 111765.9f,
|
||||
112107.234f, 112433.66f, 112746.46f, 113046.766f, 113335.555f, 113613.72f, 113882.02f,
|
||||
114141.164f, 114391.77f, 114634.414f, 114869.58f, 115097.74f, 115319.31f, 115534.68f,
|
||||
115744.19f, 115948.16f, 116146.875f, 116340.625f, 116529.66f, 116714.195f, 116894.46f,
|
||||
117070.64f, 117242.945f, 117411.52f, 117576.55f, 117738.17f, 117896.54f, 118051.77f,
|
||||
118204.0f, 118353.35f, 118499.92f, 118643.83f, 118785.16f, 118924.01f, 119060.47f,
|
||||
119194.625f, 119326.555f, 119456.336f, 119584.03f, 119709.71f, 119833.445f, 119955.29f,
|
||||
120075.31f, 120193.555f, 120310.08f, 120424.94f, 120538.17f, 120649.836f, 120759.97f,
|
||||
120868.62f, 120975.82f, 121081.62f, 121186.05f, 121289.14f, 121390.94f, 121491.47f,
|
||||
121590.766f, 121688.87f, 121785.79f, 121881.57f, 121976.24f, 122069.82f, 122162.33f,
|
||||
122253.805f, 122344.266f, 122433.73f, 122522.23f, 122609.77f, 122696.4f, 122782.11f,
|
||||
122866.93f, 122950.89f, 123033.99f, 123116.26f, 123197.72f, 123278.37f, 123358.24f,
|
||||
123437.34f, 123515.69f, 123593.3f, 123670.19f, 123746.36f, 123821.84f, 123896.63f,
|
||||
123970.76f, 124044.23f, 124117.04f, 124189.23f, 124260.78f, 124331.73f, 124402.07f,
|
||||
124471.83f, 124540.99f, 124609.59f, 124677.63f, 124745.12f, 124812.055f, 124878.47f,
|
||||
124944.34f, 125009.71f, 125074.57f, 125138.92f, 125202.79f, 125266.164f, 125329.06f,
|
||||
125391.5f, 125453.47f
|
||||
};
|
||||
|
||||
// gVolRampingRhs128[k] = 1 / max(1, (256*k)^(1/16))
|
||||
f32 gVolRampingRhs128[128] = {
|
||||
1.0f, 0.707107f, 0.677128f, 0.660184f, 0.64842f, 0.639439f, 0.632194f, 0.626133f, 0.620929f,
|
||||
0.616375f, 0.612329f, 0.608693f, 0.605391f, 0.60237f, 0.599587f, 0.597007f, 0.594604f, 0.592355f,
|
||||
1.0f, 0.707107f, 0.677128f, 0.660184f, 0.64842f, 0.639439f, 0.632194f, 0.626133f, 0.620929f,
|
||||
0.616375f, 0.612329f, 0.608693f, 0.605391f, 0.60237f, 0.599587f, 0.597007f, 0.594604f, 0.592355f,
|
||||
0.590243f, 0.588251f, 0.586369f, 0.584583f, 0.582886f, 0.581269f, 0.579725f, 0.578247f, 0.576832f,
|
||||
0.575473f, 0.574166f, 0.572908f, 0.571696f, 0.570525f, 0.569394f, 0.5683f, 0.567241f, 0.566214f,
|
||||
0.575473f, 0.574166f, 0.572908f, 0.571696f, 0.570525f, 0.569394f, 0.5683f, 0.567241f, 0.566214f,
|
||||
0.565218f, 0.564251f, 0.563311f, 0.562398f, 0.561508f, 0.560642f, 0.559799f, 0.558976f, 0.558173f,
|
||||
0.55739f, 0.556625f, 0.555877f, 0.555146f, 0.554431f, 0.553732f, 0.553047f, 0.552376f, 0.551719f,
|
||||
0.55739f, 0.556625f, 0.555877f, 0.555146f, 0.554431f, 0.553732f, 0.553047f, 0.552376f, 0.551719f,
|
||||
0.551075f, 0.550443f, 0.549823f, 0.549216f, 0.548619f, 0.548033f, 0.547458f, 0.546892f, 0.546337f,
|
||||
0.545791f, 0.545254f, 0.544726f, 0.544206f, 0.543695f, 0.543192f, 0.542696f, 0.542209f, 0.541728f,
|
||||
0.541255f, 0.540788f, 0.540329f, 0.539876f, 0.539429f, 0.538988f, 0.538554f, 0.538125f, 0.537702f,
|
||||
0.537285f, 0.536873f, 0.536467f, 0.536065f, 0.535669f, 0.535277f, 0.534891f, 0.534509f, 0.534131f,
|
||||
0.533759f, 0.53339f, 0.533026f, 0.532666f, 0.53231f, 0.531958f, 0.53161f, 0.531266f, 0.530925f,
|
||||
0.533759f, 0.53339f, 0.533026f, 0.532666f, 0.53231f, 0.531958f, 0.53161f, 0.531266f, 0.530925f,
|
||||
0.530588f, 0.530255f, 0.529926f, 0.529599f, 0.529277f, 0.528957f, 0.528641f, 0.528328f, 0.528018f,
|
||||
0.527711f, 0.527407f, 0.527106f, 0.526808f, 0.526513f, 0.52622f, 0.525931f, 0.525644f, 0.525359f,
|
||||
0.527711f, 0.527407f, 0.527106f, 0.526808f, 0.526513f, 0.52622f, 0.525931f, 0.525644f, 0.525359f,
|
||||
0.525077f, 0.524798f, 0.524522f, 0.524247f, 0.523975f, 0.523706f, 0.523439f, 0.523174f, 0.522911f,
|
||||
0.522651f, 0.522393f
|
||||
};
|
||||
@@ -888,11 +904,11 @@ volatile s32 gAudioLoadLock = AUDIO_LOCK_UNINITIALIZED;
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU)
|
||||
u8 bufferDelete2[12] = { 0 };
|
||||
u8 bufferDelete2[12] = {0};
|
||||
u8 D_EU_80302010 = 0;
|
||||
u8 D_EU_80302014 = 0;
|
||||
|
||||
struct OSMesgQueue *OSMesgQueues[4] = { &OSMesgQueue0, &OSMesgQueue1, &OSMesgQueue2, &OSMesgQueue3 };
|
||||
struct OSMesgQueue *OSMesgQueues[4] = {&OSMesgQueue0, &OSMesgQueue1, &OSMesgQueue2, &OSMesgQueue3};
|
||||
#elif defined(VERSION_JP) || defined(VERSION_US)
|
||||
s8 sUnused8033EF8 = 24;
|
||||
#endif
|
||||
|
||||
+260
-187
@@ -14,27 +14,30 @@
|
||||
f32 gTrackVolume = 1.0f;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 recalculateVolume) {
|
||||
void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 recalculateVolume)
|
||||
{
|
||||
f32 channelVolume;
|
||||
s32 i;
|
||||
|
||||
if (seqChannel->changes.as_bitfields.volume || recalculateVolume) {
|
||||
if (seqChannel->changes.as_bitfields.volume || recalculateVolume)
|
||||
{
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->appliedFadeVolume;
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0)
|
||||
{
|
||||
channelVolume = seqChannel->seqPlayer->muteVolumeScale * channelVolume;
|
||||
}
|
||||
#ifdef VERSION_SH
|
||||
seqChannel->appliedVolume = channelVolume * channelVolume;
|
||||
seqChannel->appliedVolume= channelVolume* channelVolume;
|
||||
#else
|
||||
seqChannel->appliedVolume = channelVolume;
|
||||
seqChannel->appliedVolume= channelVolume;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (seqChannel->changes.as_bitfields.pan) {
|
||||
seqChannel->pan = seqChannel->newPan * seqChannel->panChannelWeight;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
for (i =0; i<4;++i) {
|
||||
struct SequenceChannelLayer *layer = seqChannel->layers[i];
|
||||
if (layer != NULL && layer->enabled && layer->note != NULL) {
|
||||
if (layer->notePropertiesNeedInit) {
|
||||
@@ -55,58 +58,62 @@ void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 reca
|
||||
}
|
||||
}
|
||||
}
|
||||
seqChannel->changes.as_u8 = 0;
|
||||
seqChannel->changes.as_u8=0;
|
||||
}
|
||||
#else
|
||||
static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) {
|
||||
f32 channelVolume;
|
||||
f32 panLayerWeight;
|
||||
f32 panFromChannel;
|
||||
s32 i;
|
||||
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume;
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
|
||||
static void sequence_channel_process_sound(struct SequenceChannel *seqChannel)
|
||||
{
|
||||
f32 channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume;
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0)
|
||||
{
|
||||
channelVolume *= seqChannel->seqPlayer->muteVolumeScale;
|
||||
}
|
||||
|
||||
panFromChannel = seqChannel->pan * seqChannel->panChannelWeight;
|
||||
panLayerWeight = US_FLOAT(1.0) - seqChannel->panChannelWeight;
|
||||
f32 panFromChannel = seqChannel->pan * seqChannel->panChannelWeight;
|
||||
f32 panLayerWeight = US_FLOAT(1.0) - seqChannel->panChannelWeight;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (s32 i = 0; i < 4; i++)
|
||||
{
|
||||
struct SequenceChannelLayer *layer = seqChannel->layers[i];
|
||||
if (layer != NULL && layer->enabled && layer->note != NULL) {
|
||||
if (layer != NULL && layer->enabled && layer->note != NULL)
|
||||
{
|
||||
layer->noteFreqScale = layer->freqScale * seqChannel->freqScale;
|
||||
layer->noteVelocity = layer->velocitySquare * (channelVolume * gTrackVolume);
|
||||
layer->notePan = (layer->pan * panLayerWeight) + panFromChannel;
|
||||
layer->notePan = layer->pan * panLayerWeight + panFromChannel;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
s32 i;
|
||||
|
||||
if (seqPlayer->fadeRemainingFrames != 0) {
|
||||
void sequence_player_process_sound(struct SequencePlayer *seqPlayer)
|
||||
{
|
||||
if (seqPlayer->fadeRemainingFrames != 0)
|
||||
{
|
||||
seqPlayer->fadeVolume += seqPlayer->fadeVelocity;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (seqPlayer->fadeVolume > US_FLOAT2(1)) {
|
||||
if (seqPlayer->fadeVolume > US_FLOAT2(1))
|
||||
{
|
||||
seqPlayer->fadeVolume = US_FLOAT2(1);
|
||||
}
|
||||
if (seqPlayer->fadeVolume < 0) {
|
||||
if (seqPlayer->fadeVolume < 0)
|
||||
{
|
||||
seqPlayer->fadeVolume = 0;
|
||||
}
|
||||
|
||||
if (--seqPlayer->fadeRemainingFrames == 0) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (seqPlayer->state == 2) {
|
||||
if (--seqPlayer->fadeRemainingFrames == 0)
|
||||
{
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (seqPlayer->state == 2)
|
||||
{
|
||||
sequence_player_disable(seqPlayer);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
switch (seqPlayer->state) {
|
||||
#else
|
||||
switch (seqPlayer->state)
|
||||
{
|
||||
case SEQUENCE_PLAYER_STATE_FADE_OUT:
|
||||
sequence_player_disable(seqPlayer);
|
||||
return;
|
||||
@@ -119,77 +126,84 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
case SEQUENCE_PLAYER_STATE_4:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (seqPlayer->recalculateVolume) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (seqPlayer->recalculateVolume)
|
||||
{
|
||||
seqPlayer->appliedFadeVolume = seqPlayer->fadeVolume * seqPlayer->fadeVolumeScale;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Process channels
|
||||
for (i = 0; i < CHANNELS_MAX; i++) {
|
||||
for (s32 i = 0; i < CHANNELS_MAX; i++)
|
||||
{
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == TRUE
|
||||
&& seqPlayer->channels[i]->enabled == TRUE) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
&& seqPlayer->channels[i]->enabled == TRUE)
|
||||
{
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
sequence_channel_process_sound(seqPlayer->channels[i], seqPlayer->recalculateVolume);
|
||||
#else
|
||||
#else
|
||||
sequence_channel_process_sound(seqPlayer->channels[i]);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
seqPlayer->recalculateVolume = FALSE;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
f32 get_portamento_freq_scale(struct Portamento *p) {
|
||||
f32 get_portamento_freq_scale(struct Portamento *p)
|
||||
{
|
||||
u32 v0;
|
||||
f32 result;
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
if (p->mode == 0) {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
if (p->mode == 0)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
p->cur += p->speed;
|
||||
v0 = (u32) p->cur;
|
||||
v0 = (u32)p->cur;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (v0 > 127)
|
||||
#else
|
||||
#else
|
||||
if (v0 >= 127)
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
v0 = 127;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
result = US_FLOAT(1.0) + p->extent * (gPitchBendFrequencyScale[v0 + 128] - US_FLOAT(1.0));
|
||||
#else
|
||||
#else
|
||||
result = US_FLOAT(1.0) + p->extent * (gPitchBendFrequencyScale[v0 + 127] - US_FLOAT(1.0));
|
||||
#endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
s16 get_vibrato_pitch_change(struct VibratoState *vib) {
|
||||
s16 get_vibrato_pitch_change(struct VibratoState *vib)
|
||||
{
|
||||
s32 index;
|
||||
vib->time += (s32) vib->rate;
|
||||
vib->time += (s32)vib->rate;
|
||||
index = (vib->time >> 10) & 0x3F;
|
||||
return vib->curve[index] >> 8;
|
||||
}
|
||||
#else
|
||||
s8 get_vibrato_pitch_change(struct VibratoState *vib) {
|
||||
s32 index;
|
||||
s8 get_vibrato_pitch_change(struct VibratoState *vib)
|
||||
{
|
||||
vib->time += vib->rate;
|
||||
|
||||
index = (vib->time >> 10) & 0x3F;
|
||||
s32 index = vib->time >> 10 & 0x3F;
|
||||
|
||||
switch (index & 0x30) {
|
||||
switch (index & 0x30)
|
||||
{
|
||||
case 0x10:
|
||||
index = 31 - index;
|
||||
|
||||
@@ -209,181 +223,224 @@ s8 get_vibrato_pitch_change(struct VibratoState *vib) {
|
||||
}
|
||||
#endif
|
||||
|
||||
f32 get_vibrato_freq_scale(struct VibratoState *vib) {
|
||||
s32 pitchChange;
|
||||
f32 extent;
|
||||
f32 get_vibrato_freq_scale(struct VibratoState *vib)
|
||||
{
|
||||
f32 result;
|
||||
|
||||
if (vib->delay != 0) {
|
||||
if (vib->delay != 0)
|
||||
{
|
||||
vib->delay--;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (vib->extentChangeTimer) {
|
||||
if (vib->extentChangeTimer == 1) {
|
||||
vib->extent = (s32) vib->seqChannel->vibratoExtentTarget;
|
||||
} else {
|
||||
if (vib->extentChangeTimer)
|
||||
{
|
||||
if (vib->extentChangeTimer == 1)
|
||||
{
|
||||
vib->extent = (s32)vib->seqChannel->vibratoExtentTarget;
|
||||
}
|
||||
else
|
||||
{
|
||||
vib->extent +=
|
||||
((s32) vib->seqChannel->vibratoExtentTarget - vib->extent) / (s32) vib->extentChangeTimer;
|
||||
((s32)vib->seqChannel->vibratoExtentTarget - vib->extent) / (s32)vib->extentChangeTimer;
|
||||
}
|
||||
|
||||
vib->extentChangeTimer--;
|
||||
} else if (vib->seqChannel->vibratoExtentTarget != (s32) vib->extent) {
|
||||
if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0) {
|
||||
vib->extent = (s32) vib->seqChannel->vibratoExtentTarget;
|
||||
}
|
||||
else if (vib->seqChannel->vibratoExtentTarget != (s32)vib->extent)
|
||||
{
|
||||
if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0)
|
||||
{
|
||||
vib->extent = (s32)vib->seqChannel->vibratoExtentTarget;
|
||||
}
|
||||
}
|
||||
|
||||
if (vib->rateChangeTimer) {
|
||||
if (vib->rateChangeTimer == 1) {
|
||||
vib->rate = (s32) vib->seqChannel->vibratoRateTarget;
|
||||
} else {
|
||||
vib->rate += ((s32) vib->seqChannel->vibratoRateTarget - vib->rate) / (s32) vib->rateChangeTimer;
|
||||
if (vib->rateChangeTimer)
|
||||
{
|
||||
if (vib->rateChangeTimer == 1)
|
||||
{
|
||||
vib->rate = (s32)vib->seqChannel->vibratoRateTarget;
|
||||
}
|
||||
else
|
||||
{
|
||||
vib->rate += ((s32)vib->seqChannel->vibratoRateTarget - vib->rate) / (s32)vib->rateChangeTimer;
|
||||
}
|
||||
|
||||
vib->rateChangeTimer--;
|
||||
} else if (vib->seqChannel->vibratoRateTarget != (s32) vib->rate) {
|
||||
if ((vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay) == 0) {
|
||||
vib->rate = (s32) vib->seqChannel->vibratoRateTarget;
|
||||
}
|
||||
else if (vib->seqChannel->vibratoRateTarget != (s32)vib->rate)
|
||||
{
|
||||
if ((vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay) == 0)
|
||||
{
|
||||
vib->rate = (s32)vib->seqChannel->vibratoRateTarget;
|
||||
}
|
||||
}
|
||||
|
||||
if (vib->extent == 0) {
|
||||
if (vib->extent == 0)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
pitchChange = get_vibrato_pitch_change(vib);
|
||||
extent = (f32) vib->extent / US_FLOAT(4096.0);
|
||||
s32 pitchChange = get_vibrato_pitch_change(vib);
|
||||
f32 extent = (f32)vib->extent / US_FLOAT(4096.0);
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
result = US_FLOAT(1.0) + extent * (gPitchBendFrequencyScale[pitchChange + 128] - US_FLOAT(1.0));
|
||||
#else
|
||||
#else
|
||||
result = US_FLOAT(1.0) + extent * (gPitchBendFrequencyScale[pitchChange + 127] - US_FLOAT(1.0));
|
||||
#endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
void note_vibrato_update(struct Note *note) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (note->portamento.mode != 0) {
|
||||
void note_vibrato_update(struct Note *note)
|
||||
{
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (note->portamento.mode != 0)
|
||||
{
|
||||
note->portamentoFreqScale = get_portamento_freq_scale(¬e->portamento);
|
||||
}
|
||||
if (note->vibratoState.active && note->parentLayer != NO_LAYER) {
|
||||
if (note->vibratoState.active && note->parentLayer != NO_LAYER)
|
||||
{
|
||||
note->vibratoFreqScale = get_vibrato_freq_scale(¬e->vibratoState);
|
||||
}
|
||||
#else
|
||||
if (note->vibratoState.active) {
|
||||
#else
|
||||
if (note->vibratoState.active)
|
||||
{
|
||||
note->portamentoFreqScale = get_portamento_freq_scale(¬e->portamento);
|
||||
if (note->parentLayer != NO_LAYER) {
|
||||
if (note->parentLayer != NO_LAYER)
|
||||
{
|
||||
note->vibratoFreqScale = get_vibrato_freq_scale(¬e->vibratoState);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void note_vibrato_init(struct Note *note) {
|
||||
void note_vibrato_init(struct Note *note)
|
||||
{
|
||||
struct VibratoState *vib;
|
||||
UNUSED struct SequenceChannel *seqChannel;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
struct NotePlaybackState *seqPlayerState = (struct NotePlaybackState *) ¬e->priority;
|
||||
#endif
|
||||
UNUSED
|
||||
struct SequenceChannel *seqChannel;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
struct NotePlaybackState *seqPlayerState = (struct NotePlaybackState *)¬e->priority;
|
||||
#endif
|
||||
|
||||
note->vibratoFreqScale = 1.0f;
|
||||
note->portamentoFreqScale = 1.0f;
|
||||
|
||||
vib = ¬e->vibratoState;
|
||||
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
if (note->parentLayer->seqChannel->vibratoExtentStart == 0
|
||||
&& note->parentLayer->seqChannel->vibratoExtentTarget == 0
|
||||
&& note->parentLayer->portamento.mode == 0) {
|
||||
&& note->parentLayer->portamento.mode == 0)
|
||||
{
|
||||
vib->active = FALSE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
vib->active = TRUE;
|
||||
vib->time = 0;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
vib->curve = gWaveSamples[2];
|
||||
vib->seqChannel = note->parentLayer->seqChannel;
|
||||
if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0) {
|
||||
if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0)
|
||||
{
|
||||
vib->extent = FLOAT_CAST(vib->seqChannel->vibratoExtentTarget);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vib->extent = FLOAT_CAST(vib->seqChannel->vibratoExtentStart);
|
||||
}
|
||||
|
||||
if ((vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay) == 0) {
|
||||
if ((vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay) == 0)
|
||||
{
|
||||
vib->rate = FLOAT_CAST(vib->seqChannel->vibratoRateTarget);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vib->rate = FLOAT_CAST(vib->seqChannel->vibratoRateStart);
|
||||
}
|
||||
vib->delay = vib->seqChannel->vibratoDelay;
|
||||
|
||||
seqPlayerState->portamento = seqPlayerState->parentLayer->portamento;
|
||||
#else
|
||||
#else
|
||||
vib->curve = gVibratoCurve;
|
||||
vib->seqChannel = note->parentLayer->seqChannel;
|
||||
seqChannel = vib->seqChannel;
|
||||
|
||||
if ((vib->extentChangeTimer = seqChannel->vibratoExtentChangeDelay) == 0) {
|
||||
if ((vib->extentChangeTimer = seqChannel->vibratoExtentChangeDelay) == 0)
|
||||
{
|
||||
vib->extent = seqChannel->vibratoExtentTarget;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vib->extent = seqChannel->vibratoExtentStart;
|
||||
}
|
||||
|
||||
if ((vib->rateChangeTimer = seqChannel->vibratoRateChangeDelay) == 0) {
|
||||
if ((vib->rateChangeTimer = seqChannel->vibratoRateChangeDelay) == 0)
|
||||
{
|
||||
vib->rate = seqChannel->vibratoRateTarget;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vib->rate = seqChannel->vibratoRateStart;
|
||||
}
|
||||
vib->delay = seqChannel->vibratoDelay;
|
||||
|
||||
note->portamento = note->parentLayer->portamento;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, UNUSED s16 *volOut) {
|
||||
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, UNUSED s16 *volOut)
|
||||
{
|
||||
adsr->action = 0;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
adsr->delay = 0;
|
||||
adsr->envelope = envelope;
|
||||
#ifdef VERSION_SH
|
||||
#ifdef VERSION_SH
|
||||
adsr->sustain = 0.0f;
|
||||
#endif
|
||||
#endif
|
||||
adsr->current = 0.0f;
|
||||
#else
|
||||
#else
|
||||
adsr->initial = 0;
|
||||
adsr->delay = 0;
|
||||
adsr->velocity = 0;
|
||||
adsr->envelope = envelope;
|
||||
adsr->volOut = volOut;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
f32 adsr_update(struct AdsrState *adsr) {
|
||||
f32 adsr_update(struct AdsrState *adsr)
|
||||
{
|
||||
|
||||
|
||||
#else
|
||||
s32 adsr_update(struct AdsrState *adsr) {
|
||||
#endif
|
||||
s32 adsr_update(struct AdsrState *adsr)
|
||||
{
|
||||
#endif
|
||||
u8 action = adsr->action;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
u8 state = adsr->state;
|
||||
switch (state) {
|
||||
#else
|
||||
switch (adsr->state) {
|
||||
#endif
|
||||
#else
|
||||
switch (adsr->state)
|
||||
{
|
||||
#endif
|
||||
case ADSR_STATE_DISABLED:
|
||||
return 0;
|
||||
|
||||
case ADSR_STATE_INITIAL: {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
case ADSR_STATE_INITIAL:
|
||||
{
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
adsr->current = adsr->initial;
|
||||
adsr->target = adsr->initial;
|
||||
#endif
|
||||
if (action & ADSR_ACTION_HANG) {
|
||||
#endif
|
||||
if (action & ADSR_ACTION_HANG)
|
||||
{
|
||||
adsr->state = ADSR_STATE_HANG;
|
||||
break;
|
||||
}
|
||||
@@ -392,18 +449,19 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
|
||||
case ADSR_STATE_START_LOOP:
|
||||
adsr->envIndex = 0;
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
adsr->currentHiRes = adsr->current << 0x10;
|
||||
#endif
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_LOOP;
|
||||
// fallthrough
|
||||
|
||||
#ifdef VERSION_SH
|
||||
restart:
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
restart:
|
||||
#endif
|
||||
case ADSR_STATE_LOOP:
|
||||
adsr->delay = BSWAP16(adsr->envelope[adsr->envIndex].delay);
|
||||
switch (adsr->delay) {
|
||||
switch (adsr->delay)
|
||||
{
|
||||
case ADSR_DISABLE:
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
break;
|
||||
@@ -412,134 +470,149 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
break;
|
||||
case ADSR_GOTO:
|
||||
adsr->envIndex = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
#ifdef VERSION_SH
|
||||
#ifdef VERSION_SH
|
||||
goto restart;
|
||||
#else
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case ADSR_RESTART:
|
||||
adsr->state = ADSR_STATE_INITIAL;
|
||||
break;
|
||||
|
||||
default:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (adsr->delay >= 4) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (adsr->delay >= 4)
|
||||
{
|
||||
adsr->delay = adsr->delay * gAudioBufferParameters.updatesPerFrame
|
||||
#ifdef VERSION_SH
|
||||
#ifdef VERSION_SH
|
||||
/ gAudioBufferParameters.presetUnk4
|
||||
#endif
|
||||
#endif
|
||||
/ 4;
|
||||
}
|
||||
#if defined(VERSION_SH)
|
||||
if (adsr->delay == 0) {
|
||||
#if defined(VERSION_SH)
|
||||
if (adsr->delay == 0)
|
||||
{
|
||||
adsr->delay = 1;
|
||||
}
|
||||
adsr->target = (f32) BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0f;
|
||||
#elif defined(VERSION_EU)
|
||||
adsr->target = (f32) BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0;
|
||||
#endif
|
||||
adsr->target = (f32)BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0f;
|
||||
#elif defined(VERSION_EU)
|
||||
adsr->target = (f32)BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0;
|
||||
#endif
|
||||
adsr->target = adsr->target * adsr->target;
|
||||
adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
|
||||
#else
|
||||
#else
|
||||
adsr->target = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
adsr->velocity = ((adsr->target - adsr->current) << 0x10) / adsr->delay;
|
||||
#endif
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_FADE;
|
||||
adsr->envIndex++;
|
||||
break;
|
||||
}
|
||||
if (adsr->state != ADSR_STATE_FADE) {
|
||||
if (adsr->state != ADSR_STATE_FADE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
// fallthrough
|
||||
|
||||
case ADSR_STATE_FADE:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
adsr->current += adsr->velocity;
|
||||
#else
|
||||
#else
|
||||
adsr->currentHiRes += adsr->velocity;
|
||||
adsr->current = adsr->currentHiRes >> 0x10;
|
||||
#endif
|
||||
if (--adsr->delay <= 0) {
|
||||
#endif
|
||||
if (--adsr->delay <= 0)
|
||||
{
|
||||
adsr->state = ADSR_STATE_LOOP;
|
||||
}
|
||||
// fallthrough
|
||||
// fallthrough
|
||||
|
||||
case ADSR_STATE_HANG:
|
||||
break;
|
||||
|
||||
case ADSR_STATE_DECAY:
|
||||
case ADSR_STATE_RELEASE: {
|
||||
case ADSR_STATE_RELEASE:
|
||||
{
|
||||
adsr->current -= adsr->fadeOutVel;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (adsr->sustain != 0.0f && state == ADSR_STATE_DECAY) {
|
||||
#else
|
||||
if (adsr->sustain != 0 && adsr->state == ADSR_STATE_DECAY) {
|
||||
#endif
|
||||
if (adsr->current < adsr->sustain) {
|
||||
#else
|
||||
if (adsr->sustain != 0 && adsr->state == ADSR_STATE_DECAY)
|
||||
{
|
||||
#endif
|
||||
if (adsr->current < adsr->sustain)
|
||||
{
|
||||
adsr->current = adsr->sustain;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
adsr->delay = 128;
|
||||
#else
|
||||
#else
|
||||
adsr->delay = adsr->sustain / 16;
|
||||
#endif
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_SUSTAIN;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(VERSION_SH)
|
||||
if (adsr->current < 0.00001f) {
|
||||
#if defined(VERSION_SH)
|
||||
if (adsr->current < 0.00001f)
|
||||
{
|
||||
adsr->current = 0.0f;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
}
|
||||
#elif defined(VERSION_EU)
|
||||
if (adsr->current < 0) {
|
||||
#elif defined(VERSION_EU)
|
||||
if (adsr->current < 0)
|
||||
{
|
||||
adsr->current = 0.0f;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
}
|
||||
#else
|
||||
if (adsr->current < 100) {
|
||||
#else
|
||||
if (adsr->current < 100)
|
||||
{
|
||||
adsr->current = 0;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case ADSR_STATE_SUSTAIN:
|
||||
adsr->delay -= 1;
|
||||
if (adsr->delay == 0) {
|
||||
if (adsr->delay == 0)
|
||||
{
|
||||
adsr->state = ADSR_STATE_RELEASE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ((action & ADSR_ACTION_DECAY)) {
|
||||
if (action & ADSR_ACTION_DECAY)
|
||||
{
|
||||
adsr->state = ADSR_STATE_DECAY;
|
||||
adsr->action = action & ~ADSR_ACTION_DECAY;
|
||||
}
|
||||
|
||||
if ((action & ADSR_ACTION_RELEASE)) {
|
||||
if (action & ADSR_ACTION_RELEASE)
|
||||
{
|
||||
adsr->state = ADSR_STATE_RELEASE;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
adsr->action = action & ~ADSR_ACTION_RELEASE;
|
||||
#else
|
||||
#else
|
||||
adsr->action = action & ~(ADSR_ACTION_RELEASE | ADSR_ACTION_DECAY);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (adsr->current < 0.0f) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
if (adsr->current < 0.0f)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
if (adsr->current > 1.0f) {
|
||||
if (adsr->current > 1.0f)
|
||||
{
|
||||
eu_stubbed_printf_1("Audio:Envp: overflow %f\n", adsr->current);
|
||||
return 1.0f;
|
||||
}
|
||||
return adsr->current;
|
||||
#else
|
||||
#else
|
||||
*adsr->volOut = adsr->current;
|
||||
return 0;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -36,8 +36,11 @@
|
||||
extern f32 gTrackVolume;
|
||||
|
||||
void sequence_player_process_sound(struct SequencePlayer *seqPlayer);
|
||||
|
||||
void note_vibrato_update(struct Note *note);
|
||||
|
||||
void note_vibrato_init(struct Note *note);
|
||||
|
||||
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, s16 *volOut);
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
f32 adsr_update(struct AdsrState *adsr);
|
||||
|
||||
+1030
-722
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,8 @@ extern u32 gAudioRandom;
|
||||
extern f32 gAudioVolume;
|
||||
extern u8 gAudioReverb;
|
||||
|
||||
struct Sound {
|
||||
struct Sound
|
||||
{
|
||||
s32 soundBits;
|
||||
f32 *position;
|
||||
}; // size = 0x8
|
||||
@@ -35,39 +36,73 @@ extern u8 sSoundRequestCount;
|
||||
extern u8 gAudioSPTaskYieldBuffer[]; // ucode yield data ptr; only used in JP
|
||||
|
||||
struct SPTask *create_next_audio_frame_task(void);
|
||||
|
||||
void create_next_audio_buffer(s16 *samples, u32 num_samples);
|
||||
|
||||
void audio_signal_game_loop_tick(void);
|
||||
|
||||
void update_game_sound(void);
|
||||
|
||||
void seq_player_fade_out(u8 player, u16 fadeDuration);
|
||||
|
||||
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeDuration);
|
||||
|
||||
void seq_player_lower_volume(u8 player, u16 fadeDuration, u8 percentage);
|
||||
|
||||
void seq_player_unlower_volume(u8 player, u16 fadeDuration);
|
||||
|
||||
void set_audio_muted(u8 muted);
|
||||
|
||||
void sound_init(void);
|
||||
|
||||
void get_currently_playing_sound(u8 bank, u8 *numPlayingSounds, u8 *numSoundsInBank, u8 *soundId);
|
||||
|
||||
void stop_sound(u32 soundBits, f32 *pos);
|
||||
void stop_sounds_from_source(f32 *pos);
|
||||
|
||||
void stop_sounds_from_source(f32 * pos);
|
||||
|
||||
void stop_sounds_in_continuous_banks(void);
|
||||
|
||||
void sound_banks_disable(u8 player, u16 bankMask);
|
||||
|
||||
void sound_banks_enable(u8 player, u16 bankMask);
|
||||
|
||||
void set_sound_moving_speed(u8 bank, u8 speed);
|
||||
|
||||
void play_dialog_sound(u8 dialogID);
|
||||
|
||||
void play_music(u8 player, u16 seqArgs, u16 fadeTimer);
|
||||
|
||||
void stop_background_music(u16 seqId);
|
||||
|
||||
void fadeout_background_music(u16 arg0, u16 fadeOut);
|
||||
|
||||
void drop_queued_background_music(void);
|
||||
|
||||
u16 get_current_background_music(void);
|
||||
|
||||
void play_secondary_music(u8 seqId, u8 bgMusicVolume, u8 volume, u16 fadeTimer);
|
||||
|
||||
void func_80321080(u16 fadeTimer);
|
||||
|
||||
void func_803210D4(u16 fadeOutTime);
|
||||
|
||||
void play_course_clear(void);
|
||||
|
||||
void play_peachs_jingle(void);
|
||||
|
||||
void play_puzzle_jingle(void);
|
||||
|
||||
void play_star_fanfare(void);
|
||||
|
||||
void play_power_star_jingle(u8 arg0);
|
||||
|
||||
void play_race_fanfare(void);
|
||||
|
||||
void play_toads_jingle(void);
|
||||
|
||||
void sound_reset(u8 presetId);
|
||||
|
||||
void audio_set_sound_mode(u8 arg0);
|
||||
|
||||
void audio_init(void); // in load.c
|
||||
|
||||
+819
-532
File diff suppressed because it is too large
Load Diff
+35
-17
@@ -23,34 +23,41 @@ struct SoundAllocPool
|
||||
s32 numAllocatedEntries;
|
||||
}; // size = 0x10
|
||||
|
||||
struct SeqOrBankEntry {
|
||||
struct SeqOrBankEntry
|
||||
{
|
||||
u8 *ptr;
|
||||
u32 size;
|
||||
#ifdef VERSION_SH
|
||||
#ifdef VERSION_SH
|
||||
s16 poolIndex;
|
||||
s16 id;
|
||||
#else
|
||||
#else
|
||||
s32 id; // seqId or bankId
|
||||
#endif
|
||||
#endif
|
||||
}; // size = 0xC
|
||||
|
||||
struct PersistentPool
|
||||
{
|
||||
/*0x00*/ u32 numEntries;
|
||||
/*0x04*/ struct SoundAllocPool pool;
|
||||
/*0x14*/ struct SeqOrBankEntry entries[32];
|
||||
/*0x00*/
|
||||
u32 numEntries;
|
||||
/*0x04*/
|
||||
struct SoundAllocPool pool;
|
||||
/*0x14*/
|
||||
struct SeqOrBankEntry entries[32];
|
||||
}; // size = 0x194
|
||||
|
||||
struct TemporaryPool
|
||||
{
|
||||
/*EU, SH*/
|
||||
/*0x00, 0x00*/ u32 nextSide;
|
||||
/*0x04, */ struct SoundAllocPool pool;
|
||||
/*0x00, 0x00*/
|
||||
u32 nextSide;
|
||||
/*0x04, */
|
||||
struct SoundAllocPool pool;
|
||||
/*0x04, pool.start */
|
||||
/*0x08, pool.cur */
|
||||
/*0x0C, 0x0C pool.size */
|
||||
/*0x10, 0x10 pool.numAllocatedEntries */
|
||||
/*0x14, */ struct SeqOrBankEntry entries[2];
|
||||
/*0x14, */
|
||||
struct SeqOrBankEntry entries[2];
|
||||
/*0x14, 0x14 entries[0].ptr */
|
||||
/*0x18, entries[0].size*/
|
||||
/*0x1C, 0x1E entries[0].id */
|
||||
@@ -61,9 +68,12 @@ struct TemporaryPool
|
||||
|
||||
struct SoundMultiPool
|
||||
{
|
||||
/*0x000*/ struct PersistentPool persistent;
|
||||
/*0x194*/ struct TemporaryPool temporary;
|
||||
/* */ u32 pad2[4];
|
||||
/*0x000*/
|
||||
struct PersistentPool persistent;
|
||||
/*0x194*/
|
||||
struct TemporaryPool temporary;
|
||||
/* */
|
||||
u32 pad2[4];
|
||||
}; // size = 0x1D0
|
||||
|
||||
struct Unk1Pool
|
||||
@@ -85,10 +95,14 @@ struct UnkEntry
|
||||
|
||||
struct UnkPool
|
||||
{
|
||||
/*0x00*/ struct SoundAllocPool pool;
|
||||
/*0x10*/ struct UnkEntry entries[64];
|
||||
/*0x510*/ s32 numEntries;
|
||||
/*0x514*/ u32 unk514;
|
||||
/*0x00*/
|
||||
struct SoundAllocPool pool;
|
||||
/*0x10*/
|
||||
struct UnkEntry entries[64];
|
||||
/*0x510*/
|
||||
s32 numEntries;
|
||||
/*0x514*/
|
||||
u32 unk514;
|
||||
};
|
||||
|
||||
extern u8 gAudioHeap[];
|
||||
@@ -115,14 +129,18 @@ extern volatile u8 gAudioResetStatus;
|
||||
#endif
|
||||
|
||||
void *soundAlloc(struct SoundAllocPool *pool, u32 size);
|
||||
|
||||
void *sound_alloc_uninitialized(struct SoundAllocPool *pool, u32 size);
|
||||
|
||||
void sound_init_main_pools(s32 sizeForAudioInitPool);
|
||||
|
||||
void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size);
|
||||
#ifdef VERSION_SH
|
||||
void *alloc_bank_or_seq(s32 poolIdx, s32 size, s32 arg3, s32 id);
|
||||
void *get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id);
|
||||
#else
|
||||
void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id);
|
||||
|
||||
void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 id);
|
||||
#endif
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
|
||||
+706
-436
File diff suppressed because it is too large
Load Diff
+485
-383
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,8 @@ extern s8 gSoundMode;
|
||||
#ifdef VERSION_SH
|
||||
extern OSMesgQueue gUnkQueue1;
|
||||
|
||||
struct UnkStructSH8034EC88 {
|
||||
struct UnkStructSH8034EC88
|
||||
{
|
||||
u8 *endAndMediumIdentification;
|
||||
struct AudioBankSample *sample;
|
||||
u8 *ramAddr;
|
||||
@@ -64,7 +65,8 @@ struct UnkStructSH8034EC88 {
|
||||
s32 isFree;
|
||||
};
|
||||
|
||||
struct PatchStruct {
|
||||
struct PatchStruct
|
||||
{
|
||||
s32 bankId1;
|
||||
s32 bankId2;
|
||||
void *baseAddr1;
|
||||
@@ -78,7 +80,8 @@ extern struct UnkStructSH8034EC88 D_SH_8034EC88[0x80];
|
||||
|
||||
struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1);
|
||||
|
||||
void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue, OSIoMesg *mesg);
|
||||
void audio_dma_partial_copy_async(uintptr_t * devAddr, u8 * *vAddr, ssize_t * remaining, OSMesgQueue * queue, OSIoMesg * mesg);
|
||||
|
||||
void decrease_sample_dma_ttls(void);
|
||||
#ifdef VERSION_SH
|
||||
void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s32 medium);
|
||||
@@ -105,7 +108,7 @@ struct AudioBankSample *func_sh_802f4978(s32 bankId, s32 idx);
|
||||
s32 func_sh_802f47c8(s32 bankId, u8 idx, s8 *io);
|
||||
void *func_sh_802f3f08(s32 poolIdx, s32 arg1, s32 arg2, s32 arg3, OSMesgQueue *retQueue);
|
||||
void func_sh_802f41e4(s32 audioResetStatus);
|
||||
BAD_RETURN(s32) func_sh_802f3368(s32 bankId);
|
||||
BAD_RETURN (s32) func_sh_802f3368(s32 bankId);
|
||||
void *func_sh_802f3764(s32 arg0, s32 idx, s32 *arg2);
|
||||
s32 func_sh_802f3024(s32 bankId, s32 instId, s32 arg2);
|
||||
void func_sh_802f30f4(s32 arg0, s32 arg1, s32 arg2, OSMesgQueue *arg3);
|
||||
|
||||
@@ -7,5 +7,5 @@ struct seqFile *gSoundDataRaw;
|
||||
struct seqFile *gMusicData;
|
||||
|
||||
#ifndef VERSION_SH
|
||||
unsigned char* gBankSetsData;
|
||||
unsigned char *gBankSetsData;
|
||||
#endif
|
||||
+664
-397
File diff suppressed because it is too large
Load Diff
+788
-578
File diff suppressed because it is too large
Load Diff
@@ -17,17 +17,29 @@
|
||||
#define NOTE_ALLOC_GLOBAL_FREELIST 8
|
||||
|
||||
void process_notes(void);
|
||||
|
||||
void seq_channel_layer_note_decay(struct SequenceChannelLayer *seqLayer);
|
||||
|
||||
void seq_channel_layer_note_release(struct SequenceChannelLayer *seqLayer);
|
||||
|
||||
void init_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLayer);
|
||||
|
||||
void init_note_lists(struct NotePool *pool);
|
||||
|
||||
void init_note_free_list(void);
|
||||
|
||||
void note_pool_clear(struct NotePool *pool);
|
||||
|
||||
void note_pool_fill(struct NotePool *pool, s32 count);
|
||||
|
||||
void audio_list_push_front(struct AudioListItem *list, struct AudioListItem *item);
|
||||
|
||||
void audio_list_remove(struct AudioListItem *item);
|
||||
|
||||
struct Note *alloc_note(struct SequenceChannelLayer *seqLayer);
|
||||
|
||||
void reclaim_notes(void);
|
||||
|
||||
void note_init_all(void);
|
||||
|
||||
#if defined(VERSION_SH)
|
||||
|
||||
+166
-122
@@ -34,7 +34,8 @@ s32 audio_shut_down_and_reset_step(void);
|
||||
void func_802ad7ec(u32);
|
||||
|
||||
#ifdef TARGET_N64
|
||||
struct SPTask *create_next_audio_frame_task(void) {
|
||||
struct SPTask *create_next_audio_frame_task(void)
|
||||
{
|
||||
u32 samplesRemainingInAI;
|
||||
s32 writtenCmds;
|
||||
s32 index;
|
||||
@@ -46,12 +47,13 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
OSMesg sp2C;
|
||||
|
||||
gAudioFrameCount++;
|
||||
if (gAudioFrameCount % gAudioBufferParameters.presetUnk4 != 0) {
|
||||
if (gAudioFrameCount % gAudioBufferParameters.presetUnk4 != 0)
|
||||
{
|
||||
stubbed_printf("DAC:Lost 1 Frame.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
osSendMesg(OSMesgQueues[0], (OSMesg) gAudioFrameCount, 0);
|
||||
osSendMesg(OSMesgQueues[0], (OSMesg)gAudioFrameCount, 0);
|
||||
|
||||
gAudioTaskIndex ^= 1;
|
||||
gCurrAiBufferIndex++;
|
||||
@@ -59,26 +61,33 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
index = (gCurrAiBufferIndex - 2 + NUMAIBUFFERS) % NUMAIBUFFERS;
|
||||
samplesRemainingInAI = osAiGetLength() / 4;
|
||||
|
||||
if (gAiBufferLengths[index] != 0) {
|
||||
if (gAiBufferLengths[index] != 0)
|
||||
{
|
||||
osAiSetNextBuffer(gAiBuffers[index], gAiBufferLengths[index] * 4);
|
||||
}
|
||||
|
||||
oldDmaCount = gCurrAudioFrameDmaCount;
|
||||
if (oldDmaCount > AUDIO_FRAME_DMA_QUEUE_SIZE) {
|
||||
if (oldDmaCount > AUDIO_FRAME_DMA_QUEUE_SIZE)
|
||||
{
|
||||
stubbed_printf("DMA: Request queue over.( %d )\n", oldDmaCount);
|
||||
}
|
||||
gCurrAudioFrameDmaCount = 0;
|
||||
|
||||
decrease_sample_dma_ttls();
|
||||
if (osRecvMesg(OSMesgQueues[2], &sp30, 0) != -1) {
|
||||
gAudioResetPresetIdToLoad = (u8) (s32) sp30;
|
||||
if (osRecvMesg(OSMesgQueues[2], &sp30, 0) != -1)
|
||||
{
|
||||
gAudioResetPresetIdToLoad = (u8)(s32)
|
||||
sp30;
|
||||
gAudioResetStatus = 5;
|
||||
}
|
||||
|
||||
if (gAudioResetStatus != 0) {
|
||||
if (audio_shut_down_and_reset_step() == 0) {
|
||||
if (gAudioResetStatus == 0) {
|
||||
osSendMesg(OSMesgQueues[3], (OSMesg) (s32) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK);
|
||||
if (gAudioResetStatus != 0)
|
||||
{
|
||||
if (audio_shut_down_and_reset_step() == 0)
|
||||
{
|
||||
if (gAudioResetStatus == 0)
|
||||
{
|
||||
osSendMesg(OSMesgQueues[3], (OSMesg)(s32) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -90,16 +99,19 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
currAiBuffer = gAiBuffers[index];
|
||||
|
||||
gAiBufferLengths[index] = ((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI +
|
||||
EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xf) + SAMPLES_TO_OVERPRODUCE;
|
||||
if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength) {
|
||||
EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xf) + SAMPLES_TO_OVERPRODUCE;
|
||||
if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength)
|
||||
{
|
||||
gAiBufferLengths[index] = gAudioBufferParameters.minAiBufferLength;
|
||||
}
|
||||
if (gAiBufferLengths[index] > gAudioBufferParameters.maxAiBufferLength) {
|
||||
if (gAiBufferLengths[index] > gAudioBufferParameters.maxAiBufferLength)
|
||||
{
|
||||
gAiBufferLengths[index] = gAudioBufferParameters.maxAiBufferLength;
|
||||
}
|
||||
|
||||
if (osRecvMesg(OSMesgQueues[1], &sp2C, OS_MESG_NOBLOCK) != -1) {
|
||||
func_802ad7ec((u32) sp2C);
|
||||
if (osRecvMesg(OSMesgQueues[1], &sp2C, OS_MESG_NOBLOCK) != -1)
|
||||
{
|
||||
func_802ad7ec((u32)sp2C);
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
@@ -115,7 +127,7 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
task->type = M_AUDTASK;
|
||||
task->flags = flags;
|
||||
task->ucode_boot = rspF3DBootStart;
|
||||
task->ucode_boot_size = (u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart;
|
||||
task->ucode_boot_size = (u8 *)rspF3DBootEnd - (u8 *)rspF3DBootStart;
|
||||
task->ucode = rspAspMainStart;
|
||||
task->ucode_data = rspAspMainDataStart;
|
||||
task->ucode_size = 0x800; // (this size is ignored)
|
||||
@@ -131,25 +143,31 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
return gAudioTask;
|
||||
}
|
||||
#else
|
||||
struct SPTask *create_next_audio_frame_task(void) {
|
||||
struct SPTask *create_next_audio_frame_task(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
void create_next_audio_buffer(s16 *samples, u32 num_samples) {
|
||||
void create_next_audio_buffer(s16 *samples, u32 num_samples)
|
||||
{
|
||||
s32 writtenCmds;
|
||||
OSMesg msg;
|
||||
gAudioFrameCount++;
|
||||
decrease_sample_dma_ttls();
|
||||
if (osRecvMesg(OSMesgQueues[2], &msg, 0) != -1) {
|
||||
gAudioResetPresetIdToLoad = (u8) (intptr_t) msg;
|
||||
if (osRecvMesg(OSMesgQueues[2], &msg, 0) != -1)
|
||||
{
|
||||
gAudioResetPresetIdToLoad = (u8)(intptr_t)
|
||||
msg;
|
||||
gAudioResetStatus = 5;
|
||||
}
|
||||
|
||||
if (gAudioResetStatus != 0) {
|
||||
if (gAudioResetStatus != 0)
|
||||
{
|
||||
audio_reset_session();
|
||||
gAudioResetStatus = 0;
|
||||
}
|
||||
if (osRecvMesg(OSMesgQueues[1], &msg, OS_MESG_NOBLOCK) != -1) {
|
||||
func_802ad7ec((u32) msg);
|
||||
if (osRecvMesg(OSMesgQueues[1], &msg, OS_MESG_NOBLOCK) != -1)
|
||||
{
|
||||
func_802ad7ec((u32)msg);
|
||||
}
|
||||
synthesis_execute(gAudioCmdBuffers[0], &writtenCmds, samples, num_samples);
|
||||
gAudioRandom = ((gAudioRandom + gAudioFrameCount) * gAudioFrameCount);
|
||||
@@ -157,48 +175,55 @@ void create_next_audio_buffer(s16 *samples, u32 num_samples) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void eu_process_audio_cmd(struct EuAudioCmd *cmd) {
|
||||
void eu_process_audio_cmd(struct EuAudioCmd *cmd)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
switch (cmd->u.s.op) {
|
||||
case 0x81:
|
||||
preload_sequence(cmd->u.s.arg2, 3);
|
||||
break;
|
||||
switch (cmd->u.s.op)
|
||||
{
|
||||
case 0x81:
|
||||
preload_sequence(cmd->u.s.arg2, 3);
|
||||
break;
|
||||
|
||||
case 0x82:
|
||||
case 0x88:
|
||||
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
|
||||
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
break;
|
||||
case 0x82:
|
||||
case 0x88:
|
||||
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
|
||||
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
break;
|
||||
|
||||
case 0x83:
|
||||
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) {
|
||||
if (cmd->u2.as_s32 == 0) {
|
||||
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
|
||||
case 0x83:
|
||||
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE)
|
||||
{
|
||||
if (cmd->u2.as_s32 == 0)
|
||||
{
|
||||
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
}
|
||||
}
|
||||
else {
|
||||
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
break;
|
||||
|
||||
case 0xf0:
|
||||
gSoundMode = cmd->u2.as_s32;
|
||||
break;
|
||||
|
||||
case 0xf1:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gSequencePlayers[i].muted = TRUE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 0xf0:
|
||||
gSoundMode = cmd->u2.as_s32;
|
||||
break;
|
||||
|
||||
case 0xf1:
|
||||
for (i = 0; i < 4; i++) {
|
||||
gSequencePlayers[i].muted = TRUE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xf2:
|
||||
for (i = 0; i < 4; i++) {
|
||||
gSequencePlayers[i].muted = FALSE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
case 0xf2:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gSequencePlayers[i].muted = FALSE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,18 +237,21 @@ extern OSMesg OSMesg1;
|
||||
extern OSMesg OSMesg2;
|
||||
extern OSMesg OSMesg3;
|
||||
|
||||
void seq_player_fade_to_zero_volume(s32 player, FadeT fadeOutTime) {
|
||||
if (fadeOutTime == 0) {
|
||||
void seq_player_fade_to_zero_volume(s32 player, FadeT fadeOutTime)
|
||||
{
|
||||
if (fadeOutTime == 0)
|
||||
{
|
||||
fadeOutTime = 1;
|
||||
}
|
||||
gSequencePlayers[player].fadeVelocity = -(gSequencePlayers[player].fadeVolume / fadeOutTime);
|
||||
gSequencePlayers[player].state = 2;
|
||||
gSequencePlayers[player].fadeRemainingFrames = fadeOutTime;
|
||||
|
||||
}
|
||||
|
||||
void func_8031D690(s32 player, FadeT fadeInTime) {
|
||||
if (fadeInTime != 0) {
|
||||
void func_8031D690(s32 player, FadeT fadeInTime)
|
||||
{
|
||||
if (fadeInTime != 0)
|
||||
{
|
||||
gSequencePlayers[player].state = 1;
|
||||
gSequencePlayers[player].fadeTimerUnkEu = fadeInTime;
|
||||
gSequencePlayers[player].fadeRemainingFrames = fadeInTime;
|
||||
@@ -232,7 +260,8 @@ void func_8031D690(s32 player, FadeT fadeInTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void port_eu_init_queues(void) {
|
||||
void port_eu_init_queues(void)
|
||||
{
|
||||
D_EU_80302010 = 0;
|
||||
D_EU_80302014 = 0;
|
||||
osCreateMesgQueue(OSMesgQueues[0], &OSMesg0, 1);
|
||||
@@ -241,100 +270,114 @@ void port_eu_init_queues(void) {
|
||||
osCreateMesgQueue(OSMesgQueues[3], &OSMesg3, 1);
|
||||
}
|
||||
|
||||
void func_802ad6f0(s32 arg0, s32 *arg1) {
|
||||
void func_802ad6f0(s32 arg0, s32 *arg1)
|
||||
{
|
||||
struct EuAudioCmd *cmd = &sAudioCmd[D_EU_80302010 & 0xff];
|
||||
cmd->u.first = arg0;
|
||||
cmd->u2.as_u32 = *arg1;
|
||||
D_EU_80302010++;
|
||||
}
|
||||
|
||||
void func_802ad728(u32 arg0, f32 arg1) {
|
||||
func_802ad6f0(arg0, (s32*) &arg1);
|
||||
void func_802ad728(u32 arg0, f32 arg1)
|
||||
{
|
||||
func_802ad6f0(arg0, (s32 *)&arg1);
|
||||
}
|
||||
|
||||
void func_802ad74c(u32 arg0, u32 arg1) {
|
||||
func_802ad6f0(arg0, (s32*) &arg1);
|
||||
void func_802ad74c(u32 arg0, u32 arg1)
|
||||
{
|
||||
func_802ad6f0(arg0, (s32 *)&arg1);
|
||||
}
|
||||
|
||||
void func_802ad770(u32 arg0, s8 arg1) {
|
||||
void func_802ad770(u32 arg0, s8 arg1)
|
||||
{
|
||||
s32 sp1C = arg1 << 24;
|
||||
func_802ad6f0(arg0, &sp1C);
|
||||
}
|
||||
|
||||
void func_802ad7a0(void) {
|
||||
void func_802ad7a0(void)
|
||||
{
|
||||
osSendMesg(OSMesgQueues[1],
|
||||
(OSMesg)(u32)((D_EU_80302014 & 0xff) << 8 | (D_EU_80302010 & 0xff)),
|
||||
OS_MESG_NOBLOCK);
|
||||
(OSMesg)(u32)((D_EU_80302014 & 0xff) << 8 | (D_EU_80302010 & 0xff)),
|
||||
OS_MESG_NOBLOCK);
|
||||
D_EU_80302014 = D_EU_80302010;
|
||||
}
|
||||
|
||||
void func_802ad7ec(u32 arg0) {
|
||||
void func_802ad7ec(u32 arg0)
|
||||
{
|
||||
struct EuAudioCmd *cmd;
|
||||
struct SequencePlayer *seqPlayer;
|
||||
struct SequenceChannel *chan;
|
||||
u8 end = arg0 & 0xff;
|
||||
u8 i = (arg0 >> 8) & 0xff;
|
||||
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
if (i == end) break;
|
||||
cmd = &sAudioCmd[i++ & 0xff];
|
||||
|
||||
if (cmd->u.s.arg1 < SEQUENCE_PLAYERS) {
|
||||
if (cmd->u.s.arg1 < SEQUENCE_PLAYERS)
|
||||
{
|
||||
seqPlayer = &gSequencePlayers[cmd->u.s.arg1];
|
||||
if ((cmd->u.s.op & 0x80) != 0) {
|
||||
if ((cmd->u.s.op & 0x80) != 0)
|
||||
{
|
||||
eu_process_audio_cmd(cmd);
|
||||
}
|
||||
else if ((cmd->u.s.op & 0x40) != 0) {
|
||||
switch (cmd->u.s.op) {
|
||||
case 0x41:
|
||||
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
break;
|
||||
else if ((cmd->u.s.op & 0x40) != 0)
|
||||
{
|
||||
switch (cmd->u.s.op)
|
||||
{
|
||||
case 0x41:
|
||||
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
break;
|
||||
|
||||
case 0x47:
|
||||
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
|
||||
break;
|
||||
case 0x47:
|
||||
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
|
||||
break;
|
||||
|
||||
case 0x48:
|
||||
seqPlayer->transposition = cmd->u2.as_s8;
|
||||
break;
|
||||
case 0x48:
|
||||
seqPlayer->transposition = cmd->u2.as_s8;
|
||||
break;
|
||||
|
||||
case 0x46:
|
||||
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
break;
|
||||
case 0x46:
|
||||
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) {
|
||||
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10)
|
||||
{
|
||||
chan = seqPlayer->channels[cmd->u.s.arg2];
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(chan))
|
||||
{
|
||||
switch (cmd->u.s.op) {
|
||||
case 1:
|
||||
chan->volumeScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
break;
|
||||
case 2:
|
||||
chan->volume = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
break;
|
||||
case 3:
|
||||
chan->newPan = cmd->u2.as_s8;
|
||||
chan->changes.as_bitfields.pan = TRUE;
|
||||
break;
|
||||
case 4:
|
||||
chan->freqScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.freqScale = TRUE;
|
||||
break;
|
||||
case 5:
|
||||
chan->reverbVol = cmd->u2.as_s8;
|
||||
break;
|
||||
case 6:
|
||||
if (cmd->u.s.arg3 < 8) {
|
||||
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
chan->stopSomething2 = cmd->u2.as_s8;
|
||||
switch (cmd->u.s.op)
|
||||
{
|
||||
case 1:
|
||||
chan->volumeScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
break;
|
||||
case 2:
|
||||
chan->volume = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
break;
|
||||
case 3:
|
||||
chan->newPan = cmd->u2.as_s8;
|
||||
chan->changes.as_bitfields.pan = TRUE;
|
||||
break;
|
||||
case 4:
|
||||
chan->freqScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.freqScale = TRUE;
|
||||
break;
|
||||
case 5:
|
||||
chan->reverbVol = cmd->u2.as_s8;
|
||||
break;
|
||||
case 6:
|
||||
if (cmd->u.s.arg3 < 8)
|
||||
{
|
||||
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
chan->stopSomething2 = cmd->u2.as_s8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -344,7 +387,8 @@ void func_802ad7ec(u32 arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void port_eu_init(void) {
|
||||
void port_eu_init(void)
|
||||
{
|
||||
port_eu_init_queues();
|
||||
}
|
||||
|
||||
|
||||
+290
-201
@@ -24,7 +24,8 @@ void seq_player_fade_to_zero_volume(s32 arg0, s32 numFrames);
|
||||
void func_802ad7ec(u32 arg0);
|
||||
|
||||
#ifdef TARGET_N64
|
||||
struct SPTask *create_next_audio_frame_task(void) {
|
||||
struct SPTask *create_next_audio_frame_task(void)
|
||||
{
|
||||
u32 samplesRemainingInAI;
|
||||
s32 writtenCmds;
|
||||
s32 index;
|
||||
@@ -37,13 +38,15 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
s32 writtenCmdsCopy;
|
||||
|
||||
gAudioFrameCount++;
|
||||
if (gAudioFrameCount % gAudioBufferParameters.presetUnk4 != 0) {
|
||||
if ((gAudioFrameCount % gAudioBufferParameters.presetUnk4) + 1 == gAudioBufferParameters.presetUnk4) {
|
||||
if (gAudioFrameCount % gAudioBufferParameters.presetUnk4 != 0)
|
||||
{
|
||||
if ((gAudioFrameCount % gAudioBufferParameters.presetUnk4) + 1 == gAudioBufferParameters.presetUnk4)
|
||||
{
|
||||
return D_SH_80314FCC;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
osSendMesg(D_SH_80350F38, (OSMesg) gAudioFrameCount, OS_MESG_NOBLOCK);
|
||||
osSendMesg(D_SH_80350F38, (OSMesg)gAudioFrameCount, OS_MESG_NOBLOCK);
|
||||
|
||||
gAudioTaskIndex ^= 1;
|
||||
gCurrAiBufferIndex++;
|
||||
@@ -51,66 +54,81 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
index = (gCurrAiBufferIndex - 2 + NUMAIBUFFERS) % NUMAIBUFFERS;
|
||||
samplesRemainingInAI = osAiGetLength() / 4;
|
||||
|
||||
if (gAudioLoadLockSH < 0x10U) {
|
||||
if (gAiBufferLengths[index] != 0) {
|
||||
if (gAudioLoadLockSH < 0x10U)
|
||||
{
|
||||
if (gAiBufferLengths[index] != 0)
|
||||
{
|
||||
osAiSetNextBuffer(gAiBuffers[index], gAiBufferLengths[index] * 4);
|
||||
}
|
||||
}
|
||||
|
||||
oldDmaCount = gCurrAudioFrameDmaCount;
|
||||
if (oldDmaCount > AUDIO_FRAME_DMA_QUEUE_SIZE) {
|
||||
if (oldDmaCount > AUDIO_FRAME_DMA_QUEUE_SIZE)
|
||||
{
|
||||
}
|
||||
gCurrAudioFrameDmaCount = 0;
|
||||
|
||||
decrease_sample_dma_ttls();
|
||||
func_sh_802f41e4(gAudioResetStatus);
|
||||
if (osRecvMesg(D_SH_80350F88, (OSMesg *) &sp38, OS_MESG_NOBLOCK) != -1) {
|
||||
if (gAudioResetStatus == 0) {
|
||||
if (osRecvMesg(D_SH_80350F88, (OSMesg *)&sp38, OS_MESG_NOBLOCK) != -1)
|
||||
{
|
||||
if (gAudioResetStatus == 0)
|
||||
{
|
||||
gAudioResetStatus = 5;
|
||||
}
|
||||
gAudioResetPresetIdToLoad = (u8) sp38;
|
||||
gAudioResetPresetIdToLoad = (u8)sp38;
|
||||
}
|
||||
|
||||
if (gAudioResetStatus != 0) {
|
||||
if (audio_shut_down_and_reset_step() == 0) {
|
||||
if (gAudioResetStatus == 0) {
|
||||
osSendMesg(D_SH_80350FA8, (OSMesg) (s32) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK);
|
||||
if (gAudioResetStatus != 0)
|
||||
{
|
||||
if (audio_shut_down_and_reset_step() == 0)
|
||||
{
|
||||
if (gAudioResetStatus == 0)
|
||||
{
|
||||
osSendMesg(D_SH_80350FA8, (OSMesg)(s32) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK);
|
||||
}
|
||||
D_SH_80314FCC = 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (gAudioLoadLockSH >= 0x11U) {
|
||||
if (gAudioLoadLockSH >= 0x11U)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (gAudioLoadLockSH != 0) {
|
||||
if (gAudioLoadLockSH != 0)
|
||||
{
|
||||
gAudioLoadLockSH++;
|
||||
}
|
||||
|
||||
gAudioTask = &gAudioTasks[gAudioTaskIndex];
|
||||
gAudioCmd = (u64 *) gAudioCmdBuffers[gAudioTaskIndex];
|
||||
gAudioCmd = (u64 *)gAudioCmdBuffers[gAudioTaskIndex];
|
||||
index = gCurrAiBufferIndex;
|
||||
currAiBuffer = gAiBuffers[index];
|
||||
|
||||
gAiBufferLengths[index] = (s16) ((((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI) +
|
||||
EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xf) + SAMPLES_TO_OVERPRODUCE);
|
||||
if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength) {
|
||||
gAiBufferLengths[index] = (s16)((((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI) +
|
||||
EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xf) + SAMPLES_TO_OVERPRODUCE);
|
||||
if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength)
|
||||
{
|
||||
gAiBufferLengths[index] = gAudioBufferParameters.minAiBufferLength;
|
||||
}
|
||||
if (gAiBufferLengths[index] > gAudioBufferParameters.maxAiBufferLength) {
|
||||
if (gAiBufferLengths[index] > gAudioBufferParameters.maxAiBufferLength)
|
||||
{
|
||||
gAiBufferLengths[index] = gAudioBufferParameters.maxAiBufferLength;
|
||||
}
|
||||
|
||||
if (osRecvMesg(D_SH_80350F68, (OSMesg *) &sp34, 0) != -1) {
|
||||
do {
|
||||
if (osRecvMesg(D_SH_80350F68, (OSMesg *)&sp34, 0) != -1)
|
||||
{
|
||||
do
|
||||
{
|
||||
func_802ad7ec(sp34);
|
||||
} while (osRecvMesg(D_SH_80350F68, (OSMesg *) &sp34, 0) != -1);
|
||||
}
|
||||
while (osRecvMesg(D_SH_80350F68, (OSMesg *)&sp34, 0) != -1);
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
gAudioCmd = synthesis_execute(gAudioCmd, &writtenCmds, currAiBuffer, gAiBufferLengths[index]);
|
||||
gAudioRandom = (u32) (osGetCount() * (gAudioRandom + gAudioFrameCount));
|
||||
gAudioRandom = (u32) (gAiBuffers[index][gAudioFrameCount & 0xFF] + gAudioRandom);
|
||||
gAudioRandom = (u32)(osGetCount() * (gAudioRandom + gAudioFrameCount));
|
||||
gAudioRandom = (u32)(gAiBuffers[index][gAudioFrameCount & 0xFF] + gAudioRandom);
|
||||
|
||||
index = gAudioTaskIndex;
|
||||
gAudioTask->msgqueue = NULL;
|
||||
@@ -120,7 +138,7 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
task->type = M_AUDTASK;
|
||||
task->flags = flags;
|
||||
task->ucode_boot = rspF3DBootStart;
|
||||
task->ucode_boot_size = (u8 *) rspF3DStart - (u8 *) rspF3DBootStart;
|
||||
task->ucode_boot_size = (u8 *)rspF3DStart - (u8 *)rspF3DBootStart;
|
||||
task->ucode = rspAspMainStart;
|
||||
task->ucode_data = rspAspMainDataStart;
|
||||
task->ucode_size = 0x1000;
|
||||
@@ -135,39 +153,50 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
task->yield_data_size = 0;
|
||||
|
||||
writtenCmdsCopy = writtenCmds;
|
||||
if (D_SH_80314FC8 < writtenCmdsCopy) {
|
||||
if (D_SH_80314FC8 < writtenCmdsCopy)
|
||||
{
|
||||
D_SH_80314FC8 = writtenCmdsCopy;
|
||||
}
|
||||
|
||||
if (gAudioBufferParameters.presetUnk4 == 1) {
|
||||
if (gAudioBufferParameters.presetUnk4 == 1)
|
||||
{
|
||||
return gAudioTask;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
D_SH_80314FCC = gAudioTask;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
struct SPTask *create_next_audio_frame_task(void) {
|
||||
struct SPTask *create_next_audio_frame_task(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
void create_next_audio_buffer(s16 *samples, u32 num_samples) {
|
||||
void create_next_audio_buffer(s16 *samples, u32 num_samples)
|
||||
{
|
||||
s32 writtenCmds;
|
||||
OSMesg msg;
|
||||
gAudioFrameCount++;
|
||||
decrease_sample_dma_ttls();
|
||||
if (osRecvMesg(D_SH_80350F88, &msg, 0) != -1) {
|
||||
gAudioResetPresetIdToLoad = (u8) (intptr_t) msg;
|
||||
if (gAudioResetStatus == 0) {
|
||||
if (osRecvMesg(D_SH_80350F88, &msg, 0) != -1)
|
||||
{
|
||||
gAudioResetPresetIdToLoad = (u8)(intptr_t)
|
||||
msg;
|
||||
if (gAudioResetStatus == 0)
|
||||
{
|
||||
gAudioResetStatus = 5;
|
||||
}
|
||||
}
|
||||
|
||||
if (gAudioResetStatus != 0) {
|
||||
if (gAudioResetStatus != 0)
|
||||
{
|
||||
audio_reset_session();
|
||||
gAudioResetStatus = 0;
|
||||
}
|
||||
while (osRecvMesg(D_SH_80350F68, &msg, OS_MESG_NOBLOCK) != -1) {
|
||||
func_802ad7ec((u32) msg);
|
||||
while (osRecvMesg(D_SH_80350F68, &msg, OS_MESG_NOBLOCK) != -1)
|
||||
{
|
||||
func_802ad7ec((u32)msg);
|
||||
}
|
||||
synthesis_execute(gAudioCmdBuffers[0], &writtenCmds, samples, num_samples);
|
||||
gAudioRandom = ((gAudioRandom + gAudioFrameCount) * gAudioFrameCount);
|
||||
@@ -176,99 +205,114 @@ void create_next_audio_buffer(s16 *samples, u32 num_samples) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void eu_process_audio_cmd(struct EuAudioCmd *cmd) {
|
||||
void eu_process_audio_cmd(struct EuAudioCmd *cmd)
|
||||
{
|
||||
s32 i;
|
||||
struct Note *note;
|
||||
struct NoteSubEu *sub;
|
||||
|
||||
switch (cmd->u.s.op) {
|
||||
case 0x81:
|
||||
preload_sequence(cmd->u.s.arg2, 3);
|
||||
break;
|
||||
switch (cmd->u.s.op)
|
||||
{
|
||||
case 0x81:
|
||||
preload_sequence(cmd->u.s.arg2, 3);
|
||||
break;
|
||||
|
||||
case 0x82:
|
||||
case 0x88:
|
||||
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
|
||||
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
break;
|
||||
case 0x82:
|
||||
case 0x88:
|
||||
load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
|
||||
func_8031D690(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
break;
|
||||
|
||||
case 0x83:
|
||||
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) {
|
||||
if (cmd->u2.as_s32 == 0) {
|
||||
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
|
||||
case 0x83:
|
||||
if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE)
|
||||
{
|
||||
if (cmd->u2.as_s32 == 0)
|
||||
{
|
||||
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
}
|
||||
}
|
||||
else {
|
||||
seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
break;
|
||||
|
||||
case 0x84:
|
||||
break;
|
||||
|
||||
case 0xf0:
|
||||
gSoundMode = cmd->u2.as_s32;
|
||||
break;
|
||||
|
||||
case 0xf1:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gSequencePlayers[i].muted = TRUE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 0x84:
|
||||
break;
|
||||
|
||||
case 0xf0:
|
||||
gSoundMode = cmd->u2.as_s32;
|
||||
break;
|
||||
|
||||
case 0xf1:
|
||||
for (i = 0; i < 4; i++) {
|
||||
gSequencePlayers[i].muted = TRUE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xf2:
|
||||
if (cmd->u2.as_s32 == 1) {
|
||||
for (i = 0; i < gMaxSimultaneousNotes; i++) {
|
||||
note = &gNotes[i];
|
||||
sub = ¬e->noteSubEu;
|
||||
if (note->noteSubEu.enabled && note->unkSH34 == 0) {
|
||||
if ((note->parentLayer->seqChannel->muteBehavior & 8) != 0) {
|
||||
sub->finished = TRUE;
|
||||
case 0xf2:
|
||||
if (cmd->u2.as_s32 == 1)
|
||||
{
|
||||
for (i = 0; i < gMaxSimultaneousNotes; i++)
|
||||
{
|
||||
note = &gNotes[i];
|
||||
sub = ¬e->noteSubEu;
|
||||
if (note->noteSubEu.enabled && note->unkSH34 == 0)
|
||||
{
|
||||
if ((note->parentLayer->seqChannel->muteBehavior & 8) != 0)
|
||||
{
|
||||
sub->finished = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
gSequencePlayers[i].muted = FALSE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gSequencePlayers[i].muted = FALSE;
|
||||
gSequencePlayers[i].recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xf3:
|
||||
func_sh_802f3024(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
|
||||
break;
|
||||
case 0xf3:
|
||||
func_sh_802f3024(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3);
|
||||
break;
|
||||
|
||||
case 0xf4:
|
||||
func_sh_802f30f4(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
|
||||
break;
|
||||
case 0xf4:
|
||||
func_sh_802f30f4(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
|
||||
break;
|
||||
|
||||
case 0xf5:
|
||||
func_sh_802f3158(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
|
||||
break;
|
||||
case 0xf5:
|
||||
func_sh_802f3158(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3, &gUnkQueue1);
|
||||
break;
|
||||
|
||||
case 0xf6:
|
||||
func_sh_802f3288(cmd->u.s.arg2);
|
||||
break;
|
||||
case 0xf6:
|
||||
func_sh_802f3288(cmd->u.s.arg2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void seq_player_fade_to_zero_volume(s32 arg0, s32 fadeOutTime) {
|
||||
void seq_player_fade_to_zero_volume(s32 arg0, s32 fadeOutTime)
|
||||
{
|
||||
struct SequencePlayer *player;
|
||||
|
||||
if (fadeOutTime == 0) {
|
||||
if (fadeOutTime == 0)
|
||||
{
|
||||
fadeOutTime = 1;
|
||||
}
|
||||
player = &gSequencePlayers[arg0];
|
||||
player->state = 2;
|
||||
player->fadeRemainingFrames = fadeOutTime;
|
||||
player->fadeVelocity = -(player->fadeVolume / (f32) fadeOutTime);
|
||||
player->fadeVelocity = -(player->fadeVolume / (f32)fadeOutTime);
|
||||
}
|
||||
|
||||
void func_8031D690(s32 playerIndex, s32 fadeInTime) {
|
||||
void func_8031D690(s32 playerIndex, s32 fadeInTime)
|
||||
{
|
||||
struct SequencePlayer *player;
|
||||
|
||||
if (fadeInTime != 0) {
|
||||
if (fadeInTime != 0)
|
||||
{
|
||||
player = &gSequencePlayers[playerIndex];
|
||||
player->state = 1;
|
||||
player->fadeTimerUnkEu = fadeInTime;
|
||||
@@ -278,7 +322,8 @@ void func_8031D690(s32 playerIndex, s32 fadeInTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void port_eu_init_queues(void) {
|
||||
void port_eu_init_queues(void)
|
||||
{
|
||||
D_SH_80350F18 = 0;
|
||||
D_SH_80350F19 = 0;
|
||||
D_SH_80350F38 = &D_SH_80350F20;
|
||||
@@ -292,36 +337,43 @@ void port_eu_init_queues(void) {
|
||||
}
|
||||
|
||||
extern struct EuAudioCmd sAudioCmd[0x100];
|
||||
void func_802ad6f0(s32 arg0, s32 *arg1) {
|
||||
void func_802ad6f0(s32 arg0, s32 *arg1)
|
||||
{
|
||||
struct EuAudioCmd *cmd = &sAudioCmd[D_SH_80350F18 & 0xff];
|
||||
cmd->u.first = arg0;
|
||||
cmd->u2.as_u32 = *arg1;
|
||||
D_SH_80350F18++;
|
||||
if (D_SH_80350F18 == D_SH_80350F19) {
|
||||
if (D_SH_80350F18 == D_SH_80350F19)
|
||||
{
|
||||
D_SH_80350F18--;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802ad728(u32 arg0, f32 arg1) {
|
||||
func_802ad6f0(arg0, (s32 *) &arg1);
|
||||
void func_802ad728(u32 arg0, f32 arg1)
|
||||
{
|
||||
func_802ad6f0(arg0, (s32 *)&arg1);
|
||||
}
|
||||
|
||||
void func_802ad74c(u32 arg0, u32 arg1) {
|
||||
func_802ad6f0(arg0, (s32 *) &arg1);
|
||||
void func_802ad74c(u32 arg0, u32 arg1)
|
||||
{
|
||||
func_802ad6f0(arg0, (s32 *)&arg1);
|
||||
}
|
||||
|
||||
void func_802ad770(u32 arg0, s8 arg1) {
|
||||
void func_802ad770(u32 arg0, s8 arg1)
|
||||
{
|
||||
s32 sp1C = arg1 << 24;
|
||||
func_802ad6f0(arg0, &sp1C);
|
||||
}
|
||||
|
||||
char shindouDebugPrint133[] = "AudioSend: %d -> %d (%d)\n";
|
||||
|
||||
void func_sh_802F64C8(void) {
|
||||
void func_sh_802F64C8(void)
|
||||
{
|
||||
static s32 D_SH_8031503C = 0;
|
||||
s32 mesg;
|
||||
|
||||
if (((D_SH_80350F18 - D_SH_80350F19 + 0x100) & 0xff) > D_SH_8031503C) {
|
||||
if (((D_SH_80350F18 - D_SH_80350F19 + 0x100) & 0xff) > D_SH_8031503C)
|
||||
{
|
||||
D_SH_8031503C = (D_SH_80350F18 - D_SH_80350F19 + 0x100) & 0xff;
|
||||
}
|
||||
mesg = ((D_SH_80350F19 & 0xff) << 8) | (D_SH_80350F18 & 0xff);
|
||||
@@ -329,11 +381,13 @@ void func_sh_802F64C8(void) {
|
||||
D_SH_80350F19 = D_SH_80350F18;
|
||||
}
|
||||
|
||||
void func_sh_802f6540(void) {
|
||||
void func_sh_802f6540(void)
|
||||
{
|
||||
D_SH_80350F19 = D_SH_80350F18;
|
||||
}
|
||||
|
||||
void func_802ad7ec(u32 arg0) {
|
||||
void func_802ad7ec(u32 arg0)
|
||||
{
|
||||
struct EuAudioCmd *cmd;
|
||||
struct SequencePlayer *seqPlayer;
|
||||
struct SequenceChannel *chan;
|
||||
@@ -347,102 +401,120 @@ void func_802ad7ec(u32 arg0) {
|
||||
static u8 D_SH_80315098 = 0;
|
||||
static u8 D_SH_8031509C = 0;
|
||||
|
||||
if (D_SH_8031509C == 0) {
|
||||
if (D_SH_8031509C == 0)
|
||||
{
|
||||
D_SH_80315098 = (arg0 >> 8) & 0xff;
|
||||
}
|
||||
|
||||
end = arg0 & 0xff;
|
||||
|
||||
for (;;) {
|
||||
if (D_SH_80315098 == end) {
|
||||
for (;;)
|
||||
{
|
||||
if (D_SH_80315098 == end)
|
||||
{
|
||||
D_SH_8031509C = 0;
|
||||
break;
|
||||
}
|
||||
cmd = &sAudioCmd[D_SH_80315098 & 0xff];
|
||||
D_SH_80315098++;
|
||||
if (cmd->u.s.op == 0xf8) {
|
||||
if (cmd->u.s.op == 0xf8)
|
||||
{
|
||||
D_SH_8031509C = 1;
|
||||
break;
|
||||
}
|
||||
else if ((cmd->u.s.op & 0xf0) == 0xf0) {
|
||||
else if ((cmd->u.s.op & 0xf0) == 0xf0)
|
||||
{
|
||||
eu_process_audio_cmd(cmd);
|
||||
}
|
||||
else if (cmd->u.s.arg1 < SEQUENCE_PLAYERS) {
|
||||
else if (cmd->u.s.arg1 < SEQUENCE_PLAYERS)
|
||||
{
|
||||
seqPlayer = &gSequencePlayers[cmd->u.s.arg1];
|
||||
if ((cmd->u.s.op & 0x80) != 0) {
|
||||
if ((cmd->u.s.op & 0x80) != 0)
|
||||
{
|
||||
eu_process_audio_cmd(cmd);
|
||||
}
|
||||
else if ((cmd->u.s.op & 0x40) != 0) {
|
||||
switch (cmd->u.s.op) {
|
||||
case 0x41:
|
||||
if (seqPlayer->fadeVolumeScale != cmd->u2.as_f32) {
|
||||
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
else if ((cmd->u.s.op & 0x40) != 0)
|
||||
{
|
||||
switch (cmd->u.s.op)
|
||||
{
|
||||
case 0x41:
|
||||
if (seqPlayer->fadeVolumeScale != cmd->u2.as_f32)
|
||||
{
|
||||
seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x47:
|
||||
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
|
||||
break;
|
||||
case 0x47:
|
||||
seqPlayer->tempo = cmd->u2.as_s32 * TATUMS_PER_BEAT;
|
||||
break;
|
||||
|
||||
case 0x49:
|
||||
seqPlayer->tempoAdd = cmd->u2.as_s32 * TEMPO_SCALE;
|
||||
break;
|
||||
case 0x49:
|
||||
seqPlayer->tempoAdd = cmd->u2.as_s32 * TEMPO_SCALE;
|
||||
break;
|
||||
|
||||
case 0x48:
|
||||
seqPlayer->transposition = cmd->u2.as_s8;
|
||||
break;
|
||||
case 0x48:
|
||||
seqPlayer->transposition = cmd->u2.as_s8;
|
||||
break;
|
||||
|
||||
case 0x46:
|
||||
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
break;
|
||||
case 0x46:
|
||||
seqPlayer->seqVariationEu[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10) {
|
||||
else if (seqPlayer->enabled != FALSE && cmd->u.s.arg2 < 0x10)
|
||||
{
|
||||
chan = seqPlayer->channels[cmd->u.s.arg2];
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(chan))
|
||||
{
|
||||
switch (cmd->u.s.op) {
|
||||
case 1:
|
||||
if (chan->volumeScale != cmd->u2.as_f32) {
|
||||
chan->volumeScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (chan->volume != cmd->u2.as_f32) {
|
||||
chan->volume = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (chan->newPan != cmd->u2.as_s8) {
|
||||
chan->newPan = cmd->u2.as_s8;
|
||||
chan->changes.as_bitfields.pan = TRUE;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (chan->freqScale != cmd->u2.as_f32) {
|
||||
chan->freqScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.freqScale = TRUE;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
//! @bug u8 s8 comparison (but harmless)
|
||||
if (chan->reverbVol != cmd->u2.as_s8) {
|
||||
chan->reverbVol = cmd->u2.as_s8;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (cmd->u.s.arg3 < 8) {
|
||||
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
chan->stopSomething2 = cmd->u2.as_s8;
|
||||
break;
|
||||
case 9:
|
||||
chan->muteBehavior = cmd->u2.as_s8;
|
||||
switch (cmd->u.s.op)
|
||||
{
|
||||
case 1:
|
||||
if (chan->volumeScale != cmd->u2.as_f32)
|
||||
{
|
||||
chan->volumeScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (chan->volume != cmd->u2.as_f32)
|
||||
{
|
||||
chan->volume = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.volume = TRUE;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (chan->newPan != cmd->u2.as_s8)
|
||||
{
|
||||
chan->newPan = cmd->u2.as_s8;
|
||||
chan->changes.as_bitfields.pan = TRUE;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (chan->freqScale != cmd->u2.as_f32)
|
||||
{
|
||||
chan->freqScale = cmd->u2.as_f32;
|
||||
chan->changes.as_bitfields.freqScale = TRUE;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
//! @bug u8 s8 comparison (but harmless)
|
||||
if (chan->reverbVol != cmd->u2.as_s8)
|
||||
{
|
||||
chan->reverbVol = cmd->u2.as_s8;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (cmd->u.s.arg3 < 8)
|
||||
{
|
||||
chan->soundScriptIO[cmd->u.s.arg3] = cmd->u2.as_s8;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
chan->stopSomething2 = cmd->u2.as_s8;
|
||||
break;
|
||||
case 9:
|
||||
chan->muteBehavior = cmd->u2.as_s8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -452,74 +524,91 @@ void func_802ad7ec(u32 arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 func_sh_802f6878(s32 *arg0) {
|
||||
u32 func_sh_802f6878(s32 *arg0)
|
||||
{
|
||||
u32 sp1C;
|
||||
|
||||
if (osRecvMesg(&gUnkQueue1, (OSMesg *) &sp1C, 0) == -1) {
|
||||
if (osRecvMesg(&gUnkQueue1, (OSMesg *)&sp1C, 0) == -1)
|
||||
{
|
||||
*arg0 = 0;
|
||||
return 0U;
|
||||
}
|
||||
*arg0 = (s32) (sp1C & 0xFFFFFF);
|
||||
*arg0 = (s32)(sp1C & 0xFFFFFF);
|
||||
return sp1C >> 0x18;
|
||||
}
|
||||
|
||||
u8 *func_sh_802f68e0(u32 index, u32 *a1) {
|
||||
u8 *func_sh_802f68e0(u32 index, u32 *a1)
|
||||
{
|
||||
return func_sh_802f3220(index, a1);
|
||||
}
|
||||
|
||||
s32 func_sh_802f6900(void) {
|
||||
s32 func_sh_802f6900(void)
|
||||
{
|
||||
s32 ret;
|
||||
s32 sp18;
|
||||
|
||||
ret = osRecvMesg(D_SH_80350FA8, (OSMesg *) &sp18, 0);
|
||||
ret = osRecvMesg(D_SH_80350FA8, (OSMesg *)&sp18, 0);
|
||||
|
||||
if (ret == -1) {
|
||||
if (ret == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (sp18 != gAudioResetPresetIdToLoad) {
|
||||
if (sp18 != gAudioResetPresetIdToLoad)
|
||||
{
|
||||
return 0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: (Scrub C)
|
||||
void func_sh_802f6958(OSMesg mesg) {
|
||||
void func_sh_802f6958(OSMesg mesg)
|
||||
{
|
||||
s32 a;
|
||||
OSMesg recvMesg;
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
a = -1;
|
||||
} while (osRecvMesg(D_SH_80350FA8, &recvMesg, OS_MESG_NOBLOCK) != a);
|
||||
}
|
||||
while (osRecvMesg(D_SH_80350FA8, &recvMesg, OS_MESG_NOBLOCK) != a);
|
||||
func_sh_802f6540();
|
||||
osSendMesg(D_SH_80350F88, mesg, OS_MESG_NOBLOCK);
|
||||
}
|
||||
|
||||
void func_sh_802f69cc(void) {
|
||||
void func_sh_802f69cc(void)
|
||||
{
|
||||
gAudioLoadLockSH = 1;
|
||||
func_sh_802f6958(0);
|
||||
gAudioResetStatus = 0;
|
||||
}
|
||||
|
||||
s32 func_sh_802f6a08(s32 playerIndex, s32 channelIndex, s32 soundScriptIOIndex) {
|
||||
s32 func_sh_802f6a08(s32 playerIndex, s32 channelIndex, s32 soundScriptIOIndex)
|
||||
{
|
||||
struct SequenceChannel *seqChannel;
|
||||
struct SequencePlayer *player;
|
||||
|
||||
player = &gSequencePlayers[playerIndex];
|
||||
if (player->enabled) {
|
||||
if (player->enabled)
|
||||
{
|
||||
seqChannel = player->channels[channelIndex];
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(seqChannel)) {
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(seqChannel))
|
||||
{
|
||||
return seqChannel->soundScriptIO[soundScriptIOIndex];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
s8 func_sh_802f6a6c(s32 playerIndex, s32 index) {
|
||||
s8 func_sh_802f6a6c(s32 playerIndex, s32 index)
|
||||
{
|
||||
return gSequencePlayers[playerIndex].seqVariationEu[index];
|
||||
}
|
||||
|
||||
void port_eu_init(void) {
|
||||
void port_eu_init(void)
|
||||
{
|
||||
port_eu_init_queues();
|
||||
}
|
||||
|
||||
@@ -544,7 +633,7 @@ char shindouDebugPrint155[] = "Audio: voiceman: Percpointer NULL %d,%d\n";
|
||||
char shindouDebugPrint156[] = "--4 %x\n";
|
||||
char shindouDebugPrint157[] = "NoteOff Comes during wait release %x (note %x)\n";
|
||||
char shindouDebugPrint158[] = "Slow Release Batting\n";
|
||||
u8 euUnknownData_8030194c[4] = { 0x40, 0x20, 0x10, 0x08 };
|
||||
u8 euUnknownData_8030194c[4] = {0x40, 0x20, 0x10, 0x08};
|
||||
char shindouDebugPrint159[] = "Audio:Wavemem: Bad voiceno (%d)\n";
|
||||
char shindouDebugPrint160[] = "Audio: C-Alloc : Dealloc voice is NULL\n";
|
||||
char shindouDebugPrint161[] = "Alloc Error:Dim voice-Alloc %d";
|
||||
|
||||
+1056
-776
File diff suppressed because it is too large
Load Diff
@@ -7,12 +7,19 @@
|
||||
#include "playback.h"
|
||||
|
||||
void seq_channel_layer_disable(struct SequenceChannelLayer *seqPlayer);
|
||||
|
||||
void sequence_channel_disable(struct SequenceChannel *seqPlayer);
|
||||
void sequence_player_disable(struct SequencePlayer* seqPlayer);
|
||||
|
||||
void sequence_player_disable(struct SequencePlayer *seqPlayer);
|
||||
|
||||
void audio_list_push_back(struct AudioListItem *list, struct AudioListItem *item);
|
||||
|
||||
void *audio_list_pop_back(struct AudioListItem *list);
|
||||
|
||||
void process_sequences(s32 iterationsRemaining);
|
||||
|
||||
void init_sequence_player(u32 player);
|
||||
|
||||
void init_sequence_players(void);
|
||||
|
||||
#endif // AUDIO_SEQPLAYER_H
|
||||
|
||||
@@ -6,7 +6,7 @@ char shindouDebugPrint1[] = "Terminate-Canceled Channel %d,Phase %d\n";
|
||||
char shindouDebugPrint2[] = "S->W\n";
|
||||
char shindouDebugPrint3[] = "W->S\n";
|
||||
char shindouDebugPrint4[] = "S-Resample Pitch %x (old %d -> delay %d)\n";
|
||||
s32 shindouDebugPrintPadding1[] = {0,0,0};
|
||||
s32 shindouDebugPrintPadding1[] = {0, 0, 0};
|
||||
|
||||
// heap.c
|
||||
char shindouDebugPrint5[] = "Warning:Kill Note %x \n";
|
||||
|
||||
+591
-381
File diff suppressed because it is too large
Load Diff
@@ -30,46 +30,62 @@ struct ReverbRingBufferItem
|
||||
|
||||
struct SynthesisReverb
|
||||
{
|
||||
/*0x00, 0x00, 0x00*/ u8 resampleFlags;
|
||||
/*0x01, 0x01, 0x01*/ u8 useReverb;
|
||||
/*0x02, 0x02, 0x02*/ u8 framesLeftToIgnore;
|
||||
/*0x03, 0x03, 0x03*/ u8 curFrame;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
/*0x00, 0x00, 0x00*/
|
||||
u8 resampleFlags;
|
||||
/*0x01, 0x01, 0x01*/
|
||||
u8 useReverb;
|
||||
/*0x02, 0x02, 0x02*/
|
||||
u8 framesLeftToIgnore;
|
||||
/*0x03, 0x03, 0x03*/
|
||||
u8 curFrame;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
/* 0x04, 0x04*/ u8 downsampleRate;
|
||||
#ifdef VERSION_SH
|
||||
#ifdef VERSION_SH
|
||||
/* 0x05*/ s8 unk5;
|
||||
#endif
|
||||
#endif
|
||||
/* 0x06, 0x06*/ u16 windowSize; // same as bufSizePerChannel
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
/* 0x08*/ u16 unk08;
|
||||
#endif
|
||||
/*0x04, 0x08, 0x0A*/ u16 reverbGain;
|
||||
/*0x06, 0x0A, 0x0C*/ u16 resampleRate;
|
||||
#ifdef VERSION_SH
|
||||
#endif
|
||||
/*0x04, 0x08, 0x0A*/
|
||||
u16 reverbGain;
|
||||
/*0x06, 0x0A, 0x0C*/
|
||||
u16 resampleRate;
|
||||
#ifdef VERSION_SH
|
||||
/* 0x0E*/ u16 panRight;
|
||||
/* 0x10*/ u16 panLeft;
|
||||
#endif
|
||||
/*0x08, 0x0C, 0x14*/ s32 nextRingBufferPos;
|
||||
/*0x0C, 0x10, 0x18*/ s32 unkC; // never read
|
||||
/*0x10, 0x14, 0x1C*/ s32 bufSizePerChannel;
|
||||
#endif
|
||||
/*0x08, 0x0C, 0x14*/
|
||||
s32 nextRingBufferPos;
|
||||
/*0x0C, 0x10, 0x18*/
|
||||
s32 unkC; // never read
|
||||
/*0x10, 0x14, 0x1C*/
|
||||
s32 bufSizePerChannel;
|
||||
|
||||
struct
|
||||
{
|
||||
s16 *left;
|
||||
s16 *right;
|
||||
} ringBuffer;
|
||||
/*0x1C, 0x20, 0x28*/ s16 *resampleStateLeft;
|
||||
/*0x20, 0x24, 0x2C*/ s16 *resampleStateRight;
|
||||
/*0x24, 0x28, 0x30*/ s16 *unk24; // never read
|
||||
/*0x28, 0x2C, 0x34*/ s16 *unk28; // never read
|
||||
/*0x2C, 0x30, 0x38*/ struct ReverbRingBufferItem items[2][MAX_UPDATES_PER_FRAME];
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
|
||||
/*0x1C, 0x20, 0x28*/
|
||||
s16 *resampleStateLeft;
|
||||
/*0x20, 0x24, 0x2C*/
|
||||
s16 *resampleStateRight;
|
||||
/*0x24, 0x28, 0x30*/
|
||||
s16 *unk24; // never read
|
||||
/*0x28, 0x2C, 0x34*/
|
||||
s16 *unk28; // never read
|
||||
/*0x2C, 0x30, 0x38*/
|
||||
struct ReverbRingBufferItem items[2][MAX_UPDATES_PER_FRAME];
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
// Only used in sh:
|
||||
/* 0x100*/ s16 *unk100;
|
||||
/* 0x104*/ s16 *unk104;
|
||||
/* 0x108*/ s16 *unk108;
|
||||
/* 0x10C*/ s16 *unk10C;
|
||||
#endif
|
||||
#endif
|
||||
}; // 0xCC <= size <= 0x100
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
extern struct SynthesisReverb gSynthesisReverbs[4];
|
||||
|
||||
+358
-187
File diff suppressed because it is too large
Load Diff
+155
-142
@@ -6,7 +6,7 @@
|
||||
#include "graph_node.h"
|
||||
#include "../shim.h"
|
||||
|
||||
static Vec3s gVec3sZero = { 0, 0, 0 };
|
||||
static Vec3s gVec3sZero = {0, 0, 0};
|
||||
|
||||
typedef void (*GeoLayoutCommandProc)(void);
|
||||
|
||||
@@ -102,53 +102,60 @@ UNUSED s16 D_8038BD7C;
|
||||
s16 gGeoLayoutReturnIndex; // similar to RA register in MIPS
|
||||
u8 *gGeoLayoutCommand;
|
||||
|
||||
u32 unused_8038B894[3] = { 0 };
|
||||
u32 unused_8038B894[3] = {0};
|
||||
|
||||
/*
|
||||
0x00: Branch and store return address
|
||||
cmd+0x04: void *branchTarget
|
||||
*/
|
||||
void geo_layout_cmd_branch_and_link(void) {
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + CMD_PROCESS_OFFSET(8));
|
||||
void geo_layout_cmd_branch_and_link(void)
|
||||
{
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t)(gGeoLayoutCommand + CMD_PROCESS_OFFSET(8));
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (gCurGraphNodeIndex << 16) + gGeoLayoutReturnIndex;
|
||||
gGeoLayoutReturnIndex = gGeoLayoutStackIndex;
|
||||
gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04));
|
||||
}
|
||||
|
||||
// 0x01: Terminate geo layout
|
||||
void geo_layout_cmd_end(void) {
|
||||
void geo_layout_cmd_end(void)
|
||||
{
|
||||
gGeoLayoutStackIndex = gGeoLayoutReturnIndex;
|
||||
gGeoLayoutReturnIndex = gGeoLayoutStack[--gGeoLayoutStackIndex] & 0xFFFF;
|
||||
gCurGraphNodeIndex = gGeoLayoutStack[gGeoLayoutStackIndex] >> 16;
|
||||
gGeoLayoutCommand = (u8 *) gGeoLayoutStack[--gGeoLayoutStackIndex];
|
||||
gGeoLayoutCommand = (u8 *)gGeoLayoutStack[--gGeoLayoutStackIndex];
|
||||
}
|
||||
|
||||
/*
|
||||
0x02: Branch
|
||||
cmd+0x04: void *branchTarget
|
||||
*/
|
||||
void geo_layout_cmd_branch(void) {
|
||||
if (cur_geo_cmd_u8(0x01) == 1) {
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + CMD_PROCESS_OFFSET(8));
|
||||
void geo_layout_cmd_branch(void)
|
||||
{
|
||||
if (cur_geo_cmd_u8(0x01) == 1)
|
||||
{
|
||||
gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t)(gGeoLayoutCommand + CMD_PROCESS_OFFSET(8));
|
||||
}
|
||||
|
||||
gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04));
|
||||
}
|
||||
|
||||
// 0x03: Return from branch
|
||||
void geo_layout_cmd_return(void) {
|
||||
gGeoLayoutCommand = (u8 *) gGeoLayoutStack[--gGeoLayoutStackIndex];
|
||||
void geo_layout_cmd_return(void)
|
||||
{
|
||||
gGeoLayoutCommand = (u8 *)gGeoLayoutStack[--gGeoLayoutStackIndex];
|
||||
}
|
||||
|
||||
// 0x04: Open node
|
||||
void geo_layout_cmd_open_node(void) {
|
||||
void geo_layout_cmd_open_node(void)
|
||||
{
|
||||
gCurGraphNodeList[gCurGraphNodeIndex + 1] = gCurGraphNodeList[gCurGraphNodeIndex];
|
||||
gCurGraphNodeIndex++;
|
||||
gGeoLayoutCommand += 0x04 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
// 0x05: Close node
|
||||
void geo_layout_cmd_close_node(void) {
|
||||
void geo_layout_cmd_close_node(void)
|
||||
{
|
||||
gCurGraphNodeIndex--;
|
||||
gGeoLayoutCommand += 0x04 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
@@ -159,10 +166,12 @@ void geo_layout_cmd_close_node(void) {
|
||||
|
||||
Register the current node in the gGeoViews array at the given index
|
||||
*/
|
||||
void geo_layout_cmd_assign_as_view(void) {
|
||||
void geo_layout_cmd_assign_as_view(void)
|
||||
{
|
||||
u16 index = cur_geo_cmd_s16(0x02);
|
||||
|
||||
if (index < gGeoNumViews) {
|
||||
if (index < gGeoNumViews)
|
||||
{
|
||||
gGeoViews[index] = gCurGraphNodeList[gCurGraphNodeIndex];
|
||||
}
|
||||
|
||||
@@ -174,11 +183,13 @@ void geo_layout_cmd_assign_as_view(void) {
|
||||
cmd+0x01: u8 operation (0 = reset, 1 = set, 2 = clear)
|
||||
cmd+0x02: s16 bits
|
||||
*/
|
||||
void geo_layout_cmd_update_node_flags(void) {
|
||||
void geo_layout_cmd_update_node_flags(void)
|
||||
{
|
||||
u16 operation = cur_geo_cmd_u8(0x01);
|
||||
u16 flagBits = cur_geo_cmd_s16(0x02);
|
||||
|
||||
switch (operation) {
|
||||
switch (operation)
|
||||
{
|
||||
case GEO_CMD_FLAGS_RESET:
|
||||
gCurGraphNodeList[gCurGraphNodeIndex]->flags = flagBits;
|
||||
break;
|
||||
@@ -201,10 +212,8 @@ void geo_layout_cmd_update_node_flags(void) {
|
||||
cmd+0x08: s16 width
|
||||
cmd+0x0A: s16 height
|
||||
*/
|
||||
void geo_layout_cmd_node_root(void) {
|
||||
s32 i;
|
||||
struct GraphNodeRoot *graphNode;
|
||||
|
||||
void geo_layout_cmd_node_root(void)
|
||||
{
|
||||
s16 x = cur_geo_cmd_s16(0x04);
|
||||
s16 y = cur_geo_cmd_s16(0x06);
|
||||
s16 width = cur_geo_cmd_s16(0x08);
|
||||
@@ -215,7 +224,7 @@ void geo_layout_cmd_node_root(void) {
|
||||
// cmd+0x02 = 0x00: Mario face, 0x0A: all other levels
|
||||
gGeoNumViews = cur_geo_cmd_s16(0x02) + 2;
|
||||
|
||||
graphNode = init_graph_node_root(gGraphNodePool, NULL, 0, x, y, width, height);
|
||||
struct GraphNodeRoot *graphNode = init_graph_node_root(gGraphNodePool, NULL, 0, x, y, width, height);
|
||||
|
||||
// gGeoViews is unused in libsm64
|
||||
gGeoViews = NULL; // alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(struct GraphNode *));
|
||||
@@ -223,7 +232,8 @@ void geo_layout_cmd_node_root(void) {
|
||||
graphNode->views = gGeoViews;
|
||||
graphNode->numViews = gGeoNumViews;
|
||||
|
||||
for (i = 0; i < gGeoNumViews; i++) {
|
||||
for (s32 i = 0; i < gGeoNumViews; i++)
|
||||
{
|
||||
gGeoViews[i] = NULL;
|
||||
}
|
||||
|
||||
@@ -236,11 +246,11 @@ void geo_layout_cmd_node_root(void) {
|
||||
0x09: Create orthographic projection scene graph node
|
||||
cmd+0x02: s16 scale as a percentage (usually it's 100)
|
||||
*/
|
||||
void geo_layout_cmd_node_ortho_projection(void) {
|
||||
struct GraphNodeOrthoProjection *graphNode;
|
||||
f32 scale = (f32) cur_geo_cmd_s16(0x02) / 100.0f;
|
||||
void geo_layout_cmd_node_ortho_projection(void)
|
||||
{
|
||||
f32 scale = (f32)cur_geo_cmd_s16(0x02) / 100.0f;
|
||||
|
||||
graphNode = init_graph_node_ortho_projection(gGraphNodePool, NULL, scale);
|
||||
struct GraphNodeOrthoProjection *graphNode = init_graph_node_ortho_projection(gGraphNodePool, NULL, scale);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -255,20 +265,21 @@ void geo_layout_cmd_node_ortho_projection(void) {
|
||||
cmd+0x06: s16 far
|
||||
[cmd+0x08: GraphNodeFunc frustumFunc]
|
||||
*/
|
||||
void geo_layout_cmd_node_perspective(void) {
|
||||
struct GraphNodePerspective *graphNode;
|
||||
void geo_layout_cmd_node_perspective(void)
|
||||
{
|
||||
GraphNodeFunc frustumFunc = NULL;
|
||||
s16 fov = cur_geo_cmd_s16(0x02);
|
||||
s16 near = cur_geo_cmd_s16(0x04);
|
||||
s16 far = cur_geo_cmd_s16(0x06);
|
||||
|
||||
if (cur_geo_cmd_u8(0x01) != 0) {
|
||||
if (cur_geo_cmd_u8(0x01) != 0)
|
||||
{
|
||||
// optional asm function
|
||||
frustumFunc = (GraphNodeFunc) cur_geo_cmd_ptr(0x08);
|
||||
frustumFunc = (GraphNodeFunc)cur_geo_cmd_ptr(0x08);
|
||||
gGeoLayoutCommand += 4 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_perspective(gGraphNodePool, NULL, (f32) fov, near, far, frustumFunc, 0);
|
||||
struct GraphNodePerspective *graphNode = init_graph_node_perspective(gGraphNodePool, NULL, fov, near, far, frustumFunc, 0);
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
@@ -279,10 +290,9 @@ void geo_layout_cmd_node_perspective(void) {
|
||||
0x0B: Create a scene graph node that groups other nodes without any
|
||||
additional functionality
|
||||
*/
|
||||
void geo_layout_cmd_node_start(void) {
|
||||
struct GraphNodeStart *graphNode;
|
||||
|
||||
graphNode = init_graph_node_start(gGraphNodePool, NULL);
|
||||
void geo_layout_cmd_node_start(void)
|
||||
{
|
||||
struct GraphNodeStart *graphNode = init_graph_node_start(gGraphNodePool, NULL);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -290,7 +300,8 @@ void geo_layout_cmd_node_start(void) {
|
||||
}
|
||||
|
||||
// 0x1F: No operation
|
||||
void geo_layout_cmd_nop3(void) {
|
||||
void geo_layout_cmd_nop3(void)
|
||||
{
|
||||
gGeoLayoutCommand += 0x10 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
@@ -298,10 +309,9 @@ void geo_layout_cmd_nop3(void) {
|
||||
0x0C: Create zbuffer-toggling scene graph node
|
||||
cmd+0x01: u8 enableZBuffer (1 = on, 0 = off)
|
||||
*/
|
||||
void geo_layout_cmd_node_master_list(void) {
|
||||
struct GraphNodeMasterList *graphNode;
|
||||
|
||||
graphNode = init_graph_node_master_list(gGraphNodePool, NULL, cur_geo_cmd_u8(0x01));
|
||||
void geo_layout_cmd_node_master_list(void)
|
||||
{
|
||||
struct GraphNodeMasterList *graphNode = init_graph_node_master_list(gGraphNodePool, NULL, cur_geo_cmd_u8(0x01));
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -314,12 +324,12 @@ void geo_layout_cmd_node_master_list(void) {
|
||||
cmd+0x04: s16 minDistance
|
||||
cmd+0x06: s16 maxDistance
|
||||
*/
|
||||
void geo_layout_cmd_node_level_of_detail(void) {
|
||||
struct GraphNodeLevelOfDetail *graphNode;
|
||||
void geo_layout_cmd_node_level_of_detail(void)
|
||||
{
|
||||
s16 minDistance = cur_geo_cmd_s16(0x04);
|
||||
s16 maxDistance = cur_geo_cmd_s16(0x06);
|
||||
|
||||
graphNode = init_graph_node_render_range(gGraphNodePool, NULL, minDistance, maxDistance);
|
||||
struct GraphNodeLevelOfDetail *graphNode = init_graph_node_render_range(gGraphNodePool, NULL, minDistance, maxDistance);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -334,15 +344,13 @@ void geo_layout_cmd_node_level_of_detail(void) {
|
||||
caseSelectorFunc returns an index which is used to select the child node to render.
|
||||
Used for animating coins, blinking, color selection, etc.
|
||||
*/
|
||||
void geo_layout_cmd_node_switch_case(void) {
|
||||
struct GraphNodeSwitchCase *graphNode;
|
||||
|
||||
graphNode =
|
||||
init_graph_node_switch_case(gGraphNodePool, NULL,
|
||||
cur_geo_cmd_s16(0x02), // case which is initially selected
|
||||
0,
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // case update function
|
||||
0);
|
||||
void geo_layout_cmd_node_switch_case(void)
|
||||
{
|
||||
struct GraphNodeSwitchCase *graphNode = init_graph_node_switch_case(gGraphNodePool, NULL,
|
||||
cur_geo_cmd_s16(0x02), // case which is initially selected
|
||||
0,
|
||||
cur_geo_cmd_ptr(0x04), // case update function
|
||||
0);
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
@@ -360,17 +368,17 @@ void geo_layout_cmd_node_switch_case(void) {
|
||||
cmd+0x0E: s16 focusZ
|
||||
cmd+0x10: GraphNodeFunc func
|
||||
*/
|
||||
void geo_layout_cmd_node_camera(void) {
|
||||
struct GraphNodeCamera *graphNode;
|
||||
s16 *cmdPos = (s16 *) &gGeoLayoutCommand[4];
|
||||
void geo_layout_cmd_node_camera(void)
|
||||
{
|
||||
s16 *cmdPos = (s16 *)&gGeoLayoutCommand[4];
|
||||
|
||||
Vec3f pos, focus;
|
||||
|
||||
cmdPos = read_vec3s_to_vec3f(pos, cmdPos);
|
||||
cmdPos = read_vec3s_to_vec3f(focus, cmdPos);
|
||||
|
||||
graphNode = init_graph_node_camera(gGraphNodePool, NULL, pos, focus,
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x10), cur_geo_cmd_s16(0x02));
|
||||
struct GraphNodeCamera *graphNode = init_graph_node_camera(gGraphNodePool, NULL, pos, focus,
|
||||
cur_geo_cmd_ptr(0x10), cur_geo_cmd_s16(0x02));
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
@@ -413,18 +421,18 @@ void geo_layout_cmd_node_camera(void) {
|
||||
|
||||
[cmd+var: void *displayList]
|
||||
*/
|
||||
void geo_layout_cmd_node_translation_rotation(void) {
|
||||
struct GraphNodeTranslationRotation *graphNode;
|
||||
|
||||
void geo_layout_cmd_node_translation_rotation(void)
|
||||
{
|
||||
Vec3s translation, rotation;
|
||||
|
||||
void *displayList = NULL;
|
||||
s16 drawingLayer = 0;
|
||||
|
||||
s16 params = cur_geo_cmd_u8(0x01);
|
||||
s16 *cmdPos = (s16 *) gGeoLayoutCommand;
|
||||
s16 *cmdPos = (s16 *)gGeoLayoutCommand;
|
||||
|
||||
switch ((params & 0x70) >> 4) {
|
||||
switch ((params & 0x70) >> 4)
|
||||
{
|
||||
case 0:
|
||||
cmdPos = read_vec3s(translation, &cmdPos[2]);
|
||||
cmdPos = read_vec3s_angle(rotation, cmdPos);
|
||||
@@ -444,17 +452,18 @@ void geo_layout_cmd_node_translation_rotation(void) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
if (params & 0x80)
|
||||
{
|
||||
displayList = *(void **)&cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_translation_rotation(gGraphNodePool, NULL, drawingLayer, displayList,
|
||||
translation, rotation);
|
||||
struct GraphNodeTranslationRotation *graphNode = init_graph_node_translation_rotation(gGraphNodePool, NULL, drawingLayer, displayList,
|
||||
translation, rotation);
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
gGeoLayoutCommand = (u8 *) cmdPos;
|
||||
gGeoLayoutCommand = (u8 *)cmdPos;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -467,30 +476,29 @@ void geo_layout_cmd_node_translation_rotation(void) {
|
||||
cmd+0x06: s16 zTranslation
|
||||
[cmd+0x08: void *displayList]
|
||||
*/
|
||||
void geo_layout_cmd_node_translation(void) {
|
||||
struct GraphNodeTranslation *graphNode;
|
||||
|
||||
void geo_layout_cmd_node_translation(void)
|
||||
{
|
||||
Vec3s translation;
|
||||
|
||||
s16 drawingLayer = 0;
|
||||
s16 params = cur_geo_cmd_u8(0x01);
|
||||
s16 *cmdPos = (s16 *) gGeoLayoutCommand;
|
||||
s16 *cmdPos = (s16 *)gGeoLayoutCommand;
|
||||
void *displayList = NULL;
|
||||
|
||||
cmdPos = read_vec3s(translation, &cmdPos[1]);
|
||||
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
if (params & 0x80)
|
||||
{
|
||||
displayList = *(void **)&cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
graphNode =
|
||||
init_graph_node_translation(gGraphNodePool, NULL, drawingLayer, displayList, translation);
|
||||
struct GraphNodeTranslation *graphNode = init_graph_node_translation(gGraphNodePool, NULL, drawingLayer, displayList, translation);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
gGeoLayoutCommand = (u8 *) cmdPos;
|
||||
gGeoLayoutCommand = (u8 *)cmdPos;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -503,29 +511,29 @@ void geo_layout_cmd_node_translation(void) {
|
||||
cmd+0x06: s16 unkZ
|
||||
[cmd+0x08: void *displayList]
|
||||
*/
|
||||
void geo_layout_cmd_node_rotation(void) {
|
||||
struct GraphNodeRotation *graphNode;
|
||||
|
||||
void geo_layout_cmd_node_rotation(void)
|
||||
{
|
||||
Vec3s sp2c;
|
||||
|
||||
s16 drawingLayer = 0;
|
||||
s16 params = cur_geo_cmd_u8(0x01);
|
||||
s16 *cmdPos = (s16 *) gGeoLayoutCommand;
|
||||
s16 *cmdPos = (s16 *)gGeoLayoutCommand;
|
||||
void *displayList = NULL;
|
||||
|
||||
cmdPos = read_vec3s_angle(sp2c, &cmdPos[1]);
|
||||
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
if (params & 0x80)
|
||||
{
|
||||
displayList = *(void **)&cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_rotation(gGraphNodePool, NULL, drawingLayer, displayList, sp2c);
|
||||
struct GraphNodeRotation *graphNode = init_graph_node_rotation(gGraphNodePool, NULL, drawingLayer, displayList, sp2c);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
gGeoLayoutCommand = (u8 *) cmdPos;
|
||||
gGeoLayoutCommand = (u8 *)cmdPos;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -536,21 +544,21 @@ void geo_layout_cmd_node_rotation(void) {
|
||||
cmd+0x04: u32 scale (0x10000 = 1.0)
|
||||
[cmd+0x08: void *displayList]
|
||||
*/
|
||||
void geo_layout_cmd_node_scale(void) {
|
||||
struct GraphNodeScale *graphNode;
|
||||
|
||||
void geo_layout_cmd_node_scale(void)
|
||||
{
|
||||
s16 drawingLayer = 0;
|
||||
s16 params = cur_geo_cmd_u8(0x01);
|
||||
f32 scale = cur_geo_cmd_u32(0x04) / 65536.0f;
|
||||
void *displayList = NULL;
|
||||
|
||||
if (params & 0x80) {
|
||||
if (params & 0x80)
|
||||
{
|
||||
displayList = cur_geo_cmd_ptr(0x08);
|
||||
drawingLayer = params & 0x0F;
|
||||
gGeoLayoutCommand += 4 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_scale(gGraphNodePool, NULL, drawingLayer, displayList, scale);
|
||||
struct GraphNodeScale *graphNode = init_graph_node_scale(gGraphNodePool, NULL, drawingLayer, displayList, scale);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -558,7 +566,8 @@ void geo_layout_cmd_node_scale(void) {
|
||||
}
|
||||
|
||||
// 0x1E: No operation
|
||||
void geo_layout_cmd_nop2(void) {
|
||||
void geo_layout_cmd_nop2(void)
|
||||
{
|
||||
gGeoLayoutCommand += 0x08 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
@@ -570,17 +579,16 @@ void geo_layout_cmd_nop2(void) {
|
||||
cmd+0x06: s16 zTranslation
|
||||
cmd+0x08: void *displayList
|
||||
*/
|
||||
void geo_layout_cmd_node_animated_part(void) {
|
||||
struct GraphNodeAnimatedPart *graphNode;
|
||||
void geo_layout_cmd_node_animated_part(void)
|
||||
{
|
||||
Vec3s translation;
|
||||
s32 drawingLayer = cur_geo_cmd_u8(0x01);
|
||||
void *displayList = cur_geo_cmd_ptr(0x08);
|
||||
s16 *cmdPos = (s16 *) gGeoLayoutCommand;
|
||||
s16 *cmdPos = (s16 *)gGeoLayoutCommand;
|
||||
|
||||
read_vec3s(translation, &cmdPos[1]);
|
||||
|
||||
graphNode =
|
||||
init_graph_node_animated_part(gGraphNodePool, NULL, drawingLayer, displayList, translation);
|
||||
struct GraphNodeAnimatedPart *graphNode = init_graph_node_animated_part(gGraphNodePool, NULL, drawingLayer, displayList, translation);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -597,27 +605,28 @@ void geo_layout_cmd_node_animated_part(void) {
|
||||
cmd+0x06: s16 zTranslation
|
||||
[cmd+0x08: void *displayList]
|
||||
*/
|
||||
void geo_layout_cmd_node_billboard(void) {
|
||||
struct GraphNodeBillboard *graphNode;
|
||||
void geo_layout_cmd_node_billboard(void)
|
||||
{
|
||||
Vec3s translation;
|
||||
s16 drawingLayer = 0;
|
||||
s16 params = cur_geo_cmd_u8(0x01);
|
||||
s16 *cmdPos = (s16 *) gGeoLayoutCommand;
|
||||
s16 *cmdPos = (s16 *)gGeoLayoutCommand;
|
||||
void *displayList = NULL;
|
||||
|
||||
cmdPos = read_vec3s(translation, &cmdPos[1]);
|
||||
|
||||
if (params & 0x80) {
|
||||
displayList = *(void **) &cmdPos[0];
|
||||
if (params & 0x80)
|
||||
{
|
||||
displayList = *(void **)&cmdPos[0];
|
||||
drawingLayer = params & 0x0F;
|
||||
cmdPos += 2 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_billboard(gGraphNodePool, NULL, drawingLayer, displayList, translation);
|
||||
struct GraphNodeBillboard *graphNode = init_graph_node_billboard(gGraphNodePool, NULL, drawingLayer, displayList, translation);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
gGeoLayoutCommand = (u8 *) cmdPos;
|
||||
gGeoLayoutCommand = (u8 *)cmdPos;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -625,12 +634,12 @@ void geo_layout_cmd_node_billboard(void) {
|
||||
cmd+0x01: u8 drawingLayer
|
||||
cmd+0x04: void *displayList
|
||||
*/
|
||||
void geo_layout_cmd_node_display_list(void) {
|
||||
struct GraphNodeDisplayList *graphNode;
|
||||
void geo_layout_cmd_node_display_list(void)
|
||||
{
|
||||
s32 drawingLayer = cur_geo_cmd_u8(0x01);
|
||||
void *displayList = cur_geo_cmd_ptr(0x04);
|
||||
|
||||
graphNode = init_graph_node_display_list(gGraphNodePool, NULL, drawingLayer, displayList);
|
||||
struct GraphNodeDisplayList *graphNode = init_graph_node_display_list(gGraphNodePool, NULL, drawingLayer, displayList);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -643,13 +652,13 @@ void geo_layout_cmd_node_display_list(void) {
|
||||
cmd+0x04: s16 shadowSolidity
|
||||
cmd+0x06: s16 shadowScale
|
||||
*/
|
||||
void geo_layout_cmd_node_shadow(void) {
|
||||
struct GraphNodeShadow *graphNode;
|
||||
void geo_layout_cmd_node_shadow(void)
|
||||
{
|
||||
u8 shadowType = cur_geo_cmd_s16(0x02);
|
||||
u8 shadowSolidity = cur_geo_cmd_s16(0x04);
|
||||
s16 shadowScale = cur_geo_cmd_s16(0x06);
|
||||
|
||||
graphNode = init_graph_node_shadow(gGraphNodePool, NULL, shadowScale, shadowSolidity, shadowType);
|
||||
struct GraphNodeShadow *graphNode = init_graph_node_shadow(gGraphNodePool, NULL, shadowScale, shadowSolidity, shadowType);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -657,10 +666,9 @@ void geo_layout_cmd_node_shadow(void) {
|
||||
}
|
||||
|
||||
// 0x17: Create scene graph node that manages the group of all object nodes
|
||||
void geo_layout_cmd_node_object_parent(void) {
|
||||
struct GraphNodeObjectParent *graphNode;
|
||||
|
||||
graphNode = init_graph_node_object_parent(gGraphNodePool, NULL, &gObjParentGraphNode);
|
||||
void geo_layout_cmd_node_object_parent(void)
|
||||
{
|
||||
struct GraphNodeObjectParent *graphNode = init_graph_node_object_parent(gGraphNodePool, NULL, &gObjParentGraphNode);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -672,12 +680,11 @@ void geo_layout_cmd_node_object_parent(void) {
|
||||
cmd+0x02: s16 parameter
|
||||
cmd+0x04: GraphNodeFunc func
|
||||
*/
|
||||
void geo_layout_cmd_node_generated(void) {
|
||||
struct GraphNodeGenerated *graphNode;
|
||||
|
||||
graphNode = init_graph_node_generated(gGraphNodePool, NULL,
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // asm function
|
||||
cur_geo_cmd_s16(0x02)); // parameter
|
||||
void geo_layout_cmd_node_generated(void)
|
||||
{
|
||||
struct GraphNodeGenerated *graphNode = init_graph_node_generated(gGraphNodePool, NULL,
|
||||
cur_geo_cmd_ptr(0x04), // asm function
|
||||
cur_geo_cmd_s16(0x02)); // parameter
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
@@ -689,13 +696,12 @@ void geo_layout_cmd_node_generated(void) {
|
||||
cmd+0x02: s16 background // background ID, or RGBA5551 color if backgroundFunc is null
|
||||
cmd+0x04: GraphNodeFunc backgroundFunc
|
||||
*/
|
||||
void geo_layout_cmd_node_background(void) {
|
||||
struct GraphNodeBackground *graphNode;
|
||||
|
||||
graphNode = init_graph_node_background(
|
||||
void geo_layout_cmd_node_background(void)
|
||||
{
|
||||
struct GraphNodeBackground *graphNode = init_graph_node_background(
|
||||
gGraphNodePool, NULL,
|
||||
cur_geo_cmd_s16(0x02), // background ID, or RGBA5551 color if asm function is null
|
||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // asm function
|
||||
cur_geo_cmd_ptr(0x04), // asm function
|
||||
0);
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
@@ -704,7 +710,8 @@ void geo_layout_cmd_node_background(void) {
|
||||
}
|
||||
|
||||
// 0x1A: No operation
|
||||
void geo_layout_cmd_nop(void) {
|
||||
void geo_layout_cmd_nop(void)
|
||||
{
|
||||
gGeoLayoutCommand += 0x08 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
@@ -713,22 +720,26 @@ void geo_layout_cmd_nop(void) {
|
||||
to a newly created object parent node.
|
||||
cmd+0x02: s16 index (of gGeoViews)
|
||||
*/
|
||||
void geo_layout_cmd_copy_view(void) {
|
||||
struct GraphNodeObjectParent *graphNode;
|
||||
void geo_layout_cmd_copy_view(void)
|
||||
{
|
||||
struct GraphNode *node = NULL;
|
||||
s16 index = cur_geo_cmd_s16(0x02);
|
||||
|
||||
if (index >= 0) {
|
||||
if (index >= 0)
|
||||
{
|
||||
node = gGeoViews[index];
|
||||
|
||||
if (node->type == GRAPH_NODE_TYPE_OBJECT_PARENT) {
|
||||
node = ((struct GraphNodeObjectParent *) node)->sharedChild;
|
||||
} else {
|
||||
if (node->type == GRAPH_NODE_TYPE_OBJECT_PARENT)
|
||||
{
|
||||
node = ((struct GraphNodeObjectParent *)node)->sharedChild;
|
||||
}
|
||||
else
|
||||
{
|
||||
node = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
graphNode = init_graph_node_object_parent(gGraphNodePool, NULL, node);
|
||||
struct GraphNodeObjectParent *graphNode = init_graph_node_object_parent(gGraphNodePool, NULL, node);
|
||||
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
|
||||
@@ -743,14 +754,14 @@ void geo_layout_cmd_copy_view(void) {
|
||||
cmd+0x06: s16 offsetZ
|
||||
cmd+0x08: GraphNodeFunc nodeFunc
|
||||
*/
|
||||
void geo_layout_cmd_node_held_obj(void) {
|
||||
struct GraphNodeHeldObject *graphNode;
|
||||
void geo_layout_cmd_node_held_obj(void)
|
||||
{
|
||||
Vec3s offset;
|
||||
|
||||
read_vec3s(offset, (s16 *) &gGeoLayoutCommand[0x02]);
|
||||
read_vec3s(offset, (s16 *)&gGeoLayoutCommand[0x02]);
|
||||
|
||||
graphNode = init_graph_node_held_object(
|
||||
gGraphNodePool, NULL, NULL, offset, (GraphNodeFunc) cur_geo_cmd_ptr(0x08), cur_geo_cmd_u8(0x01));
|
||||
struct GraphNodeHeldObject *graphNode = init_graph_node_held_object(
|
||||
gGraphNodePool, NULL, NULL, offset, cur_geo_cmd_ptr(0x08), cur_geo_cmd_u8(0x01));
|
||||
|
||||
register_scene_graph_node(&graphNode->fnNode.node);
|
||||
|
||||
@@ -762,14 +773,15 @@ void geo_layout_cmd_node_held_obj(void) {
|
||||
is used for frustum culling.
|
||||
cmd+0x02: s16 cullingRadius
|
||||
*/
|
||||
void geo_layout_cmd_node_culling_radius(void) {
|
||||
struct GraphNodeCullingRadius *graphNode;
|
||||
graphNode = init_graph_node_culling_radius(gGraphNodePool, NULL, cur_geo_cmd_s16(0x02));
|
||||
void geo_layout_cmd_node_culling_radius(void)
|
||||
{
|
||||
struct GraphNodeCullingRadius *graphNode = init_graph_node_culling_radius(gGraphNodePool, NULL, cur_geo_cmd_s16(0x02));
|
||||
register_scene_graph_node(&graphNode->node);
|
||||
gGeoLayoutCommand += 0x04 << CMD_SIZE_SHIFT;
|
||||
}
|
||||
|
||||
struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) {
|
||||
struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr)
|
||||
{
|
||||
// set by register_scene_graph_node when gCurGraphNodeIndex is 0
|
||||
// and gCurRootGraphNode is NULL
|
||||
gCurRootGraphNode = NULL;
|
||||
@@ -789,7 +801,8 @@ struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) {
|
||||
gGeoLayoutStack[0] = 0;
|
||||
gGeoLayoutStack[1] = 0;
|
||||
|
||||
while (gGeoLayoutCommand != NULL) {
|
||||
while (gGeoLayoutCommand != NULL)
|
||||
{
|
||||
GeoLayoutJumpTable[gGeoLayoutCommand[0x00]]();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,37 +49,69 @@ extern s16 D_8038BD78;
|
||||
extern struct GraphNode *D_8038BCF8[];
|
||||
|
||||
void geo_layout_cmd_branch_and_link(void);
|
||||
|
||||
void geo_layout_cmd_end(void);
|
||||
|
||||
void geo_layout_cmd_branch(void);
|
||||
|
||||
void geo_layout_cmd_return(void);
|
||||
|
||||
void geo_layout_cmd_open_node(void);
|
||||
|
||||
void geo_layout_cmd_close_node(void);
|
||||
|
||||
void geo_layout_cmd_assign_as_view(void);
|
||||
|
||||
void geo_layout_cmd_update_node_flags(void);
|
||||
|
||||
void geo_layout_cmd_node_root(void);
|
||||
|
||||
void geo_layout_cmd_node_ortho_projection(void);
|
||||
|
||||
void geo_layout_cmd_node_perspective(void);
|
||||
|
||||
void geo_layout_cmd_node_start(void);
|
||||
|
||||
void geo_layout_cmd_nop3(void);
|
||||
|
||||
void geo_layout_cmd_node_master_list(void);
|
||||
|
||||
void geo_layout_cmd_node_level_of_detail(void);
|
||||
|
||||
void geo_layout_cmd_node_switch_case(void);
|
||||
|
||||
void geo_layout_cmd_node_camera(void);
|
||||
|
||||
void geo_layout_cmd_node_translation_rotation(void);
|
||||
|
||||
void geo_layout_cmd_node_translation(void);
|
||||
|
||||
void geo_layout_cmd_node_rotation(void);
|
||||
|
||||
void geo_layout_cmd_node_scale(void);
|
||||
|
||||
void geo_layout_cmd_nop2(void);
|
||||
|
||||
void geo_layout_cmd_node_animated_part(void);
|
||||
|
||||
void geo_layout_cmd_node_billboard(void);
|
||||
|
||||
void geo_layout_cmd_node_display_list(void);
|
||||
|
||||
void geo_layout_cmd_node_shadow(void);
|
||||
|
||||
void geo_layout_cmd_node_object_parent(void);
|
||||
|
||||
void geo_layout_cmd_node_generated(void);
|
||||
|
||||
void geo_layout_cmd_node_background(void);
|
||||
|
||||
void geo_layout_cmd_nop(void);
|
||||
|
||||
void geo_layout_cmd_copy_view(void);
|
||||
|
||||
void geo_layout_cmd_node_held_obj(void);
|
||||
|
||||
void geo_layout_cmd_node_culling_radius(void);
|
||||
|
||||
struct GraphNode *process_geo_layout(struct AllocOnlyPool *a0, void *segptr);
|
||||
|
||||
+381
-237
File diff suppressed because it is too large
Load Diff
+240
-112
@@ -70,23 +70,34 @@ typedef Gfx *(*GraphNodeFunc)(s32 callContext, struct GraphNode *node, void *con
|
||||
*/
|
||||
struct FnGraphNode
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ GraphNodeFunc func;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
GraphNodeFunc func;
|
||||
};
|
||||
|
||||
/** The very root of the geo tree. Specifies the viewport.
|
||||
*/
|
||||
struct GraphNodeRoot
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ u8 areaIndex;
|
||||
/*0x15*/ s8 unk15; // ?
|
||||
/*0x16*/ s16 x;
|
||||
/*0x18*/ s16 y;
|
||||
/*0x1A*/ s16 width; // half width, 160
|
||||
/*0x1C*/ s16 height; // half height
|
||||
/*0x1E*/ s16 numViews; // number of entries in mystery array
|
||||
/*0x20*/ struct GraphNode **views;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
u8 areaIndex;
|
||||
/*0x15*/
|
||||
s8 unk15; // ?
|
||||
/*0x16*/
|
||||
s16 x;
|
||||
/*0x18*/
|
||||
s16 y;
|
||||
/*0x1A*/
|
||||
s16 width; // half width, 160
|
||||
/*0x1C*/
|
||||
s16 height; // half height
|
||||
/*0x1E*/
|
||||
s16 numViews; // number of entries in mystery array
|
||||
/*0x20*/
|
||||
struct GraphNode **views;
|
||||
};
|
||||
|
||||
/** A node that sets up an orthographic projection based on the global
|
||||
@@ -94,8 +105,10 @@ struct GraphNodeRoot
|
||||
*/
|
||||
struct GraphNodeOrthoProjection
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ f32 scale;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
f32 scale;
|
||||
};
|
||||
|
||||
/** A node that sets up a perspective projection. Used for drawing the
|
||||
@@ -104,11 +117,16 @@ struct GraphNodeOrthoProjection
|
||||
*/
|
||||
struct GraphNodePerspective
|
||||
{
|
||||
/*0x00*/ struct FnGraphNode fnNode;
|
||||
/*0x18*/ s32 unused;
|
||||
/*0x1C*/ f32 fov; // horizontal field of view in degrees
|
||||
/*0x20*/ s16 near; // near clipping plane
|
||||
/*0x22*/ s16 far; // far clipping plane
|
||||
/*0x00*/
|
||||
struct FnGraphNode fnNode;
|
||||
/*0x18*/
|
||||
s32 unused;
|
||||
/*0x1C*/
|
||||
f32 fov; // horizontal field of view in degrees
|
||||
/*0x20*/
|
||||
s16 near; // near clipping plane
|
||||
/*0x22*/
|
||||
s16 far; // far clipping plane
|
||||
};
|
||||
|
||||
/** An entry in the master list. It is a linked list of display lists
|
||||
@@ -128,9 +146,12 @@ struct DisplayListNode
|
||||
*/
|
||||
struct GraphNodeMasterList
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ struct DisplayListNode *listHeads[GFX_NUM_MASTER_LISTS];
|
||||
/*0x34*/ struct DisplayListNode *listTails[GFX_NUM_MASTER_LISTS];
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
struct DisplayListNode *listHeads[GFX_NUM_MASTER_LISTS];
|
||||
/*0x34*/
|
||||
struct DisplayListNode *listTails[GFX_NUM_MASTER_LISTS];
|
||||
};
|
||||
|
||||
/** Simply used as a parent to group multiple children.
|
||||
@@ -138,7 +159,8 @@ struct GraphNodeMasterList
|
||||
*/
|
||||
struct GraphNodeStart
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
};
|
||||
|
||||
/** GraphNode that only renders its children if the current transformation matrix
|
||||
@@ -149,9 +171,12 @@ struct GraphNodeStart
|
||||
*/
|
||||
struct GraphNodeLevelOfDetail
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ s16 minDistance;
|
||||
/*0x16*/ s16 maxDistance;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
s16 minDistance;
|
||||
/*0x16*/
|
||||
s16 maxDistance;
|
||||
};
|
||||
|
||||
/** GraphNode that renders exactly one of its children.
|
||||
@@ -161,10 +186,14 @@ struct GraphNodeLevelOfDetail
|
||||
*/
|
||||
struct GraphNodeSwitchCase
|
||||
{
|
||||
/*0x00*/ struct FnGraphNode fnNode;
|
||||
/*0x18*/ s32 unused;
|
||||
/*0x1C*/ s16 numCases;
|
||||
/*0x1E*/ s16 selectedCase;
|
||||
/*0x00*/
|
||||
struct FnGraphNode fnNode;
|
||||
/*0x18*/
|
||||
s32 unused;
|
||||
/*0x1C*/
|
||||
s16 numCases;
|
||||
/*0x1E*/
|
||||
s16 selectedCase;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -173,8 +202,12 @@ struct GraphNodeSwitchCase
|
||||
*/
|
||||
struct GraphNodeCamera
|
||||
{
|
||||
/*0x00*/ struct FnGraphNode fnNode;
|
||||
/*0x18*/ union {
|
||||
/*0x00*/
|
||||
struct FnGraphNode fnNode;
|
||||
|
||||
/*0x18*/
|
||||
union
|
||||
{
|
||||
// When the node is created, a mode is assigned to the node.
|
||||
// Later in geo_camera_main a Camera is allocated,
|
||||
// the mode is passed to the struct, and the field is overridden
|
||||
@@ -182,11 +215,17 @@ struct GraphNodeCamera
|
||||
s32 mode;
|
||||
struct Camera *camera;
|
||||
} config;
|
||||
/*0x1C*/ Vec3f pos;
|
||||
/*0x28*/ Vec3f focus;
|
||||
/*0x34*/ Mat4 *matrixPtr; // pointer to look-at matrix of this camera as a Mat4
|
||||
/*0x38*/ s16 roll; // roll in look at matrix. Doesn't account for light direction unlike rollScreen.
|
||||
/*0x3A*/ s16 rollScreen; // rolls screen while keeping the light direction consistent
|
||||
|
||||
/*0x1C*/
|
||||
Vec3f pos;
|
||||
/*0x28*/
|
||||
Vec3f focus;
|
||||
/*0x34*/
|
||||
Mat4 *matrixPtr; // pointer to look-at matrix of this camera as a Mat4
|
||||
/*0x38*/
|
||||
s16 roll; // roll in look at matrix. Doesn't account for light direction unlike rollScreen.
|
||||
/*0x3A*/
|
||||
s16 rollScreen; // rolls screen while keeping the light direction consistent
|
||||
};
|
||||
|
||||
/** GraphNode that translates and rotates its children.
|
||||
@@ -197,10 +236,14 @@ struct GraphNodeCamera
|
||||
*/
|
||||
struct GraphNodeTranslationRotation
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ void *displayList;
|
||||
/*0x18*/ Vec3s translation;
|
||||
/*0x1E*/ Vec3s rotation;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
void *displayList;
|
||||
/*0x18*/
|
||||
Vec3s translation;
|
||||
/*0x1E*/
|
||||
Vec3s rotation;
|
||||
};
|
||||
|
||||
/** GraphNode that translates itself and its children.
|
||||
@@ -209,9 +252,12 @@ struct GraphNodeTranslationRotation
|
||||
*/
|
||||
struct GraphNodeTranslation
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ void *displayList;
|
||||
/*0x18*/ Vec3s translation;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
void *displayList;
|
||||
/*0x18*/
|
||||
Vec3s translation;
|
||||
u8 pad1E[2];
|
||||
};
|
||||
|
||||
@@ -222,9 +268,12 @@ struct GraphNodeTranslation
|
||||
*/
|
||||
struct GraphNodeRotation
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ void *displayList;
|
||||
/*0x18*/ Vec3s rotation;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
void *displayList;
|
||||
/*0x18*/
|
||||
Vec3s rotation;
|
||||
u8 pad1E[2];
|
||||
};
|
||||
|
||||
@@ -237,9 +286,12 @@ struct GraphNodeRotation
|
||||
*/
|
||||
struct GraphNodeAnimatedPart
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ void *displayList;
|
||||
/*0x18*/ Vec3s translation;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
void *displayList;
|
||||
/*0x18*/
|
||||
Vec3s translation;
|
||||
};
|
||||
|
||||
/** A GraphNode that draws a display list rotated in a way to always face the
|
||||
@@ -249,9 +301,12 @@ struct GraphNodeAnimatedPart
|
||||
*/
|
||||
struct GraphNodeBillboard
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ void *displayList;
|
||||
/*0x18*/ Vec3s translation;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
void *displayList;
|
||||
/*0x18*/
|
||||
Vec3s translation;
|
||||
};
|
||||
|
||||
/** A GraphNode that simply draws a display list without doing any
|
||||
@@ -259,8 +314,10 @@ struct GraphNodeBillboard
|
||||
*/
|
||||
struct GraphNodeDisplayList
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ void *displayList;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
void *displayList;
|
||||
};
|
||||
|
||||
/** GraphNode part that scales itself and its children.
|
||||
@@ -273,9 +330,12 @@ struct GraphNodeDisplayList
|
||||
*/
|
||||
struct GraphNodeScale
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ void *displayList;
|
||||
/*0x18*/ f32 scale;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
void *displayList;
|
||||
/*0x18*/
|
||||
f32 scale;
|
||||
};
|
||||
|
||||
/** GraphNode that draws a shadow under an object.
|
||||
@@ -285,10 +345,14 @@ struct GraphNodeScale
|
||||
*/
|
||||
struct GraphNodeShadow
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ s16 shadowScale; // diameter (when a circle) or side (when a square) of shadow
|
||||
/*0x16*/ u8 shadowSolidity; // opacity of shadow, 255 = opaque
|
||||
/*0x17*/ u8 shadowType; // see ShadowType enum in shadow.h
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
s16 shadowScale; // diameter (when a circle) or side (when a square) of shadow
|
||||
/*0x16*/
|
||||
u8 shadowSolidity; // opacity of shadow, 255 = opaque
|
||||
/*0x17*/
|
||||
u8 shadowType; // see ShadowType enum in shadow.h
|
||||
};
|
||||
|
||||
/** GraphNode that contains as its sharedChild a group node containing all
|
||||
@@ -296,8 +360,10 @@ struct GraphNodeShadow
|
||||
*/
|
||||
struct GraphNodeObjectParent
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ struct GraphNode *sharedChild;
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
struct GraphNode *sharedChild;
|
||||
};
|
||||
|
||||
/** GraphNode that draws display lists not directly in memory but generated by
|
||||
@@ -310,8 +376,10 @@ struct GraphNodeObjectParent
|
||||
*/
|
||||
struct GraphNodeGenerated
|
||||
{
|
||||
/*0x00*/ struct FnGraphNode fnNode;
|
||||
/*0x18*/ u32 parameter; // extra context for the function
|
||||
/*0x00*/
|
||||
struct FnGraphNode fnNode;
|
||||
/*0x18*/
|
||||
u32 parameter; // extra context for the function
|
||||
};
|
||||
|
||||
/** GraphNode that draws a background image or a rectangle of a color.
|
||||
@@ -319,19 +387,26 @@ struct GraphNodeGenerated
|
||||
*/
|
||||
struct GraphNodeBackground
|
||||
{
|
||||
/*0x00*/ struct FnGraphNode fnNode;
|
||||
/*0x18*/ s32 unused;
|
||||
/*0x1C*/ s32 background; // background ID, or rgba5551 color if fnNode.func is null
|
||||
/*0x00*/
|
||||
struct FnGraphNode fnNode;
|
||||
/*0x18*/
|
||||
s32 unused;
|
||||
/*0x1C*/
|
||||
s32 background; // background ID, or rgba5551 color if fnNode.func is null
|
||||
};
|
||||
|
||||
/** Renders the object that Mario is holding.
|
||||
*/
|
||||
struct GraphNodeHeldObject
|
||||
{
|
||||
/*0x00*/ struct FnGraphNode fnNode;
|
||||
/*0x18*/ s32 playerIndex;
|
||||
/*0x1C*/ struct Object *objNode;
|
||||
/*0x20*/ Vec3s translation;
|
||||
/*0x00*/
|
||||
struct FnGraphNode fnNode;
|
||||
/*0x18*/
|
||||
s32 playerIndex;
|
||||
/*0x1C*/
|
||||
struct Object *objNode;
|
||||
/*0x20*/
|
||||
Vec3s translation;
|
||||
};
|
||||
|
||||
/** A node that allows an object to specify a different culling radius than the
|
||||
@@ -341,8 +416,10 @@ struct GraphNodeHeldObject
|
||||
*/
|
||||
struct GraphNodeCullingRadius
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
/*0x14*/ s16 cullingRadius; // specifies the 'sphere radius' for purposes of frustum culling
|
||||
/*0x00*/
|
||||
struct GraphNode node;
|
||||
/*0x14*/
|
||||
s16 cullingRadius; // specifies the 'sphere radius' for purposes of frustum culling
|
||||
u8 pad1E[2];
|
||||
};
|
||||
|
||||
@@ -363,71 +440,122 @@ extern s16 gCurGraphNodeIndex;
|
||||
|
||||
void init_scene_graph_node_links(struct GraphNode *graphNode, s32 type);
|
||||
|
||||
struct GraphNodeRoot *init_graph_node_root(struct AllocOnlyPool *pool, struct GraphNodeRoot *graphNode,
|
||||
s16 areaIndex, s16 x, s16 y, s16 width, s16 height);
|
||||
struct GraphNodeRoot *init_graph_node_root(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeRoot *graphNode,
|
||||
s16 areaIndex, s16 x, s16 y, s16 width, s16 height);
|
||||
|
||||
struct GraphNodeOrthoProjection *init_graph_node_ortho_projection(struct AllocOnlyPool *pool, struct GraphNodeOrthoProjection *graphNode, f32 scale);
|
||||
struct GraphNodePerspective *init_graph_node_perspective(struct AllocOnlyPool *pool, struct GraphNodePerspective *graphNode,
|
||||
f32 fov, s16 near, s16 far, GraphNodeFunc nodeFunc, s32 unused);
|
||||
|
||||
struct GraphNodePerspective *init_graph_node_perspective(
|
||||
struct AllocOnlyPool *pool, struct GraphNodePerspective *graphNode,
|
||||
f32 fov, s16 near, s16 far, GraphNodeFunc nodeFunc, s32 unused);
|
||||
|
||||
struct GraphNodeStart *init_graph_node_start(struct AllocOnlyPool *pool, struct GraphNodeStart *graphNode);
|
||||
|
||||
struct GraphNodeMasterList *init_graph_node_master_list(struct AllocOnlyPool *pool, struct GraphNodeMasterList *graphNode, s16 on);
|
||||
struct GraphNodeLevelOfDetail *init_graph_node_render_range(struct AllocOnlyPool *pool, struct GraphNodeLevelOfDetail *graphNode,
|
||||
s16 minDistance, s16 maxDistance);
|
||||
struct GraphNodeSwitchCase *init_graph_node_switch_case(struct AllocOnlyPool *pool, struct GraphNodeSwitchCase *graphNode,
|
||||
s16 numCases, s16 selectedCase, GraphNodeFunc nodeFunc, s32 unused);
|
||||
struct GraphNodeCamera *init_graph_node_camera(struct AllocOnlyPool *pool, struct GraphNodeCamera *graphNode,
|
||||
f32 *pos, f32 *focus, GraphNodeFunc func, s32 mode);
|
||||
struct GraphNodeTranslationRotation *init_graph_node_translation_rotation(struct AllocOnlyPool *pool, struct GraphNodeTranslationRotation *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation, Vec3s rotation);
|
||||
struct GraphNodeTranslation *init_graph_node_translation(struct AllocOnlyPool *pool, struct GraphNodeTranslation *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation);
|
||||
struct GraphNodeRotation *init_graph_node_rotation(struct AllocOnlyPool *pool, struct GraphNodeRotation *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s rotation);
|
||||
struct GraphNodeScale *init_graph_node_scale(struct AllocOnlyPool *pool, struct GraphNodeScale *graphNode,
|
||||
s32 drawingLayer, void *displayList, f32 scale);
|
||||
struct GraphNodeObject *init_graph_node_object(struct AllocOnlyPool *pool, struct GraphNodeObject *graphNode,
|
||||
struct GraphNode *sharedChild, Vec3f pos, Vec3s angle, Vec3f scale);
|
||||
|
||||
struct GraphNodeLevelOfDetail *init_graph_node_render_range(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeLevelOfDetail *graphNode,
|
||||
s16 minDistance, s16 maxDistance);
|
||||
|
||||
struct GraphNodeSwitchCase *init_graph_node_switch_case(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeSwitchCase *graphNode,
|
||||
s16 numCases, s16 selectedCase, GraphNodeFunc nodeFunc, s32 unused);
|
||||
|
||||
struct GraphNodeCamera *init_graph_node_camera(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeCamera *graphNode,
|
||||
f32 *pos, f32 *focus, GraphNodeFunc func, s32 mode);
|
||||
|
||||
struct GraphNodeTranslationRotation *init_graph_node_translation_rotation(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeTranslationRotation *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation, Vec3s rotation);
|
||||
|
||||
struct GraphNodeTranslation *init_graph_node_translation(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeTranslation *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation);
|
||||
|
||||
struct GraphNodeRotation *init_graph_node_rotation(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeRotation *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s rotation);
|
||||
|
||||
struct GraphNodeScale *init_graph_node_scale(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeScale *graphNode,
|
||||
s32 drawingLayer, void *displayList, f32 scale);
|
||||
|
||||
struct GraphNodeObject *init_graph_node_object(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeObject *graphNode,
|
||||
struct GraphNode *sharedChild, Vec3f pos, Vec3s angle, Vec3f scale);
|
||||
|
||||
struct GraphNodeCullingRadius *init_graph_node_culling_radius(struct AllocOnlyPool *pool, struct GraphNodeCullingRadius *graphNode, s16 radius);
|
||||
struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool *pool, struct GraphNodeAnimatedPart *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation);
|
||||
struct GraphNodeBillboard *init_graph_node_billboard(struct AllocOnlyPool *pool, struct GraphNodeBillboard *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation);
|
||||
struct GraphNodeDisplayList *init_graph_node_display_list(struct AllocOnlyPool *pool, struct GraphNodeDisplayList *graphNode,
|
||||
s32 drawingLayer, void *displayList);
|
||||
struct GraphNodeShadow *init_graph_node_shadow(struct AllocOnlyPool *pool, struct GraphNodeShadow *graphNode,
|
||||
s16 shadowScale, u8 shadowSolidity, u8 shadowType);
|
||||
struct GraphNodeObjectParent *init_graph_node_object_parent(struct AllocOnlyPool *pool, struct GraphNodeObjectParent *sp1c,
|
||||
struct GraphNode *sharedChild);
|
||||
struct GraphNodeGenerated *init_graph_node_generated(struct AllocOnlyPool *pool, struct GraphNodeGenerated *sp1c,
|
||||
GraphNodeFunc gfxFunc, s32 parameter);
|
||||
struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *pool, struct GraphNodeBackground *sp1c,
|
||||
u16 background, GraphNodeFunc backgroundFunc, s32 zero);
|
||||
struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool, struct GraphNodeHeldObject *sp1c,
|
||||
struct Object *objNode, Vec3s translation,
|
||||
GraphNodeFunc nodeFunc, s32 playerIndex);
|
||||
|
||||
struct GraphNodeAnimatedPart *init_graph_node_animated_part(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeAnimatedPart *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation);
|
||||
|
||||
struct GraphNodeBillboard *init_graph_node_billboard(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeBillboard *graphNode,
|
||||
s32 drawingLayer, void *displayList, Vec3s translation);
|
||||
|
||||
struct GraphNodeDisplayList *init_graph_node_display_list(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeDisplayList *graphNode,
|
||||
s32 drawingLayer, void *displayList);
|
||||
|
||||
struct GraphNodeShadow *init_graph_node_shadow(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeShadow *graphNode,
|
||||
s16 shadowScale, u8 shadowSolidity, u8 shadowType);
|
||||
|
||||
struct GraphNodeObjectParent *init_graph_node_object_parent(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeObjectParent *sp1c,
|
||||
struct GraphNode *sharedChild);
|
||||
|
||||
struct GraphNodeGenerated *init_graph_node_generated(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeGenerated *sp1c,
|
||||
GraphNodeFunc gfxFunc, s32 parameter);
|
||||
|
||||
struct GraphNodeBackground *init_graph_node_background(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeBackground *sp1c,
|
||||
u16 background, GraphNodeFunc backgroundFunc, s32 zero);
|
||||
|
||||
struct GraphNodeHeldObject *init_graph_node_held_object(
|
||||
struct AllocOnlyPool *pool, struct GraphNodeHeldObject *sp1c,
|
||||
struct Object *objNode, Vec3s translation,
|
||||
GraphNodeFunc nodeFunc, s32 playerIndex);
|
||||
|
||||
struct GraphNode *geo_add_child(struct GraphNode *parent, struct GraphNode *childNode);
|
||||
|
||||
struct GraphNode *geo_remove_child(struct GraphNode *graphNode);
|
||||
|
||||
struct GraphNode *geo_make_first_child(struct GraphNode *newFirstChild);
|
||||
|
||||
void geo_call_global_function_nodes_helper(struct GraphNode *graphNode, s32 callContext);
|
||||
|
||||
void geo_call_global_function_nodes(struct GraphNode *graphNode, s32 callContext);
|
||||
|
||||
void geo_reset_object_node(struct GraphNodeObject *graphNode);
|
||||
|
||||
void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, Vec3f pos, Vec3s angle);
|
||||
|
||||
void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo *spawn);
|
||||
|
||||
void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr);
|
||||
|
||||
void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel);
|
||||
|
||||
s32 retrieve_animation_index(s32 frame, u16 **attributes);
|
||||
|
||||
s16 geo_update_animation_frame(struct AnimInfo *obj, s32 *accelAssist);
|
||||
|
||||
void geo_retreive_animation_translation(struct GraphNodeObject *obj, Vec3f position);
|
||||
|
||||
struct GraphNodeRoot *geo_find_root(struct GraphNode *graphNode);
|
||||
|
||||
// graph_node_manager
|
||||
s16 *read_vec3s_to_vec3f(Vec3f, s16 *src);
|
||||
s16 *read_vec3s_to_vec3f(Vec3f, s16 * src);
|
||||
|
||||
s16 *read_vec3s(Vec3s dst, s16 *src);
|
||||
|
||||
s16 *read_vec3s_angle(Vec3s dst, s16 *src);
|
||||
|
||||
void register_scene_graph_node(struct GraphNode *graphNode);
|
||||
|
||||
#endif // GRAPH_NODE_H
|
||||
|
||||
@@ -6,14 +6,16 @@
|
||||
#include "graph_node.h"
|
||||
|
||||
#if IS_64_BIT
|
||||
static s16 next_s16_in_geo_script(s16 **src) {
|
||||
s16 ret;
|
||||
if (((uintptr_t)(*src) & 7) == 4) {
|
||||
*src += 2; // skip 32 bits
|
||||
static s16 next_s16_in_geo_script(s16 **src)
|
||||
{
|
||||
if (((uintptr_t) * src & 7) == 4)
|
||||
{
|
||||
*src += 2; // skip 32 bits
|
||||
}
|
||||
ret = *(*src)++;
|
||||
if (((uintptr_t)(*src) & 7) == 4) {
|
||||
*src += 2; // skip 32 bits
|
||||
s16 ret = *(*src)++;
|
||||
if (((uintptr_t) * src & 7) == 4)
|
||||
{
|
||||
*src += 2; // skip 32 bits
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -25,7 +27,8 @@ static s16 next_s16_in_geo_script(s16 **src) {
|
||||
* Takes a pointer to three shorts (supplied by a geo layout script) and
|
||||
* copies it to the destination float vector.
|
||||
*/
|
||||
s16 *read_vec3s_to_vec3f(Vec3f dst, s16 *src) {
|
||||
s16 *read_vec3s_to_vec3f(Vec3f dst, s16 *src)
|
||||
{
|
||||
dst[0] = next_s16_in_geo_script(&src);
|
||||
dst[1] = next_s16_in_geo_script(&src);
|
||||
dst[2] = next_s16_in_geo_script(&src);
|
||||
@@ -37,7 +40,8 @@ s16 *read_vec3s_to_vec3f(Vec3f dst, s16 *src) {
|
||||
* copies it to the destination vector. It's essentially a memcpy but consistent
|
||||
* with the other two 'geo-script vector to internal vector' functions.
|
||||
*/
|
||||
s16 *read_vec3s(Vec3s dst, s16 *src) {
|
||||
s16 *read_vec3s(Vec3s dst, s16 *src)
|
||||
{
|
||||
dst[0] = next_s16_in_geo_script(&src);
|
||||
dst[1] = next_s16_in_geo_script(&src);
|
||||
dst[2] = next_s16_in_geo_script(&src);
|
||||
@@ -49,7 +53,8 @@ s16 *read_vec3s(Vec3s dst, s16 *src) {
|
||||
* and converts it to a vector of three in-game angle units in [-32768, 32767]
|
||||
* range.
|
||||
*/
|
||||
s16 *read_vec3s_angle(Vec3s dst, s16 *src) {
|
||||
s16 *read_vec3s_angle(Vec3s dst, s16 *src)
|
||||
{
|
||||
dst[0] = (next_s16_in_geo_script(&src) << 15) / 180;
|
||||
dst[1] = (next_s16_in_geo_script(&src) << 15) / 180;
|
||||
dst[2] = (next_s16_in_geo_script(&src) << 15) / 180;
|
||||
@@ -61,19 +66,28 @@ s16 *read_vec3s_angle(Vec3s dst, s16 *src) {
|
||||
* 'gCurGraphNodeList'. This is called from geo_layout commands to add nodes
|
||||
* to the scene graph.
|
||||
*/
|
||||
void register_scene_graph_node(struct GraphNode *graphNode) {
|
||||
if (graphNode != NULL) {
|
||||
void register_scene_graph_node(struct GraphNode *graphNode)
|
||||
{
|
||||
if (graphNode != NULL)
|
||||
{
|
||||
gCurGraphNodeList[gCurGraphNodeIndex] = graphNode;
|
||||
|
||||
if (gCurGraphNodeIndex == 0) {
|
||||
if (gCurRootGraphNode == NULL) {
|
||||
if (gCurGraphNodeIndex == 0)
|
||||
{
|
||||
if (gCurRootGraphNode == NULL)
|
||||
{
|
||||
gCurRootGraphNode = graphNode;
|
||||
}
|
||||
} else {
|
||||
if (gCurGraphNodeList[gCurGraphNodeIndex - 1]->type == GRAPH_NODE_TYPE_OBJECT_PARENT) {
|
||||
((struct GraphNodeObjectParent *) gCurGraphNodeList[gCurGraphNodeIndex - 1])
|
||||
->sharedChild = graphNode;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurGraphNodeList[gCurGraphNodeIndex - 1]->type == GRAPH_NODE_TYPE_OBJECT_PARENT)
|
||||
{
|
||||
((struct GraphNodeObjectParent *)gCurGraphNodeList[gCurGraphNodeIndex - 1])
|
||||
->sharedChild = graphNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
geo_add_child(gCurGraphNodeList[gCurGraphNodeIndex - 1], graphNode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,17 @@
|
||||
#endif
|
||||
|
||||
#ifndef GBI_FLOATS
|
||||
void guMtxF2L(float mf[4][4], Mtx *m) {
|
||||
void guMtxF2L(float mf[4][4], Mtx *m)
|
||||
{
|
||||
int r, c;
|
||||
s32 tmp1;
|
||||
s32 tmp2;
|
||||
s32 *m1 = &m->m[0][0];
|
||||
s32 *m2 = &m->m[2][0];
|
||||
for (r = 0; r < 4; r++) {
|
||||
for (c = 0; c < 2; c++) {
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (c = 0; c < 2; c++)
|
||||
{
|
||||
tmp1 = mf[r][2 * c] * 65536.0f;
|
||||
tmp2 = mf[r][2 * c + 1] * 65536.0f;
|
||||
*m1++ = (tmp1 & 0xffff0000) | ((tmp2 >> 0x10) & 0xffff);
|
||||
@@ -20,53 +23,66 @@ void guMtxF2L(float mf[4][4], Mtx *m) {
|
||||
}
|
||||
}
|
||||
}
|
||||
void guMtxL2F(float mf[4][4], Mtx *m) {
|
||||
|
||||
void guMtxL2F(float mf[4][4], Mtx *m)
|
||||
{
|
||||
int r, c;
|
||||
u32 tmp1;
|
||||
u32 tmp2;
|
||||
u32 *m1;
|
||||
u32 *m2;
|
||||
s32 stmp1, stmp2;
|
||||
m1 = (u32 *) &m->m[0][0];
|
||||
m2 = (u32 *) &m->m[2][0];
|
||||
for (r = 0; r < 4; r++) {
|
||||
for (c = 0; c < 2; c++) {
|
||||
m1 = (u32 *)&m->m[0][0];
|
||||
m2 = (u32 *)&m->m[2][0];
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (c = 0; c < 2; c++)
|
||||
{
|
||||
tmp1 = (*m1 & 0xffff0000) | ((*m2 >> 0x10) & 0xffff);
|
||||
tmp2 = ((*m1++ << 0x10) & 0xffff0000) | (*m2++ & 0xffff);
|
||||
stmp1 = *(s32 *) &tmp1;
|
||||
stmp2 = *(s32 *) &tmp2;
|
||||
stmp1 = *(s32 *)&tmp1;
|
||||
stmp2 = *(s32 *)&tmp2;
|
||||
mf[r][c * 2 + 0] = stmp1 / 65536.0f;
|
||||
mf[r][c * 2 + 1] = stmp2 / 65536.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
void guMtxF2L(float mf[4][4], Mtx *m) {
|
||||
void guMtxF2L(float mf[4][4], Mtx *m)
|
||||
{
|
||||
memcpy(m, mf, sizeof(Mtx));
|
||||
}
|
||||
void guMtxL2F(float mf[4][4], Mtx *m) {
|
||||
void guMtxL2F(float mf[4][4], Mtx *m)
|
||||
{
|
||||
memcpy(mf, m, sizeof(Mtx));
|
||||
}
|
||||
#endif
|
||||
|
||||
void guMtxIdentF(float mf[4][4]) {
|
||||
int r, c;
|
||||
for (r = 0; r < 4; r++) {
|
||||
for (c = 0; c < 4; c++) {
|
||||
if (r == c) {
|
||||
void guMtxIdentF(float mf[4][4])
|
||||
{
|
||||
for (int r = 0; r < 4; r++)
|
||||
{
|
||||
for (int c = 0; c < 4; c++)
|
||||
{
|
||||
if (r == c)
|
||||
{
|
||||
mf[r][c] = 1.0f;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
mf[r][c] = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void guMtxIdent(Mtx *m) {
|
||||
#ifndef GBI_FLOATS
|
||||
|
||||
void guMtxIdent(Mtx *m)
|
||||
{
|
||||
#ifndef GBI_FLOATS
|
||||
float mf[4][4];
|
||||
guMtxIdentF(mf);
|
||||
guMtxF2L(mf, m);
|
||||
#else
|
||||
#else
|
||||
guMtxIdentF(m->m);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "../include/PR/gbi.h"
|
||||
|
||||
extern void guMtxF2L(float mf[4][4], Mtx *m);
|
||||
|
||||
extern void guMtxL2F(float mf[4][4], Mtx *m);
|
||||
|
||||
#endif//GUMTXF2L_H
|
||||
+224
-159
@@ -8,13 +8,13 @@
|
||||
#include "graph_node.h"
|
||||
#include "surface_collision.h"
|
||||
|
||||
static Vec3f gVec3fZero = { 0.0f, 0.0f, 0.0f };
|
||||
static Vec3f gVec3fZero = {0.0f, 0.0f, 0.0f};
|
||||
|
||||
// Inlined tables
|
||||
f32 gSineTable[] = {
|
||||
0.000000000f, 0.0015339801f,0.0030679568f,0.004601926f,
|
||||
0.0061358847f,0.007669829f, 0.009203754f, 0.010737659f,
|
||||
0.012271538f, 0.0138053885f,0.015339206f, 0.016872987f,
|
||||
0.000000000f, 0.0015339801f, 0.0030679568f, 0.004601926f,
|
||||
0.0061358847f, 0.007669829f, 0.009203754f, 0.010737659f,
|
||||
0.012271538f, 0.0138053885f, 0.015339206f, 0.016872987f,
|
||||
0.018406730f, 0.019940428f, 0.021474080f, 0.023007682f,
|
||||
0.024541229f, 0.026074719f, 0.027608145f, 0.029141508f,
|
||||
0.030674804f, 0.032208025f, 0.033741172f, 0.035274237f,
|
||||
@@ -268,11 +268,11 @@ f32 gSineTable[] = {
|
||||
0.999830604f, 0.999857664f, 0.999882340f, 0.999904692f,
|
||||
0.999924719f, 0.999942362f, 0.999957621f, 0.999970615f,
|
||||
0.999981165f, 0.999989390f, 0.999995291f, 0.999998808f,
|
||||
#ifndef AVOID_UB
|
||||
#ifndef AVOID_UB
|
||||
};
|
||||
|
||||
f32 gCosineTable[0x1000] = {
|
||||
#endif
|
||||
#endif
|
||||
// cosine
|
||||
1.000000000f, 0.999998808f, 0.999995291f, 0.999989390f,
|
||||
0.999981165f, 0.999970615f, 0.999957621f, 0.999942362f,
|
||||
@@ -529,12 +529,12 @@ f32 gCosineTable[0x1000] = {
|
||||
0.024541229f, 0.023007682f, 0.021474080f, 0.019940428f,
|
||||
0.018406730f, 0.016872987f, 0.015339206f, 0.0138053885f,
|
||||
0.012271538f, 0.010737659f, 0.009203754f, 0.007669829f,
|
||||
0.0061358847f,0.004601926f, 0.0030679568f,0.0015339801f,
|
||||
0.0061358847f, 0.004601926f, 0.0030679568f, 0.0015339801f,
|
||||
|
||||
// negative sine
|
||||
0.000000000f, -0.0015339801f,-0.0030679568f,-0.004601926f,
|
||||
-0.0061358847f,-0.007669829f, -0.009203754f, -0.010737659f,
|
||||
-0.012271538f, -0.0138053885f,-0.015339206f, -0.016872987f,
|
||||
0.000000000f, -0.0015339801f, -0.0030679568f, -0.004601926f,
|
||||
-0.0061358847f, -0.007669829f, -0.009203754f, -0.010737659f,
|
||||
-0.012271538f, -0.0138053885f, -0.015339206f, -0.016872987f,
|
||||
-0.018406730f, -0.019940428f, -0.021474080f, -0.023007682f,
|
||||
-0.024541229f, -0.026074719f, -0.027608145f, -0.029141508f,
|
||||
-0.030674804f, -0.032208025f, -0.033741172f, -0.035274237f,
|
||||
@@ -1045,12 +1045,12 @@ f32 gCosineTable[0x1000] = {
|
||||
-0.024541229f, -0.023007682f, -0.021474080f, -0.019940428f,
|
||||
-0.018406730f, -0.016872987f, -0.015339206f, -0.0138053885f,
|
||||
-0.012271538f, -0.010737659f, -0.009203754f, -0.007669829f,
|
||||
-0.0061358847f,-0.004601926f, -0.0030679568f,-0.0015339801f,
|
||||
-0.0061358847f, -0.004601926f, -0.0030679568f, -0.0015339801f,
|
||||
|
||||
// sine
|
||||
0.000000000f, 0.0015339801f,0.0030679568f,0.004601926f,
|
||||
0.0061358847f,0.007669829f, 0.009203754f, 0.010737659f,
|
||||
0.012271538f, 0.0138053885f,0.015339206f, 0.016872987f,
|
||||
0.000000000f, 0.0015339801f, 0.0030679568f, 0.004601926f,
|
||||
0.0061358847f, 0.007669829f, 0.009203754f, 0.010737659f,
|
||||
0.012271538f, 0.0138053885f, 0.015339206f, 0.016872987f,
|
||||
0.018406730f, 0.019940428f, 0.021474080f, 0.023007682f,
|
||||
0.024541229f, 0.026074719f, 0.027608145f, 0.029141508f,
|
||||
0.030674804f, 0.032208025f, 0.033741172f, 0.035274237f,
|
||||
@@ -1450,7 +1450,8 @@ int gSplineState;
|
||||
#pragma GCC diagnostic ignored "-Wreturn-local-addr"
|
||||
|
||||
/// Copy vector 'src' to 'dest'
|
||||
void *vec3f_copy(Vec3f dest, Vec3f src) {
|
||||
void *vec3f_copy(Vec3f dest, Vec3f src)
|
||||
{
|
||||
dest[0] = src[0];
|
||||
dest[1] = src[1];
|
||||
dest[2] = src[2];
|
||||
@@ -1458,7 +1459,8 @@ void *vec3f_copy(Vec3f dest, Vec3f src) {
|
||||
}
|
||||
|
||||
/// Set vector 'dest' to (x, y, z)
|
||||
void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z) {
|
||||
void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z)
|
||||
{
|
||||
dest[0] = x;
|
||||
dest[1] = y;
|
||||
dest[2] = z;
|
||||
@@ -1466,7 +1468,8 @@ void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z) {
|
||||
}
|
||||
|
||||
/// Add vector 'a' to 'dest'
|
||||
void *vec3f_add(Vec3f dest, Vec3f a) {
|
||||
void *vec3f_add(Vec3f dest, Vec3f a)
|
||||
{
|
||||
dest[0] += a[0];
|
||||
dest[1] += a[1];
|
||||
dest[2] += a[2];
|
||||
@@ -1474,7 +1477,8 @@ void *vec3f_add(Vec3f dest, Vec3f a) {
|
||||
}
|
||||
|
||||
/// Make 'dest' the sum of vectors a and b.
|
||||
void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b) {
|
||||
void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b)
|
||||
{
|
||||
dest[0] = a[0] + b[0];
|
||||
dest[1] = a[1] + b[1];
|
||||
dest[2] = a[2] + b[2];
|
||||
@@ -1482,7 +1486,8 @@ void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b) {
|
||||
}
|
||||
|
||||
/// Copy vector src to dest
|
||||
void *vec3s_copy(Vec3s dest, Vec3s src) {
|
||||
void *vec3s_copy(Vec3s dest, Vec3s src)
|
||||
{
|
||||
dest[0] = src[0];
|
||||
dest[1] = src[1];
|
||||
dest[2] = src[2];
|
||||
@@ -1490,7 +1495,8 @@ void *vec3s_copy(Vec3s dest, Vec3s src) {
|
||||
}
|
||||
|
||||
/// Set vector 'dest' to (x, y, z)
|
||||
void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z) {
|
||||
void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z)
|
||||
{
|
||||
dest[0] = x;
|
||||
dest[1] = y;
|
||||
dest[2] = z;
|
||||
@@ -1498,7 +1504,8 @@ void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z) {
|
||||
}
|
||||
|
||||
/// Add vector a to 'dest'
|
||||
void *vec3s_add(Vec3s dest, Vec3s a) {
|
||||
void *vec3s_add(Vec3s dest, Vec3s a)
|
||||
{
|
||||
dest[0] += a[0];
|
||||
dest[1] += a[1];
|
||||
dest[2] += a[2];
|
||||
@@ -1506,7 +1513,8 @@ void *vec3s_add(Vec3s dest, Vec3s a) {
|
||||
}
|
||||
|
||||
/// Make 'dest' the sum of vectors a and b.
|
||||
void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b) {
|
||||
void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b)
|
||||
{
|
||||
dest[0] = a[0] + b[0];
|
||||
dest[1] = a[1] + b[1];
|
||||
dest[2] = a[2] + b[2];
|
||||
@@ -1514,7 +1522,8 @@ void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b) {
|
||||
}
|
||||
|
||||
/// Subtract vector a from 'dest'
|
||||
void *vec3s_sub(Vec3s dest, Vec3s a) {
|
||||
void *vec3s_sub(Vec3s dest, Vec3s a)
|
||||
{
|
||||
dest[0] -= a[0];
|
||||
dest[1] -= a[1];
|
||||
dest[2] -= a[2];
|
||||
@@ -1522,7 +1531,8 @@ void *vec3s_sub(Vec3s dest, Vec3s a) {
|
||||
}
|
||||
|
||||
/// Convert short vector a to float vector 'dest'
|
||||
void *vec3s_to_vec3f(Vec3f dest, Vec3s a) {
|
||||
void *vec3s_to_vec3f(Vec3f dest, Vec3s a)
|
||||
{
|
||||
dest[0] = a[0];
|
||||
dest[1] = a[1];
|
||||
dest[2] = a[2];
|
||||
@@ -1533,11 +1543,12 @@ void *vec3s_to_vec3f(Vec3f dest, Vec3s a) {
|
||||
* Convert float vector a to a short vector 'dest' by rounding the components
|
||||
* to the nearest integer.
|
||||
*/
|
||||
void *vec3f_to_vec3s(Vec3s dest, Vec3f a) {
|
||||
void *vec3f_to_vec3s(Vec3s dest, Vec3f a)
|
||||
{
|
||||
// add/subtract 0.5 in order to round to the nearest s32 instead of truncating
|
||||
dest[0] = a[0] + ((a[0] > 0) ? 0.5f : -0.5f);
|
||||
dest[1] = a[1] + ((a[1] > 0) ? 0.5f : -0.5f);
|
||||
dest[2] = a[2] + ((a[2] > 0) ? 0.5f : -0.5f);
|
||||
dest[0] = a[0] + (a[0] > 0 ? 0.5f : -0.5f);
|
||||
dest[1] = a[1] + (a[1] > 0 ? 0.5f : -0.5f);
|
||||
dest[2] = a[2] + (a[2] > 0 ? 0.5f : -0.5f);
|
||||
return &dest; //! warning: function returns address of local variable
|
||||
}
|
||||
|
||||
@@ -1546,7 +1557,8 @@ void *vec3f_to_vec3s(Vec3s dest, Vec3f a) {
|
||||
* It is similar to vec3f_cross, but it calculates the vectors (c-b) and (b-a)
|
||||
* at the same time.
|
||||
*/
|
||||
void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c) {
|
||||
void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c)
|
||||
{
|
||||
dest[0] = (b[1] - a[1]) * (c[2] - b[2]) - (c[1] - b[1]) * (b[2] - a[2]);
|
||||
dest[1] = (b[2] - a[2]) * (c[0] - b[0]) - (c[2] - b[2]) * (b[0] - a[0]);
|
||||
dest[2] = (b[0] - a[0]) * (c[1] - b[1]) - (c[0] - b[0]) * (b[1] - a[1]);
|
||||
@@ -1554,7 +1566,8 @@ void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c)
|
||||
}
|
||||
|
||||
/// Make vector 'dest' the cross product of vectors a and b.
|
||||
void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b) {
|
||||
void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b)
|
||||
{
|
||||
dest[0] = a[1] * b[2] - b[1] * a[2];
|
||||
dest[1] = a[2] * b[0] - b[2] * a[0];
|
||||
dest[2] = a[0] * b[1] - b[0] * a[1];
|
||||
@@ -1562,7 +1575,8 @@ void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b) {
|
||||
}
|
||||
|
||||
/// Scale vector 'dest' so it has length 1
|
||||
void *vec3f_normalize(Vec3f dest) {
|
||||
void *vec3f_normalize(Vec3f dest)
|
||||
{
|
||||
//! Possible division by zero
|
||||
f32 invsqrt = 1.0f / sqrtf(dest[0] * dest[0] + dest[1] * dest[1] + dest[2] * dest[2]);
|
||||
|
||||
@@ -1575,12 +1589,13 @@ void *vec3f_normalize(Vec3f dest) {
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/// Copy matrix 'src' to 'dest'
|
||||
void mtxf_copy(Mat4 dest, Mat4 src) {
|
||||
register s32 i;
|
||||
register u32 *d = (u32 *) dest;
|
||||
register u32 *s = (u32 *) src;
|
||||
void mtxf_copy(Mat4 dest, Mat4 src)
|
||||
{
|
||||
register u32 *d = (u32 *)dest;
|
||||
register u32 *s = (u32 *)src;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (register s32 i = 0; i < 16; i++)
|
||||
{
|
||||
*d++ = *s++;
|
||||
}
|
||||
}
|
||||
@@ -1588,22 +1603,24 @@ void mtxf_copy(Mat4 dest, Mat4 src) {
|
||||
/**
|
||||
* Set mtx to the identity matrix
|
||||
*/
|
||||
void mtxf_identity(Mat4 mtx) {
|
||||
void mtxf_identity(Mat4 mtx)
|
||||
{
|
||||
register s32 i;
|
||||
register f32 *dest;
|
||||
// These loops must be one line to match on -O2
|
||||
|
||||
// initialize everything except the first and last cells to 0
|
||||
for (dest = (f32 *) mtx + 1, i = 0; i < 14; dest++, i++) *dest = 0;
|
||||
for (dest = (f32 *)mtx + 1, i = 0; i < 14; dest++, i++) *dest = 0;
|
||||
|
||||
// initialize the diagonal cells to 1
|
||||
for (dest = (f32 *) mtx, i = 0; i < 4; dest += 5, i++) *dest = 1;
|
||||
for (dest = (f32 *)mtx, i = 0; i < 4; dest += 5, i++) *dest = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set dest to a translation matrix of vector b
|
||||
*/
|
||||
void mtxf_translate(Mat4 dest, Vec3f b) {
|
||||
void mtxf_translate(Mat4 dest, Vec3f b)
|
||||
{
|
||||
mtxf_identity(dest);
|
||||
dest[3][0] = b[0];
|
||||
dest[3][1] = b[1];
|
||||
@@ -1616,43 +1633,31 @@ void mtxf_translate(Mat4 dest, Vec3f b) {
|
||||
* at the position 'to'. The up-vector is assumed to be (0, 1, 0), but the 'roll'
|
||||
* angle allows a bank rotation of the camera.
|
||||
*/
|
||||
void mtxf_lookat(Mat4 mtx, Vec3f from, Vec3f to, s16 roll) {
|
||||
register f32 invLength;
|
||||
f32 dx;
|
||||
f32 dz;
|
||||
f32 xColY;
|
||||
f32 yColY;
|
||||
f32 zColY;
|
||||
f32 xColZ;
|
||||
f32 yColZ;
|
||||
f32 zColZ;
|
||||
f32 xColX;
|
||||
f32 yColX;
|
||||
f32 zColX;
|
||||
void mtxf_lookat(Mat4 mtx, Vec3f from, Vec3f to, s16 roll)
|
||||
{
|
||||
f32 dx = to[0] - from[0];
|
||||
f32 dz = to[2] - from[2];
|
||||
|
||||
dx = to[0] - from[0];
|
||||
dz = to[2] - from[2];
|
||||
|
||||
invLength = -1.0 / sqrtf(dx * dx + dz * dz);
|
||||
register f32 invLength = -1.0 / sqrtf(dx * dx + dz * dz);
|
||||
dx *= invLength;
|
||||
dz *= invLength;
|
||||
|
||||
yColY = coss(roll);
|
||||
xColY = sins(roll) * dz;
|
||||
zColY = -sins(roll) * dx;
|
||||
f32 yColY = coss(roll);
|
||||
f32 xColY = sins(roll) * dz;
|
||||
f32 zColY = -sins(roll) * dx;
|
||||
|
||||
xColZ = to[0] - from[0];
|
||||
yColZ = to[1] - from[1];
|
||||
zColZ = to[2] - from[2];
|
||||
f32 xColZ = to[0] - from[0];
|
||||
f32 yColZ = to[1] - from[1];
|
||||
f32 zColZ = to[2] - from[2];
|
||||
|
||||
invLength = -1.0 / sqrtf(xColZ * xColZ + yColZ * yColZ + zColZ * zColZ);
|
||||
xColZ *= invLength;
|
||||
yColZ *= invLength;
|
||||
zColZ *= invLength;
|
||||
|
||||
xColX = yColY * zColZ - zColY * yColZ;
|
||||
yColX = zColY * xColZ - xColY * zColZ;
|
||||
zColX = xColY * yColZ - yColY * xColZ;
|
||||
f32 xColX = yColY * zColZ - zColY * yColZ;
|
||||
f32 yColX = zColY * xColZ - xColY * zColZ;
|
||||
f32 zColX = xColY * yColZ - yColY * xColZ;
|
||||
|
||||
invLength = 1.0 / sqrtf(xColX * xColX + yColX * yColX + zColX * zColX);
|
||||
|
||||
@@ -1694,7 +1699,8 @@ void mtxf_lookat(Mat4 mtx, Vec3f from, Vec3f to, s16 roll) {
|
||||
* Build a matrix that rotates around the z axis, then the x axis, then the y
|
||||
* axis, and then translates.
|
||||
*/
|
||||
void mtxf_rotate_zxy_and_translate(Mat4 dest, Vec3f translate, Vec3s rotate) {
|
||||
void mtxf_rotate_zxy_and_translate(Mat4 dest, Vec3f translate, Vec3s rotate)
|
||||
{
|
||||
register f32 sx = sins(rotate[0]);
|
||||
register f32 cx = coss(rotate[0]);
|
||||
|
||||
@@ -1727,7 +1733,8 @@ void mtxf_rotate_zxy_and_translate(Mat4 dest, Vec3f translate, Vec3s rotate) {
|
||||
* Build a matrix that rotates around the x axis, then the y axis, then the z
|
||||
* axis, and then translates.
|
||||
*/
|
||||
void mtxf_rotate_xyz_and_translate(Mat4 dest, Vec3f b, Vec3s c) {
|
||||
void mtxf_rotate_xyz_and_translate(Mat4 dest, Vec3f b, Vec3s c)
|
||||
{
|
||||
register f32 sx = sins(c[0]);
|
||||
register f32 cx = coss(c[0]);
|
||||
|
||||
@@ -1764,7 +1771,8 @@ void mtxf_rotate_xyz_and_translate(Mat4 dest, Vec3f b, Vec3s c) {
|
||||
* 'position' is the position of the object in the world
|
||||
* 'angle' rotates the object while still facing the camera.
|
||||
*/
|
||||
void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle) {
|
||||
void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle)
|
||||
{
|
||||
dest[0][0] = coss(angle);
|
||||
dest[0][1] = sins(angle);
|
||||
dest[0][2] = 0;
|
||||
@@ -1781,11 +1789,11 @@ void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle) {
|
||||
dest[2][3] = 0;
|
||||
|
||||
dest[3][0] =
|
||||
mtx[0][0] * position[0] + mtx[1][0] * position[1] + mtx[2][0] * position[2] + mtx[3][0];
|
||||
mtx[0][0] * position[0] + mtx[1][0] * position[1] + mtx[2][0] * position[2] + mtx[3][0];
|
||||
dest[3][1] =
|
||||
mtx[0][1] * position[0] + mtx[1][1] * position[1] + mtx[2][1] * position[2] + mtx[3][1];
|
||||
mtx[0][1] * position[0] + mtx[1][1] * position[1] + mtx[2][1] * position[2] + mtx[3][1];
|
||||
dest[3][2] =
|
||||
mtx[0][2] * position[0] + mtx[1][2] * position[1] + mtx[2][2] * position[2] + mtx[3][2];
|
||||
mtx[0][2] * position[0] + mtx[1][2] * position[1] + mtx[2][2] * position[2] + mtx[3][2];
|
||||
dest[3][3] = 1;
|
||||
}
|
||||
|
||||
@@ -1796,7 +1804,8 @@ void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle) {
|
||||
* 'yaw' is the angle which it should face
|
||||
* 'pos' is the object's position in the world
|
||||
*/
|
||||
void mtxf_align_terrain_normal(Mat4 dest, Vec3f upDir, Vec3f pos, s16 yaw) {
|
||||
void mtxf_align_terrain_normal(Mat4 dest, Vec3f upDir, Vec3f pos, s16 yaw)
|
||||
{
|
||||
Vec3f lateralDir;
|
||||
Vec3f leftDir;
|
||||
Vec3f forwardDir;
|
||||
@@ -1839,7 +1848,8 @@ void mtxf_align_terrain_normal(Mat4 dest, Vec3f upDir, Vec3f pos, s16 yaw) {
|
||||
* 'pos' is the object's position in the world
|
||||
* 'radius' is the distance from each triangle vertex to the center
|
||||
*/
|
||||
void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius) {
|
||||
void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *sp74;
|
||||
Vec3f point0;
|
||||
Vec3f point1;
|
||||
@@ -1848,7 +1858,6 @@ void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius) {
|
||||
Vec3f xColumn;
|
||||
Vec3f yColumn;
|
||||
Vec3f zColumn;
|
||||
f32 avgY;
|
||||
f32 minY = -radius * 3;
|
||||
|
||||
point0[0] = pos[0] + radius * sins(yaw + 0x2AAA);
|
||||
@@ -1862,19 +1871,22 @@ void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius) {
|
||||
point1[1] = find_floor(point1[0], pos[1] + 150, point1[2], &sp74);
|
||||
point2[1] = find_floor(point2[0], pos[1] + 150, point2[2], &sp74);
|
||||
|
||||
if (point0[1] - pos[1] < minY) {
|
||||
if (point0[1] - pos[1] < minY)
|
||||
{
|
||||
point0[1] = pos[1];
|
||||
}
|
||||
|
||||
if (point1[1] - pos[1] < minY) {
|
||||
if (point1[1] - pos[1] < minY)
|
||||
{
|
||||
point1[1] = pos[1];
|
||||
}
|
||||
|
||||
if (point2[1] - pos[1] < minY) {
|
||||
if (point2[1] - pos[1] < minY)
|
||||
{
|
||||
point2[1] = pos[1];
|
||||
}
|
||||
|
||||
avgY = (point0[1] + point1[1] + point2[1]) / 3;
|
||||
f32 avgY = (point0[1] + point1[1] + point2[1]) / 3;
|
||||
|
||||
vec3f_set(forward, sins(yaw), 0, coss(yaw));
|
||||
find_vector_perpendicular_to_plane(yColumn, point0, point1, point2);
|
||||
@@ -1892,7 +1904,7 @@ void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius) {
|
||||
mtx[1][0] = yColumn[0];
|
||||
mtx[1][1] = yColumn[1];
|
||||
mtx[1][2] = yColumn[2];
|
||||
mtx[3][1] = (avgY < pos[1]) ? pos[1] : avgY;
|
||||
mtx[3][1] = avgY < pos[1] ? pos[1] : avgY;
|
||||
|
||||
mtx[2][0] = zColumn[0];
|
||||
mtx[2][1] = zColumn[1];
|
||||
@@ -1913,16 +1925,14 @@ void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius) {
|
||||
* The resulting matrix represents first applying transformation b and
|
||||
* then a.
|
||||
*/
|
||||
void mtxf_mul(Mat4 dest, Mat4 a, Mat4 b) {
|
||||
void mtxf_mul(Mat4 dest, Mat4 a, Mat4 b)
|
||||
{
|
||||
Mat4 temp;
|
||||
register f32 entry0;
|
||||
register f32 entry1;
|
||||
register f32 entry2;
|
||||
|
||||
// column 0
|
||||
entry0 = a[0][0];
|
||||
entry1 = a[0][1];
|
||||
entry2 = a[0][2];
|
||||
register f32 entry0 = a[0][0];
|
||||
register f32 entry1 = a[0][1];
|
||||
register f32 entry2 = a[0][2];
|
||||
temp[0][0] = entry0 * b[0][0] + entry1 * b[1][0] + entry2 * b[2][0];
|
||||
temp[0][1] = entry0 * b[0][1] + entry1 * b[1][1] + entry2 * b[2][1];
|
||||
temp[0][2] = entry0 * b[0][2] + entry1 * b[1][2] + entry2 * b[2][2];
|
||||
@@ -1960,10 +1970,10 @@ void mtxf_mul(Mat4 dest, Mat4 a, Mat4 b) {
|
||||
/**
|
||||
* Set matrix 'dest' to 'mtx' scaled by vector s
|
||||
*/
|
||||
void mtxf_scale_vec3f(Mat4 dest, Mat4 mtx, Vec3f s) {
|
||||
register s32 i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
void mtxf_scale_vec3f(Mat4 dest, Mat4 mtx, Vec3f s)
|
||||
{
|
||||
for (register s32 i = 0; i < 4; i++)
|
||||
{
|
||||
dest[0][i] = mtx[0][i] * s[0];
|
||||
dest[1][i] = mtx[1][i] * s[1];
|
||||
dest[2][i] = mtx[2][i] * s[2];
|
||||
@@ -1976,7 +1986,8 @@ void mtxf_scale_vec3f(Mat4 dest, Mat4 mtx, Vec3f s) {
|
||||
* to the point. Note that the bottom row is assumed to be [0, 0, 0, 1], which is
|
||||
* true for transformation matrices if the translation has a w component of 1.
|
||||
*/
|
||||
void mtxf_mul_vec3s(Mat4 mtx, Vec3s b) {
|
||||
void mtxf_mul_vec3s(Mat4 mtx, Vec3s b)
|
||||
{
|
||||
register f32 x = b[0];
|
||||
register f32 y = b[1];
|
||||
register f32 z = b[2];
|
||||
@@ -1986,7 +1997,8 @@ void mtxf_mul_vec3s(Mat4 mtx, Vec3s b) {
|
||||
b[2] = x * mtx[0][2] + y * mtx[1][2] + z * mtx[2][2] + mtx[3][2];
|
||||
}
|
||||
|
||||
void mtxf_mul_vec3f(Mat4 mtx, Vec3f b) {
|
||||
void mtxf_mul_vec3f(Mat4 mtx, Vec3f b)
|
||||
{
|
||||
register f32 x = b[0];
|
||||
register f32 y = b[1];
|
||||
register f32 z = b[2];
|
||||
@@ -1995,6 +2007,7 @@ void mtxf_mul_vec3f(Mat4 mtx, Vec3f b) {
|
||||
b[1] = x * mtx[0][1] + y * mtx[1][1] + z * mtx[2][1] + mtx[3][1];
|
||||
b[2] = x * mtx[0][2] + y * mtx[1][2] + z * mtx[2][2] + mtx[3][2];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert float matrix 'src' to fixed point matrix 'dest'.
|
||||
* The float matrix may not contain entries larger than 65536 or the console
|
||||
@@ -2004,30 +2017,33 @@ void mtxf_mul_vec3f(Mat4 mtx, Vec3f b) {
|
||||
* exception. On Wii and Wii U Virtual Console the value will simply be clamped
|
||||
* and no crashes occur.
|
||||
*/
|
||||
void mtxf_to_mtx(Mtx *dest, Mat4 src) {
|
||||
#ifdef AVOID_UB
|
||||
void mtxf_to_mtx(Mtx *dest, Mat4 src)
|
||||
{
|
||||
#ifdef AVOID_UB
|
||||
// Avoid type-casting which is technically UB by calling the equivalent
|
||||
// guMtxF2L function. This helps little-endian systems, as well.
|
||||
guMtxF2L(src, dest);
|
||||
#else
|
||||
#else
|
||||
s32 asFixedPoint;
|
||||
register s32 i;
|
||||
register s16 *a3 = (s16 *) dest; // all integer parts stored in first 16 bytes
|
||||
register s16 *t0 = (s16 *) dest + 16; // all fraction parts stored in last 16 bytes
|
||||
register f32 *t1 = (f32 *) src;
|
||||
register s16 *a3 = (s16 *)dest; // all integer parts stored in first 16 bytes
|
||||
register s16 *t0 = (s16 *)dest + 16; // all fraction parts stored in last 16 bytes
|
||||
register f32 *t1 = (f32 *)src;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
asFixedPoint = *t1++ * (1 << 16); //! float-to-integer conversion responsible for PU crashes
|
||||
*a3++ = GET_HIGH_S16_OF_32(asFixedPoint); // integer part
|
||||
*t0++ = GET_LOW_S16_OF_32(asFixedPoint); // fraction part
|
||||
*t0++ = GET_LOW_S16_OF_32(asFixedPoint); // fraction part
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Set 'mtx' to a transformation matrix that rotates around the z axis.
|
||||
*/
|
||||
void mtxf_rotate_xy(Mtx *mtx, s16 angle) {
|
||||
void mtxf_rotate_xy(Mtx *mtx, s16 angle)
|
||||
{
|
||||
Mat4 temp;
|
||||
|
||||
mtxf_identity(temp);
|
||||
@@ -2046,17 +2062,18 @@ void mtxf_rotate_xy(Mtx *mtx, s16 angle) {
|
||||
* objMtx back from screen orientation to world orientation, and then subtracting
|
||||
* the camera position.
|
||||
*/
|
||||
void get_pos_from_transform_mtx(Vec3f dest, Mat4 objMtx, Mat4 camMtx) {
|
||||
void get_pos_from_transform_mtx(Vec3f dest, Mat4 objMtx, Mat4 camMtx)
|
||||
{
|
||||
f32 camX = camMtx[3][0] * camMtx[0][0] + camMtx[3][1] * camMtx[0][1] + camMtx[3][2] * camMtx[0][2];
|
||||
f32 camY = camMtx[3][0] * camMtx[1][0] + camMtx[3][1] * camMtx[1][1] + camMtx[3][2] * camMtx[1][2];
|
||||
f32 camZ = camMtx[3][0] * camMtx[2][0] + camMtx[3][1] * camMtx[2][1] + camMtx[3][2] * camMtx[2][2];
|
||||
|
||||
dest[0] =
|
||||
objMtx[3][0] * camMtx[0][0] + objMtx[3][1] * camMtx[0][1] + objMtx[3][2] * camMtx[0][2] - camX;
|
||||
objMtx[3][0] * camMtx[0][0] + objMtx[3][1] * camMtx[0][1] + objMtx[3][2] * camMtx[0][2] - camX;
|
||||
dest[1] =
|
||||
objMtx[3][0] * camMtx[1][0] + objMtx[3][1] * camMtx[1][1] + objMtx[3][2] * camMtx[1][2] - camY;
|
||||
objMtx[3][0] * camMtx[1][0] + objMtx[3][1] * camMtx[1][1] + objMtx[3][2] * camMtx[1][2] - camY;
|
||||
dest[2] =
|
||||
objMtx[3][0] * camMtx[2][0] + objMtx[3][1] * camMtx[2][1] + objMtx[3][2] * camMtx[2][2] - camZ;
|
||||
objMtx[3][0] * camMtx[2][0] + objMtx[3][1] * camMtx[2][1] + objMtx[3][2] * camMtx[2][2] - camZ;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2064,7 +2081,8 @@ void get_pos_from_transform_mtx(Vec3f dest, Mat4 objMtx, Mat4 camMtx) {
|
||||
* of that vector, as well as the yaw and pitch angles.
|
||||
* Basically it converts the direction to spherical coordinates.
|
||||
*/
|
||||
void vec3f_get_dist_and_angle(Vec3f from, Vec3f to, f32 *dist, s16 *pitch, s16 *yaw) {
|
||||
void vec3f_get_dist_and_angle(Vec3f from, Vec3f to, f32 *dist, s16 *pitch, s16 *yaw)
|
||||
{
|
||||
register f32 x = to[0] - from[0];
|
||||
register f32 y = to[1] - from[1];
|
||||
register f32 z = to[2] - from[2];
|
||||
@@ -2078,7 +2096,8 @@ void vec3f_get_dist_and_angle(Vec3f from, Vec3f to, f32 *dist, s16 *pitch, s16 *
|
||||
* Construct the 'to' point which is distance 'dist' away from the 'from' position,
|
||||
* and has the angles pitch and yaw.
|
||||
*/
|
||||
void vec3f_set_dist_and_angle(Vec3f from, Vec3f to, f32 dist, s16 pitch, s16 yaw) {
|
||||
void vec3f_set_dist_and_angle(Vec3f from, Vec3f to, f32 dist, s16 pitch, s16 yaw)
|
||||
{
|
||||
to[0] = from[0] + dist * coss(pitch) * sins(yaw);
|
||||
to[1] = from[1] + dist * sins(pitch);
|
||||
to[2] = from[2] + dist * coss(pitch) * coss(yaw);
|
||||
@@ -2088,18 +2107,24 @@ void vec3f_set_dist_and_angle(Vec3f from, Vec3f to, f32 dist, s16 pitch, s16 yaw
|
||||
* Return the value 'current' after it tries to approach target, going up at
|
||||
* most 'inc' and going down at most 'dec'.
|
||||
*/
|
||||
s32 approach_s32(s32 current, s32 target, s32 inc, s32 dec) {
|
||||
s32 approach_s32(s32 current, s32 target, s32 inc, s32 dec)
|
||||
{
|
||||
//! If target is close to the max or min s32, then it's possible to overflow
|
||||
// past it without stopping.
|
||||
|
||||
if (current < target) {
|
||||
if (current < target)
|
||||
{
|
||||
current += inc;
|
||||
if (current > target) {
|
||||
if (current > target)
|
||||
{
|
||||
current = target;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
current -= dec;
|
||||
if (current < target) {
|
||||
if (current < target)
|
||||
{
|
||||
current = target;
|
||||
}
|
||||
}
|
||||
@@ -2110,15 +2135,21 @@ s32 approach_s32(s32 current, s32 target, s32 inc, s32 dec) {
|
||||
* Return the value 'current' after it tries to approach target, going up at
|
||||
* most 'inc' and going down at most 'dec'.
|
||||
*/
|
||||
f32 approach_f32(f32 current, f32 target, f32 inc, f32 dec) {
|
||||
if (current < target) {
|
||||
f32 approach_f32(f32 current, f32 target, f32 inc, f32 dec)
|
||||
{
|
||||
if (current < target)
|
||||
{
|
||||
current += inc;
|
||||
if (current > target) {
|
||||
if (current > target)
|
||||
{
|
||||
current = target;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
current -= dec;
|
||||
if (current < target) {
|
||||
if (current < target)
|
||||
{
|
||||
current = target;
|
||||
}
|
||||
}
|
||||
@@ -2129,12 +2160,16 @@ f32 approach_f32(f32 current, f32 target, f32 inc, f32 dec) {
|
||||
* Helper function for atan2s. Does a look up of the arctangent of y/x assuming
|
||||
* the resulting angle is in range [0, 0x2000] (1/8 of a circle).
|
||||
*/
|
||||
static u16 atan2_lookup(f32 y, f32 x) {
|
||||
static u16 atan2_lookup(f32 y, f32 x)
|
||||
{
|
||||
u16 ret;
|
||||
|
||||
if (x == 0) {
|
||||
if (x == 0)
|
||||
{
|
||||
ret = gArctanTable[0];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = gArctanTable[(s32)(y / x * 1024 + 0.5f)];
|
||||
}
|
||||
return ret;
|
||||
@@ -2144,37 +2179,59 @@ static u16 atan2_lookup(f32 y, f32 x) {
|
||||
* Compute the angle from (0, 0) to (x, y) as a s16. Given that terrain is in
|
||||
* the xz-plane, this is commonly called with (z, x) to get a yaw angle.
|
||||
*/
|
||||
s16 atan2s(f32 y, f32 x) {
|
||||
s16 atan2s(f32 y, f32 x)
|
||||
{
|
||||
u16 ret;
|
||||
|
||||
if (x >= 0) {
|
||||
if (y >= 0) {
|
||||
if (y >= x) {
|
||||
if (x >= 0)
|
||||
{
|
||||
if (y >= 0)
|
||||
{
|
||||
if (y >= x)
|
||||
{
|
||||
ret = atan2_lookup(x, y);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = 0x4000 - atan2_lookup(y, x);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
y = -y;
|
||||
if (y < x) {
|
||||
if (y < x)
|
||||
{
|
||||
ret = 0x4000 + atan2_lookup(y, x);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = 0x8000 - atan2_lookup(x, y);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
x = -x;
|
||||
if (y < 0) {
|
||||
if (y < 0)
|
||||
{
|
||||
y = -y;
|
||||
if (y >= x) {
|
||||
if (y >= x)
|
||||
{
|
||||
ret = 0x8000 + atan2_lookup(x, y);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = 0xC000 - atan2_lookup(y, x);
|
||||
}
|
||||
} else {
|
||||
if (y < x) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (y < x)
|
||||
{
|
||||
ret = 0xC000 + atan2_lookup(y, x);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = -atan2_lookup(x, y);
|
||||
}
|
||||
}
|
||||
@@ -2220,14 +2277,16 @@ s16 atan2s(f32 y, f32 x) {
|
||||
* [0, 0, 0, 0, 1, 2, ... n-1, n, n, n, n]
|
||||
* TODO: verify the classification of the spline / figure out how polynomials were computed
|
||||
*/
|
||||
void spline_get_weights(Vec4f result, f32 t, UNUSED s32 c) {
|
||||
void spline_get_weights(Vec4f result, f32 t, UNUSED s32 c)
|
||||
{
|
||||
f32 tinv = 1 - t;
|
||||
f32 tinv2 = tinv * tinv;
|
||||
f32 tinv3 = tinv2 * tinv;
|
||||
f32 t2 = t * t;
|
||||
f32 t3 = t2 * t;
|
||||
|
||||
switch (gSplineState) {
|
||||
switch (gSplineState)
|
||||
{
|
||||
case CURVE_BEGIN_1:
|
||||
result[0] = tinv3;
|
||||
result[1] = t3 * 1.75f - t2 * 4.5f + t * 3.0f;
|
||||
@@ -2236,20 +2295,20 @@ void spline_get_weights(Vec4f result, f32 t, UNUSED s32 c) {
|
||||
break;
|
||||
case CURVE_BEGIN_2:
|
||||
result[0] = tinv3 * 0.25f;
|
||||
result[1] = t3 * (7 / 12.0f) - t2 * 1.25f + t * 0.25f + (7 / 12.0f);
|
||||
result[2] = -t3 * 0.5f + t2 * 0.5f + t * 0.5f + (1 / 6.0f);
|
||||
result[1] = t3 * (7 / 12.0f) - t2 * 1.25f + t * 0.25f + 7 / 12.0f;
|
||||
result[2] = -t3 * 0.5f + t2 * 0.5f + t * 0.5f + 1 / 6.0f;
|
||||
result[3] = t3 * (1 / 6.0f);
|
||||
break;
|
||||
case CURVE_MIDDLE:
|
||||
result[0] = tinv3 * (1 / 6.0f);
|
||||
result[1] = t3 * 0.5f - t2 + (4 / 6.0f);
|
||||
result[2] = -t3 * 0.5f + t2 * 0.5f + t * 0.5f + (1 / 6.0f);
|
||||
result[1] = t3 * 0.5f - t2 + 4 / 6.0f;
|
||||
result[2] = -t3 * 0.5f + t2 * 0.5f + t * 0.5f + 1 / 6.0f;
|
||||
result[3] = t3 * (1 / 6.0f);
|
||||
break;
|
||||
case CURVE_END_1:
|
||||
result[0] = tinv3 * (1 / 6.0f);
|
||||
result[1] = -tinv3 * 0.5f + tinv2 * 0.5f + tinv * 0.5f + (1 / 6.0f);
|
||||
result[2] = tinv3 * (7 / 12.0f) - tinv2 * 1.25f + tinv * 0.25f + (7 / 12.0f);
|
||||
result[1] = -tinv3 * 0.5f + tinv2 * 0.5f + tinv * 0.5f + 1 / 6.0f;
|
||||
result[2] = tinv3 * (7 / 12.0f) - tinv2 * 1.25f + tinv * 0.25f + 7 / 12.0f;
|
||||
result[3] = t3 * 0.25f;
|
||||
break;
|
||||
case CURVE_END_2:
|
||||
@@ -2269,7 +2328,8 @@ void spline_get_weights(Vec4f result, f32 t, UNUSED s32 c) {
|
||||
* The array should end with three entries with s=0 (infinite keyframe duration).
|
||||
* That's because the spline has a 3rd degree polynomial, so it looks 3 points ahead.
|
||||
*/
|
||||
void anim_spline_init(Vec4s *keyFrames) {
|
||||
void anim_spline_init(Vec4s *keyFrames)
|
||||
{
|
||||
gSplineKeyframe = keyFrames;
|
||||
gSplineKeyframeFraction = 0;
|
||||
gSplineState = 1;
|
||||
@@ -2280,28 +2340,32 @@ void anim_spline_init(Vec4s *keyFrames) {
|
||||
* anim_spline_init should be called before polling for vectors.
|
||||
* Returns TRUE when the last point is reached, FALSE otherwise.
|
||||
*/
|
||||
s32 anim_spline_poll(Vec3f result) {
|
||||
s32 anim_spline_poll(Vec3f result)
|
||||
{
|
||||
Vec4f weights;
|
||||
s32 i;
|
||||
s32 hasEnded = FALSE;
|
||||
|
||||
vec3f_copy(result, gVec3fZero);
|
||||
spline_get_weights(weights, gSplineKeyframeFraction, gSplineState);
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (s32 i = 0; i < 4; i++)
|
||||
{
|
||||
result[0] += weights[i] * gSplineKeyframe[i][1];
|
||||
result[1] += weights[i] * gSplineKeyframe[i][2];
|
||||
result[2] += weights[i] * gSplineKeyframe[i][3];
|
||||
}
|
||||
|
||||
if ((gSplineKeyframeFraction += gSplineKeyframe[0][0] / 1000.0f) >= 1) {
|
||||
if ((gSplineKeyframeFraction += gSplineKeyframe[0][0] / 1000.0f) >= 1)
|
||||
{
|
||||
gSplineKeyframe++;
|
||||
gSplineKeyframeFraction--;
|
||||
switch (gSplineState) {
|
||||
switch (gSplineState)
|
||||
{
|
||||
case CURVE_END_2:
|
||||
hasEnded = TRUE;
|
||||
break;
|
||||
case CURVE_MIDDLE:
|
||||
if (gSplineKeyframe[2][0] == 0) {
|
||||
if (gSplineKeyframe[2][0] == 0)
|
||||
{
|
||||
gSplineState = CURVE_END_1;
|
||||
}
|
||||
break;
|
||||
@@ -2315,7 +2379,6 @@ s32 anim_spline_poll(Vec3f result) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// From object_helpers.c
|
||||
|
||||
/**
|
||||
@@ -2326,9 +2389,10 @@ s32 anim_spline_poll(Vec3f result) {
|
||||
* | 0 0 0 1 |
|
||||
* i.e. a matrix representing a linear transformation over 3 space.
|
||||
*/
|
||||
void linear_mtxf_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v) {
|
||||
s32 i;
|
||||
for (i = 0; i < 3; i++) {
|
||||
void linear_mtxf_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v)
|
||||
{
|
||||
for (s32 i = 0; i < 3; i++)
|
||||
{
|
||||
dst[i] = m[0][i] * v[0] + m[1][i] * v[1] + m[2][i] * v[2];
|
||||
}
|
||||
}
|
||||
@@ -2341,9 +2405,10 @@ void linear_mtxf_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v) {
|
||||
* | 0 0 0 1 |
|
||||
* i.e. a matrix representing a linear transformation over 3 space.
|
||||
*/
|
||||
void linear_mtxf_transpose_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v) {
|
||||
s32 i;
|
||||
for (i = 0; i < 3; i++) {
|
||||
void linear_mtxf_transpose_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v)
|
||||
{
|
||||
for (s32 i = 0; i < 3; i++)
|
||||
{
|
||||
dst[i] = m[i][0] * v[0] + m[i][1] * v[1] + m[i][2] * v[2];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,49 +34,87 @@ extern f32 gCosineTable[];
|
||||
#define sqr(x) ((x) * (x))
|
||||
|
||||
void *vec3f_copy(Vec3f dest, Vec3f src);
|
||||
|
||||
void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z);
|
||||
|
||||
void *vec3f_add(Vec3f dest, Vec3f a);
|
||||
|
||||
void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b);
|
||||
|
||||
void *vec3s_copy(Vec3s dest, Vec3s src);
|
||||
|
||||
void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z);
|
||||
|
||||
void *vec3s_add(Vec3s dest, Vec3s a);
|
||||
|
||||
void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b);
|
||||
|
||||
void *vec3s_sub(Vec3s dest, Vec3s a);
|
||||
|
||||
void *vec3s_to_vec3f(Vec3f dest, Vec3s a);
|
||||
|
||||
void *vec3f_to_vec3s(Vec3s dest, Vec3f a);
|
||||
|
||||
void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c);
|
||||
|
||||
void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b);
|
||||
|
||||
void *vec3f_normalize(Vec3f dest);
|
||||
|
||||
void mtxf_copy(Mat4 dest, Mat4 src);
|
||||
|
||||
void mtxf_identity(Mat4 mtx);
|
||||
|
||||
void mtxf_translate(Mat4 dest, Vec3f b);
|
||||
|
||||
void mtxf_lookat(Mat4 mtx, Vec3f from, Vec3f to, s16 roll);
|
||||
|
||||
void mtxf_rotate_zxy_and_translate(Mat4 dest, Vec3f translate, Vec3s rotate);
|
||||
|
||||
void mtxf_rotate_xyz_and_translate(Mat4 dest, Vec3f b, Vec3s c);
|
||||
|
||||
void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle);
|
||||
|
||||
void mtxf_align_terrain_normal(Mat4 dest, Vec3f upDir, Vec3f pos, s16 yaw);
|
||||
|
||||
void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius);
|
||||
|
||||
void mtxf_mul(Mat4 dest, Mat4 a, Mat4 b);
|
||||
|
||||
void mtxf_scale_vec3f(Mat4 dest, Mat4 mtx, Vec3f s);
|
||||
|
||||
void mtxf_mul_vec3s(Mat4 mtx, Vec3s b);
|
||||
|
||||
void mtxf_mul_vec3f(Mat4 mtx, Vec3f b);
|
||||
|
||||
void mtxf_to_mtx(Mtx *dest, Mat4 src);
|
||||
|
||||
void mtxf_rotate_xy(Mtx *mtx, s16 angle);
|
||||
|
||||
void get_pos_from_transform_mtx(Vec3f dest, Mat4 objMtx, Mat4 camMtx);
|
||||
|
||||
void vec3f_get_dist_and_angle(Vec3f from, Vec3f to, f32 *dist, s16 *pitch, s16 *yaw);
|
||||
void vec3f_set_dist_and_angle(Vec3f from, Vec3f to, f32 dist, s16 pitch, s16 yaw);
|
||||
|
||||
void vec3f_set_dist_and_angle(Vec3f from, Vec3f to, f32 dist, s16 pitch, s16 yaw);
|
||||
|
||||
s32 approach_s32(s32 current, s32 target, s32 inc, s32 dec);
|
||||
|
||||
f32 approach_f32(f32 current, f32 target, f32 inc, f32 dec);
|
||||
|
||||
s16 atan2s(f32 y, f32 x);
|
||||
|
||||
// libsm64: `atan2f()` is not used anywhere and collides with `math.h`'s definition of the function, better to remove it entirely.
|
||||
// f32 atan2f(f32 a, f32 b);
|
||||
void spline_get_weights(Vec4f result, f32 t, UNUSED s32 c);
|
||||
void anim_spline_init(Vec4s *keyFrames);
|
||||
|
||||
void anim_spline_init(Vec4s * keyFrames);
|
||||
|
||||
s32 anim_spline_poll(Vec3f result);
|
||||
|
||||
|
||||
// From object_helpers.c
|
||||
void linear_mtxf_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v);
|
||||
|
||||
void linear_mtxf_transpose_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v);
|
||||
|
||||
|
||||
|
||||
@@ -8,284 +8,333 @@
|
||||
/**
|
||||
* Iterate through the list of ceilings and find the first ceiling over a given point.
|
||||
*/
|
||||
static struct SM64SurfaceCollisionData *find_ceil_from_list( s32 x, s32 y, s32 z, f32 *pheight) {
|
||||
register struct SM64SurfaceCollisionData *surf;
|
||||
register s32 x1, z1, x2, z2, x3, z3;
|
||||
static struct SM64SurfaceCollisionData *find_ceil_from_list(f32 x, f32 y, f32 z, f32 *pheight)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *ceil = NULL;
|
||||
|
||||
ceil = NULL;
|
||||
|
||||
uint32_t groupCount = loaded_surface_iter_group_count();
|
||||
for( int i = 0; i < groupCount; ++i ) {
|
||||
uint32_t surfCount = loaded_surface_iter_group_size( i );
|
||||
for( int j = 0; j < surfCount; ++j ) {
|
||||
surf = loaded_surface_iter_get_at_index( i, j );
|
||||
|
||||
// libsm64: Weed out surfaces whose triangles are actually line segs. TODO do this at surface load time
|
||||
if( !surf->isValid ) continue;
|
||||
|
||||
// Do the check normally done in add_surface_to_cell
|
||||
if( surf->normal.y >= -0.01f ) continue;
|
||||
|
||||
x1 = surf->vertex1[0];
|
||||
z1 = surf->vertex1[2];
|
||||
z2 = surf->vertex2[2];
|
||||
x2 = surf->vertex2[0];
|
||||
|
||||
// Checking if point is in bounds of the triangle laterally.
|
||||
if ((z1 - z) * (x2 - x1) - (x1 - x) * (z2 - z1) > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Slight optimization by checking these later.
|
||||
x3 = surf->vertex3[0];
|
||||
z3 = surf->vertex3[2];
|
||||
if ((z2 - z) * (x3 - x2) - (x2 - x) * (z3 - z2) > 0) {
|
||||
continue;
|
||||
}
|
||||
if ((z3 - z) * (x1 - x3) - (x3 - x) * (z1 - z3) > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i < groupCount; ++i)
|
||||
{
|
||||
uint32_t surfCount = loaded_surface_iter_group_size(i);
|
||||
for (int j = 0; j < surfCount; ++j)
|
||||
{
|
||||
f32 nx = surf->normal.x;
|
||||
f32 ny = surf->normal.y;
|
||||
f32 nz = surf->normal.z;
|
||||
f32 oo = surf->originOffset;
|
||||
f32 height;
|
||||
register struct SM64SurfaceCollisionData *surf = loaded_surface_iter_get_at_index(i, j);
|
||||
|
||||
// If a wall, ignore it. Likely a remnant, should never occur.
|
||||
if (ny == 0.0f) {
|
||||
continue;
|
||||
}
|
||||
// libsm64: Weed out surfaces whose triangles are actually line segs. TODO do this at surface load time
|
||||
if (!surf->isValid) continue;
|
||||
|
||||
// Find the ceil height at the specific point.
|
||||
height = -(x * nx + nz * z + oo) / ny;
|
||||
// Do the check normally done in add_surface_to_cell
|
||||
if (surf->normal.y >= -0.01f) continue;
|
||||
|
||||
// Checks for ceiling interaction with a 78 unit buffer.
|
||||
//! (Exposed Ceilings) Because any point above a ceiling counts
|
||||
// as interacting with a ceiling, ceilings far below can cause
|
||||
// "invisible walls" that are really just exposed ceilings.
|
||||
if (y - (height - -78.0f) > 0.0f) {
|
||||
continue;
|
||||
}
|
||||
register f32 x1 = surf->vertex1[0];
|
||||
register f32 z1 = surf->vertex1[2];
|
||||
register f32 z2 = surf->vertex2[2];
|
||||
register f32 x2 = surf->vertex2[0];
|
||||
|
||||
if( height < *pheight )
|
||||
// Checking if point is in bounds of the triangle laterally.
|
||||
if ((z1 - z) * (x2 - x1) - (x1 - x) * (z2 - z1) > 0)
|
||||
{
|
||||
*pheight = height;
|
||||
ceil = surf;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Slight optimization by checking these later.
|
||||
register f32 x3 = surf->vertex3[0];
|
||||
register f32 z3 = surf->vertex3[2];
|
||||
if ((z2 - z) * (x3 - x2) - (x2 - x) * (z3 - z2) > 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((z3 - z) * (x1 - x3) - (x3 - x) * (z1 - z3) > 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
f32 nx = surf->normal.x;
|
||||
f32 ny = surf->normal.y;
|
||||
f32 nz = surf->normal.z;
|
||||
f32 oo = surf->originOffset;
|
||||
|
||||
// If a wall, ignore it. Likely a remnant, should never occur.
|
||||
if (ny == 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Find the ceil height at the specific point.
|
||||
f32 height = -(x * nx + nz * z + oo) / ny;
|
||||
|
||||
// Checks for ceiling interaction with a 78 unit buffer.
|
||||
//! (Exposed Ceilings) Because any point above a ceiling counts
|
||||
// as interacting with a ceiling, ceilings far below can cause
|
||||
// "invisible walls" that are really just exposed ceilings.
|
||||
if (y - (height - -78.0f) > 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (height < *pheight)
|
||||
{
|
||||
*pheight = height;
|
||||
ceil = surf;
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
return ceil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through the list of floors and find the first floor under a given point.
|
||||
*/
|
||||
static struct SM64SurfaceCollisionData *find_floor_from_list( s32 x, s32 y, s32 z, f32 *pheight) {
|
||||
register struct SM64SurfaceCollisionData *surf;
|
||||
register s32 x1, z1, x2, z2, x3, z3;
|
||||
f32 nx, ny, nz;
|
||||
f32 oo;
|
||||
f32 height;
|
||||
static struct SM64SurfaceCollisionData *find_floor_from_list(f32 x, f32 y, f32 z, f32 *pheight)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *floor = NULL;
|
||||
|
||||
uint32_t groupCount = loaded_surface_iter_group_count();
|
||||
for( int i = 0; i < groupCount; ++i ) {
|
||||
uint32_t surfCount = loaded_surface_iter_group_size( i );
|
||||
for( int j = 0; j < surfCount; ++j ) {
|
||||
surf = loaded_surface_iter_get_at_index( i, j );
|
||||
|
||||
// libsm64: Weed out surfaces whose triangles are actually line segs. TODO do this at surface load time
|
||||
if( !surf->isValid ) continue;
|
||||
|
||||
// Do the check normally done in add_surface_to_cell
|
||||
if( surf->normal.y <= 0.01f ) continue;
|
||||
|
||||
x1 = surf->vertex1[0];
|
||||
z1 = surf->vertex1[2];
|
||||
x2 = surf->vertex2[0];
|
||||
z2 = surf->vertex2[2];
|
||||
|
||||
// Check that the point is within the triangle bounds.
|
||||
if ((z1 - z) * (x2 - x1) - (x1 - x) * (z2 - z1) < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// To slightly save on computation time, set this later.
|
||||
x3 = surf->vertex3[0];
|
||||
z3 = surf->vertex3[2];
|
||||
|
||||
if ((z2 - z) * (x3 - x2) - (x2 - x) * (z3 - z2) < 0) {
|
||||
continue;
|
||||
}
|
||||
if ((z3 - z) * (x1 - x3) - (x3 - x) * (z1 - z3) < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nx = surf->normal.x;
|
||||
ny = surf->normal.y;
|
||||
nz = surf->normal.z;
|
||||
oo = surf->originOffset;
|
||||
|
||||
// If a wall, ignore it. Likely a remnant, should never occur.
|
||||
if (ny == 0.0f) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Find the height of the floor at a given location.
|
||||
height = -(x * nx + nz * z + oo) / ny;
|
||||
// Checks for floor interaction with a 78 unit buffer.
|
||||
if (y - (height + -78.0f) < 0.0f) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if( height > *pheight )
|
||||
for (int i = 0; i < groupCount; ++i)
|
||||
{
|
||||
uint32_t surfCount = loaded_surface_iter_group_size(i);
|
||||
for (int j = 0; j < surfCount; ++j)
|
||||
{
|
||||
*pheight = height;
|
||||
floor = surf;
|
||||
register struct SM64SurfaceCollisionData *surf = loaded_surface_iter_get_at_index(i, j);
|
||||
|
||||
// libsm64: Weed out surfaces whose triangles are actually line segs. TODO do this at surface load time
|
||||
if (!surf->isValid) continue;
|
||||
|
||||
// Do the check normally done in add_surface_to_cell
|
||||
if (surf->normal.y <= 0.01f) continue;
|
||||
|
||||
register f32 x1 = surf->vertex1[0];
|
||||
register f32 z1 = surf->vertex1[2];
|
||||
register f32 x2 = surf->vertex2[0];
|
||||
register f32 z2 = surf->vertex2[2];
|
||||
|
||||
// Check that the point is within the triangle bounds.
|
||||
if ((z1 - z) * (x2 - x1) - (x1 - x) * (z2 - z1) < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// To slightly save on computation time, set this later.
|
||||
register f32 x3 = surf->vertex3[0];
|
||||
register f32 z3 = surf->vertex3[2];
|
||||
|
||||
if ((z2 - z) * (x3 - x2) - (x2 - x) * (z3 - z2) < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((z3 - z) * (x1 - x3) - (x3 - x) * (z1 - z3) < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
f32 nx = surf->normal.x;
|
||||
f32 ny = surf->normal.y;
|
||||
f32 nz = surf->normal.z;
|
||||
f32 oo = surf->originOffset;
|
||||
|
||||
// If a wall, ignore it. Likely a remnant, should never occur.
|
||||
if (ny == 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Find the height of the floor at a given location.
|
||||
f32 height = -(x * nx + nz * z + oo) / ny;
|
||||
// Checks for floor interaction with a 78 unit buffer.
|
||||
if (y - (height + -78.0f) < 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (height > *pheight)
|
||||
{
|
||||
*pheight = height;
|
||||
floor = surf;
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
return floor;
|
||||
}
|
||||
|
||||
static s32 find_wall_collisions_from_list( struct SM64WallCollisionData *data) {
|
||||
register struct SM64SurfaceCollisionData *surf;
|
||||
register f32 offset;
|
||||
static s32 find_wall_collisions_from_list(struct SM64WallCollisionData *data)
|
||||
{
|
||||
register f32 radius = data->radius;
|
||||
register f32 x = data->x;
|
||||
register f32 y = data->y + data->offsetY;
|
||||
register f32 z = data->z;
|
||||
register f32 px, pz;
|
||||
register f32 w1, w2, w3;
|
||||
register f32 y1, y2, y3;
|
||||
s32 numCols = 0;
|
||||
|
||||
// Max collision radius = 200
|
||||
if (radius > 200.0f) {
|
||||
if (radius > 200.0f)
|
||||
{
|
||||
radius = 200.0f;
|
||||
}
|
||||
|
||||
uint32_t groupCount = loaded_surface_iter_group_count();
|
||||
for( int i = 0; i < groupCount; ++i ) {
|
||||
uint32_t surfCount = loaded_surface_iter_group_size( i );
|
||||
for( int j = 0; j < surfCount; ++j ) {
|
||||
surf = loaded_surface_iter_get_at_index( i, j );
|
||||
for (int i = 0; i < groupCount; ++i)
|
||||
{
|
||||
uint32_t surfCount = loaded_surface_iter_group_size(i);
|
||||
for (int j = 0; j < surfCount; ++j)
|
||||
{
|
||||
register struct SM64SurfaceCollisionData *surf = loaded_surface_iter_get_at_index(i, j);
|
||||
|
||||
// libsm64: Weed out surfaces whose triangles are actually line segs. TODO do this at surface load time
|
||||
if( !surf->isValid ) continue;
|
||||
// libsm64: Weed out surfaces whose triangles are actually line segs. TODO do this at surface load time
|
||||
if (!surf->isValid) continue;
|
||||
|
||||
// Do the check normally done in add_surface_to_cell
|
||||
if( surf->normal.y < -0.01f || surf->normal.y > 0.01f ) continue;
|
||||
// Do the check normally done in add_surface_to_cell
|
||||
if (surf->normal.y < -0.01f || surf->normal.y > 0.01f) continue;
|
||||
|
||||
if( surf->normal.x < -0.707f || surf->normal.x > 0.707f ) {
|
||||
surf->flags |= SURFACE_FLAG_X_PROJECTION;
|
||||
}
|
||||
if (surf->normal.x < -0.707f || surf->normal.x > 0.707f)
|
||||
{
|
||||
surf->flags |= SURFACE_FLAG_X_PROJECTION;
|
||||
}
|
||||
|
||||
// Exclude a large number of walls immediately to optimize.
|
||||
if (y < surf->lowerY || y > surf->upperY) {
|
||||
continue;
|
||||
}
|
||||
// Exclude a large number of walls immediately to optimize.
|
||||
if (y < surf->lowerY || y > surf->upperY)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
offset = surf->normal.x * x + surf->normal.y * y + surf->normal.z * z + surf->originOffset;
|
||||
register f32 offset = surf->normal.x * x + surf->normal.y * y + surf->normal.z * z + surf->originOffset;
|
||||
|
||||
if (offset < -radius || offset > radius) {
|
||||
continue;
|
||||
}
|
||||
if (offset < -radius || offset > radius)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
px = x;
|
||||
pz = z;
|
||||
register f32 px = x;
|
||||
register f32 pz = z;
|
||||
|
||||
//! (Quantum Tunneling) Due to issues with the vertices walls choose and
|
||||
// the fact they are floating point, certain floating point positions
|
||||
// along the seam of two walls may collide with neither wall or both walls.
|
||||
if (surf->flags & SURFACE_FLAG_X_PROJECTION) {
|
||||
w1 = -surf->vertex1[2]; w2 = -surf->vertex2[2]; w3 = -surf->vertex3[2];
|
||||
y1 = surf->vertex1[1]; y2 = surf->vertex2[1]; y3 = surf->vertex3[1];
|
||||
//! (Quantum Tunneling) Due to issues with the vertices walls choose and
|
||||
// the fact they are floating point, certain floating point positions
|
||||
// along the seam of two walls may collide with neither wall or both walls.
|
||||
if (surf->flags & SURFACE_FLAG_X_PROJECTION)
|
||||
{
|
||||
w1 = -surf->vertex1[2];
|
||||
w2 = -surf->vertex2[2];
|
||||
w3 = -surf->vertex3[2];
|
||||
y1 = surf->vertex1[1];
|
||||
y2 = surf->vertex2[1];
|
||||
y3 = surf->vertex3[1];
|
||||
|
||||
if (surf->normal.x > 0.0f) {
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - -pz) * (y2 - y1) > 0.0f) {
|
||||
continue;
|
||||
if (surf->normal.x > 0.0f)
|
||||
{
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - -pz) * (y2 - y1) > 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - -pz) * (y3 - y2) > 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - -pz) * (y1 - y3) > 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - -pz) * (y3 - y2) > 0.0f) {
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - -pz) * (y1 - y3) > 0.0f) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - -pz) * (y2 - y1) < 0.0f) {
|
||||
continue;
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - -pz) * (y3 - y2) < 0.0f) {
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - -pz) * (y1 - y3) < 0.0f) {
|
||||
continue;
|
||||
else
|
||||
{
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - -pz) * (y2 - y1) < 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - -pz) * (y3 - y2) < 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - -pz) * (y1 - y3) < 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
w1 = surf->vertex1[0]; w2 = surf->vertex2[0]; w3 = surf->vertex3[0];
|
||||
y1 = surf->vertex1[1]; y2 = surf->vertex2[1]; y3 = surf->vertex3[1];
|
||||
else
|
||||
{
|
||||
w1 = surf->vertex1[0];
|
||||
w2 = surf->vertex2[0];
|
||||
w3 = surf->vertex3[0];
|
||||
y1 = surf->vertex1[1];
|
||||
y2 = surf->vertex2[1];
|
||||
y3 = surf->vertex3[1];
|
||||
|
||||
if (surf->normal.z > 0.0f) {
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - px) * (y2 - y1) > 0.0f) {
|
||||
continue;
|
||||
if (surf->normal.z > 0.0f)
|
||||
{
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - px) * (y2 - y1) > 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - px) * (y3 - y2) > 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - px) * (y1 - y3) > 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - px) * (y3 - y2) > 0.0f) {
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - px) * (y1 - y3) > 0.0f) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - px) * (y2 - y1) < 0.0f) {
|
||||
continue;
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - px) * (y3 - y2) < 0.0f) {
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - px) * (y1 - y3) < 0.0f) {
|
||||
continue;
|
||||
else
|
||||
{
|
||||
if ((y1 - y) * (w2 - w1) - (w1 - px) * (y2 - y1) < 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y2 - y) * (w3 - w2) - (w2 - px) * (y3 - y2) < 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((y3 - y) * (w1 - w3) - (w3 - px) * (y1 - y3) < 0.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore camera only surfaces.
|
||||
if (surf->type == SURFACE_CAMERA_BOUNDARY) {
|
||||
continue;
|
||||
}
|
||||
// Ignore camera only surfaces.
|
||||
if (surf->type == SURFACE_CAMERA_BOUNDARY)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// If an object can pass through a vanish cap wall, pass through.
|
||||
if (surf->type == SURFACE_VANISH_CAP_WALLS) {
|
||||
// If an object can pass through a vanish cap wall, pass through.
|
||||
if (gCurrentObject != NULL
|
||||
&& (gCurrentObject->activeFlags & ACTIVE_FLAG_MOVE_THROUGH_GRATE)) {
|
||||
continue;
|
||||
if (surf->type == SURFACE_VANISH_CAP_WALLS)
|
||||
{
|
||||
// If an object can pass through a vanish cap wall, pass through.
|
||||
if (gCurrentObject != NULL
|
||||
&& gCurrentObject->activeFlags & ACTIVE_FLAG_MOVE_THROUGH_GRATE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// If Mario has a vanish cap, pass through the vanish cap wall.
|
||||
if (gCurrentObject != NULL && gCurrentObject == gMarioObject
|
||||
&& gMarioState->flags & MARIO_VANISH_CAP)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// If Mario has a vanish cap, pass through the vanish cap wall.
|
||||
if (gCurrentObject != NULL && gCurrentObject == gMarioObject
|
||||
&& (gMarioState->flags & MARIO_VANISH_CAP)) {
|
||||
continue;
|
||||
//! (Wall Overlaps) Because this doesn't update the x and z local variables,
|
||||
// multiple walls can push mario more than is required.
|
||||
data->x += surf->normal.x * (radius - offset);
|
||||
data->z += surf->normal.z * (radius - offset);
|
||||
|
||||
//! (Unreferenced Walls) Since this only returns the first four walls,
|
||||
// this can lead to wall interaction being missed. Typically unreferenced walls
|
||||
// come from only using one wall, however.
|
||||
if (data->numWalls < 4)
|
||||
{
|
||||
data->walls[data->numWalls++] = surf;
|
||||
}
|
||||
|
||||
numCols++;
|
||||
}
|
||||
|
||||
//! (Wall Overlaps) Because this doesn't update the x and z local variables,
|
||||
// multiple walls can push mario more than is required.
|
||||
data->x += surf->normal.x * (radius - offset);
|
||||
data->z += surf->normal.z * (radius - offset);
|
||||
|
||||
//! (Unreferenced Walls) Since this only returns the first four walls,
|
||||
// this can lead to wall interaction being missed. Typically unreferenced walls
|
||||
// come from only using one wall, however.
|
||||
if (data->numWalls < 4) {
|
||||
data->walls[data->numWalls++] = surf;
|
||||
}
|
||||
|
||||
numCols++;
|
||||
}}
|
||||
}
|
||||
|
||||
return numCols;
|
||||
}
|
||||
@@ -335,8 +384,8 @@ s32 find_wall_collisions(struct SM64WallCollisionData *colData)
|
||||
f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct SM64SurfaceCollisionData **pceil)
|
||||
{
|
||||
f32 height = CELL_HEIGHT_LIMIT;
|
||||
*pceil = find_ceil_from_list( posX, posY, posZ, &height );
|
||||
return height;
|
||||
*pceil = find_ceil_from_list(posX, posY, posZ, &height);
|
||||
return height;
|
||||
}
|
||||
|
||||
struct SM64FloorCollisionData sFloorGeo;
|
||||
@@ -348,7 +397,8 @@ f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct SM64FloorCol
|
||||
|
||||
*floorGeo = NULL;
|
||||
|
||||
if (floor != NULL) {
|
||||
if (floor != NULL)
|
||||
{
|
||||
sFloorGeo.normalX = floor->normal.x;
|
||||
sFloorGeo.normalY = floor->normal.y;
|
||||
sFloorGeo.normalZ = floor->normal.z;
|
||||
@@ -362,23 +412,23 @@ f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct SM64FloorCol
|
||||
f32 find_floor_height(f32 x, f32 y, f32 z)
|
||||
{
|
||||
f32 height = FLOOR_LOWER_LIMIT;
|
||||
find_floor_from_list( x, y, z, &height );
|
||||
return height;
|
||||
find_floor_from_list(x, y, z, &height);
|
||||
return height;
|
||||
}
|
||||
|
||||
f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct SM64SurfaceCollisionData **pfloor)
|
||||
{
|
||||
f32 height = FLOOR_LOWER_LIMIT;
|
||||
*pfloor = find_floor_from_list( xPos, yPos, zPos, &height );
|
||||
return height;
|
||||
*pfloor = find_floor_from_list(xPos, yPos, zPos, &height);
|
||||
return height;
|
||||
}
|
||||
|
||||
f32 find_water_level(f32 x, f32 z)
|
||||
{
|
||||
return -10000.0f;
|
||||
return -10000.0f;
|
||||
}
|
||||
|
||||
f32 find_poison_gas_level(f32 x, f32 z)
|
||||
{
|
||||
return -10000.0f;
|
||||
return -10000.0f;
|
||||
}
|
||||
|
||||
@@ -13,12 +13,19 @@
|
||||
#define FLOOR_LOWER_LIMIT -110000.f
|
||||
|
||||
s32 f32_find_wall_collision(f32 *xPtr, f32 *yPtr, f32 *zPtr, f32 offsetY, f32 radius);
|
||||
|
||||
s32 find_wall_collisions(struct SM64WallCollisionData *colData);
|
||||
|
||||
f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct SM64SurfaceCollisionData **pceil);
|
||||
|
||||
f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct SM64FloorCollisionData **floorGeo);
|
||||
|
||||
f32 find_floor_height(f32 x, f32 y, f32 z);
|
||||
|
||||
f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct SM64SurfaceCollisionData **pfloor);
|
||||
|
||||
f32 find_water_level(f32 x, f32 z);
|
||||
|
||||
f32 find_poison_gas_level(f32 x, f32 z);
|
||||
|
||||
#endif // SURFACE_COLLISION_H
|
||||
|
||||
+113
-57
@@ -9,17 +9,24 @@
|
||||
|
||||
struct WarpNode
|
||||
{
|
||||
/*00*/ u8 id;
|
||||
/*01*/ u8 destLevel;
|
||||
/*02*/ u8 destArea;
|
||||
/*03*/ u8 destNode;
|
||||
/*00*/
|
||||
u8 id;
|
||||
/*01*/
|
||||
u8 destLevel;
|
||||
/*02*/
|
||||
u8 destArea;
|
||||
/*03*/
|
||||
u8 destNode;
|
||||
};
|
||||
|
||||
struct ObjectWarpNode
|
||||
{
|
||||
/*0x00*/ struct WarpNode node;
|
||||
/*0x04*/ struct Object *object;
|
||||
/*0x08*/ struct ObjectWarpNode *next;
|
||||
/*0x00*/
|
||||
struct WarpNode node;
|
||||
/*0x04*/
|
||||
struct Object *object;
|
||||
/*0x08*/
|
||||
struct ObjectWarpNode *next;
|
||||
};
|
||||
|
||||
// From Surface 0x1B to 0x1E
|
||||
@@ -28,74 +35,118 @@ struct ObjectWarpNode
|
||||
|
||||
struct InstantWarp
|
||||
{
|
||||
/*0x00*/ u8 id; // 0 = 0x1B / 1 = 0x1C / 2 = 0x1D / 3 = 0x1E
|
||||
/*0x01*/ u8 area;
|
||||
/*0x02*/ Vec3s displacement;
|
||||
/*0x00*/
|
||||
u8 id; // 0 = 0x1B / 1 = 0x1C / 2 = 0x1D / 3 = 0x1E
|
||||
/*0x01*/
|
||||
u8 area;
|
||||
/*0x02*/
|
||||
Vec3s displacement;
|
||||
};
|
||||
|
||||
struct SpawnInfo
|
||||
{
|
||||
/*0x00*/ Vec3f startPos;
|
||||
/*0x06*/ Vec3s startAngle;
|
||||
/*0x0C*/ s8 areaIndex;
|
||||
/*0x0D*/ s8 activeAreaIndex;
|
||||
/*0x10*/ u32 behaviorArg;
|
||||
/*0x14*/ void *behaviorScript;
|
||||
/*0x18*/ struct GraphNode *unk18;
|
||||
/*0x1C*/ struct SpawnInfo *next;
|
||||
/*0x00*/
|
||||
Vec3f startPos;
|
||||
/*0x06*/
|
||||
Vec3s startAngle;
|
||||
/*0x0C*/
|
||||
s8 areaIndex;
|
||||
/*0x0D*/
|
||||
s8 activeAreaIndex;
|
||||
/*0x10*/
|
||||
u32 behaviorArg;
|
||||
/*0x14*/
|
||||
void *behaviorScript;
|
||||
/*0x18*/
|
||||
struct GraphNode *unk18;
|
||||
/*0x1C*/
|
||||
struct SpawnInfo *next;
|
||||
};
|
||||
|
||||
struct UnusedArea28
|
||||
{
|
||||
/*0x00*/ s16 unk00;
|
||||
/*0x02*/ s16 unk02;
|
||||
/*0x04*/ s16 unk04;
|
||||
/*0x06*/ s16 unk06;
|
||||
/*0x08*/ s16 unk08;
|
||||
/*0x00*/
|
||||
s16 unk00;
|
||||
/*0x02*/
|
||||
s16 unk02;
|
||||
/*0x04*/
|
||||
s16 unk04;
|
||||
/*0x06*/
|
||||
s16 unk06;
|
||||
/*0x08*/
|
||||
s16 unk08;
|
||||
};
|
||||
|
||||
struct Whirlpool
|
||||
{
|
||||
/*0x00*/ Vec3s pos;
|
||||
/*0x03*/ s16 strength;
|
||||
/*0x00*/
|
||||
Vec3s pos;
|
||||
/*0x03*/
|
||||
s16 strength;
|
||||
};
|
||||
|
||||
struct Area
|
||||
{
|
||||
/*0x00*/ s8 index;
|
||||
/*0x01*/ s8 flags; // Only has 1 flag: 0x01 = Is this the active area?
|
||||
// /*0x02*/ u16 terrainType; // default terrain of the level (set from level script cmd 0x31) ; in libsm64 terrain is defined in the Surface struct
|
||||
/*0x04*/ struct GraphNodeRoot *unk04; // geometry layout data
|
||||
/*0x08*/ s16 *terrainData; // collision data (set from level script cmd 0x2E)
|
||||
/*0x0C*/ s8 *surfaceRooms; // (set from level script cmd 0x2F)
|
||||
/*0x10*/ s16 *macroObjects; // Macro Objects Ptr (set from level script cmd 0x39)
|
||||
/*0x14*/ struct ObjectWarpNode *warpNodes;
|
||||
/*0x18*/ struct WarpNode *paintingWarpNodes;
|
||||
/*0x1C*/ struct InstantWarp *instantWarps;
|
||||
/*0x20*/ struct SpawnInfo *objectSpawnInfos;
|
||||
/*0x24*/ struct Camera *camera;
|
||||
/*0x28*/ struct UnusedArea28 *unused28; // Filled by level script 0x3A, but is unused.
|
||||
/*0x2C*/ struct Whirlpool *whirlpools[2];
|
||||
/*0x34*/ u8 dialog[2]; // Level start dialog number (set by level script cmd 0x30)
|
||||
/*0x36*/ u16 musicParam;
|
||||
/*0x38*/ u16 musicParam2;
|
||||
/*0x00*/
|
||||
s8 index;
|
||||
/*0x01*/
|
||||
s8 flags; // Only has 1 flag: 0x01 = Is this the active area?
|
||||
// /*0x02*/ u16 terrainType; // default terrain of the level (set from level script cmd 0x31) ; in libsm64 terrain is defined in the Surface struct
|
||||
/*0x04*/
|
||||
struct GraphNodeRoot *unk04; // geometry layout data
|
||||
/*0x08*/
|
||||
s16 *terrainData; // collision data (set from level script cmd 0x2E)
|
||||
/*0x0C*/
|
||||
s8 *surfaceRooms; // (set from level script cmd 0x2F)
|
||||
/*0x10*/
|
||||
s16 *macroObjects; // Macro Objects Ptr (set from level script cmd 0x39)
|
||||
/*0x14*/
|
||||
struct ObjectWarpNode *warpNodes;
|
||||
/*0x18*/
|
||||
struct WarpNode *paintingWarpNodes;
|
||||
/*0x1C*/
|
||||
struct InstantWarp *instantWarps;
|
||||
/*0x20*/
|
||||
struct SpawnInfo *objectSpawnInfos;
|
||||
/*0x24*/
|
||||
struct Camera *camera;
|
||||
/*0x28*/
|
||||
struct UnusedArea28 *unused28; // Filled by level script 0x3A, but is unused.
|
||||
/*0x2C*/
|
||||
struct Whirlpool *whirlpools[2];
|
||||
/*0x34*/
|
||||
u8 dialog[2]; // Level start dialog number (set by level script cmd 0x30)
|
||||
/*0x36*/
|
||||
u16 musicParam;
|
||||
/*0x38*/
|
||||
u16 musicParam2;
|
||||
};
|
||||
|
||||
// All the transition data to be used in screen_transition.c
|
||||
struct WarpTransitionData
|
||||
{
|
||||
/*0x00*/ u8 red;
|
||||
/*0x01*/ u8 green;
|
||||
/*0x02*/ u8 blue;
|
||||
/*0x00*/
|
||||
u8 red;
|
||||
/*0x01*/
|
||||
u8 green;
|
||||
/*0x02*/
|
||||
u8 blue;
|
||||
|
||||
/*0x04*/ s16 startTexRadius;
|
||||
/*0x06*/ s16 endTexRadius;
|
||||
/*0x08*/ s16 startTexX;
|
||||
/*0x0A*/ s16 startTexY;
|
||||
/*0x0C*/ s16 endTexX;
|
||||
/*0x0E*/ s16 endTexY;
|
||||
/*0x04*/
|
||||
s16 startTexRadius;
|
||||
/*0x06*/
|
||||
s16 endTexRadius;
|
||||
/*0x08*/
|
||||
s16 startTexX;
|
||||
/*0x0A*/
|
||||
s16 startTexY;
|
||||
/*0x0C*/
|
||||
s16 endTexX;
|
||||
/*0x0E*/
|
||||
s16 endTexY;
|
||||
|
||||
/*0x10*/ s16 texTimer; // always 0, does seems to affect transition when disabled
|
||||
/*0x10*/
|
||||
s16 texTimer; // always 0, does seems to affect transition when disabled
|
||||
};
|
||||
|
||||
#define WARP_TRANSITION_FADE_FROM_COLOR 0x00
|
||||
@@ -111,11 +162,16 @@ struct WarpTransitionData
|
||||
|
||||
struct WarpTransition
|
||||
{
|
||||
/*0x00*/ u8 isActive; // Is the transition active. (either TRUE or FALSE)
|
||||
/*0x01*/ u8 type; // Determines the type of transition to use (circle, star, etc.)
|
||||
/*0x02*/ u8 time; // Amount of time to complete the transition (in frames)
|
||||
/*0x03*/ u8 pauseRendering; // Should the game stop rendering. (either TRUE or FALSE)
|
||||
/*0x04*/ struct WarpTransitionData data;
|
||||
/*0x00*/
|
||||
u8 isActive; // Is the transition active. (either TRUE or FALSE)
|
||||
/*0x01*/
|
||||
u8 type; // Determines the type of transition to use (circle, star, etc.)
|
||||
/*0x02*/
|
||||
u8 time; // Amount of time to complete the transition (in frames)
|
||||
/*0x03*/
|
||||
u8 pauseRendering; // Should the game stop rendering. (either TRUE or FALSE)
|
||||
/*0x04*/
|
||||
struct WarpTransitionData data;
|
||||
};
|
||||
|
||||
// extern struct GraphNode **gLoadedGraphNodes;
|
||||
|
||||
@@ -4,13 +4,15 @@
|
||||
#include "../shim.h"
|
||||
|
||||
// not sure what this is doing here. not in a behavior file.
|
||||
Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
|
||||
Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx)
|
||||
{
|
||||
Mat4 sp20;
|
||||
struct Object *sp1C;
|
||||
|
||||
if (run == TRUE) {
|
||||
sp1C = (struct Object *) gCurGraphNodeObject;
|
||||
if (sp1C == gMarioObject && sp1C->prevObj != NULL) {
|
||||
if (run == TRUE)
|
||||
{
|
||||
struct Object *sp1C = (struct Object *)gCurGraphNodeObject;
|
||||
if (sp1C == gMarioObject && sp1C->prevObj != NULL)
|
||||
{
|
||||
create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr);
|
||||
obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
|
||||
obj_set_gfx_pos_from_pos(sp1C->prevObj);
|
||||
|
||||
+193
-97
@@ -32,7 +32,7 @@
|
||||
* Because a mask is used by two levels, the pattern will repeat when more than 4 areas are used by a level.
|
||||
*/
|
||||
#define ZOOMOUT_AREA_MASK(level1Area1, level1Area2, level1Area3, level1Area4, \
|
||||
level2Area1, level2Area2, level2Area3, level2Area4) \
|
||||
level2Area1, level2Area2, level2Area3, level2Area4) \
|
||||
((level2Area4) << 7 | \
|
||||
(level2Area3) << 6 | \
|
||||
(level2Area2) << 5 | \
|
||||
@@ -300,17 +300,24 @@ struct PlayerCameraState
|
||||
/**
|
||||
* Mario's action on this frame.
|
||||
*/
|
||||
/*0x00*/ u32 action;
|
||||
/*0x04*/ Vec3f pos;
|
||||
/*0x10*/ Vec3s faceAngle;
|
||||
/*0x16*/ Vec3s headRotation;
|
||||
/*0x1C*/ s16 unused;
|
||||
/*0x00*/
|
||||
u32 action;
|
||||
/*0x04*/
|
||||
Vec3f pos;
|
||||
/*0x10*/
|
||||
Vec3s faceAngle;
|
||||
/*0x16*/
|
||||
Vec3s headRotation;
|
||||
/*0x1C*/
|
||||
s16 unused;
|
||||
/**
|
||||
* Set to nonzero when an event, such as entering a door, starting the credits, or throwing bowser,
|
||||
* has happened on this frame.
|
||||
*/
|
||||
/*0x1E*/ s16 cameraEvent;
|
||||
/*0x20*/ struct Object *usedObj;
|
||||
/*0x1E*/
|
||||
s16 cameraEvent;
|
||||
/*0x20*/
|
||||
struct Object *usedObj;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -319,15 +326,24 @@ struct PlayerCameraState
|
||||
*/
|
||||
struct TransitionInfo
|
||||
{
|
||||
/*0x00*/ s16 posPitch;
|
||||
/*0x02*/ s16 posYaw;
|
||||
/*0x04*/ f32 posDist;
|
||||
/*0x08*/ s16 focPitch;
|
||||
/*0x0A*/ s16 focYaw;
|
||||
/*0x0C*/ f32 focDist;
|
||||
/*0x10*/ s32 framesLeft;
|
||||
/*0x14*/ Vec3f marioPos;
|
||||
/*0x20*/ u8 pad; // for the structs to align, there has to be an extra unused variable here. type is unknown.
|
||||
/*0x00*/
|
||||
s16 posPitch;
|
||||
/*0x02*/
|
||||
s16 posYaw;
|
||||
/*0x04*/
|
||||
f32 posDist;
|
||||
/*0x08*/
|
||||
s16 focPitch;
|
||||
/*0x0A*/
|
||||
s16 focYaw;
|
||||
/*0x0C*/
|
||||
f32 focDist;
|
||||
/*0x10*/
|
||||
s32 framesLeft;
|
||||
/*0x14*/
|
||||
Vec3f marioPos;
|
||||
/*0x20*/
|
||||
u8 pad; // for the structs to align, there has to be an extra unused variable here. type is unknown.
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -336,9 +352,12 @@ struct TransitionInfo
|
||||
*/
|
||||
struct HandheldShakePoint
|
||||
{
|
||||
/*0x00*/ s8 index; // only set to -1
|
||||
/*0x04 (aligned)*/ u32 pad;
|
||||
/*0x08*/ Vec3s point;
|
||||
/*0x00*/
|
||||
s8 index; // only set to -1
|
||||
/*0x04 (aligned)*/
|
||||
u32 pad;
|
||||
/*0x08*/
|
||||
Vec3s point;
|
||||
}; // size = 0x10
|
||||
|
||||
struct Camera;
|
||||
@@ -347,7 +366,8 @@ struct Camera;
|
||||
* A function that is called by CameraTriggers and cutscene shots.
|
||||
* These are concurrent: multiple CameraEvents can occur on the same frame.
|
||||
*/
|
||||
typedef BAD_RETURN(s32) (*CameraEvent)(struct Camera *c);
|
||||
typedef BAD_RETURN (s32)(*CameraEvent)(struct Camera *c);
|
||||
|
||||
/**
|
||||
* The same type as a CameraEvent, but because these are generally longer, and happen in sequential
|
||||
* order, they're are called "shots," a term taken from cinematography.
|
||||
@@ -403,24 +423,32 @@ struct Cutscene
|
||||
struct CameraFOVStatus
|
||||
{
|
||||
/// The current function being used to set the camera's field of view (before any fov shake is applied).
|
||||
/*0x00*/ u8 fovFunc;
|
||||
/*0x00*/
|
||||
u8 fovFunc;
|
||||
/// The current field of view in degrees
|
||||
/*0x04*/ f32 fov;
|
||||
/*0x04*/
|
||||
f32 fov;
|
||||
|
||||
// Fields used by shake_camera_fov()
|
||||
|
||||
/// The amount to change the current fov by in the fov shake effect.
|
||||
/*0x08*/ f32 fovOffset;
|
||||
/*0x08*/
|
||||
f32 fovOffset;
|
||||
/// A bool set in fov_default() but unused otherwise
|
||||
/*0x0C*/ u32 unusedIsSleeping;
|
||||
/*0x0C*/
|
||||
u32 unusedIsSleeping;
|
||||
/// The range in degrees to shake fov
|
||||
/*0x10*/ f32 shakeAmplitude;
|
||||
/*0x10*/
|
||||
f32 shakeAmplitude;
|
||||
/// Used to calculate fovOffset, the phase through the shake's period.
|
||||
/*0x14*/ s16 shakePhase;
|
||||
/*0x14*/
|
||||
s16 shakePhase;
|
||||
/// How much to progress through the shake period
|
||||
/*0x16*/ s16 shakeSpeed;
|
||||
/*0x16*/
|
||||
s16 shakeSpeed;
|
||||
/// How much to decrease shakeAmplitude each frame.
|
||||
/*0x18*/ s16 decay;
|
||||
/*0x18*/
|
||||
s16 decay;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -443,20 +471,33 @@ struct CutsceneSplinePoint
|
||||
*/
|
||||
struct PlayerGeometry
|
||||
{
|
||||
/*0x00*/ struct SM64SurfaceCollisionData *currFloor;
|
||||
/*0x04*/ f32 currFloorHeight;
|
||||
/*0x08*/ s16 currFloorType;
|
||||
/*0x0C*/ struct SM64SurfaceCollisionData *currCeil;
|
||||
/*0x10*/ s16 currCeilType;
|
||||
/*0x14*/ f32 currCeilHeight;
|
||||
/*0x18*/ struct SM64SurfaceCollisionData *prevFloor;
|
||||
/*0x1C*/ f32 prevFloorHeight;
|
||||
/*0x20*/ s16 prevFloorType;
|
||||
/*0x24*/ struct SM64SurfaceCollisionData *prevCeil;
|
||||
/*0x28*/ f32 prevCeilHeight;
|
||||
/*0x2C*/ s16 prevCeilType;
|
||||
/*0x00*/
|
||||
struct SM64SurfaceCollisionData *currFloor;
|
||||
/*0x04*/
|
||||
f32 currFloorHeight;
|
||||
/*0x08*/
|
||||
s16 currFloorType;
|
||||
/*0x0C*/
|
||||
struct SM64SurfaceCollisionData *currCeil;
|
||||
/*0x10*/
|
||||
s16 currCeilType;
|
||||
/*0x14*/
|
||||
f32 currCeilHeight;
|
||||
/*0x18*/
|
||||
struct SM64SurfaceCollisionData *prevFloor;
|
||||
/*0x1C*/
|
||||
f32 prevFloorHeight;
|
||||
/*0x20*/
|
||||
s16 prevFloorType;
|
||||
/*0x24*/
|
||||
struct SM64SurfaceCollisionData *prevCeil;
|
||||
/*0x28*/
|
||||
f32 prevCeilHeight;
|
||||
/*0x2C*/
|
||||
s16 prevCeilType;
|
||||
/// Unused, but recalculated every frame
|
||||
/*0x30*/ f32 waterHeight;
|
||||
/*0x30*/
|
||||
f32 waterHeight;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -504,10 +545,14 @@ struct ParallelTrackingPoint
|
||||
*/
|
||||
struct CameraStoredInfo
|
||||
{
|
||||
/*0x00*/ Vec3f pos;
|
||||
/*0x0C*/ Vec3f focus;
|
||||
/*0x18*/ f32 panDist;
|
||||
/*0x1C*/ f32 cannonYOffset;
|
||||
/*0x00*/
|
||||
Vec3f pos;
|
||||
/*0x0C*/
|
||||
Vec3f focus;
|
||||
/*0x18*/
|
||||
f32 panDist;
|
||||
/*0x1C*/
|
||||
f32 cannonYOffset;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -533,8 +578,10 @@ struct CutsceneVariable
|
||||
*/
|
||||
struct Camera
|
||||
{
|
||||
/*0x00*/ u8 mode; // What type of mode the camera uses (see defines above)
|
||||
/*0x01*/ u8 defMode;
|
||||
/*0x00*/
|
||||
u8 mode; // What type of mode the camera uses (see defines above)
|
||||
/*0x01*/
|
||||
u8 defMode;
|
||||
/**
|
||||
* Determines what direction Mario moves in when the analog stick is moved.
|
||||
*
|
||||
@@ -543,24 +590,36 @@ struct Camera
|
||||
* be. It's effectively the opposite of the camera's actual yaw. Use
|
||||
* vec3f_get_dist_and_angle() if you need the camera's yaw.
|
||||
*/
|
||||
/*0x02*/ s16 yaw;
|
||||
/*0x04*/ Vec3f focus;
|
||||
/*0x10*/ Vec3f pos;
|
||||
/*0x1C*/ Vec3f unusedVec1;
|
||||
/*0x02*/
|
||||
s16 yaw;
|
||||
/*0x04*/
|
||||
Vec3f focus;
|
||||
/*0x10*/
|
||||
Vec3f pos;
|
||||
/*0x1C*/
|
||||
Vec3f unusedVec1;
|
||||
/// The x coordinate of the "center" of the area. The camera will rotate around this point.
|
||||
/// For example, this is what makes the camera rotate around the hill in BoB
|
||||
/*0x28*/ f32 areaCenX;
|
||||
/*0x28*/
|
||||
f32 areaCenX;
|
||||
/// The z coordinate of the "center" of the area. The camera will rotate around this point.
|
||||
/// For example, this is what makes the camera rotate around the hill in BoB
|
||||
/*0x2C*/ f32 areaCenZ;
|
||||
/*0x30*/ u8 cutscene;
|
||||
/*0x31*/ u8 filler31[0x8];
|
||||
/*0x3A*/ s16 nextYaw;
|
||||
/*0x3C*/ u8 filler3C[0x28];
|
||||
/*0x64*/ u8 doorStatus;
|
||||
/*0x2C*/
|
||||
f32 areaCenZ;
|
||||
/*0x30*/
|
||||
u8 cutscene;
|
||||
/*0x31*/
|
||||
u8 filler31[0x8];
|
||||
/*0x3A*/
|
||||
s16 nextYaw;
|
||||
/*0x3C*/
|
||||
u8 filler3C[0x28];
|
||||
/*0x64*/
|
||||
u8 doorStatus;
|
||||
/// The y coordinate of the "center" of the area. Unlike areaCenX and areaCenZ, this is only used
|
||||
/// when paused. See zoom_out_if_paused_and_outside
|
||||
/*0x68*/ f32 areaCenY;
|
||||
/*0x68*/
|
||||
f32 areaCenY;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -576,85 +635,122 @@ struct LakituState
|
||||
/**
|
||||
* Lakitu's position, which (when CAM_FLAG_SMOOTH_MOVEMENT is set), approaches his goalPos every frame.
|
||||
*/
|
||||
/*0x00*/ Vec3f curFocus;
|
||||
/*0x00*/
|
||||
Vec3f curFocus;
|
||||
/**
|
||||
* Lakitu's focus, which (when CAM_FLAG_SMOOTH_MOVEMENT is set), approaches his goalFocus every frame.
|
||||
*/
|
||||
/*0x0C*/ Vec3f curPos;
|
||||
/*0x0C*/
|
||||
Vec3f curPos;
|
||||
/**
|
||||
* The focus point that lakitu turns towards every frame.
|
||||
* If CAM_FLAG_SMOOTH_MOVEMENT is unset, this is the same as curFocus.
|
||||
*/
|
||||
/*0x18*/ Vec3f goalFocus;
|
||||
/*0x18*/
|
||||
Vec3f goalFocus;
|
||||
/**
|
||||
* The point that lakitu flies towards every frame.
|
||||
* If CAM_FLAG_SMOOTH_MOVEMENT is unset, this is the same as curPos.
|
||||
*/
|
||||
/*0x24*/ Vec3f goalPos;
|
||||
/*0x24*/
|
||||
Vec3f goalPos;
|
||||
|
||||
/*0x30*/ u8 filler30[12]; // extra unused Vec3f?
|
||||
/*0x30*/
|
||||
u8 filler30[12]; // extra unused Vec3f?
|
||||
|
||||
/// Copy of the active camera mode
|
||||
/*0x3C*/ u8 mode;
|
||||
/*0x3C*/
|
||||
u8 mode;
|
||||
/// Copy of the default camera mode
|
||||
/*0x3D*/ u8 defMode;
|
||||
/*0x3D*/
|
||||
u8 defMode;
|
||||
|
||||
/*0x3E*/ u8 filler3E[10];
|
||||
/*0x3E*/
|
||||
u8 filler3E[10];
|
||||
|
||||
/*0x48*/ f32 focusDistance; // unused
|
||||
/*0x4C*/ s16 oldPitch; // unused
|
||||
/*0x4E*/ s16 oldYaw; // unused
|
||||
/*0x50*/ s16 oldRoll; // unused
|
||||
/*0x48*/
|
||||
f32 focusDistance; // unused
|
||||
/*0x4C*/
|
||||
s16 oldPitch; // unused
|
||||
/*0x4E*/
|
||||
s16 oldYaw; // unused
|
||||
/*0x50*/
|
||||
s16 oldRoll; // unused
|
||||
|
||||
/// The angular offsets added to lakitu's pitch, yaw, and roll
|
||||
/*0x52*/ Vec3s shakeMagnitude;
|
||||
/*0x52*/
|
||||
Vec3s shakeMagnitude;
|
||||
|
||||
// shake pitch, yaw, and roll phase: The progression through the camera shake (a cosine wave).
|
||||
// shake pitch, yaw, and roll vel: The speed of the camera shake.
|
||||
// shake pitch, yaw, and roll decay: The shake's deceleration.
|
||||
/*0x58*/ s16 shakePitchPhase;
|
||||
/*0x5A*/ s16 shakePitchVel;
|
||||
/*0x5C*/ s16 shakePitchDecay;
|
||||
/*0x58*/
|
||||
s16 shakePitchPhase;
|
||||
/*0x5A*/
|
||||
s16 shakePitchVel;
|
||||
/*0x5C*/
|
||||
s16 shakePitchDecay;
|
||||
|
||||
/*0x60*/ Vec3f unusedVec1;
|
||||
/*0x6C*/ Vec3s unusedVec2;
|
||||
/*0x72*/ u8 filler72[8];
|
||||
/*0x60*/
|
||||
Vec3f unusedVec1;
|
||||
/*0x6C*/
|
||||
Vec3s unusedVec2;
|
||||
/*0x72*/
|
||||
u8 filler72[8];
|
||||
|
||||
/// Used to rotate the screen when rendering.
|
||||
/*0x7A*/ s16 roll;
|
||||
/*0x7A*/
|
||||
s16 roll;
|
||||
/// Copy of the camera's yaw.
|
||||
/*0x7C*/ s16 yaw;
|
||||
/*0x7C*/
|
||||
s16 yaw;
|
||||
/// Copy of the camera's next yaw.
|
||||
/*0x7E*/ s16 nextYaw;
|
||||
/*0x7E*/
|
||||
s16 nextYaw;
|
||||
/// The actual focus point the game uses to render.
|
||||
/*0x80*/ Vec3f focus;
|
||||
/*0x80*/
|
||||
Vec3f focus;
|
||||
/// The actual position the game is rendered from.
|
||||
/*0x8C*/ Vec3f pos;
|
||||
/*0x8C*/
|
||||
Vec3f pos;
|
||||
|
||||
// Shake variables: See above description
|
||||
/*0x98*/ s16 shakeRollPhase;
|
||||
/*0x9A*/ s16 shakeRollVel;
|
||||
/*0x9C*/ s16 shakeRollDecay;
|
||||
/*0x9E*/ s16 shakeYawPhase;
|
||||
/*0xA0*/ s16 shakeYawVel;
|
||||
/*0xA2*/ s16 shakeYawDecay;
|
||||
/*0x98*/
|
||||
s16 shakeRollPhase;
|
||||
/*0x9A*/
|
||||
s16 shakeRollVel;
|
||||
/*0x9C*/
|
||||
s16 shakeRollDecay;
|
||||
/*0x9E*/
|
||||
s16 shakeYawPhase;
|
||||
/*0xA0*/
|
||||
s16 shakeYawVel;
|
||||
/*0xA2*/
|
||||
s16 shakeYawDecay;
|
||||
|
||||
// focH,Vspeed: how fast lakitu turns towards his goalFocus.
|
||||
/// By default HSpeed is 0.8, so lakitu turns 80% of the horz distance to his goal each frame.
|
||||
/*0xA4*/ f32 focHSpeed;
|
||||
/*0xA4*/
|
||||
f32 focHSpeed;
|
||||
/// By default VSpeed is 0.3, so lakitu turns 30% of the vert distance to his goal each frame.
|
||||
/*0xA8*/ f32 focVSpeed;
|
||||
/*0xA8*/
|
||||
f32 focVSpeed;
|
||||
|
||||
// posH,Vspeed: How fast lakitu flies towards his goalPos.
|
||||
/// By default they are 0.3, so lakitu will fly 30% of the way towards his goal each frame.
|
||||
/*0xAC*/ f32 posHSpeed;
|
||||
/*0xB0*/ f32 posVSpeed;
|
||||
/*0xAC*/
|
||||
f32 posHSpeed;
|
||||
/*0xB0*/
|
||||
f32 posVSpeed;
|
||||
|
||||
/// The roll offset applied during part of the key dance cutscene
|
||||
/*0xB4*/ s16 keyDanceRoll;
|
||||
/*0xB4*/
|
||||
s16 keyDanceRoll;
|
||||
/// Mario's action from the previous frame. Only used to determine if Mario just finished a dive.
|
||||
/*0xB8*/ u32 lastFrameAction;
|
||||
/*0xBC*/ s16 unused;
|
||||
/*0xB8*/
|
||||
u32 lastFrameAction;
|
||||
/*0xBC*/
|
||||
s16 unused;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+493
-281
File diff suppressed because it is too large
Load Diff
@@ -99,19 +99,33 @@
|
||||
|
||||
|
||||
s16 mario_obj_angle_to_object(struct MarioState *m, struct Object *o);
|
||||
|
||||
void mario_stop_riding_object(struct MarioState *m);
|
||||
|
||||
void mario_grab_used_object(struct MarioState *m);
|
||||
|
||||
void mario_drop_held_object(struct MarioState *m);
|
||||
|
||||
void mario_throw_held_object(struct MarioState *m);
|
||||
|
||||
void mario_stop_riding_and_holding(struct MarioState *m);
|
||||
|
||||
u32 does_mario_have_normal_cap_on_head(struct MarioState *m);
|
||||
|
||||
void mario_blow_off_cap(struct MarioState *m, f32 capSpeed);
|
||||
|
||||
u32 mario_lose_cap_to_enemy(u32 arg);
|
||||
|
||||
void mario_retrieve_cap(void);
|
||||
|
||||
struct Object *mario_get_collided_object(struct MarioState *m, u32 interactType);
|
||||
|
||||
u32 mario_check_object_grab(struct MarioState *m);
|
||||
|
||||
u32 get_door_save_file_flag(struct Object *door);
|
||||
|
||||
void mario_process_interactions(struct MarioState *m);
|
||||
|
||||
void mario_handle_special_floors(struct MarioState *m);
|
||||
|
||||
#endif // INTERACTION_H
|
||||
|
||||
@@ -89,20 +89,29 @@
|
||||
// extern u8 unused4[2];
|
||||
// extern s8 sTimerRunning;
|
||||
|
||||
struct HudDisplay {
|
||||
/*0x00*/ s16 lives;
|
||||
/*0x02*/ s16 coins;
|
||||
/*0x04*/ s16 stars;
|
||||
/*0x06*/ s16 wedges;
|
||||
/*0x08*/ s16 keys;
|
||||
/*0x0A*/ s16 flags;
|
||||
/*0x0C*/ u16 timer;
|
||||
struct HudDisplay
|
||||
{
|
||||
/*0x00*/
|
||||
s16 lives;
|
||||
/*0x02*/
|
||||
s16 coins;
|
||||
/*0x04*/
|
||||
s16 stars;
|
||||
/*0x06*/
|
||||
s16 wedges;
|
||||
/*0x08*/
|
||||
s16 keys;
|
||||
/*0x0A*/
|
||||
s16 flags;
|
||||
/*0x0C*/
|
||||
u16 timer;
|
||||
};
|
||||
|
||||
// extern struct HudDisplay gHudDisplay;
|
||||
// extern s8 gNeverEnteredCastle;
|
||||
|
||||
enum HUDDisplayFlag {
|
||||
enum HUDDisplayFlag
|
||||
{
|
||||
HUD_DISPLAY_FLAG_LIVES = 0x0001,
|
||||
HUD_DISPLAY_FLAG_COIN_COUNT = 0x0002,
|
||||
HUD_DISPLAY_FLAG_STAR_COUNT = 0x0004,
|
||||
@@ -111,10 +120,10 @@ enum HUDDisplayFlag {
|
||||
HUD_DISPLAY_FLAG_UNKNOWN_0020 = 0x0020,
|
||||
HUD_DISPLAY_FLAG_TIMER = 0x0040,
|
||||
HUD_DISPLAY_FLAG_EMPHASIZE_POWER = 0x8000,
|
||||
|
||||
HUD_DISPLAY_NONE = 0x0000,
|
||||
HUD_DISPLAY_DEFAULT = HUD_DISPLAY_FLAG_LIVES | HUD_DISPLAY_FLAG_COIN_COUNT | HUD_DISPLAY_FLAG_STAR_COUNT | HUD_DISPLAY_FLAG_CAMERA_AND_POWER | HUD_DISPLAY_FLAG_KEYS | HUD_DISPLAY_FLAG_UNKNOWN_0020
|
||||
};
|
||||
|
||||
//
|
||||
//
|
||||
// u16 level_control_timer(s32 timerOp);
|
||||
|
||||
+699
-395
File diff suppressed because it is too large
Load Diff
+44
-1
@@ -7,48 +7,91 @@
|
||||
#include "../include/types.h"
|
||||
|
||||
s32 is_anim_at_end(struct MarioState *m);
|
||||
|
||||
s32 is_anim_past_end(struct MarioState *m);
|
||||
|
||||
s16 set_mario_animation(struct MarioState *m, s32 targetAnimID);
|
||||
|
||||
s16 set_mario_anim_with_accel(struct MarioState *m, s32 targetAnimID, s32 accel);
|
||||
|
||||
void set_anim_to_frame(struct MarioState *m, s16 animFrame);
|
||||
|
||||
s32 is_anim_past_frame(struct MarioState *m, s16 animFrame);
|
||||
|
||||
s16 find_mario_anim_flags_and_translation(struct Object *o, s32 yaw, Vec3s translation);
|
||||
|
||||
void update_mario_pos_for_anim(struct MarioState *m);
|
||||
|
||||
s16 return_mario_anim_y_translation(struct MarioState *m);
|
||||
|
||||
void play_sound_if_no_flag(struct MarioState *m, u32 soundBits, u32 flags);
|
||||
|
||||
void play_mario_jump_sound(struct MarioState *m);
|
||||
|
||||
void adjust_sound_for_speed(struct MarioState *m);
|
||||
|
||||
void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 waveParticleType);
|
||||
|
||||
void play_mario_action_sound(struct MarioState *m, u32 soundBits, u32 waveParticleType);
|
||||
|
||||
void play_mario_landing_sound(struct MarioState *m, u32 soundBits);
|
||||
|
||||
void play_mario_landing_sound_once(struct MarioState *m, u32 soundBits);
|
||||
|
||||
void play_mario_heavy_landing_sound(struct MarioState *m, u32 soundBits);
|
||||
|
||||
void play_mario_heavy_landing_sound_once(struct MarioState *m, u32 soundBits);
|
||||
|
||||
void play_mario_sound(struct MarioState *m, s32 primarySoundBits, s32 scondarySoundBits);
|
||||
|
||||
void mario_set_forward_vel(struct MarioState *m, f32 speed);
|
||||
|
||||
s32 mario_get_floor_class(struct MarioState *m);
|
||||
|
||||
u32 mario_get_terrain_sound_addend(struct MarioState *m);
|
||||
|
||||
struct SM64SurfaceCollisionData *resolve_and_return_wall_collisions(Vec3f pos, f32 offset, f32 radius);
|
||||
|
||||
f32 vec3f_find_ceil(Vec3f pos, f32 height, struct SM64SurfaceCollisionData **ceil);
|
||||
|
||||
s32 mario_facing_downhill(struct MarioState *m, s32 turnYaw);
|
||||
|
||||
u32 mario_floor_is_slippery(struct MarioState *m);
|
||||
|
||||
s32 mario_floor_is_slope(struct MarioState *m);
|
||||
|
||||
s32 mario_floor_is_steep(struct MarioState *m);
|
||||
|
||||
f32 find_floor_height_relative_polar(struct MarioState *m, s16 angleFromMario, f32 distFromMario);
|
||||
|
||||
s16 find_floor_slope(struct MarioState *m, s16 yawOffset);
|
||||
|
||||
void update_mario_sound_and_camera(struct MarioState *m);
|
||||
|
||||
void set_steep_jump_action(struct MarioState *m);
|
||||
|
||||
u32 set_mario_action(struct MarioState *, u32 action, u32 actionArg);
|
||||
|
||||
s32 set_jump_from_landing(struct MarioState *m);
|
||||
|
||||
s32 set_jumping_action(struct MarioState *m, u32 action, u32 actionArg);
|
||||
|
||||
s32 drop_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg);
|
||||
|
||||
s32 hurt_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg, s16 hurtCounter);
|
||||
|
||||
s32 check_common_action_exits(struct MarioState *m);
|
||||
|
||||
s32 check_common_hold_action_exits(struct MarioState *m);
|
||||
|
||||
s32 transition_submerged_to_walking(struct MarioState *m);
|
||||
|
||||
s32 set_water_plunge_action(struct MarioState *m);
|
||||
|
||||
s32 execute_mario_action(UNUSED struct Object *o);
|
||||
int init_mario(void);
|
||||
|
||||
int init_mario(uint8_t isLocal);
|
||||
|
||||
void init_mario_from_save_file(void);
|
||||
|
||||
#endif // MARIO_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1530
-1261
File diff suppressed because it is too large
Load Diff
@@ -7,11 +7,17 @@
|
||||
#include "../include/types.h"
|
||||
|
||||
void print_displaying_credits_entry(void);
|
||||
|
||||
void bhv_end_peach_loop(void);
|
||||
|
||||
void bhv_end_toad_loop(void);
|
||||
|
||||
s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2);
|
||||
|
||||
s32 mario_ready_to_speak(void);
|
||||
|
||||
s32 set_mario_npc_dialog(s32 actionArg);
|
||||
|
||||
s32 mario_execute_cutscene_action(struct MarioState *m);
|
||||
|
||||
#endif // MARIO_ACTIONS_CUTSCENE_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
||||
#include "../include/types.h"
|
||||
|
||||
void play_step_sound(struct MarioState *m, s16 frame1, s16 frame2);
|
||||
|
||||
s32 mario_execute_moving_action(struct MarioState *m);
|
||||
|
||||
#endif // MARIO_ACTIONS_MOVING
|
||||
|
||||
@@ -16,103 +16,128 @@
|
||||
#include "../include/mario_animation_ids.h"
|
||||
#include "../include/object_fields.h"
|
||||
#include "../include/mario_geo_switch_case_ids.h"
|
||||
#include "../../rumble.h"
|
||||
|
||||
/**
|
||||
* Used by act_punching() to determine Mario's forward velocity during each
|
||||
* animation frame.
|
||||
*/
|
||||
s8 sPunchingForwardVelocities[8] = { 0, 1, 1, 2, 3, 5, 7, 10 };
|
||||
s8 sPunchingForwardVelocities[8] = {0, 1, 1, 2, 3, 5, 7, 10};
|
||||
|
||||
void animated_stationary_ground_step(struct MarioState *m, s32 animation, u32 endAction) {
|
||||
void animated_stationary_ground_step(struct MarioState *m, s32 animation, u32 endAction)
|
||||
{
|
||||
stationary_ground_step(m);
|
||||
set_mario_animation(m, animation);
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, endAction, 0);
|
||||
}
|
||||
}
|
||||
|
||||
s32 mario_update_punch_sequence(struct MarioState *m) {
|
||||
s32 mario_update_punch_sequence(struct MarioState *m)
|
||||
{
|
||||
u32 endAction, crouchEndAction;
|
||||
s32 animFrame;
|
||||
|
||||
if (m->action & ACT_FLAG_MOVING) {
|
||||
if (m->action & ACT_FLAG_MOVING)
|
||||
{
|
||||
endAction = ACT_WALKING, crouchEndAction = ACT_CROUCH_SLIDE;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
endAction = ACT_IDLE, crouchEndAction = ACT_CROUCHING;
|
||||
}
|
||||
|
||||
switch (m->actionArg) {
|
||||
switch (m->actionArg)
|
||||
{
|
||||
case 0:
|
||||
play_sound(SOUND_MARIO_PUNCH_YAH, m->marioObj->header.gfx.cameraToObject);
|
||||
// Fall-through:
|
||||
// Fall-through:
|
||||
case 1:
|
||||
set_mario_animation(m, MARIO_ANIM_FIRST_PUNCH);
|
||||
if (is_anim_past_end(m)) {
|
||||
if (is_anim_past_end(m))
|
||||
{
|
||||
m->actionArg = 2;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->actionArg = 1;
|
||||
}
|
||||
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame >= 2) {
|
||||
if (mario_check_object_grab(m)) {
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame >= 2)
|
||||
{
|
||||
if (mario_check_object_grab(m))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
m->flags |= MARIO_PUNCHING;
|
||||
}
|
||||
|
||||
if (m->actionArg == 2) {
|
||||
m->marioBodyState->punchState = (0 << 6) | 4;
|
||||
if (m->actionArg == 2)
|
||||
{
|
||||
m->marioBodyState->punchState = 0 << 6 | 4;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
set_mario_animation(m, MARIO_ANIM_FIRST_PUNCH_FAST);
|
||||
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame <= 0) {
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame <= 0)
|
||||
{
|
||||
m->flags |= MARIO_PUNCHING;
|
||||
}
|
||||
|
||||
if (m->input & INPUT_B_PRESSED) {
|
||||
if (m->input & INPUT_B_PRESSED)
|
||||
{
|
||||
m->actionArg = 3;
|
||||
}
|
||||
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, endAction, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
play_sound(SOUND_MARIO_PUNCH_WAH, m->marioObj->header.gfx.cameraToObject);
|
||||
// Fall-through:
|
||||
// Fall-through:
|
||||
case 4:
|
||||
set_mario_animation(m, MARIO_ANIM_SECOND_PUNCH);
|
||||
if (is_anim_past_end(m)) {
|
||||
if (is_anim_past_end(m))
|
||||
{
|
||||
m->actionArg = 5;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->actionArg = 4;
|
||||
}
|
||||
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame > 0) {
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame > 0)
|
||||
{
|
||||
m->flags |= MARIO_PUNCHING;
|
||||
}
|
||||
|
||||
if (m->actionArg == 5) {
|
||||
m->marioBodyState->punchState = (1 << 6) | 4;
|
||||
if (m->actionArg == 5)
|
||||
{
|
||||
m->marioBodyState->punchState = 1 << 6 | 4;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
set_mario_animation(m, MARIO_ANIM_SECOND_PUNCH_FAST);
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame <= 0) {
|
||||
if (m->marioObj->header.gfx.animInfo.animFrame <= 0)
|
||||
{
|
||||
m->flags |= MARIO_PUNCHING;
|
||||
}
|
||||
|
||||
if (m->input & INPUT_B_PRESSED) {
|
||||
if (m->input & INPUT_B_PRESSED)
|
||||
{
|
||||
m->actionArg = 6;
|
||||
}
|
||||
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, endAction, 0);
|
||||
}
|
||||
break;
|
||||
@@ -120,15 +145,18 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
|
||||
case 6:
|
||||
play_mario_action_sound(m, SOUND_MARIO_PUNCH_HOO, 1);
|
||||
animFrame = set_mario_animation(m, MARIO_ANIM_GROUND_KICK);
|
||||
if (animFrame == 0) {
|
||||
m->marioBodyState->punchState = (2 << 6) | 6;
|
||||
if (animFrame == 0)
|
||||
{
|
||||
m->marioBodyState->punchState = 2 << 6 | 6;
|
||||
}
|
||||
|
||||
if (animFrame >= 0 && animFrame < 8) {
|
||||
if (animFrame >= 0 && animFrame < 8)
|
||||
{
|
||||
m->flags |= MARIO_KICKING;
|
||||
}
|
||||
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, endAction, 0);
|
||||
}
|
||||
break;
|
||||
@@ -138,11 +166,13 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
|
||||
set_mario_animation(m, MARIO_ANIM_BREAKDANCE);
|
||||
animFrame = m->marioObj->header.gfx.animInfo.animFrame;
|
||||
|
||||
if (animFrame >= 2 && animFrame < 8) {
|
||||
if (animFrame >= 2 && animFrame < 8)
|
||||
{
|
||||
m->flags |= MARIO_TRIPPING;
|
||||
}
|
||||
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, crouchEndAction, 0);
|
||||
}
|
||||
break;
|
||||
@@ -151,26 +181,32 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_punching(struct MarioState *m) {
|
||||
if (m->input & INPUT_UNKNOWN_10) {
|
||||
s32 act_punching(struct MarioState *m)
|
||||
{
|
||||
if (m->input & INPUT_UNKNOWN_10)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0);
|
||||
}
|
||||
|
||||
if (m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE)) {
|
||||
if (m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE))
|
||||
{
|
||||
return check_common_action_exits(m);
|
||||
}
|
||||
|
||||
if (m->actionState == 0 && (m->input & INPUT_A_DOWN)) {
|
||||
if (m->actionState == 0 && m->input & INPUT_A_DOWN)
|
||||
{
|
||||
return set_mario_action(m, ACT_JUMP_KICK, 0);
|
||||
}
|
||||
|
||||
m->actionState = 1;
|
||||
if (m->actionArg == 0) {
|
||||
if (m->actionArg == 0)
|
||||
{
|
||||
m->actionTimer = 7;
|
||||
}
|
||||
|
||||
mario_set_forward_vel(m, sPunchingForwardVelocities[m->actionTimer]);
|
||||
if (m->actionTimer > 0) {
|
||||
if (m->actionTimer > 0)
|
||||
{
|
||||
m->actionTimer--;
|
||||
}
|
||||
|
||||
@@ -179,16 +215,20 @@ s32 act_punching(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_picking_up(struct MarioState *m) {
|
||||
if (m->input & INPUT_UNKNOWN_10) {
|
||||
s32 act_picking_up(struct MarioState *m)
|
||||
{
|
||||
if (m->input & INPUT_UNKNOWN_10)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_OFF_FLOOR) {
|
||||
if (m->input & INPUT_OFF_FLOOR)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
||||
if (m->actionState == 0 && is_anim_at_end(m)) {
|
||||
if (m->actionState == 0 && is_anim_at_end(m))
|
||||
{
|
||||
//! While the animation is playing, it is possible for the used object
|
||||
// to unload. This allows you to pick up a vacant or newly loaded object
|
||||
// slot (cloning via fake object).
|
||||
@@ -197,17 +237,23 @@ s32 act_picking_up(struct MarioState *m) {
|
||||
m->actionState = 1;
|
||||
}
|
||||
|
||||
if (m->actionState == 1) {
|
||||
if (m->heldObj->oInteractionSubtype & INT_SUBTYPE_GRABS_MARIO) {
|
||||
if (m->actionState == 1)
|
||||
{
|
||||
if (m->heldObj->oInteractionSubtype & INT_SUBTYPE_GRABS_MARIO)
|
||||
{
|
||||
m->marioBodyState->grabPos = GRAB_POS_HEAVY_OBJ;
|
||||
set_mario_animation(m, MARIO_ANIM_GRAB_HEAVY_OBJECT);
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, ACT_HOLD_HEAVY_IDLE, 0);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->marioBodyState->grabPos = GRAB_POS_LIGHT_OBJ;
|
||||
set_mario_animation(m, MARIO_ANIM_PICK_UP_LIGHT_OBJ);
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, ACT_HOLD_IDLE, 0);
|
||||
}
|
||||
}
|
||||
@@ -217,19 +263,23 @@ s32 act_picking_up(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_dive_picking_up(struct MarioState *m) {
|
||||
if (m->input & INPUT_UNKNOWN_10) {
|
||||
s32 act_dive_picking_up(struct MarioState *m)
|
||||
{
|
||||
if (m->input & INPUT_UNKNOWN_10)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0);
|
||||
}
|
||||
|
||||
//! Hands-free holding. Landing on a slope or being pushed off a ledge while
|
||||
// landing from a dive grab sets Mario's action to a non-holding action
|
||||
// without dropping the object, causing the hands-free holding glitch.
|
||||
if (m->input & INPUT_OFF_FLOOR) {
|
||||
if (m->input & INPUT_OFF_FLOOR)
|
||||
{
|
||||
return set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_ABOVE_SLIDE) {
|
||||
if (m->input & INPUT_ABOVE_SLIDE)
|
||||
{
|
||||
return set_mario_action(m, ACT_BEGIN_SLIDING, 0);
|
||||
}
|
||||
|
||||
@@ -237,16 +287,20 @@ s32 act_dive_picking_up(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_placing_down(struct MarioState *m) {
|
||||
if (m->input & INPUT_UNKNOWN_10) {
|
||||
s32 act_placing_down(struct MarioState *m)
|
||||
{
|
||||
if (m->input & INPUT_UNKNOWN_10)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_OFF_FLOOR) {
|
||||
if (m->input & INPUT_OFF_FLOOR)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
||||
if (++m->actionTimer == 8) {
|
||||
if (++m->actionTimer == 8)
|
||||
{
|
||||
mario_drop_held_object(m);
|
||||
}
|
||||
|
||||
@@ -254,64 +308,77 @@ s32 act_placing_down(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_throwing(struct MarioState *m) {
|
||||
if (m->heldObj && (m->heldObj->oInteractionSubtype & INT_SUBTYPE_HOLDABLE_NPC)) {
|
||||
s32 act_throwing(struct MarioState *m)
|
||||
{
|
||||
if (m->heldObj && m->heldObj->oInteractionSubtype & INT_SUBTYPE_HOLDABLE_NPC)
|
||||
{
|
||||
return set_mario_action(m, ACT_PLACING_DOWN, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_UNKNOWN_10) {
|
||||
if (m->input & INPUT_UNKNOWN_10)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_OFF_FLOOR) {
|
||||
if (m->input & INPUT_OFF_FLOOR)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
||||
if (++m->actionTimer == 7) {
|
||||
if (++m->actionTimer == 7)
|
||||
{
|
||||
mario_throw_held_object(m);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
|
||||
#ifdef VERSION_SH
|
||||
// #ifdef VERSION_SH
|
||||
queue_rumble_data(3, 50);
|
||||
#endif
|
||||
// #endif
|
||||
}
|
||||
|
||||
animated_stationary_ground_step(m, MARIO_ANIM_GROUND_THROW, ACT_IDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_heavy_throw(struct MarioState *m) {
|
||||
if (m->input & INPUT_UNKNOWN_10) {
|
||||
s32 act_heavy_throw(struct MarioState *m)
|
||||
{
|
||||
if (m->input & INPUT_UNKNOWN_10)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_OFF_FLOOR) {
|
||||
if (m->input & INPUT_OFF_FLOOR)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
||||
if (++m->actionTimer == 13) {
|
||||
if (++m->actionTimer == 13)
|
||||
{
|
||||
mario_drop_held_object(m);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
|
||||
#ifdef VERSION_SH
|
||||
// #ifdef VERSION_SH
|
||||
queue_rumble_data(3, 50);
|
||||
#endif
|
||||
// #endif
|
||||
}
|
||||
|
||||
animated_stationary_ground_step(m, MARIO_ANIM_HEAVY_THROW, ACT_IDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_stomach_slide_stop(struct MarioState *m) {
|
||||
if (m->input & INPUT_UNKNOWN_10) {
|
||||
s32 act_stomach_slide_stop(struct MarioState *m)
|
||||
{
|
||||
if (m->input & INPUT_UNKNOWN_10)
|
||||
{
|
||||
return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_OFF_FLOOR) {
|
||||
if (m->input & INPUT_OFF_FLOOR)
|
||||
{
|
||||
return set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_ABOVE_SLIDE) {
|
||||
if (m->input & INPUT_ABOVE_SLIDE)
|
||||
{
|
||||
return set_mario_action(m, ACT_BEGIN_SLIDING, 0);
|
||||
}
|
||||
|
||||
@@ -319,20 +386,23 @@ s32 act_stomach_slide_stop(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_picking_up_bowser(struct MarioState *m) {
|
||||
if (m->actionState == 0) {
|
||||
s32 act_picking_up_bowser(struct MarioState *m)
|
||||
{
|
||||
if (m->actionState == 0)
|
||||
{
|
||||
m->actionState = 1;
|
||||
m->angleVel[1] = 0;
|
||||
m->marioBodyState->grabPos = GRAB_POS_BOWSER;
|
||||
mario_grab_used_object(m);
|
||||
#ifdef VERSION_SH
|
||||
// #ifdef VERSION_SH
|
||||
queue_rumble_data(5, 80);
|
||||
#endif
|
||||
// #endif
|
||||
play_sound(SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
set_mario_animation(m, MARIO_ANIM_GRAB_BOWSER);
|
||||
if (is_anim_at_end(m)) {
|
||||
if (is_anim_at_end(m))
|
||||
{
|
||||
set_mario_action(m, ACT_HOLDING_BOWSER, 0);
|
||||
}
|
||||
|
||||
@@ -340,59 +410,78 @@ s32 act_picking_up_bowser(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_holding_bowser(struct MarioState *m) {
|
||||
s32 act_holding_bowser(struct MarioState *m)
|
||||
{
|
||||
s16 spin;
|
||||
|
||||
if (m->input & INPUT_B_PRESSED) {
|
||||
#ifndef VERSION_JP
|
||||
if (m->angleVel[1] <= -0xE00 || m->angleVel[1] >= 0xE00) {
|
||||
if (m->input & INPUT_B_PRESSED)
|
||||
{
|
||||
#ifndef VERSION_JP
|
||||
if (m->angleVel[1] <= -0xE00 || m->angleVel[1] >= 0xE00)
|
||||
{
|
||||
play_sound(SOUND_MARIO_SO_LONGA_BOWSER, m->marioObj->header.gfx.cameraToObject);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
#else
|
||||
#else
|
||||
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
#endif
|
||||
return set_mario_action(m, ACT_RELEASING_BOWSER, 0);
|
||||
}
|
||||
|
||||
if (m->angleVel[1] == 0) {
|
||||
if (m->actionTimer++ > 120) {
|
||||
if (m->angleVel[1] == 0)
|
||||
{
|
||||
if (m->actionTimer++ > 120)
|
||||
{
|
||||
return set_mario_action(m, ACT_RELEASING_BOWSER, 1);
|
||||
}
|
||||
|
||||
set_mario_animation(m, MARIO_ANIM_HOLDING_BOWSER);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->actionTimer = 0;
|
||||
set_mario_animation(m, MARIO_ANIM_SWINGING_BOWSER);
|
||||
}
|
||||
|
||||
if (m->intendedMag > 20.0f) {
|
||||
if (m->actionArg == 0) {
|
||||
if (m->intendedMag > 20.0f)
|
||||
{
|
||||
if (m->actionArg == 0)
|
||||
{
|
||||
m->actionArg = 1;
|
||||
m->twirlYaw = m->intendedYaw;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// spin = acceleration
|
||||
spin = (s16)(m->intendedYaw - m->twirlYaw) / 0x80;
|
||||
|
||||
if (spin < -0x80) {
|
||||
if (spin < -0x80)
|
||||
{
|
||||
spin = -0x80;
|
||||
}
|
||||
if (spin > 0x80) {
|
||||
if (spin > 0x80)
|
||||
{
|
||||
spin = 0x80;
|
||||
}
|
||||
|
||||
m->twirlYaw = m->intendedYaw;
|
||||
m->angleVel[1] += spin;
|
||||
|
||||
if (m->angleVel[1] > 0x1000) {
|
||||
if (m->angleVel[1] > 0x1000)
|
||||
{
|
||||
m->angleVel[1] = 0x1000;
|
||||
}
|
||||
if (m->angleVel[1] < -0x1000) {
|
||||
if (m->angleVel[1] < -0x1000)
|
||||
{
|
||||
m->angleVel[1] = -0x1000;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->actionArg = 0;
|
||||
m->angleVel[1] = approach_s32(m->angleVel[1], 0, 64, 64);
|
||||
}
|
||||
@@ -402,40 +491,50 @@ s32 act_holding_bowser(struct MarioState *m) {
|
||||
m->faceAngle[1] += m->angleVel[1];
|
||||
|
||||
// play sound on overflow
|
||||
if (m->angleVel[1] <= -0x100 && spin < m->faceAngle[1]) {
|
||||
#ifdef VERSION_SH
|
||||
if (m->angleVel[1] <= -0x100 && spin < m->faceAngle[1])
|
||||
{
|
||||
// #ifdef VERSION_SH
|
||||
queue_rumble_data(4, 20);
|
||||
#endif
|
||||
// #endif
|
||||
play_sound(SOUND_OBJ_BOWSER_SPINNING, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
if (m->angleVel[1] >= 0x100 && spin > m->faceAngle[1]) {
|
||||
#ifdef VERSION_SH
|
||||
if (m->angleVel[1] >= 0x100 && spin > m->faceAngle[1])
|
||||
{
|
||||
// #ifdef VERSION_SH
|
||||
queue_rumble_data(4, 20);
|
||||
#endif
|
||||
// #endif
|
||||
play_sound(SOUND_OBJ_BOWSER_SPINNING, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
stationary_ground_step(m);
|
||||
if (m->angleVel[1] >= 0) {
|
||||
if (m->angleVel[1] >= 0)
|
||||
{
|
||||
m->marioObj->header.gfx.angle[0] = -m->angleVel[1];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->marioObj->header.gfx.angle[0] = m->angleVel[1];
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_releasing_bowser(struct MarioState *m) {
|
||||
if (++m->actionTimer == 1) {
|
||||
if (m->actionArg == 0) {
|
||||
#ifdef VERSION_SH
|
||||
s32 act_releasing_bowser(struct MarioState *m)
|
||||
{
|
||||
if (++m->actionTimer == 1)
|
||||
{
|
||||
if (m->actionArg == 0)
|
||||
{
|
||||
// #ifdef VERSION_SH
|
||||
queue_rumble_data(4, 50);
|
||||
#endif
|
||||
// #endif
|
||||
mario_throw_held_object(m);
|
||||
} else {
|
||||
#ifdef VERSION_SH
|
||||
}
|
||||
else
|
||||
{
|
||||
// #ifdef VERSION_SH
|
||||
queue_rumble_data(4, 50);
|
||||
#endif
|
||||
// #endif
|
||||
mario_drop_held_object(m);
|
||||
}
|
||||
}
|
||||
@@ -445,31 +544,38 @@ s32 act_releasing_bowser(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 check_common_object_cancels(struct MarioState *m) {
|
||||
s32 check_common_object_cancels(struct MarioState *m)
|
||||
{
|
||||
f32 waterSurface = m->waterLevel - 100;
|
||||
if (m->pos[1] < waterSurface) {
|
||||
if (m->pos[1] < waterSurface)
|
||||
{
|
||||
return set_water_plunge_action(m);
|
||||
}
|
||||
|
||||
if (m->input & INPUT_SQUISHED) {
|
||||
if (m->input & INPUT_SQUISHED)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_SQUISHED, 0);
|
||||
}
|
||||
|
||||
if (m->health < 0x100) {
|
||||
if (m->health < 0x100)
|
||||
{
|
||||
return drop_and_set_mario_action(m, ACT_STANDING_DEATH, 0);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 mario_execute_object_action(struct MarioState *m) {
|
||||
s32 mario_execute_object_action(struct MarioState *m)
|
||||
{
|
||||
s32 cancel;
|
||||
|
||||
if (check_common_object_cancels(m)) {
|
||||
if (check_common_object_cancels(m))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (mario_update_quicksand(m, 0.5f)) {
|
||||
if (mario_update_quicksand(m, 0.5f))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -488,7 +594,8 @@ s32 mario_execute_object_action(struct MarioState *m) {
|
||||
}
|
||||
/* clang-format on */
|
||||
|
||||
if (!cancel && (m->input & INPUT_IN_WATER)) {
|
||||
if (!cancel && m->input & INPUT_IN_WATER)
|
||||
{
|
||||
m->particleFlags |= PARTICLE_IDLE_WATER_WAVE;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "../include/types.h"
|
||||
|
||||
s32 mario_update_punch_sequence(struct MarioState *m);
|
||||
|
||||
s32 mario_execute_object_action(struct MarioState *m);
|
||||
|
||||
#endif // MARIO_ACTIONS_OBJECT_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,45 +6,85 @@
|
||||
#include "../include/types.h"
|
||||
|
||||
s32 check_common_idle_cancels(struct MarioState *m);
|
||||
|
||||
s32 check_common_hold_idle_cancels(struct MarioState *m);
|
||||
|
||||
s32 act_idle(struct MarioState *m);
|
||||
|
||||
void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound);
|
||||
|
||||
s32 act_start_sleeping(struct MarioState *m);
|
||||
|
||||
s32 act_sleeping(struct MarioState *m);
|
||||
|
||||
s32 act_waking_up(struct MarioState *m);
|
||||
|
||||
s32 act_shivering(struct MarioState *m);
|
||||
|
||||
s32 act_coughing(struct MarioState *m);
|
||||
|
||||
s32 act_standing_against_wall(struct MarioState *m);
|
||||
|
||||
s32 act_in_quicksand(struct MarioState *m);
|
||||
|
||||
s32 act_crouching(struct MarioState *m);
|
||||
|
||||
s32 act_panting(struct MarioState *m);
|
||||
|
||||
void stopping_step(struct MarioState *m, s32 animID, u32 action);
|
||||
|
||||
s32 act_braking_stop(struct MarioState *m);
|
||||
|
||||
s32 act_butt_slide_stop(struct MarioState *m);
|
||||
|
||||
s32 act_hold_butt_slide_stop(struct MarioState *m);
|
||||
|
||||
s32 act_slide_kick_slide_stop(struct MarioState *m);
|
||||
|
||||
s32 act_start_crouching(struct MarioState *m);
|
||||
|
||||
s32 act_stop_crouching(struct MarioState *m);
|
||||
|
||||
s32 act_start_crawling(struct MarioState *m);
|
||||
|
||||
s32 act_stop_crawling(struct MarioState *m);
|
||||
|
||||
s32 act_shockwave_bounce(struct MarioState *m);
|
||||
|
||||
s32 landing_step(struct MarioState *m, s32 arg1, u32 action);
|
||||
|
||||
s32 check_common_landing_cancels(struct MarioState *m, u32 action);
|
||||
|
||||
s32 act_jump_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_double_jump_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_side_flip_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_freefall_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_triple_jump_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_backflip_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_lava_boost_land(struct MarioState *m);
|
||||
|
||||
s32 act_long_jump_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_hold_jump_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_hold_freefall_land_stop(struct MarioState *m);
|
||||
|
||||
s32 act_air_throw_land(struct MarioState *m);
|
||||
|
||||
s32 act_twirl_land(struct MarioState *m);
|
||||
|
||||
s32 act_ground_pound_land(struct MarioState *m);
|
||||
|
||||
s32 act_first_person(struct MarioState *m);
|
||||
|
||||
s32 check_common_stationary_cancels(struct MarioState *m);
|
||||
|
||||
s32 mario_execute_stationary_action(struct MarioState *m);
|
||||
|
||||
#endif // MARIO_ACTIONS_STATIONARY
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+368
-286
@@ -28,7 +28,7 @@
|
||||
#include "../include/object_fields.h"
|
||||
#include "../include/mario_geo_switch_case_ids.h"
|
||||
|
||||
static Vec3s gVec3sZero = {0,0,0};
|
||||
static Vec3s gVec3sZero = {0, 0, 0};
|
||||
|
||||
#define TOAD_STAR_1_REQUIREMENT 12
|
||||
#define TOAD_STAR_2_REQUIREMENT 25
|
||||
@@ -42,7 +42,8 @@ static Vec3s gVec3sZero = {0,0,0};
|
||||
#define TOAD_STAR_2_DIALOG_AFTER 91 // DIALOG_155
|
||||
#define TOAD_STAR_3_DIALOG_AFTER 92 // DIALOG_156
|
||||
|
||||
enum ToadMessageStates {
|
||||
enum ToadMessageStates
|
||||
{
|
||||
TOAD_MESSAGE_FADED,
|
||||
TOAD_MESSAGE_OPAQUE,
|
||||
TOAD_MESSAGE_OPACIFYING,
|
||||
@@ -50,7 +51,8 @@ enum ToadMessageStates {
|
||||
TOAD_MESSAGE_TALKING
|
||||
};
|
||||
|
||||
enum UnlockDoorStarStates {
|
||||
enum UnlockDoorStarStates
|
||||
{
|
||||
UNLOCK_DOOR_STAR_RISING,
|
||||
UNLOCK_DOOR_STAR_WAITING,
|
||||
UNLOCK_DOOR_STAR_SPAWNING_PARTICLES,
|
||||
@@ -61,7 +63,7 @@ enum UnlockDoorStarStates {
|
||||
* The eye texture on succesive frames of Mario's blink animation.
|
||||
* He intentionally blinks twice each time.
|
||||
*/
|
||||
static s8 gMarioBlinkAnimation[7] = { 1, 2, 1, 0, 1, 2, 1 };
|
||||
static s8 gMarioBlinkAnimation[7] = {1, 2, 1, 0, 1, 2, 1};
|
||||
|
||||
/**
|
||||
* The scale values per frame for Mario's foot/hand for his attack animation
|
||||
@@ -106,66 +108,76 @@ static s8 gMarioAttackScaleAnimation[3 * 6] = {
|
||||
// return gfx;
|
||||
// }
|
||||
|
||||
static void toad_message_faded(void) {
|
||||
// if (gCurrentObject->oDistanceToMario > 700.0f) {
|
||||
// gCurrentObject->oToadMessageRecentlyTalked = FALSE;
|
||||
// }
|
||||
// if (!gCurrentObject->oToadMessageRecentlyTalked && gCurrentObject->oDistanceToMario < 600.0f) {
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_OPACIFYING;
|
||||
// }
|
||||
static void toad_message_faded(void)
|
||||
{
|
||||
// if (gCurrentObject->oDistanceToMario > 700.0f) {
|
||||
// gCurrentObject->oToadMessageRecentlyTalked = FALSE;
|
||||
// }
|
||||
// if (!gCurrentObject->oToadMessageRecentlyTalked && gCurrentObject->oDistanceToMario < 600.0f) {
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_OPACIFYING;
|
||||
// }
|
||||
}
|
||||
|
||||
static void toad_message_opaque(void) {
|
||||
// if (gCurrentObject->oDistanceToMario > 700.0f) {
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADING;
|
||||
// } else if (!gCurrentObject->oToadMessageRecentlyTalked) {
|
||||
// gCurrentObject->oInteractionSubtype = INT_SUBTYPE_NPC;
|
||||
// if (gCurrentObject->oInteractStatus & INT_STATUS_INTERACTED) {
|
||||
// gCurrentObject->oInteractStatus = 0;
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_TALKING;
|
||||
// play_toads_jingle();
|
||||
// }
|
||||
// }
|
||||
static void toad_message_opaque(void)
|
||||
{
|
||||
// if (gCurrentObject->oDistanceToMario > 700.0f) {
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADING;
|
||||
// } else if (!gCurrentObject->oToadMessageRecentlyTalked) {
|
||||
// gCurrentObject->oInteractionSubtype = INT_SUBTYPE_NPC;
|
||||
// if (gCurrentObject->oInteractStatus & INT_STATUS_INTERACTED) {
|
||||
// gCurrentObject->oInteractStatus = 0;
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_TALKING;
|
||||
// play_toads_jingle();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
static void toad_message_talking(void) {
|
||||
// if (cur_obj_update_dialog_with_cutscene(3, 1, CUTSCENE_DIALOG, gCurrentObject->oToadMessageDialogId)
|
||||
// != 0) {
|
||||
// gCurrentObject->oToadMessageRecentlyTalked = TRUE;
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADING;
|
||||
// switch (gCurrentObject->oToadMessageDialogId) {
|
||||
// case TOAD_STAR_1_DIALOG:
|
||||
// gCurrentObject->oToadMessageDialogId = TOAD_STAR_1_DIALOG_AFTER;
|
||||
// bhv_spawn_star_no_level_exit(0);
|
||||
// break;
|
||||
// case TOAD_STAR_2_DIALOG:
|
||||
// gCurrentObject->oToadMessageDialogId = TOAD_STAR_2_DIALOG_AFTER;
|
||||
// bhv_spawn_star_no_level_exit(1);
|
||||
// break;
|
||||
// case TOAD_STAR_3_DIALOG:
|
||||
// gCurrentObject->oToadMessageDialogId = TOAD_STAR_3_DIALOG_AFTER;
|
||||
// bhv_spawn_star_no_level_exit(2);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
static void toad_message_talking(void)
|
||||
{
|
||||
// if (cur_obj_update_dialog_with_cutscene(3, 1, CUTSCENE_DIALOG, gCurrentObject->oToadMessageDialogId)
|
||||
// != 0) {
|
||||
// gCurrentObject->oToadMessageRecentlyTalked = TRUE;
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADING;
|
||||
// switch (gCurrentObject->oToadMessageDialogId) {
|
||||
// case TOAD_STAR_1_DIALOG:
|
||||
// gCurrentObject->oToadMessageDialogId = TOAD_STAR_1_DIALOG_AFTER;
|
||||
// bhv_spawn_star_no_level_exit(0);
|
||||
// break;
|
||||
// case TOAD_STAR_2_DIALOG:
|
||||
// gCurrentObject->oToadMessageDialogId = TOAD_STAR_2_DIALOG_AFTER;
|
||||
// bhv_spawn_star_no_level_exit(1);
|
||||
// break;
|
||||
// case TOAD_STAR_3_DIALOG:
|
||||
// gCurrentObject->oToadMessageDialogId = TOAD_STAR_3_DIALOG_AFTER;
|
||||
// bhv_spawn_star_no_level_exit(2);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
static void toad_message_opacifying(void) {
|
||||
if ((gCurrentObject->oOpacity += 6) == 255) {
|
||||
static void toad_message_opacifying(void)
|
||||
{
|
||||
if ((gCurrentObject->oOpacity += 6) == 255)
|
||||
{
|
||||
gCurrentObject->oToadMessageState = TOAD_MESSAGE_OPAQUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void toad_message_fading(void) {
|
||||
if ((gCurrentObject->oOpacity -= 6) == 81) {
|
||||
static void toad_message_fading(void)
|
||||
{
|
||||
if ((gCurrentObject->oOpacity -= 6) == 81)
|
||||
{
|
||||
gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADED;
|
||||
}
|
||||
}
|
||||
|
||||
void bhv_toad_message_loop(void) {
|
||||
if (gCurrentObject->header.gfx.node.flags & GRAPH_RENDER_ACTIVE) {
|
||||
void bhv_toad_message_loop(void)
|
||||
{
|
||||
if (gCurrentObject->header.gfx.node.flags & GRAPH_RENDER_ACTIVE)
|
||||
{
|
||||
gCurrentObject->oInteractionSubtype = 0;
|
||||
switch (gCurrentObject->oToadMessageState) {
|
||||
switch (gCurrentObject->oToadMessageState)
|
||||
{
|
||||
case TOAD_MESSAGE_FADED:
|
||||
toad_message_faded();
|
||||
break;
|
||||
@@ -185,40 +197,41 @@ void bhv_toad_message_loop(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void bhv_toad_message_init(void) {
|
||||
// s32 saveFlags = save_file_get_flags();
|
||||
// s32 starCount = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1);
|
||||
// s32 dialogId = (gCurrentObject->oBehParams >> 24) & 0xFF;
|
||||
// s32 enoughStars = TRUE;
|
||||
//
|
||||
// switch (dialogId) {
|
||||
// case TOAD_STAR_1_DIALOG:
|
||||
// enoughStars = (starCount >= TOAD_STAR_1_REQUIREMENT);
|
||||
// if (saveFlags & SAVE_FLAG_COLLECTED_TOAD_STAR_1) {
|
||||
// dialogId = TOAD_STAR_1_DIALOG_AFTER;
|
||||
// }
|
||||
// break;
|
||||
// case TOAD_STAR_2_DIALOG:
|
||||
// enoughStars = (starCount >= TOAD_STAR_2_REQUIREMENT);
|
||||
// if (saveFlags & SAVE_FLAG_COLLECTED_TOAD_STAR_2) {
|
||||
// dialogId = TOAD_STAR_2_DIALOG_AFTER;
|
||||
// }
|
||||
// break;
|
||||
// case TOAD_STAR_3_DIALOG:
|
||||
// enoughStars = (starCount >= TOAD_STAR_3_REQUIREMENT);
|
||||
// if (saveFlags & SAVE_FLAG_COLLECTED_TOAD_STAR_3) {
|
||||
// dialogId = TOAD_STAR_3_DIALOG_AFTER;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// if (enoughStars) {
|
||||
// gCurrentObject->oToadMessageDialogId = dialogId;
|
||||
// gCurrentObject->oToadMessageRecentlyTalked = FALSE;
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADED;
|
||||
// gCurrentObject->oOpacity = 81;
|
||||
// } else {
|
||||
// obj_mark_for_deletion(gCurrentObject);
|
||||
// }
|
||||
void bhv_toad_message_init(void)
|
||||
{
|
||||
// s32 saveFlags = save_file_get_flags();
|
||||
// s32 starCount = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1);
|
||||
// s32 dialogId = (gCurrentObject->oBehParams >> 24) & 0xFF;
|
||||
// s32 enoughStars = TRUE;
|
||||
//
|
||||
// switch (dialogId) {
|
||||
// case TOAD_STAR_1_DIALOG:
|
||||
// enoughStars = (starCount >= TOAD_STAR_1_REQUIREMENT);
|
||||
// if (saveFlags & SAVE_FLAG_COLLECTED_TOAD_STAR_1) {
|
||||
// dialogId = TOAD_STAR_1_DIALOG_AFTER;
|
||||
// }
|
||||
// break;
|
||||
// case TOAD_STAR_2_DIALOG:
|
||||
// enoughStars = (starCount >= TOAD_STAR_2_REQUIREMENT);
|
||||
// if (saveFlags & SAVE_FLAG_COLLECTED_TOAD_STAR_2) {
|
||||
// dialogId = TOAD_STAR_2_DIALOG_AFTER;
|
||||
// }
|
||||
// break;
|
||||
// case TOAD_STAR_3_DIALOG:
|
||||
// enoughStars = (starCount >= TOAD_STAR_3_REQUIREMENT);
|
||||
// if (saveFlags & SAVE_FLAG_COLLECTED_TOAD_STAR_3) {
|
||||
// dialogId = TOAD_STAR_3_DIALOG_AFTER;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// if (enoughStars) {
|
||||
// gCurrentObject->oToadMessageDialogId = dialogId;
|
||||
// gCurrentObject->oToadMessageRecentlyTalked = FALSE;
|
||||
// gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADED;
|
||||
// gCurrentObject->oOpacity = 81;
|
||||
// } else {
|
||||
// obj_mark_for_deletion(gCurrentObject);
|
||||
// }
|
||||
}
|
||||
|
||||
//static void star_door_unlock_spawn_particles(s16 angleOffset) {
|
||||
@@ -232,88 +245,94 @@ void bhv_toad_message_init(void) {
|
||||
// sparkleParticle->oPosY -= gCurrentObject->oUnlockDoorStarTimer * 10.0f;
|
||||
//}
|
||||
|
||||
void bhv_unlock_door_star_init(void) {
|
||||
// gCurrentObject->oUnlockDoorStarState = UNLOCK_DOOR_STAR_RISING;
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject->oUnlockDoorStarYawVel = 0x1000;
|
||||
// gCurrentObject->oPosX += 30.0f * sins(gMarioState->faceAngle[1] - 0x4000);
|
||||
// gCurrentObject->oPosY += 160.0f;
|
||||
// gCurrentObject->oPosZ += 30.0f * coss(gMarioState->faceAngle[1] - 0x4000);
|
||||
// gCurrentObject->oMoveAngleYaw = 0x7800;
|
||||
// obj_scale(gCurrentObject, 0.5f);
|
||||
void bhv_unlock_door_star_init(void)
|
||||
{
|
||||
// gCurrentObject->oUnlockDoorStarState = UNLOCK_DOOR_STAR_RISING;
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject->oUnlockDoorStarYawVel = 0x1000;
|
||||
// gCurrentObject->oPosX += 30.0f * sins(gMarioState->faceAngle[1] - 0x4000);
|
||||
// gCurrentObject->oPosY += 160.0f;
|
||||
// gCurrentObject->oPosZ += 30.0f * coss(gMarioState->faceAngle[1] - 0x4000);
|
||||
// gCurrentObject->oMoveAngleYaw = 0x7800;
|
||||
// obj_scale(gCurrentObject, 0.5f);
|
||||
}
|
||||
|
||||
void bhv_unlock_door_star_loop(void) {
|
||||
// UNUSED u8 unused1[4];
|
||||
// s16 prevYaw = gCurrentObject->oMoveAngleYaw;
|
||||
// UNUSED u8 unused2[4];
|
||||
//
|
||||
// // Speed up the star every frame
|
||||
// if (gCurrentObject->oUnlockDoorStarYawVel < 0x2400) {
|
||||
// gCurrentObject->oUnlockDoorStarYawVel += 0x60;
|
||||
// }
|
||||
// switch (gCurrentObject->oUnlockDoorStarState) {
|
||||
// case UNLOCK_DOOR_STAR_RISING:
|
||||
// gCurrentObject->oPosY += 3.4f; // Raise the star up in the air
|
||||
// gCurrentObject->oMoveAngleYaw +=
|
||||
// gCurrentObject->oUnlockDoorStarYawVel; // Apply yaw velocity
|
||||
// obj_scale(gCurrentObject, gCurrentObject->oUnlockDoorStarTimer / 50.0f
|
||||
// + 0.5f); // Scale the star to be bigger
|
||||
// if (++gCurrentObject->oUnlockDoorStarTimer == 30) {
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_WAITING
|
||||
// }
|
||||
// break;
|
||||
// case UNLOCK_DOOR_STAR_WAITING:
|
||||
// gCurrentObject->oMoveAngleYaw +=
|
||||
// gCurrentObject->oUnlockDoorStarYawVel; // Apply yaw velocity
|
||||
// if (++gCurrentObject->oUnlockDoorStarTimer == 30) {
|
||||
// play_sound(SOUND_MENU_STAR_SOUND,
|
||||
// gCurrentObject->header.gfx.cameraToObject); // Play final sound
|
||||
// cur_obj_hide(); // Hide the object
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject
|
||||
// ->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_SPAWNING_PARTICLES
|
||||
// }
|
||||
// break;
|
||||
// case UNLOCK_DOOR_STAR_SPAWNING_PARTICLES:
|
||||
// // Spawn two particles, opposite sides of the star.
|
||||
// star_door_unlock_spawn_particles(0);
|
||||
// star_door_unlock_spawn_particles(0x8000);
|
||||
// if (gCurrentObject->oUnlockDoorStarTimer++ == 20) {
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_DONE
|
||||
// }
|
||||
// break;
|
||||
// case UNLOCK_DOOR_STAR_DONE: // The object stays loaded for an additional 50 frames so that the
|
||||
// // sound doesn't immediately stop.
|
||||
// if (gCurrentObject->oUnlockDoorStarTimer++ == 50) {
|
||||
// obj_mark_for_deletion(gCurrentObject);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// // Checks if the angle has cycled back to 0.
|
||||
// // This means that the code will execute when the star completes a full revolution.
|
||||
// if (prevYaw > (s16) gCurrentObject->oMoveAngleYaw) {
|
||||
// play_sound(
|
||||
// SOUND_GENERAL_SHORT_STAR,
|
||||
// gCurrentObject->header.gfx.cameraToObject); // Play a sound every time the star spins once
|
||||
// }
|
||||
void bhv_unlock_door_star_loop(void)
|
||||
{
|
||||
// UNUSED u8 unused1[4];
|
||||
// s16 prevYaw = gCurrentObject->oMoveAngleYaw;
|
||||
// UNUSED u8 unused2[4];
|
||||
//
|
||||
// // Speed up the star every frame
|
||||
// if (gCurrentObject->oUnlockDoorStarYawVel < 0x2400) {
|
||||
// gCurrentObject->oUnlockDoorStarYawVel += 0x60;
|
||||
// }
|
||||
// switch (gCurrentObject->oUnlockDoorStarState) {
|
||||
// case UNLOCK_DOOR_STAR_RISING:
|
||||
// gCurrentObject->oPosY += 3.4f; // Raise the star up in the air
|
||||
// gCurrentObject->oMoveAngleYaw +=
|
||||
// gCurrentObject->oUnlockDoorStarYawVel; // Apply yaw velocity
|
||||
// obj_scale(gCurrentObject, gCurrentObject->oUnlockDoorStarTimer / 50.0f
|
||||
// + 0.5f); // Scale the star to be bigger
|
||||
// if (++gCurrentObject->oUnlockDoorStarTimer == 30) {
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_WAITING
|
||||
// }
|
||||
// break;
|
||||
// case UNLOCK_DOOR_STAR_WAITING:
|
||||
// gCurrentObject->oMoveAngleYaw +=
|
||||
// gCurrentObject->oUnlockDoorStarYawVel; // Apply yaw velocity
|
||||
// if (++gCurrentObject->oUnlockDoorStarTimer == 30) {
|
||||
// play_sound(SOUND_MENU_STAR_SOUND,
|
||||
// gCurrentObject->header.gfx.cameraToObject); // Play final sound
|
||||
// cur_obj_hide(); // Hide the object
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject
|
||||
// ->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_SPAWNING_PARTICLES
|
||||
// }
|
||||
// break;
|
||||
// case UNLOCK_DOOR_STAR_SPAWNING_PARTICLES:
|
||||
// // Spawn two particles, opposite sides of the star.
|
||||
// star_door_unlock_spawn_particles(0);
|
||||
// star_door_unlock_spawn_particles(0x8000);
|
||||
// if (gCurrentObject->oUnlockDoorStarTimer++ == 20) {
|
||||
// gCurrentObject->oUnlockDoorStarTimer = 0;
|
||||
// gCurrentObject->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_DONE
|
||||
// }
|
||||
// break;
|
||||
// case UNLOCK_DOOR_STAR_DONE: // The object stays loaded for an additional 50 frames so that the
|
||||
// // sound doesn't immediately stop.
|
||||
// if (gCurrentObject->oUnlockDoorStarTimer++ == 50) {
|
||||
// obj_mark_for_deletion(gCurrentObject);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// // Checks if the angle has cycled back to 0.
|
||||
// // This means that the code will execute when the star completes a full revolution.
|
||||
// if (prevYaw > (s16) gCurrentObject->oMoveAngleYaw) {
|
||||
// play_sound(
|
||||
// SOUND_GENERAL_SHORT_STAR,
|
||||
// gCurrentObject->header.gfx.cameraToObject); // Play a sound every time the star spins once
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a display list that sets the correct blend mode and color for mirror Mario.
|
||||
*/
|
||||
static Gfx *make_gfx_mario_alpha(struct GraphNodeGenerated *node, s16 alpha) {
|
||||
static Gfx *make_gfx_mario_alpha(struct GraphNodeGenerated *node, s16 alpha)
|
||||
{
|
||||
Gfx *gfx;
|
||||
Gfx *gfxHead = NULL;
|
||||
|
||||
if (alpha == 255) {
|
||||
node->fnNode.node.flags = (node->fnNode.node.flags & 0xFF) | (LAYER_OPAQUE << 8);
|
||||
if (alpha == 255)
|
||||
{
|
||||
node->fnNode.node.flags = node->fnNode.node.flags & 0xFF | LAYER_OPAQUE << 8;
|
||||
gfxHead = alloc_display_list(2 * sizeof(*gfxHead));
|
||||
gfx = gfxHead;
|
||||
} else {
|
||||
node->fnNode.node.flags = (node->fnNode.node.flags & 0xFF) | (LAYER_TRANSPARENT << 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->fnNode.node.flags = node->fnNode.node.flags & 0xFF | LAYER_TRANSPARENT << 8;
|
||||
gfxHead = alloc_display_list(3 * sizeof(*gfxHead));
|
||||
gfx = gfxHead;
|
||||
gDPSetAlphaCompare(gfx++, G_AC_DITHER);
|
||||
@@ -326,16 +345,17 @@ static Gfx *make_gfx_mario_alpha(struct GraphNodeGenerated *node, s16 alpha) {
|
||||
/**
|
||||
* Sets the correct blend mode and color for mirror Mario.
|
||||
*/
|
||||
Gfx *geo_mirror_mario_set_alpha(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
Gfx *geo_mirror_mario_set_alpha(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
UNUSED u8 unused1[4];
|
||||
Gfx *gfx = NULL;
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[asGenerated->parameter];
|
||||
s16 alpha;
|
||||
UNUSED u8 unused2[4];
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
alpha = (bodyState->modelState & 0x100) ? (bodyState->modelState & 0xFF) : 255;
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
s16 alpha = bodyState->modelState & 0x100 ? bodyState->modelState & 0xFF : 255;
|
||||
gfx = make_gfx_mario_alpha(asGenerated, alpha);
|
||||
}
|
||||
return gfx;
|
||||
@@ -346,13 +366,15 @@ Gfx *geo_mirror_mario_set_alpha(s32 callContext, struct GraphNode *node, UNUSED
|
||||
* If Mario is standing still, he is always high poly. If he is running,
|
||||
* his level of detail depends on the distance to the camera.
|
||||
*/
|
||||
Gfx *geo_switch_mario_stand_run(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx) {
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
||||
Gfx *geo_switch_mario_stand_run(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx)
|
||||
{
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases];
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
// assign result. 0 if moving, 1 if stationary.
|
||||
switchCase->selectedCase = ((bodyState->action & ACT_FLAG_STATIONARY) == 0);
|
||||
switchCase->selectedCase = (bodyState->action & ACT_FLAG_STATIONARY) == 0;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -360,20 +382,27 @@ Gfx *geo_switch_mario_stand_run(s32 callContext, struct GraphNode *node, UNUSED
|
||||
/**
|
||||
* Geo node script that makes Mario blink
|
||||
*/
|
||||
Gfx *geo_switch_mario_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
||||
Gfx *geo_switch_mario_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases];
|
||||
s16 blinkFrame;
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (bodyState->eyeState == 0) {
|
||||
blinkFrame = ((switchCase->numCases * 32 + gAreaUpdateCounter) >> 1) & 0x1F;
|
||||
if (blinkFrame < 7) {
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
if (bodyState->eyeState == 0)
|
||||
{
|
||||
s16 blinkFrame = (switchCase->numCases * 32 + gAreaUpdateCounter) >> 1 & 0x1F;
|
||||
if (blinkFrame < 7)
|
||||
{
|
||||
switchCase->selectedCase = gMarioBlinkAnimation[blinkFrame];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
switchCase->selectedCase = 0;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
switchCase->selectedCase = bodyState->eyeState - 1;
|
||||
}
|
||||
}
|
||||
@@ -383,16 +412,19 @@ Gfx *geo_switch_mario_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4
|
||||
/**
|
||||
* Makes Mario's upper body tilt depending on the rotation stored in his bodyState
|
||||
*/
|
||||
Gfx *geo_mario_tilt_torso(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
Gfx *geo_mario_tilt_torso(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[asGenerated->parameter];
|
||||
s32 action = bodyState->action;
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
struct GraphNodeRotation *rotNode = (struct GraphNodeRotation *) node->next;
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
struct GraphNodeRotation *rotNode = (struct GraphNodeRotation *)node->next;
|
||||
|
||||
if (action != ACT_BUTT_SLIDE && action != ACT_HOLD_BUTT_SLIDE && action != ACT_WALKING
|
||||
&& action != ACT_RIDING_SHELL_GROUND) {
|
||||
&& action != ACT_RIDING_SHELL_GROUND)
|
||||
{
|
||||
vec3s_copy(bodyState->torsoAngle, gVec3sZero);
|
||||
}
|
||||
rotNode->rotation[0] = bodyState->torsoAngle[1];
|
||||
@@ -405,26 +437,28 @@ Gfx *geo_mario_tilt_torso(s32 callContext, struct GraphNode *node, UNUSED Mat4 *
|
||||
/**
|
||||
* Makes Mario's head rotate with the camera angle when in C-up mode
|
||||
*/
|
||||
Gfx *geo_mario_head_rotation(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
Gfx *geo_mario_head_rotation(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[asGenerated->parameter];
|
||||
// s32 action = bodyState->action;
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
struct GraphNodeRotation *rotNode = (struct GraphNodeRotation *) node->next;
|
||||
// struct Camera *camera = gCurGraphNodeCamera->config.camera;
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
struct GraphNodeRotation *rotNode = (struct GraphNodeRotation *)node->next;
|
||||
// struct Camera *camera = gCurGraphNodeCamera->config.camera;
|
||||
|
||||
// if (camera->mode == CAMERA_MODE_C_UP) {
|
||||
// rotNode->rotation[0] = 0; // gPlayerCameraState->headRotation[1]; // PATCH
|
||||
// rotNode->rotation[2] = 0; // gPlayerCameraState->headRotation[0];
|
||||
// } else if (action & ACT_FLAG_WATER_OR_TEXT) {
|
||||
// rotNode->rotation[0] = bodyState->headAngle[1];
|
||||
// rotNode->rotation[1] = bodyState->headAngle[2];
|
||||
// rotNode->rotation[2] = bodyState->headAngle[0];
|
||||
// } else {
|
||||
vec3s_set(bodyState->headAngle, 0, 0, 0);
|
||||
vec3s_set(rotNode->rotation, 0, 0, 0);
|
||||
// }
|
||||
// if (camera->mode == CAMERA_MODE_C_UP) {
|
||||
// rotNode->rotation[0] = 0; // gPlayerCameraState->headRotation[1]; // PATCH
|
||||
// rotNode->rotation[2] = 0; // gPlayerCameraState->headRotation[0];
|
||||
// } else if (action & ACT_FLAG_WATER_OR_TEXT) {
|
||||
// rotNode->rotation[0] = bodyState->headAngle[1];
|
||||
// rotNode->rotation[1] = bodyState->headAngle[2];
|
||||
// rotNode->rotation[2] = bodyState->headAngle[0];
|
||||
// } else {
|
||||
vec3s_set(bodyState->headAngle, 0, 0, 0);
|
||||
vec3s_set(rotNode->rotation, 0, 0, 0);
|
||||
// }
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -433,21 +467,29 @@ Gfx *geo_mario_head_rotation(s32 callContext, struct GraphNode *node, UNUSED Mat
|
||||
* Switch between hand models.
|
||||
* Possible options are described in the MarioHandGSCId enum.
|
||||
*/
|
||||
Gfx *geo_switch_mario_hand(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
||||
Gfx *geo_switch_mario_hand(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[0];
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (bodyState->handState == MARIO_HAND_FISTS) {
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
if (bodyState->handState == MARIO_HAND_FISTS)
|
||||
{
|
||||
// switch between fists (0) and open (1)
|
||||
switchCase->selectedCase = ((bodyState->action & ACT_FLAG_SWIMMING_OR_FLYING) != 0);
|
||||
} else {
|
||||
if (switchCase->numCases == 0) {
|
||||
switchCase->selectedCase = (bodyState->action & ACT_FLAG_SWIMMING_OR_FLYING) != 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (switchCase->numCases == 0)
|
||||
{
|
||||
switchCase->selectedCase =
|
||||
(bodyState->handState < 5) ? bodyState->handState : MARIO_HAND_OPEN;
|
||||
} else {
|
||||
bodyState->handState < 5 ? bodyState->handState : MARIO_HAND_OPEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
switchCase->selectedCase =
|
||||
(bodyState->handState < 2) ? bodyState->handState : MARIO_HAND_FISTS;
|
||||
bodyState->handState < 2 ? bodyState->handState : MARIO_HAND_FISTS;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -462,21 +504,25 @@ Gfx *geo_switch_mario_hand(s32 callContext, struct GraphNode *node, UNUSED Mat4
|
||||
* ! Since the animation gets updated in GEO_CONTEXT_RENDER, drawing Mario multiple times
|
||||
* (such as in the mirror room) results in a faster and desynced punch / kick animation.
|
||||
*/
|
||||
Gfx *geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
struct GraphNodeScale *scaleNode = (struct GraphNodeScale *) node->next;
|
||||
Gfx *geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *)node;
|
||||
struct GraphNodeScale *scaleNode = (struct GraphNodeScale *)node->next;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[0];
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
scaleNode->scale = 1.0f;
|
||||
if (asGenerated->parameter == bodyState->punchState >> 6) {
|
||||
if (g_state->msMarioAttackAnimCounter != gAreaUpdateCounter && (bodyState->punchState & 0x3F) > 0) {
|
||||
if (asGenerated->parameter == bodyState->punchState >> 6)
|
||||
{
|
||||
if (g_state->msMarioAttackAnimCounter != gAreaUpdateCounter && (bodyState->punchState & 0x3F) > 0)
|
||||
{
|
||||
bodyState->punchState -= 1;
|
||||
g_state->msMarioAttackAnimCounter = gAreaUpdateCounter;
|
||||
}
|
||||
scaleNode->scale =
|
||||
gMarioAttackScaleAnimation[asGenerated->parameter * 6 + (bodyState->punchState & 0x3F)]
|
||||
/ 10.0f;
|
||||
gMarioAttackScaleAnimation[asGenerated->parameter * 6 + (bodyState->punchState & 0x3F)]
|
||||
/ 10.0f;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
@@ -485,12 +531,22 @@ Gfx *geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode *node, UNUSED
|
||||
/**
|
||||
* Switch between normal cap, wing cap, vanish cap and metal cap.
|
||||
*/
|
||||
Gfx *geo_switch_mario_cap_effect(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
||||
Gfx *geo_switch_mario_cap_effect(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases];
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
switchCase->selectedCase = bodyState->modelState >> 8;
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
// switchCase->selectedCase = bodyState->modelState >> 8;
|
||||
if (bodyState->modelState >> 8 >= 2)
|
||||
{ // temporarily disables metal cap
|
||||
switchCase->selectedCase = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
switchCase->selectedCase = bodyState->modelState >> 8;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -499,18 +555,25 @@ Gfx *geo_switch_mario_cap_effect(s32 callContext, struct GraphNode *node, UNUSED
|
||||
* Determine whether Mario's head is drawn with or without a cap on.
|
||||
* Also sets the visibility of the wing cap wings on or off.
|
||||
*/
|
||||
Gfx *geo_switch_mario_cap_on_off(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
Gfx *geo_switch_mario_cap_on_off(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
struct GraphNode *next = node->next;
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *)node;
|
||||
struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases];
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
switchCase->selectedCase = bodyState->capState & 1;
|
||||
while (next != node) {
|
||||
if (next->type == GRAPH_NODE_TYPE_TRANSLATION_ROTATION) {
|
||||
if (bodyState->capState & 2) {
|
||||
while (next != node)
|
||||
{
|
||||
if (next->type == GRAPH_NODE_TYPE_TRANSLATION_ROTATION)
|
||||
{
|
||||
if (bodyState->capState & 2)
|
||||
{
|
||||
next->flags |= GRAPH_RENDER_ACTIVE;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
next->flags &= ~GRAPH_RENDER_ACTIVE;
|
||||
}
|
||||
}
|
||||
@@ -524,21 +587,29 @@ Gfx *geo_switch_mario_cap_on_off(s32 callContext, struct GraphNode *node, UNUSED
|
||||
* Geo node script that makes the wings on Mario's wing cap flap.
|
||||
* Should be placed before a rotation node.
|
||||
*/
|
||||
Gfx *geo_mario_rotate_wing_cap_wings(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
Gfx *geo_mario_rotate_wing_cap_wings(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
s16 rotX;
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *)node;
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
struct GraphNodeRotation *rotNode = (struct GraphNodeRotation *) node->next;
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
struct GraphNodeRotation *rotNode = (struct GraphNodeRotation *)node->next;
|
||||
|
||||
if (!gBodyStates[asGenerated->parameter >> 1].wingFlutter) {
|
||||
if (!gBodyStates[asGenerated->parameter >> 1].wingFlutter)
|
||||
{
|
||||
rotX = (coss((gAreaUpdateCounter & 0xF) << 12) + 1.0f) * 4096.0f;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
rotX = (coss((gAreaUpdateCounter & 7) << 13) + 1.0f) * 6144.0f;
|
||||
}
|
||||
if (!(asGenerated->parameter & 1)) {
|
||||
if (!(asGenerated->parameter & 1))
|
||||
{
|
||||
rotNode->rotation[0] = -rotX;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
rotNode->rotation[0] = rotX;
|
||||
}
|
||||
}
|
||||
@@ -548,20 +619,27 @@ Gfx *geo_mario_rotate_wing_cap_wings(s32 callContext, struct GraphNode *node, UN
|
||||
/**
|
||||
* Geo node that updates the held object node and the HOLP.
|
||||
*/
|
||||
Gfx *geo_switch_mario_hand_grab_pos(s32 callContext, struct GraphNode *b, Mat4 *mtx) {
|
||||
struct GraphNodeHeldObject *asHeldObj = (struct GraphNodeHeldObject *) b;
|
||||
Gfx *geo_switch_mario_hand_grab_pos(s32 callContext, struct GraphNode *b, Mat4 *mtx)
|
||||
{
|
||||
struct GraphNodeHeldObject *asHeldObj = (struct GraphNodeHeldObject *)b;
|
||||
Mat4 *curTransform = mtx;
|
||||
struct MarioState *marioState = gMarioState; // &gMarioStates[asHeldObj->playerIndex]; // PATCH
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (callContext == GEO_CONTEXT_RENDER)
|
||||
{
|
||||
asHeldObj->objNode = NULL;
|
||||
if (marioState->heldObj != NULL) {
|
||||
if (marioState->heldObj != NULL)
|
||||
{
|
||||
asHeldObj->objNode = marioState->heldObj;
|
||||
switch (marioState->marioBodyState->grabPos) {
|
||||
switch (marioState->marioBodyState->grabPos)
|
||||
{
|
||||
case GRAB_POS_LIGHT_OBJ:
|
||||
if (marioState->action & ACT_FLAG_THROWING) {
|
||||
if (marioState->action & ACT_FLAG_THROWING)
|
||||
{
|
||||
vec3s_set(asHeldObj->translation, 50, 0, 0);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vec3s_set(asHeldObj->translation, 50, 0, 110);
|
||||
}
|
||||
break;
|
||||
@@ -573,7 +651,9 @@ Gfx *geo_switch_mario_hand_grab_pos(s32 callContext, struct GraphNode *b, Mat4 *
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (callContext == GEO_CONTEXT_HELD_OBJ) {
|
||||
}
|
||||
else if (callContext == GEO_CONTEXT_HELD_OBJ)
|
||||
{
|
||||
// ! The HOLP is set here, which is why it only updates when the held object is drawn.
|
||||
// This is why it won't update during a pause buffered hitstun or when the camera is very far
|
||||
// away.
|
||||
@@ -590,40 +670,41 @@ Gfx *geo_switch_mario_hand_grab_pos(s32 callContext, struct GraphNode *b, Mat4 *
|
||||
* Geo node that creates a clone of Mario's geo node and updates it to becomes
|
||||
* a mirror image of the player.
|
||||
*/
|
||||
Gfx *geo_render_mirror_mario(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
// f32 mirroredX;
|
||||
// struct Object *mario = gMarioState->marioObj; // PATCH gMarioStates[0].marioObj;
|
||||
Gfx *geo_render_mirror_mario(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
// f32 mirroredX;
|
||||
// struct Object *mario = gMarioState->marioObj; // PATCH gMarioStates[0].marioObj;
|
||||
|
||||
// switch (callContext) {
|
||||
// case GEO_CONTEXT_CREATE:
|
||||
// init_graph_node_object(NULL, &gMirrorMario, NULL, gVec3fZero, gVec3sZero, gVec3fOne);
|
||||
// break;
|
||||
// case GEO_CONTEXT_AREA_LOAD:
|
||||
// geo_add_child(node, &gMirrorMario.node);
|
||||
// break;
|
||||
// case GEO_CONTEXT_AREA_UNLOAD:
|
||||
// geo_remove_child(&gMirrorMario.node);
|
||||
// break;
|
||||
// case GEO_CONTEXT_RENDER:
|
||||
// if (mario->header.gfx.pos[0] > 1700.0f) {
|
||||
// // TODO: Is this a geo layout copy or a graph node copy?
|
||||
// gMirrorMario.sharedChild = mario->header.gfx.sharedChild;
|
||||
// gMirrorMario.areaIndex = mario->header.gfx.areaIndex;
|
||||
// vec3s_copy(gMirrorMario.angle, mario->header.gfx.angle);
|
||||
// vec3f_copy(gMirrorMario.pos, mario->header.gfx.pos);
|
||||
// vec3f_copy(gMirrorMario.scale, mario->header.gfx.scale);
|
||||
// switch (callContext) {
|
||||
// case GEO_CONTEXT_CREATE:
|
||||
// init_graph_node_object(NULL, &gMirrorMario, NULL, gVec3fZero, gVec3sZero, gVec3fOne);
|
||||
// break;
|
||||
// case GEO_CONTEXT_AREA_LOAD:
|
||||
// geo_add_child(node, &gMirrorMario.node);
|
||||
// break;
|
||||
// case GEO_CONTEXT_AREA_UNLOAD:
|
||||
// geo_remove_child(&gMirrorMario.node);
|
||||
// break;
|
||||
// case GEO_CONTEXT_RENDER:
|
||||
// if (mario->header.gfx.pos[0] > 1700.0f) {
|
||||
// // TODO: Is this a geo layout copy or a graph node copy?
|
||||
// gMirrorMario.sharedChild = mario->header.gfx.sharedChild;
|
||||
// gMirrorMario.areaIndex = mario->header.gfx.areaIndex;
|
||||
// vec3s_copy(gMirrorMario.angle, mario->header.gfx.angle);
|
||||
// vec3f_copy(gMirrorMario.pos, mario->header.gfx.pos);
|
||||
// vec3f_copy(gMirrorMario.scale, mario->header.gfx.scale);
|
||||
|
||||
// gMirrorMario.animInfo = mario->header.gfx.animInfo;
|
||||
// mirroredX = MIRROR_X - gMirrorMario.pos[0];
|
||||
// gMirrorMario.pos[0] = mirroredX + MIRROR_X;
|
||||
// gMirrorMario.angle[1] = -gMirrorMario.angle[1];
|
||||
// gMirrorMario.scale[0] *= -1.0f;
|
||||
// ((struct GraphNode *) &gMirrorMario)->flags |= 1;
|
||||
// } else {
|
||||
// ((struct GraphNode *) &gMirrorMario)->flags &= ~1;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// gMirrorMario.animInfo = mario->header.gfx.animInfo;
|
||||
// mirroredX = MIRROR_X - gMirrorMario.pos[0];
|
||||
// gMirrorMario.pos[0] = mirroredX + MIRROR_X;
|
||||
// gMirrorMario.angle[1] = -gMirrorMario.angle[1];
|
||||
// gMirrorMario.scale[0] *= -1.0f;
|
||||
// ((struct GraphNode *) &gMirrorMario)->flags |= 1;
|
||||
// } else {
|
||||
// ((struct GraphNode *) &gMirrorMario)->flags &= ~1;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -631,24 +712,25 @@ Gfx *geo_render_mirror_mario(s32 callContext, struct GraphNode *node, UNUSED Mat
|
||||
* Since Mirror Mario has an x scale of -1, the mesh becomes inside out.
|
||||
* This node corrects that by changing the culling mode accordingly.
|
||||
*/
|
||||
Gfx *geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
// struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
// Gfx *gfx = NULL;
|
||||
Gfx *geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c)
|
||||
{
|
||||
// struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
// Gfx *gfx = NULL;
|
||||
|
||||
// if (callContext == GEO_CONTEXT_RENDER && gCurGraphNodeObject == &gMirrorMario) {
|
||||
// gfx = alloc_display_list(3 * sizeof(*gfx));
|
||||
// if (callContext == GEO_CONTEXT_RENDER && gCurGraphNodeObject == &gMirrorMario) {
|
||||
// gfx = alloc_display_list(3 * sizeof(*gfx));
|
||||
|
||||
// if (asGenerated->parameter == 0) {
|
||||
// gSPClearGeometryMode(&gfx[0], G_CULL_BACK);
|
||||
// gSPSetGeometryMode(&gfx[1], G_CULL_FRONT);
|
||||
// gSPEndDisplayList(&gfx[2]);
|
||||
// } else {
|
||||
// gSPClearGeometryMode(&gfx[0], G_CULL_FRONT);
|
||||
// gSPSetGeometryMode(&gfx[1], G_CULL_BACK);
|
||||
// gSPEndDisplayList(&gfx[2]);
|
||||
// }
|
||||
// asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (LAYER_OPAQUE << 8);
|
||||
// }
|
||||
// return gfx;
|
||||
// if (asGenerated->parameter == 0) {
|
||||
// gSPClearGeometryMode(&gfx[0], G_CULL_BACK);
|
||||
// gSPSetGeometryMode(&gfx[1], G_CULL_FRONT);
|
||||
// gSPEndDisplayList(&gfx[2]);
|
||||
// } else {
|
||||
// gSPClearGeometryMode(&gfx[0], G_CULL_FRONT);
|
||||
// gSPSetGeometryMode(&gfx[1], G_CULL_BACK);
|
||||
// gSPEndDisplayList(&gfx[2]);
|
||||
// }
|
||||
// asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (LAYER_OPAQUE << 8);
|
||||
// }
|
||||
// return gfx;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -8,21 +8,37 @@
|
||||
|
||||
// Gfx *geo_draw_mario_head_goddard(s32 callContext, struct GraphNode *node, Mat4 *c);
|
||||
void bhv_toad_message_loop(void);
|
||||
|
||||
void bhv_toad_message_init(void);
|
||||
|
||||
void bhv_unlock_door_star_init(void);
|
||||
|
||||
void bhv_unlock_door_star_loop(void);
|
||||
|
||||
Gfx *geo_mirror_mario_set_alpha(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_switch_mario_stand_run(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx);
|
||||
|
||||
Gfx *geo_switch_mario_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_mario_tilt_torso(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_mario_head_rotation(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_switch_mario_hand(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_switch_mario_cap_effect(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_switch_mario_cap_on_off(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_mario_rotate_wing_cap_wings(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_switch_mario_hand_grab_pos(s32 callContext, struct GraphNode *b, Mat4 *mtx);
|
||||
|
||||
Gfx *geo_render_mirror_mario(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
Gfx *geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
|
||||
|
||||
#endif // MARIO_MISC_H
|
||||
|
||||
+257
-154
@@ -8,11 +8,11 @@
|
||||
#include "interaction.h"
|
||||
#include "mario_step.h"
|
||||
|
||||
static s16 sMovingSandSpeeds[] = { 12, 8, 4, 0 };
|
||||
static s16 sMovingSandSpeeds[] = {12, 8, 4, 0};
|
||||
|
||||
struct SM64SurfaceCollisionData gWaterSurfacePseudoFloor = {
|
||||
SURFACE_VERY_SLIPPERY, 0, 0, 0, 0, 0, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
|
||||
{ 0.0f, 1.0f, 0.0f }, 0.0f, 0, NULL, 0
|
||||
SURFACE_VERY_SLIPPERY, 0, 0, 0, 0, 0, {0, 0, 0}, {0, 0, 0}, {0, 0, 0},
|
||||
{0.0f, 1.0f, 0.0f}, 0.0f, 0, NULL, 0
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,8 @@ struct SM64SurfaceCollisionData gWaterSurfacePseudoFloor = {
|
||||
* known through stub_mario_step_2 and whether Mario was on it,
|
||||
* and if so return a higher value than 0.
|
||||
*/
|
||||
f32 get_additive_y_vel_for_jumps(void) {
|
||||
f32 get_additive_y_vel_for_jumps(void)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -38,7 +39,8 @@ f32 get_additive_y_vel_for_jumps(void) {
|
||||
* this could be used for checking if Mario was on the trampoline.
|
||||
* It could, for example, make him bounce.
|
||||
*/
|
||||
void stub_mario_step_1(UNUSED struct MarioState *x) {
|
||||
void stub_mario_step_1(UNUSED struct MarioState * x)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,10 +50,12 @@ void stub_mario_step_1(UNUSED struct MarioState *x) {
|
||||
* by the trampoline to make itself known to get_additive_y_vel_for_jumps,
|
||||
* or to set a variable with its intended additive Y vel.
|
||||
*/
|
||||
void stub_mario_step_2(void) {
|
||||
void stub_mario_step_2(void)
|
||||
{
|
||||
}
|
||||
|
||||
void transfer_bully_speed(struct BullyCollisionData *obj1, struct BullyCollisionData *obj2) {
|
||||
void transfer_bully_speed(struct BullyCollisionData *obj1, struct BullyCollisionData *obj2)
|
||||
{
|
||||
f32 rx = obj2->posX - obj1->posX;
|
||||
f32 rz = obj2->posZ - obj1->posZ;
|
||||
|
||||
@@ -70,9 +74,12 @@ void transfer_bully_speed(struct BullyCollisionData *obj1, struct BullyCollision
|
||||
//! Bully battery
|
||||
}
|
||||
|
||||
BAD_RETURN(s32) init_bully_collision_data(struct BullyCollisionData *data, f32 posX, f32 posZ,
|
||||
f32 forwardVel, s16 yaw, f32 conversionRatio, f32 radius) {
|
||||
if (forwardVel < 0.0f) {
|
||||
BAD_RETURN (s32) init_bully_collision_data(
|
||||
struct BullyCollisionData *data, f32 posX, f32 posZ,
|
||||
f32 forwardVel, s16 yaw, f32 conversionRatio, f32 radius)
|
||||
{
|
||||
if (forwardVel < 0.0f)
|
||||
{
|
||||
forwardVel *= -1.0f;
|
||||
yaw += 0x8000;
|
||||
}
|
||||
@@ -85,55 +92,72 @@ BAD_RETURN(s32) init_bully_collision_data(struct BullyCollisionData *data, f32 p
|
||||
data->velZ = forwardVel * coss(yaw);
|
||||
}
|
||||
|
||||
void mario_bonk_reflection(struct MarioState *m, u32 negateSpeed) {
|
||||
if (m->wall != NULL) {
|
||||
void mario_bonk_reflection(struct MarioState *m, u32 negateSpeed)
|
||||
{
|
||||
if (m->wall != NULL)
|
||||
{
|
||||
s16 wallAngle = atan2s(m->wall->normal.z, m->wall->normal.x);
|
||||
m->faceAngle[1] = wallAngle - (s16)(m->faceAngle[1] - wallAngle);
|
||||
|
||||
play_sound((m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_BONK : SOUND_ACTION_BONK,
|
||||
play_sound(m->flags & MARIO_METAL_CAP ? SOUND_ACTION_METAL_BONK : SOUND_ACTION_BONK,
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
play_sound(SOUND_ACTION_HIT, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
if (negateSpeed) {
|
||||
if (negateSpeed)
|
||||
{
|
||||
mario_set_forward_vel(m, -m->forwardVel);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->faceAngle[1] += 0x8000;
|
||||
}
|
||||
}
|
||||
|
||||
u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed) {
|
||||
if (m->action & ACT_FLAG_RIDING_SHELL) {
|
||||
u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed)
|
||||
{
|
||||
if (m->action & ACT_FLAG_RIDING_SHELL)
|
||||
{
|
||||
m->quicksandDepth = 0.0f;
|
||||
} else {
|
||||
if (m->quicksandDepth < 1.1f) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m->quicksandDepth < 1.1f)
|
||||
{
|
||||
m->quicksandDepth = 1.1f;
|
||||
}
|
||||
|
||||
switch (m->floor->type) {
|
||||
switch (m->floor->type)
|
||||
{
|
||||
case SURFACE_SHALLOW_QUICKSAND:
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 10.0f) {
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 10.0f)
|
||||
{
|
||||
m->quicksandDepth = 10.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case SURFACE_SHALLOW_MOVING_QUICKSAND:
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 25.0f) {
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 25.0f)
|
||||
{
|
||||
m->quicksandDepth = 25.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case SURFACE_QUICKSAND:
|
||||
case SURFACE_MOVING_QUICKSAND:
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 60.0f) {
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 60.0f)
|
||||
{
|
||||
m->quicksandDepth = 60.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case SURFACE_DEEP_QUICKSAND:
|
||||
case SURFACE_DEEP_MOVING_QUICKSAND:
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 160.0f) {
|
||||
if ((m->quicksandDepth += sinkingSpeed) >= 160.0f)
|
||||
{
|
||||
update_mario_sound_and_camera(m);
|
||||
return drop_and_set_mario_action(m, ACT_QUICKSAND_DEATH, 0);
|
||||
}
|
||||
@@ -154,13 +178,17 @@ u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 mario_push_off_steep_floor(struct MarioState *m, u32 action, u32 actionArg) {
|
||||
u32 mario_push_off_steep_floor(struct MarioState *m, u32 action, u32 actionArg)
|
||||
{
|
||||
s16 floorDYaw = m->floorAngle - m->faceAngle[1];
|
||||
|
||||
if (floorDYaw > -0x4000 && floorDYaw < 0x4000) {
|
||||
if (floorDYaw > -0x4000 && floorDYaw < 0x4000)
|
||||
{
|
||||
m->forwardVel = 16.0f;
|
||||
m->faceAngle[1] = m->floorAngle;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->forwardVel = -16.0f;
|
||||
m->faceAngle[1] = m->floorAngle + 0x8000;
|
||||
}
|
||||
@@ -168,12 +196,14 @@ u32 mario_push_off_steep_floor(struct MarioState *m, u32 action, u32 actionArg)
|
||||
return set_mario_action(m, action, actionArg);
|
||||
}
|
||||
|
||||
u32 mario_update_moving_sand(struct MarioState *m) {
|
||||
u32 mario_update_moving_sand(struct MarioState *m)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *floor = m->floor;
|
||||
s32 floorType = floor->type;
|
||||
|
||||
if (floorType == SURFACE_DEEP_MOVING_QUICKSAND || floorType == SURFACE_SHALLOW_MOVING_QUICKSAND
|
||||
|| floorType == SURFACE_MOVING_QUICKSAND || floorType == SURFACE_INSTANT_MOVING_QUICKSAND) {
|
||||
|| floorType == SURFACE_MOVING_QUICKSAND || floorType == SURFACE_INSTANT_MOVING_QUICKSAND)
|
||||
{
|
||||
s16 pushAngle = floor->force << 8;
|
||||
f32 pushSpeed = sMovingSandSpeeds[floor->force >> 8];
|
||||
|
||||
@@ -186,40 +216,47 @@ u32 mario_update_moving_sand(struct MarioState *m) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 mario_update_windy_ground(struct MarioState *m) {
|
||||
u32 mario_update_windy_ground(struct MarioState *m)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *floor = m->floor;
|
||||
|
||||
if (floor->type == SURFACE_HORIZONTAL_WIND) {
|
||||
if (floor->type == SURFACE_HORIZONTAL_WIND)
|
||||
{
|
||||
f32 pushSpeed;
|
||||
s16 pushAngle = floor->force << 8;
|
||||
|
||||
if (m->action & ACT_FLAG_MOVING) {
|
||||
if (m->action & ACT_FLAG_MOVING)
|
||||
{
|
||||
s16 pushDYaw = m->faceAngle[1] - pushAngle;
|
||||
|
||||
pushSpeed = m->forwardVel > 0.0f ? -m->forwardVel * 0.5f : -8.0f;
|
||||
|
||||
if (pushDYaw > -0x4000 && pushDYaw < 0x4000) {
|
||||
if (pushDYaw > -0x4000 && pushDYaw < 0x4000)
|
||||
{
|
||||
pushSpeed *= -1.0f;
|
||||
}
|
||||
|
||||
pushSpeed *= coss(pushDYaw);
|
||||
} else {
|
||||
pushSpeed = 3.2f + (gGlobalTimer % 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
pushSpeed = 3.2f + gGlobalTimer % 4;
|
||||
}
|
||||
|
||||
m->vel[0] += pushSpeed * sins(pushAngle);
|
||||
m->vel[2] += pushSpeed * coss(pushAngle);
|
||||
|
||||
#if VERSION_JP
|
||||
#if VERSION_JP
|
||||
play_sound(SOUND_ENV_WIND2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void stop_and_set_height_to_floor(struct MarioState *m) {
|
||||
void stop_and_set_height_to_floor(struct MarioState *m)
|
||||
{
|
||||
struct Object *marioObj = m->marioObj;
|
||||
|
||||
mario_set_forward_vel(m, 0.0f);
|
||||
@@ -232,18 +269,21 @@ void stop_and_set_height_to_floor(struct MarioState *m) {
|
||||
vec3s_set(marioObj->header.gfx.angle, 0, m->faceAngle[1], 0);
|
||||
}
|
||||
|
||||
s32 stationary_ground_step(struct MarioState *m) {
|
||||
u32 takeStep;
|
||||
s32 stationary_ground_step(struct MarioState *m)
|
||||
{
|
||||
struct Object *marioObj = m->marioObj;
|
||||
u32 stepResult = GROUND_STEP_NONE;
|
||||
|
||||
mario_set_forward_vel(m, 0.0f);
|
||||
|
||||
takeStep = mario_update_moving_sand(m);
|
||||
u32 takeStep = mario_update_moving_sand(m);
|
||||
takeStep |= mario_update_windy_ground(m);
|
||||
if (takeStep) {
|
||||
if (takeStep)
|
||||
{
|
||||
stepResult = perform_ground_step(m);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
//! This is responsible for several stationary downwarps.
|
||||
m->pos[1] = m->floorHeight;
|
||||
|
||||
@@ -254,38 +294,38 @@ s32 stationary_ground_step(struct MarioState *m) {
|
||||
return stepResult;
|
||||
}
|
||||
|
||||
static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
|
||||
UNUSED struct SM64SurfaceCollisionData *lowerWall;
|
||||
struct SM64SurfaceCollisionData *upperWall;
|
||||
static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *ceil;
|
||||
struct SM64SurfaceCollisionData *floor;
|
||||
f32 ceilHeight;
|
||||
f32 floorHeight;
|
||||
f32 waterLevel;
|
||||
|
||||
lowerWall = resolve_and_return_wall_collisions(nextPos, 30.0f, 24.0f);
|
||||
upperWall = resolve_and_return_wall_collisions(nextPos, 60.0f, 50.0f);
|
||||
struct SM64SurfaceCollisionData *lowerWall = resolve_and_return_wall_collisions(nextPos, 30.0f, 24.0f);
|
||||
struct SM64SurfaceCollisionData *upperWall = resolve_and_return_wall_collisions(nextPos, 60.0f, 50.0f);
|
||||
|
||||
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
||||
f32 floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||
f32 ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
||||
|
||||
//waterLevel = find_water_level(nextPos[0], nextPos[2]);
|
||||
waterLevel = m->waterLevel;
|
||||
f32 waterLevel = m->waterLevel;
|
||||
|
||||
m->wall = upperWall;
|
||||
|
||||
if (floor == NULL) {
|
||||
if (floor == NULL)
|
||||
{
|
||||
return GROUND_STEP_HIT_WALL_STOP_QSTEPS;
|
||||
}
|
||||
|
||||
if ((m->action & ACT_FLAG_RIDING_SHELL) && floorHeight < waterLevel) {
|
||||
if (m->action & ACT_FLAG_RIDING_SHELL && floorHeight < waterLevel)
|
||||
{
|
||||
floorHeight = waterLevel;
|
||||
floor = &gWaterSurfacePseudoFloor;
|
||||
floor->originOffset = floorHeight; //! Wrong origin offset (no effect)
|
||||
}
|
||||
|
||||
if (nextPos[1] > floorHeight + 100.0f) {
|
||||
if (nextPos[1] + 160.0f >= ceilHeight) {
|
||||
if (nextPos[1] > floorHeight + 100.0f)
|
||||
{
|
||||
if (nextPos[1] + 160.0f >= ceilHeight)
|
||||
{
|
||||
return GROUND_STEP_HIT_WALL_STOP_QSTEPS;
|
||||
}
|
||||
|
||||
@@ -295,7 +335,8 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
|
||||
return GROUND_STEP_LEFT_GROUND;
|
||||
}
|
||||
|
||||
if (floorHeight + 160.0f >= ceilHeight) {
|
||||
if (floorHeight + 160.0f >= ceilHeight)
|
||||
{
|
||||
return GROUND_STEP_HIT_WALL_STOP_QSTEPS;
|
||||
}
|
||||
|
||||
@@ -303,13 +344,16 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
|
||||
m->floor = floor;
|
||||
m->floorHeight = floorHeight;
|
||||
|
||||
if (upperWall != NULL) {
|
||||
if (upperWall != NULL)
|
||||
{
|
||||
s16 wallDYaw = atan2s(upperWall->normal.z, upperWall->normal.x) - m->faceAngle[1];
|
||||
|
||||
if (wallDYaw >= 0x2AAA && wallDYaw <= 0x5555) {
|
||||
if (wallDYaw >= 0x2AAA && wallDYaw <= 0x5555)
|
||||
{
|
||||
return GROUND_STEP_NONE;
|
||||
}
|
||||
if (wallDYaw <= -0x2AAA && wallDYaw >= -0x5555) {
|
||||
if (wallDYaw <= -0x2AAA && wallDYaw >= -0x5555)
|
||||
{
|
||||
return GROUND_STEP_NONE;
|
||||
}
|
||||
|
||||
@@ -319,18 +363,20 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) {
|
||||
return GROUND_STEP_NONE;
|
||||
}
|
||||
|
||||
s32 perform_ground_step(struct MarioState *m) {
|
||||
s32 i;
|
||||
s32 perform_ground_step(struct MarioState *m)
|
||||
{
|
||||
u32 stepResult;
|
||||
Vec3f intendedPos;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (s32 i = 0; i < 4; i++)
|
||||
{
|
||||
intendedPos[0] = m->pos[0] + m->floor->normal.y * (m->vel[0] / 4.0f);
|
||||
intendedPos[2] = m->pos[2] + m->floor->normal.y * (m->vel[2] / 4.0f);
|
||||
intendedPos[1] = m->pos[1];
|
||||
|
||||
stepResult = perform_ground_quarter_step(m, intendedPos);
|
||||
if (stepResult == GROUND_STEP_LEFT_GROUND || stepResult == GROUND_STEP_HIT_WALL_STOP_QSTEPS) {
|
||||
if (stepResult == GROUND_STEP_LEFT_GROUND || stepResult == GROUND_STEP_HIT_WALL_STOP_QSTEPS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -339,28 +385,30 @@ s32 perform_ground_step(struct MarioState *m) {
|
||||
vec3f_copy(m->marioObj->header.gfx.pos, m->pos);
|
||||
vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0);
|
||||
|
||||
if (stepResult == GROUND_STEP_HIT_WALL_CONTINUE_QSTEPS) {
|
||||
if (stepResult == GROUND_STEP_HIT_WALL_CONTINUE_QSTEPS)
|
||||
{
|
||||
stepResult = GROUND_STEP_HIT_WALL;
|
||||
}
|
||||
return stepResult;
|
||||
}
|
||||
|
||||
u32 check_ledge_grab(struct MarioState *m, struct SM64SurfaceCollisionData *wall, Vec3f intendedPos, Vec3f nextPos) {
|
||||
u32 check_ledge_grab(struct MarioState *m, struct SM64SurfaceCollisionData *wall, Vec3f intendedPos, Vec3f nextPos)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *ledgeFloor;
|
||||
Vec3f ledgePos;
|
||||
f32 displacementX;
|
||||
f32 displacementZ;
|
||||
|
||||
if (m->vel[1] > 0) {
|
||||
if (m->vel[1] > 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
displacementX = nextPos[0] - intendedPos[0];
|
||||
displacementZ = nextPos[2] - intendedPos[2];
|
||||
f32 displacementX = nextPos[0] - intendedPos[0];
|
||||
f32 displacementZ = nextPos[2] - intendedPos[2];
|
||||
|
||||
// Only ledge grab if the wall displaced Mario in the opposite direction of
|
||||
// his velocity.
|
||||
if (displacementX * m->vel[0] + displacementZ * m->vel[2] > 0.0f) {
|
||||
if (displacementX * m->vel[0] + displacementZ * m->vel[2] > 0.0f)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -370,7 +418,8 @@ u32 check_ledge_grab(struct MarioState *m, struct SM64SurfaceCollisionData *wall
|
||||
ledgePos[2] = nextPos[2] - wall->normal.z * 60.0f;
|
||||
ledgePos[1] = find_floor(ledgePos[0], nextPos[1] + 160.0f, ledgePos[2], &ledgeFloor);
|
||||
|
||||
if (ledgePos[1] - nextPos[1] <= 100.0f) {
|
||||
if (ledgePos[1] - nextPos[1] <= 100.0f)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -385,35 +434,32 @@ u32 check_ledge_grab(struct MarioState *m, struct SM64SurfaceCollisionData *wall
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepArg) {
|
||||
s16 wallDYaw;
|
||||
s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepArg)
|
||||
{
|
||||
Vec3f nextPos;
|
||||
struct SM64SurfaceCollisionData *upperWall;
|
||||
struct SM64SurfaceCollisionData *lowerWall;
|
||||
struct SM64SurfaceCollisionData *ceil;
|
||||
struct SM64SurfaceCollisionData *floor;
|
||||
f32 ceilHeight;
|
||||
f32 floorHeight;
|
||||
f32 waterLevel;
|
||||
|
||||
vec3f_copy(nextPos, intendedPos);
|
||||
|
||||
upperWall = resolve_and_return_wall_collisions(nextPos, 150.0f, 50.0f);
|
||||
lowerWall = resolve_and_return_wall_collisions(nextPos, 30.0f, 50.0f);
|
||||
struct SM64SurfaceCollisionData *upperWall = resolve_and_return_wall_collisions(nextPos, 150.0f, 50.0f);
|
||||
struct SM64SurfaceCollisionData *lowerWall = resolve_and_return_wall_collisions(nextPos, 30.0f, 50.0f);
|
||||
|
||||
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||
ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
||||
f32 floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||
f32 ceilHeight = vec3f_find_ceil(nextPos, floorHeight, &ceil);
|
||||
|
||||
//waterLevel = find_water_level(nextPos[0], nextPos[2]);
|
||||
waterLevel = m->waterLevel;
|
||||
f32 waterLevel = m->waterLevel;
|
||||
|
||||
m->wall = NULL;
|
||||
|
||||
//! The water pseudo floor is not referenced when your intended qstep is
|
||||
// out of bounds, so it won't detect you as landing.
|
||||
|
||||
if (floor == NULL) {
|
||||
if (nextPos[1] <= m->floorHeight) {
|
||||
if (floor == NULL)
|
||||
{
|
||||
if (nextPos[1] <= m->floorHeight)
|
||||
{
|
||||
m->pos[1] = m->floorHeight;
|
||||
return AIR_STEP_LANDED;
|
||||
}
|
||||
@@ -422,15 +468,18 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
|
||||
return AIR_STEP_HIT_WALL;
|
||||
}
|
||||
|
||||
if ((m->action & ACT_FLAG_RIDING_SHELL) && floorHeight < waterLevel) {
|
||||
if (m->action & ACT_FLAG_RIDING_SHELL && floorHeight < waterLevel)
|
||||
{
|
||||
floorHeight = waterLevel;
|
||||
floor = &gWaterSurfacePseudoFloor;
|
||||
floor->originOffset = floorHeight; //! Incorrect origin offset (no effect)
|
||||
}
|
||||
|
||||
//! This check uses f32, but findFloor uses short (overflow jumps)
|
||||
if (nextPos[1] <= floorHeight) {
|
||||
if (ceilHeight - floorHeight > 160.0f) {
|
||||
if (nextPos[1] <= floorHeight)
|
||||
{
|
||||
if (ceilHeight - floorHeight > 160.0f)
|
||||
{
|
||||
m->pos[0] = nextPos[0];
|
||||
m->pos[2] = nextPos[2];
|
||||
m->floor = floor;
|
||||
@@ -444,13 +493,16 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
|
||||
return AIR_STEP_LANDED;
|
||||
}
|
||||
|
||||
if (nextPos[1] + 160.0f > ceilHeight) {
|
||||
if (m->vel[1] >= 0.0f) {
|
||||
if (nextPos[1] + 160.0f > ceilHeight)
|
||||
{
|
||||
if (m->vel[1] >= 0.0f)
|
||||
{
|
||||
m->vel[1] = 0.0f;
|
||||
|
||||
//! Uses referenced ceiling instead of ceil (ceiling hang upwarp)
|
||||
if ((stepArg & AIR_STEP_CHECK_HANG) && m->ceil != NULL
|
||||
&& m->ceil->type == SURFACE_HANGABLE) {
|
||||
if (stepArg & AIR_STEP_CHECK_HANG && m->ceil != NULL
|
||||
&& m->ceil->type == SURFACE_HANGABLE)
|
||||
{
|
||||
return AIR_STEP_GRABBED_CEILING;
|
||||
}
|
||||
|
||||
@@ -458,7 +510,8 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
|
||||
}
|
||||
|
||||
//! Potential subframe downwarp->upwarp?
|
||||
if (nextPos[1] <= m->floorHeight) {
|
||||
if (nextPos[1] <= m->floorHeight)
|
||||
{
|
||||
m->pos[1] = m->floorHeight;
|
||||
return AIR_STEP_LANDED;
|
||||
}
|
||||
@@ -469,8 +522,10 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
|
||||
|
||||
//! When the wall is not completely vertical or there is a slight wall
|
||||
// misalignment, you can activate these conditions in unexpected situations
|
||||
if ((stepArg & AIR_STEP_CHECK_LEDGE_GRAB) && upperWall == NULL && lowerWall != NULL) {
|
||||
if (check_ledge_grab(m, lowerWall, intendedPos, nextPos)) {
|
||||
if (stepArg & AIR_STEP_CHECK_LEDGE_GRAB && upperWall == NULL && lowerWall != NULL)
|
||||
{
|
||||
if (check_ledge_grab(m, lowerWall, intendedPos, nextPos))
|
||||
{
|
||||
return AIR_STEP_GRABBED_LEDGE;
|
||||
}
|
||||
|
||||
@@ -484,15 +539,18 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
|
||||
m->floor = floor;
|
||||
m->floorHeight = floorHeight;
|
||||
|
||||
if (upperWall != NULL || lowerWall != NULL) {
|
||||
if (upperWall != NULL || lowerWall != NULL)
|
||||
{
|
||||
m->wall = upperWall != NULL ? upperWall : lowerWall;
|
||||
wallDYaw = atan2s(m->wall->normal.z, m->wall->normal.x) - m->faceAngle[1];
|
||||
s16 wallDYaw = atan2s(m->wall->normal.z, m->wall->normal.x) - m->faceAngle[1];
|
||||
|
||||
if (m->wall->type == SURFACE_BURNING) {
|
||||
if (m->wall->type == SURFACE_BURNING)
|
||||
{
|
||||
return AIR_STEP_HIT_LAVA_WALL;
|
||||
}
|
||||
|
||||
if (wallDYaw < -0x6000 || wallDYaw > 0x6000) {
|
||||
if (wallDYaw < -0x6000 || wallDYaw > 0x6000)
|
||||
{
|
||||
m->flags |= MARIO_UNKNOWN_30;
|
||||
return AIR_STEP_HIT_WALL;
|
||||
}
|
||||
@@ -501,150 +559,193 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr
|
||||
return AIR_STEP_NONE;
|
||||
}
|
||||
|
||||
void apply_twirl_gravity(struct MarioState *m) {
|
||||
f32 terminalVelocity;
|
||||
void apply_twirl_gravity(struct MarioState *m)
|
||||
{
|
||||
f32 heaviness = 1.0f;
|
||||
|
||||
if (m->angleVel[1] > 1024) {
|
||||
if (m->angleVel[1] > 1024)
|
||||
{
|
||||
heaviness = 1024.0f / m->angleVel[1];
|
||||
}
|
||||
|
||||
terminalVelocity = -75.0f * heaviness;
|
||||
f32 terminalVelocity = -75.0f * heaviness;
|
||||
|
||||
m->vel[1] -= 4.0f * heaviness;
|
||||
if (m->vel[1] < terminalVelocity) {
|
||||
if (m->vel[1] < terminalVelocity)
|
||||
{
|
||||
m->vel[1] = terminalVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
u32 should_strengthen_gravity_for_jump_ascent(struct MarioState *m) {
|
||||
if (!(m->flags & MARIO_UNKNOWN_08)) {
|
||||
u32 should_strengthen_gravity_for_jump_ascent(struct MarioState *m)
|
||||
{
|
||||
if (!(m->flags & MARIO_UNKNOWN_08))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (m->action & (ACT_FLAG_INTANGIBLE | ACT_FLAG_INVULNERABLE)) {
|
||||
if (m->action & (ACT_FLAG_INTANGIBLE | ACT_FLAG_INVULNERABLE))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(m->input & INPUT_A_DOWN) && m->vel[1] > 20.0f) {
|
||||
if (!(m->input & INPUT_A_DOWN) && m->vel[1] > 20.0f)
|
||||
{
|
||||
return (m->action & ACT_FLAG_CONTROL_JUMP_HEIGHT) != 0;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void apply_gravity(struct MarioState *m) {
|
||||
if (m->action == ACT_TWIRLING && m->vel[1] < 0.0f) {
|
||||
void apply_gravity(struct MarioState *m)
|
||||
{
|
||||
if (m->action == ACT_TWIRLING && m->vel[1] < 0.0f)
|
||||
{
|
||||
apply_twirl_gravity(m);
|
||||
} else if (m->action == ACT_SHOT_FROM_CANNON) {
|
||||
}
|
||||
else if (m->action == ACT_SHOT_FROM_CANNON)
|
||||
{
|
||||
m->vel[1] -= 1.0f;
|
||||
if (m->vel[1] < -75.0f) {
|
||||
if (m->vel[1] < -75.0f)
|
||||
{
|
||||
m->vel[1] = -75.0f;
|
||||
}
|
||||
} else if (m->action == ACT_LONG_JUMP || m->action == ACT_SLIDE_KICK
|
||||
|| m->action == ACT_BBH_ENTER_SPIN) {
|
||||
}
|
||||
else if (m->action == ACT_LONG_JUMP || m->action == ACT_SLIDE_KICK
|
||||
|| m->action == ACT_BBH_ENTER_SPIN)
|
||||
{
|
||||
m->vel[1] -= 2.0f;
|
||||
if (m->vel[1] < -75.0f) {
|
||||
if (m->vel[1] < -75.0f)
|
||||
{
|
||||
m->vel[1] = -75.0f;
|
||||
}
|
||||
} else if (m->action == ACT_LAVA_BOOST || m->action == ACT_FALL_AFTER_STAR_GRAB) {
|
||||
}
|
||||
else if (m->action == ACT_LAVA_BOOST || m->action == ACT_FALL_AFTER_STAR_GRAB)
|
||||
{
|
||||
m->vel[1] -= 3.2f;
|
||||
if (m->vel[1] < -65.0f) {
|
||||
if (m->vel[1] < -65.0f)
|
||||
{
|
||||
m->vel[1] = -65.0f;
|
||||
}
|
||||
} else if (m->action == ACT_GETTING_BLOWN) {
|
||||
}
|
||||
else if (m->action == ACT_GETTING_BLOWN)
|
||||
{
|
||||
m->vel[1] -= m->unkC4;
|
||||
if (m->vel[1] < -75.0f) {
|
||||
if (m->vel[1] < -75.0f)
|
||||
{
|
||||
m->vel[1] = -75.0f;
|
||||
}
|
||||
} else if (should_strengthen_gravity_for_jump_ascent(m)) {
|
||||
}
|
||||
else if (should_strengthen_gravity_for_jump_ascent(m))
|
||||
{
|
||||
m->vel[1] /= 4.0f;
|
||||
} else if (m->action & ACT_FLAG_METAL_WATER) {
|
||||
}
|
||||
else if (m->action & ACT_FLAG_METAL_WATER)
|
||||
{
|
||||
m->vel[1] -= 1.6f;
|
||||
if (m->vel[1] < -16.0f) {
|
||||
if (m->vel[1] < -16.0f)
|
||||
{
|
||||
m->vel[1] = -16.0f;
|
||||
}
|
||||
} else if ((m->flags & MARIO_WING_CAP) && m->vel[1] < 0.0f && (m->input & INPUT_A_DOWN)) {
|
||||
}
|
||||
else if (m->flags & MARIO_WING_CAP && m->vel[1] < 0.0f && m->input & INPUT_A_DOWN)
|
||||
{
|
||||
m->marioBodyState->wingFlutter = TRUE;
|
||||
|
||||
m->vel[1] -= 2.0f;
|
||||
if (m->vel[1] < -37.5f) {
|
||||
if ((m->vel[1] += 4.0f) > -37.5f) {
|
||||
if (m->vel[1] < -37.5f)
|
||||
{
|
||||
if ((m->vel[1] += 4.0f) > -37.5f)
|
||||
{
|
||||
m->vel[1] = -37.5f;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m->vel[1] -= 4.0f;
|
||||
if (m->vel[1] < -75.0f) {
|
||||
if (m->vel[1] < -75.0f)
|
||||
{
|
||||
m->vel[1] = -75.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void apply_vertical_wind(struct MarioState *m) {
|
||||
void apply_vertical_wind(struct MarioState *m)
|
||||
{
|
||||
f32 maxVelY;
|
||||
f32 offsetY;
|
||||
|
||||
if (m->action != ACT_GROUND_POUND) {
|
||||
offsetY = m->pos[1] - -1500.0f;
|
||||
if (m->action != ACT_GROUND_POUND)
|
||||
{
|
||||
f32 offsetY = m->pos[1] - -1500.0f;
|
||||
|
||||
if (m->floor->type == SURFACE_VERTICAL_WIND && -3000.0f < offsetY && offsetY < 2000.0f) {
|
||||
if (offsetY >= 0.0f) {
|
||||
if (m->floor->type == SURFACE_VERTICAL_WIND && -3000.0f < offsetY && offsetY < 2000.0f)
|
||||
{
|
||||
if (offsetY >= 0.0f)
|
||||
{
|
||||
maxVelY = 10000.0f / (offsetY + 200.0f);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
maxVelY = 50.0f;
|
||||
}
|
||||
|
||||
if (m->vel[1] < maxVelY) {
|
||||
if ((m->vel[1] += maxVelY / 8.0f) > maxVelY) {
|
||||
if (m->vel[1] < maxVelY)
|
||||
{
|
||||
if ((m->vel[1] += maxVelY / 8.0f) > maxVelY)
|
||||
{
|
||||
m->vel[1] = maxVelY;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VERSION_JP
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_ENV_WIND2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 perform_air_step(struct MarioState *m, u32 stepArg) {
|
||||
s32 perform_air_step(struct MarioState *m, u32 stepArg)
|
||||
{
|
||||
Vec3f intendedPos;
|
||||
s32 i;
|
||||
s32 quarterStepResult;
|
||||
s32 stepResult = AIR_STEP_NONE;
|
||||
|
||||
m->wall = NULL;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (s32 i = 0; i < 4; i++)
|
||||
{
|
||||
intendedPos[0] = m->pos[0] + m->vel[0] / 4.0f;
|
||||
intendedPos[1] = m->pos[1] + m->vel[1] / 4.0f;
|
||||
intendedPos[2] = m->pos[2] + m->vel[2] / 4.0f;
|
||||
|
||||
quarterStepResult = perform_air_quarter_step(m, intendedPos, stepArg);
|
||||
s32 quarterStepResult = perform_air_quarter_step(m, intendedPos, stepArg);
|
||||
|
||||
//! On one qf, hit OOB/ceil/wall to store the 2 return value, and continue
|
||||
// getting 0s until your last qf. Graze a wall on your last qf, and it will
|
||||
// return the stored 2 with a sharply angled reference wall. (some gwks)
|
||||
|
||||
if (quarterStepResult != AIR_STEP_NONE) {
|
||||
if (quarterStepResult != AIR_STEP_NONE)
|
||||
{
|
||||
stepResult = quarterStepResult;
|
||||
}
|
||||
|
||||
if (quarterStepResult == AIR_STEP_LANDED || quarterStepResult == AIR_STEP_GRABBED_LEDGE
|
||||
|| quarterStepResult == AIR_STEP_GRABBED_CEILING
|
||||
|| quarterStepResult == AIR_STEP_HIT_LAVA_WALL) {
|
||||
|| quarterStepResult == AIR_STEP_HIT_LAVA_WALL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m->vel[1] >= 0.0f) {
|
||||
if (m->vel[1] >= 0.0f)
|
||||
{
|
||||
m->peakHeight = m->pos[1];
|
||||
}
|
||||
|
||||
m->terrainSoundAddend = mario_get_terrain_sound_addend(m);
|
||||
|
||||
if (m->action != ACT_FLYING) {
|
||||
if (m->action != ACT_FLYING)
|
||||
{
|
||||
apply_gravity(m);
|
||||
}
|
||||
apply_vertical_wind(m);
|
||||
@@ -657,13 +758,15 @@ s32 perform_air_step(struct MarioState *m, u32 stepArg) {
|
||||
|
||||
// They had these functions the whole time and never used them? Lol
|
||||
|
||||
void set_vel_from_pitch_and_yaw(struct MarioState *m) {
|
||||
void set_vel_from_pitch_and_yaw(struct MarioState *m)
|
||||
{
|
||||
m->vel[0] = m->forwardVel * coss(m->faceAngle[0]) * sins(m->faceAngle[1]);
|
||||
m->vel[1] = m->forwardVel * sins(m->faceAngle[0]);
|
||||
m->vel[2] = m->forwardVel * coss(m->faceAngle[0]) * coss(m->faceAngle[1]);
|
||||
}
|
||||
|
||||
void set_vel_from_yaw(struct MarioState *m) {
|
||||
void set_vel_from_yaw(struct MarioState *m)
|
||||
{
|
||||
m->vel[0] = m->slideVelX = m->forwardVel * sins(m->faceAngle[1]);
|
||||
m->vel[1] = 0.0f;
|
||||
m->vel[2] = m->slideVelZ = m->forwardVel * coss(m->faceAngle[1]);
|
||||
|
||||
@@ -5,32 +5,52 @@
|
||||
|
||||
#include "../include/types.h"
|
||||
|
||||
struct BullyCollisionData {
|
||||
/*0x00*/ f32 conversionRatio;
|
||||
/*0x04*/ f32 radius;
|
||||
/*0x08*/ f32 posX;
|
||||
/*0x0C*/ f32 posZ;
|
||||
/*0x10*/ f32 velX;
|
||||
/*0x14*/ f32 velZ;
|
||||
struct BullyCollisionData
|
||||
{
|
||||
/*0x00*/
|
||||
f32 conversionRatio;
|
||||
/*0x04*/
|
||||
f32 radius;
|
||||
/*0x08*/
|
||||
f32 posX;
|
||||
/*0x0C*/
|
||||
f32 posZ;
|
||||
/*0x10*/
|
||||
f32 velX;
|
||||
/*0x14*/
|
||||
f32 velZ;
|
||||
};
|
||||
|
||||
extern struct SM64SurfaceCollisionData gWaterSurfacePseudoFloor;
|
||||
|
||||
f32 get_additive_y_vel_for_jumps(void);
|
||||
|
||||
void stub_mario_step_1(struct MarioState *);
|
||||
|
||||
void stub_mario_step_2(void);
|
||||
|
||||
void mario_bonk_reflection(struct MarioState *, u32);
|
||||
|
||||
void transfer_bully_speed(struct BullyCollisionData *obj1, struct BullyCollisionData *obj2);
|
||||
BAD_RETURN(s32) init_bully_collision_data(struct BullyCollisionData *data, f32 posX, f32 posZ,
|
||||
f32 forwardVel, s16 yaw, f32 conversionRatio, f32 radius);
|
||||
|
||||
BAD_RETURN (s32) init_bully_collision_data(
|
||||
struct BullyCollisionData *data, f32 posX, f32 posZ,
|
||||
f32 forwardVel, s16 yaw, f32 conversionRatio, f32 radius);
|
||||
|
||||
u32 mario_update_quicksand(struct MarioState *, f32);
|
||||
|
||||
u32 mario_push_off_steep_floor(struct MarioState *, u32, u32);
|
||||
|
||||
u32 mario_update_moving_sand(struct MarioState *);
|
||||
|
||||
u32 mario_update_windy_ground(struct MarioState *);
|
||||
|
||||
void stop_and_set_height_to_floor(struct MarioState *);
|
||||
|
||||
s32 stationary_ground_step(struct MarioState *);
|
||||
|
||||
s32 perform_ground_step(struct MarioState *);
|
||||
|
||||
s32 perform_air_step(struct MarioState *, u32);
|
||||
|
||||
#endif // MARIO_STEP_H
|
||||
@@ -8,19 +8,19 @@
|
||||
#include "../engine/math_util.h"
|
||||
#include "../include/object_fields.h"
|
||||
|
||||
static Vec3f gVec3fZero = { 0.0f, 0.0f, 0.0f };
|
||||
static Vec3s gVec3sZero = { 0, 0, 0 };
|
||||
static Vec3f gVec3fZero = {0.0f, 0.0f, 0.0f};
|
||||
static Vec3s gVec3sZero = {0, 0, 0};
|
||||
|
||||
static struct Object *try_allocate_object(void) {
|
||||
struct ObjectNode *nextObj;
|
||||
nextObj = (struct ObjectNode *) malloc(sizeof(struct Object));
|
||||
static struct Object *try_allocate_object(void)
|
||||
{
|
||||
struct ObjectNode *nextObj = (struct ObjectNode *)malloc(sizeof(struct Object));
|
||||
nextObj->prev = NULL;
|
||||
nextObj->next = NULL;
|
||||
return (struct Object *) nextObj;
|
||||
return (struct Object *)nextObj;
|
||||
}
|
||||
|
||||
static struct Object *allocate_object(void) {
|
||||
s32 i;
|
||||
static struct Object *allocate_object(void)
|
||||
{
|
||||
struct Object *obj = try_allocate_object();
|
||||
|
||||
// Initialize object fields
|
||||
@@ -31,21 +31,22 @@ static struct Object *allocate_object(void) {
|
||||
obj->collidedObjInteractTypes = 0;
|
||||
obj->numCollidedObjs = 0;
|
||||
|
||||
for (i = 0; i < 0x50; i++) {
|
||||
#ifdef _WIN32
|
||||
for (s32 i = 0; i < 0x50; i++)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
obj->rawData.asS32[i] = 0;
|
||||
#endif
|
||||
#ifdef _WIN64
|
||||
#endif
|
||||
#ifdef _WIN64
|
||||
obj->ptrData.asVoidPtr[i] = NULL;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
obj->unused1 = 0;
|
||||
obj->bhvStackIndex = 0;
|
||||
obj->bhvDelayTimer = 0;
|
||||
|
||||
obj->hitboxRadius = 37.0f; // Override directly for Mario
|
||||
obj->hitboxHeight = 160.0f; //
|
||||
obj->hitboxRadius = 37.0f; // Override directly for Mario
|
||||
obj->hitboxHeight = 160.0f; //
|
||||
obj->hurtboxRadius = 0.0f;
|
||||
obj->hurtboxHeight = 0.0f;
|
||||
obj->hitboxDownOffset = 0.0f;
|
||||
@@ -58,9 +59,12 @@ static struct Object *allocate_object(void) {
|
||||
obj->oHealth = 2048;
|
||||
|
||||
obj->oCollisionDistance = 1000.0f;
|
||||
if (gCurrLevelNum == LEVEL_TTC) {
|
||||
if (gCurrLevelNum == LEVEL_TTC)
|
||||
{
|
||||
obj->oDrawingDistance = 2000.0f;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
obj->oDrawingDistance = 4000.0f;
|
||||
}
|
||||
|
||||
@@ -81,15 +85,16 @@ static struct Object *allocate_object(void) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
static struct Object *create_object(void) {
|
||||
struct Object *obj;
|
||||
obj = allocate_object();
|
||||
static struct Object *create_object(void)
|
||||
{
|
||||
struct Object *obj = allocate_object();
|
||||
obj->curBhvCommand = NULL;
|
||||
obj->behavior = NULL;
|
||||
return obj;
|
||||
}
|
||||
|
||||
static void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, Vec3f pos, Vec3s angle) {
|
||||
static void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, Vec3f pos, Vec3s angle)
|
||||
{
|
||||
vec3f_set(graphNode->scale, 1.0f, 1.0f, 1.0f);
|
||||
vec3f_copy(graphNode->pos, pos);
|
||||
vec3s_copy(graphNode->angle, angle);
|
||||
@@ -105,14 +110,13 @@ static void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, V
|
||||
graphNode->node.flags &= ~GRAPH_RENDER_BILLBOARD;
|
||||
}
|
||||
|
||||
static struct Object *spawn_object_at_origin(void) {
|
||||
struct Object *obj;
|
||||
obj = create_object();
|
||||
|
||||
static struct Object *spawn_object_at_origin(void)
|
||||
{
|
||||
struct Object *obj = create_object();
|
||||
obj->parentObj = NULL;
|
||||
obj->header.gfx.areaIndex = 0;
|
||||
obj->header.gfx.activeAreaIndex = 0;
|
||||
geo_obj_init((struct GraphNodeObject *) &obj->header.gfx, NULL, gVec3fZero, gVec3sZero);
|
||||
geo_obj_init(&obj->header.gfx, NULL, gVec3fZero, gVec3sZero);
|
||||
|
||||
return obj;
|
||||
}
|
||||
@@ -121,10 +125,12 @@ static struct Object *spawn_object_at_origin(void) {
|
||||
* Copy position, velocity, and angle variables from MarioState to the Mario
|
||||
* object.
|
||||
*/
|
||||
static void copy_mario_state_to_object(void) {
|
||||
static void copy_mario_state_to_object(void)
|
||||
{
|
||||
s32 i = 0;
|
||||
// L is real
|
||||
if (gCurrentObject != gMarioObject) {
|
||||
if (gCurrentObject != gMarioObject)
|
||||
{
|
||||
i += 1;
|
||||
}
|
||||
|
||||
@@ -157,11 +163,12 @@ struct Object *hack_allocate_mario(void)
|
||||
/**
|
||||
* Mario's primary behavior update function.
|
||||
*/
|
||||
void bhv_mario_update(void) {
|
||||
void bhv_mario_update(void)
|
||||
{
|
||||
u32 particleFlags = 0;
|
||||
// s32 i;
|
||||
// s32 i;
|
||||
|
||||
gCurrentObject = gMarioObject;
|
||||
gCurrentObject = gMarioObject;
|
||||
particleFlags = execute_mario_action(gCurrentObject);
|
||||
gCurrentObject->oMarioParticleFlags = particleFlags;
|
||||
|
||||
@@ -169,23 +176,22 @@ void bhv_mario_update(void) {
|
||||
// to sync it with the Mario object
|
||||
copy_mario_state_to_object();
|
||||
|
||||
// i = 0;
|
||||
// while (sParticleTypes[i].particleFlag != 0) {
|
||||
// if (particleFlags & sParticleTypes[i].particleFlag) {
|
||||
// spawn_particle(sParticleTypes[i].activeParticleFlag, sParticleTypes[i].model,
|
||||
// sParticleTypes[i].behavior);
|
||||
// }
|
||||
// i = 0;
|
||||
// while (sParticleTypes[i].particleFlag != 0) {
|
||||
// if (particleFlags & sParticleTypes[i].particleFlag) {
|
||||
// spawn_particle(sParticleTypes[i].activeParticleFlag, sParticleTypes[i].model,
|
||||
// sParticleTypes[i].behavior);
|
||||
// }
|
||||
|
||||
// i++;
|
||||
// }
|
||||
// i++;
|
||||
// }
|
||||
}
|
||||
|
||||
void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2) {
|
||||
f32 spC, sp8, sp4;
|
||||
|
||||
spC = a2[3][0] * a2[0][0] + a2[3][1] * a2[0][1] + a2[3][2] * a2[0][2];
|
||||
sp8 = a2[3][0] * a2[1][0] + a2[3][1] * a2[1][1] + a2[3][2] * a2[1][2];
|
||||
sp4 = a2[3][0] * a2[2][0] + a2[3][1] * a2[2][1] + a2[3][2] * a2[2][2];
|
||||
void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2)
|
||||
{
|
||||
f32 spC = a2[3][0] * a2[0][0] + a2[3][1] * a2[0][1] + a2[3][2] * a2[0][2];
|
||||
f32 sp8 = a2[3][0] * a2[1][0] + a2[3][1] * a2[1][1] + a2[3][2] * a2[1][2];
|
||||
f32 sp4 = a2[3][0] * a2[2][0] + a2[3][1] * a2[2][1] + a2[3][2] * a2[2][2];
|
||||
|
||||
a0[0][0] = a1[0][0] * a2[0][0] + a1[0][1] * a2[0][1] + a1[0][2] * a2[0][2];
|
||||
a0[0][1] = a1[0][0] * a2[1][0] + a1[0][1] * a2[1][1] + a1[0][2] * a2[1][2];
|
||||
@@ -208,7 +214,9 @@ void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2) {
|
||||
a0[2][3] = 0;
|
||||
a0[3][3] = 1.0f;
|
||||
}
|
||||
void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1) {
|
||||
|
||||
void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1)
|
||||
{
|
||||
f32 spC = a1->oParentRelativePosX;
|
||||
f32 sp8 = a1->oParentRelativePosY;
|
||||
f32 sp4 = a1->oParentRelativePosZ;
|
||||
@@ -217,7 +225,9 @@ void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1) {
|
||||
a1->oPosY = spC * a0[0][1] + sp8 * a0[1][1] + sp4 * a0[2][1] + a0[3][1];
|
||||
a1->oPosZ = spC * a0[0][2] + sp8 * a0[1][2] + sp4 * a0[2][2] + a0[3][2];
|
||||
}
|
||||
void obj_set_gfx_pos_from_pos(struct Object *obj) {
|
||||
|
||||
void obj_set_gfx_pos_from_pos(struct Object *obj)
|
||||
{
|
||||
obj->header.gfx.pos[0] = obj->oPosX;
|
||||
obj->header.gfx.pos[1] = obj->oPosY;
|
||||
obj->header.gfx.pos[2] = obj->oPosZ;
|
||||
|
||||
@@ -53,7 +53,11 @@
|
||||
#define GRAPH_RENDER_HAS_ANIMATION (1 << 5)
|
||||
|
||||
struct Object *hack_allocate_mario(void);
|
||||
|
||||
void bhv_mario_update(void);
|
||||
|
||||
void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2);
|
||||
|
||||
void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1);
|
||||
|
||||
void obj_set_gfx_pos_from_pos(struct Object *obj);
|
||||
@@ -16,16 +16,13 @@
|
||||
* Determine if Mario is standing on a platform object, meaning that he is
|
||||
* within 4 units of the floor. Set his referenced platform object accordingly.
|
||||
*/
|
||||
void update_mario_platform(void) {
|
||||
void update_mario_platform(void)
|
||||
{
|
||||
struct SM64SurfaceCollisionData *floor;
|
||||
UNUSED u32 unused;
|
||||
f32 marioX;
|
||||
f32 marioY;
|
||||
f32 marioZ;
|
||||
f32 floorHeight;
|
||||
u32 awayFromFloor;
|
||||
|
||||
if (gMarioObject == NULL) {
|
||||
if (gMarioObject == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,26 +31,34 @@ void update_mario_platform(void) {
|
||||
// of displacement since he is considered to be far from the platform's
|
||||
// axis of rotation.
|
||||
|
||||
marioX = gMarioObject->oPosX;
|
||||
marioY = gMarioObject->oPosY;
|
||||
marioZ = gMarioObject->oPosZ;
|
||||
floorHeight = find_floor(marioX, marioY, marioZ, &floor);
|
||||
f32 marioX = gMarioObject->oPosX;
|
||||
f32 marioY = gMarioObject->oPosY;
|
||||
f32 marioZ = gMarioObject->oPosZ;
|
||||
f32 floorHeight = find_floor(marioX, marioY, marioZ, &floor);
|
||||
|
||||
if (absfx(marioY - floorHeight) < 4.0f) {
|
||||
u32 awayFromFloor;
|
||||
|
||||
if (absfx(marioY - floorHeight) < 4.0f)
|
||||
{
|
||||
awayFromFloor = 0;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
awayFromFloor = 1;
|
||||
}
|
||||
|
||||
switch (awayFromFloor) {
|
||||
switch (awayFromFloor)
|
||||
{
|
||||
case 1:
|
||||
gMarioObject->platform = NULL;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
if (floor != NULL && floor->transform != NULL) {
|
||||
if (floor != NULL && floor->transform != NULL)
|
||||
{
|
||||
gMarioObject->platform = floor->transform;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
gMarioObject->platform = NULL;
|
||||
}
|
||||
break;
|
||||
@@ -63,7 +68,8 @@ void update_mario_platform(void) {
|
||||
/**
|
||||
* Get Mario's position and store it in x, y, and z.
|
||||
*/
|
||||
static void get_mario_pos(f32 *x, f32 *y, f32 *z) {
|
||||
static void get_mario_pos(f32 *x, f32 *y, f32 *z)
|
||||
{
|
||||
*x = gMarioState->pos[0];
|
||||
*y = gMarioState->pos[1];
|
||||
*z = gMarioState->pos[2];
|
||||
@@ -72,7 +78,8 @@ static void get_mario_pos(f32 *x, f32 *y, f32 *z) {
|
||||
/**
|
||||
* Set Mario's position.
|
||||
*/
|
||||
static void set_mario_pos(f32 x, f32 y, f32 z) {
|
||||
static void set_mario_pos(f32 x, f32 y, f32 z)
|
||||
{
|
||||
gMarioState->pos[0] = x;
|
||||
gMarioState->pos[1] = y;
|
||||
gMarioState->pos[2] = z;
|
||||
@@ -82,50 +89,47 @@ static void set_mario_pos(f32 x, f32 y, f32 z) {
|
||||
* Apply one frame of platform rotation to Mario or an object using the given
|
||||
* platform. If isMario is false, use gCurrentObject.
|
||||
*/
|
||||
void apply_platform_displacement(u32 isMario, struct SM64SurfaceObjectTransform *platform) {
|
||||
void apply_platform_displacement(u32 isMario, struct SM64SurfaceObjectTransform *platform)
|
||||
{
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
f32 platformPosX;
|
||||
f32 platformPosY;
|
||||
f32 platformPosZ;
|
||||
Vec3f currentObjectOffset;
|
||||
Vec3f relativeOffset;
|
||||
Vec3f newObjectOffset;
|
||||
Vec3s rotation;
|
||||
UNUSED s16 unused1;
|
||||
UNUSED s16 unused2;
|
||||
UNUSED s16 unused3;
|
||||
f32 displaceMatrix[4][4];
|
||||
|
||||
rotation[0] = platform->aAngleVelPitch;
|
||||
rotation[1] = platform->aAngleVelYaw;
|
||||
rotation[2] = platform->aAngleVelRoll;
|
||||
|
||||
// if (isMario) {
|
||||
// D_8032FEC0 = 0;
|
||||
get_mario_pos(&x, &y, &z);
|
||||
// } else {
|
||||
// x = gCurrentObject->aPosX;
|
||||
// y = gCurrentObject->aPosY;
|
||||
// z = gCurrentObject->aPosZ;
|
||||
// }
|
||||
// if (isMario) {
|
||||
// D_8032FEC0 = 0;
|
||||
get_mario_pos(&x, &y, &z);
|
||||
// } else {
|
||||
// x = gCurrentObject->aPosX;
|
||||
// y = gCurrentObject->aPosY;
|
||||
// z = gCurrentObject->aPosZ;
|
||||
// }
|
||||
|
||||
x += platform->aVelX;
|
||||
z += platform->aVelZ;
|
||||
|
||||
if (rotation[0] != 0 || rotation[1] != 0 || rotation[2] != 0) {
|
||||
unused1 = rotation[0];
|
||||
unused2 = rotation[2];
|
||||
unused3 = platform->aFaceAngleYaw;
|
||||
if (rotation[0] != 0 || rotation[1] != 0 || rotation[2] != 0)
|
||||
{
|
||||
s16 unused1 = rotation[0];
|
||||
s16 unused2 = rotation[2];
|
||||
s16 unused3 = platform->aFaceAngleYaw;
|
||||
|
||||
if (isMario) {
|
||||
if (isMario)
|
||||
{
|
||||
gMarioState->faceAngle[1] += rotation[1];
|
||||
}
|
||||
|
||||
platformPosX = platform->aPosX;
|
||||
platformPosY = platform->aPosY;
|
||||
platformPosZ = platform->aPosZ;
|
||||
f32 platformPosX = platform->aPosX;
|
||||
f32 platformPosY = platform->aPosY;
|
||||
f32 platformPosZ = platform->aPosZ;
|
||||
|
||||
currentObjectOffset[0] = x - platformPosX;
|
||||
currentObjectOffset[1] = y - platformPosY;
|
||||
@@ -150,20 +154,22 @@ void apply_platform_displacement(u32 isMario, struct SM64SurfaceObjectTransform
|
||||
z = platformPosZ + newObjectOffset[2];
|
||||
}
|
||||
|
||||
// if (isMario) {
|
||||
set_mario_pos(x, y, z);
|
||||
// } else {
|
||||
// gCurrentObject->oPosX = x;
|
||||
// gCurrentObject->oPosY = y;
|
||||
// gCurrentObject->oPosZ = z;
|
||||
// }
|
||||
// if (isMario) {
|
||||
set_mario_pos(x, y, z);
|
||||
// } else {
|
||||
// gCurrentObject->oPosX = x;
|
||||
// gCurrentObject->oPosY = y;
|
||||
// gCurrentObject->oPosZ = z;
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* If Mario's platform is not null, apply platform displacement.
|
||||
*/
|
||||
void apply_mario_platform_displacement(void) {
|
||||
if (gMarioObject != NULL && gMarioObject->platform != NULL) {
|
||||
void apply_mario_platform_displacement(void)
|
||||
{
|
||||
if (gMarioObject != NULL && gMarioObject->platform != NULL)
|
||||
{
|
||||
apply_platform_displacement(TRUE, gMarioObject->platform);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "../include/types.h"
|
||||
|
||||
void update_mario_platform(void);
|
||||
|
||||
void apply_mario_platform_displacement(void);
|
||||
|
||||
#endif // PLATFORM_DISPLACEMENT_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,7 @@ extern struct GraphNodeHeldObject *gCurGraphNodeHeldObject;
|
||||
#define ANIM_TYPE_ROTATION 5
|
||||
|
||||
void geo_process_node_and_siblings(struct GraphNode *firstNode);
|
||||
|
||||
//void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor);
|
||||
void geo_process_root_hack_single_node(struct GraphNode *node);
|
||||
|
||||
|
||||
+45
-19
@@ -42,7 +42,8 @@ struct SaveFile
|
||||
struct SaveBlockSignature signature;
|
||||
};
|
||||
|
||||
enum SaveFileIndex {
|
||||
enum SaveFileIndex
|
||||
{
|
||||
SAVE_FILE_A,
|
||||
SAVE_FILE_B,
|
||||
SAVE_FILE_C,
|
||||
@@ -57,15 +58,15 @@ struct MainMenuSaveData
|
||||
u32 coinScoreAges[NUM_SAVE_FILES];
|
||||
u16 soundMode;
|
||||
|
||||
#ifdef VERSION_EU
|
||||
#ifdef VERSION_EU
|
||||
u16 language;
|
||||
#define SUBTRAHEND 8
|
||||
#else
|
||||
#define SUBTRAHEND 6
|
||||
#endif
|
||||
#define SUBTRAHEND 8
|
||||
#else
|
||||
#define SUBTRAHEND 6
|
||||
#endif
|
||||
|
||||
// Pad to match the EEPROM size of 0x200 (10 bytes on JP/US, 8 bytes on EU)
|
||||
u8 filler[ 128 ]; // EEPROM_SIZE / 2 - SUBTRAHEND - NUM_SAVE_FILES * (4 + sizeof(struct SaveFile))];
|
||||
u8 filler[128]; // EEPROM_SIZE / 2 - SUBTRAHEND - NUM_SAVE_FILES * (4 + sizeof(struct SaveFile))];
|
||||
|
||||
struct SaveBlockSignature signature;
|
||||
};
|
||||
@@ -75,7 +76,7 @@ struct SaveBuffer
|
||||
// Each of the four save files has two copies. If one is bad, the other is used as a backup.
|
||||
struct SaveFile files[NUM_SAVE_FILES][2];
|
||||
// The main menu data has two copies. If one is bad, the other is used as a backup.
|
||||
// struct MainMenuSaveData menuData[0];
|
||||
// struct MainMenuSaveData menuData[0];
|
||||
};
|
||||
|
||||
extern u8 gLastCompletedCourseNum;
|
||||
@@ -120,12 +121,18 @@ extern s8 gLevelToCourseNumTable[];
|
||||
// Variable for setting a warp checkpoint.
|
||||
|
||||
// possibly a WarpDest struct where arg is a union. TODO: Check?
|
||||
struct WarpCheckpoint {
|
||||
/*0x00*/ u8 actNum;
|
||||
/*0x01*/ u8 courseNum;
|
||||
/*0x02*/ u8 levelID;
|
||||
/*0x03*/ u8 areaNum;
|
||||
/*0x04*/ u8 warpNode;
|
||||
struct WarpCheckpoint
|
||||
{
|
||||
/*0x00*/
|
||||
u8 actNum;
|
||||
/*0x01*/
|
||||
u8 courseNum;
|
||||
/*0x02*/
|
||||
u8 levelID;
|
||||
/*0x03*/
|
||||
u8 areaNum;
|
||||
/*0x04*/
|
||||
u8 warpNode;
|
||||
};
|
||||
|
||||
extern struct WarpCheckpoint gWarpCheckpoint;
|
||||
@@ -134,38 +141,57 @@ extern s8 gMainMenuDataModified;
|
||||
extern s8 gSaveFileModified;
|
||||
|
||||
void save_file_do_save(s32 fileIndex);
|
||||
|
||||
void save_file_erase(s32 fileIndex);
|
||||
BAD_RETURN(s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex);
|
||||
|
||||
BAD_RETURN (s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex);
|
||||
|
||||
void save_file_load_all(void);
|
||||
|
||||
void save_file_reload(void);
|
||||
|
||||
void save_file_collect_star_or_key(s16 coinScore, s16 starIndex);
|
||||
|
||||
s32 save_file_exists(s32 fileIndex);
|
||||
|
||||
u32 save_file_get_max_coin_score(s32 courseIndex);
|
||||
|
||||
s32 save_file_get_course_star_count(s32 fileIndex, s32 courseIndex);
|
||||
|
||||
//s32 save_file_get_total_star_count(s32 fileIndex, s32 minCourse, s32 maxCourse);
|
||||
//void save_file_set_flags(u32 flags);
|
||||
//void save_file_clear_flags(u32 flags);
|
||||
//u32 save_file_get_flags(void);
|
||||
u32 save_file_get_star_flags(s32 fileIndex, s32 courseIndex);
|
||||
|
||||
void save_file_set_star_flags(s32 fileIndex, s32 courseIndex, u32 starFlags);
|
||||
|
||||
s32 save_file_get_course_coin_score(s32 fileIndex, s32 courseIndex);
|
||||
|
||||
s32 save_file_is_cannon_unlocked(void);
|
||||
|
||||
void save_file_set_cannon_unlocked(void);
|
||||
|
||||
void save_file_set_cap_pos(s16 x, s16 y, s16 z);
|
||||
|
||||
s32 save_file_get_cap_pos(Vec3s capPos);
|
||||
|
||||
void save_file_set_sound_mode(u16 mode);
|
||||
|
||||
u16 save_file_get_sound_mode(void);
|
||||
|
||||
void save_file_move_cap_to_default_location(void);
|
||||
|
||||
void disable_warp_checkpoint(void);
|
||||
|
||||
void check_if_should_set_warp_checkpoint(struct WarpNode *warpNode);
|
||||
|
||||
s32 check_warp_checkpoint(struct WarpNode *warpNode);
|
||||
|
||||
#ifdef VERSION_EU
|
||||
enum EuLanguages {
|
||||
LANGUAGE_ENGLISH,
|
||||
LANGUAGE_FRENCH,
|
||||
LANGUAGE_GERMAN
|
||||
enum EuLanguages
|
||||
{
|
||||
LANGUAGE_ENGLISH, LANGUAGE_FRENCH, LANGUAGE_GERMAN
|
||||
};
|
||||
|
||||
void eu_set_language(u16 language);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "sound_init.h"
|
||||
#include "../../play_sound.h"
|
||||
//#include "rumble_init.h"
|
||||
#include "../../rumble.h"
|
||||
|
||||
#define MUSIC_NONE 0xFFFF
|
||||
|
||||
@@ -34,8 +35,8 @@ static u16 sCurrentMusic = MUSIC_NONE;
|
||||
static u16 sCurrentShellMusic = MUSIC_NONE;
|
||||
static u16 sCurrentCapMusic = MUSIC_NONE;
|
||||
static u8 sPlayingInfiniteStairs = FALSE;
|
||||
UNUSED static u8 unused8032C6D8[16] = { 0 };
|
||||
static s16 sSoundMenuModeToSoundMode[] = { SOUND_MODE_STEREO, SOUND_MODE_MONO, SOUND_MODE_HEADSET };
|
||||
UNUSED static u8 unused8032C6D8[16] = {0};
|
||||
static s16 sSoundMenuModeToSoundMode[] = {SOUND_MODE_STEREO, SOUND_MODE_MONO, SOUND_MODE_HEADSET};
|
||||
// Only the 20th array element is used.
|
||||
static u32 sMenuSoundsExtra[] = {
|
||||
SOUND_MOVING_TERRAIN_SLIDE + (0 << 16),
|
||||
@@ -82,15 +83,18 @@ void play_menu_sounds_extra(s32 a, void *b);
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void reset_volume(void) {
|
||||
void reset_volume(void)
|
||||
{
|
||||
sMusicVolume = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void lower_background_noise(s32 a) {
|
||||
switch (a) {
|
||||
void lower_background_noise(s32 a)
|
||||
{
|
||||
switch (a)
|
||||
{
|
||||
case 1:
|
||||
set_audio_muted(TRUE);
|
||||
break;
|
||||
@@ -104,8 +108,10 @@ void lower_background_noise(s32 a) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void raise_background_noise(s32 a) {
|
||||
switch (a) {
|
||||
void raise_background_noise(s32 a)
|
||||
{
|
||||
switch (a)
|
||||
{
|
||||
case 1:
|
||||
set_audio_muted(FALSE);
|
||||
break;
|
||||
@@ -119,8 +125,10 @@ void raise_background_noise(s32 a) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void disable_background_sound(void) {
|
||||
if (sBgMusicDisabled == FALSE) {
|
||||
void disable_background_sound(void)
|
||||
{
|
||||
if (sBgMusicDisabled == FALSE)
|
||||
{
|
||||
sBgMusicDisabled = TRUE;
|
||||
sound_banks_disable(SEQ_PLAYER_SFX, SOUND_BANKS_BACKGROUND);
|
||||
}
|
||||
@@ -129,8 +137,10 @@ void disable_background_sound(void) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void enable_background_sound(void) {
|
||||
if (sBgMusicDisabled == TRUE) {
|
||||
void enable_background_sound(void)
|
||||
{
|
||||
if (sBgMusicDisabled == TRUE)
|
||||
{
|
||||
sBgMusicDisabled = FALSE;
|
||||
sound_banks_enable(SEQ_PLAYER_SFX, SOUND_BANKS_BACKGROUND);
|
||||
}
|
||||
@@ -141,8 +151,10 @@ void enable_background_sound(void) {
|
||||
*
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void set_sound_mode(u16 soundMode) {
|
||||
if (soundMode < 3) {
|
||||
void set_sound_mode(u16 soundMode)
|
||||
{
|
||||
if (soundMode < 3)
|
||||
{
|
||||
audio_set_sound_mode(sSoundMenuModeToSoundMode[soundMode]);
|
||||
}
|
||||
}
|
||||
@@ -152,33 +164,51 @@ void set_sound_mode(u16 soundMode) {
|
||||
*
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void play_menu_sounds(s16 soundMenuFlags) {
|
||||
if (soundMenuFlags & SOUND_MENU_FLAG_HANDAPPEAR) {
|
||||
void play_menu_sounds(s16 soundMenuFlags)
|
||||
{
|
||||
if (soundMenuFlags & SOUND_MENU_FLAG_HANDAPPEAR)
|
||||
{
|
||||
play_sound(SOUND_MENU_HAND_APPEAR, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_HANDISAPPEAR) {
|
||||
}
|
||||
else if (soundMenuFlags & SOUND_MENU_FLAG_HANDISAPPEAR)
|
||||
{
|
||||
play_sound(SOUND_MENU_HAND_DISAPPEAR, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_UNKNOWN1) {
|
||||
}
|
||||
else if (soundMenuFlags & SOUND_MENU_FLAG_UNKNOWN1)
|
||||
{
|
||||
play_sound(SOUND_MENU_UNK0C, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_PINCHMARIOFACE) {
|
||||
}
|
||||
else if (soundMenuFlags & SOUND_MENU_FLAG_PINCHMARIOFACE)
|
||||
{
|
||||
play_sound(SOUND_MENU_PINCH_MARIO_FACE, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_PINCHMARIOFACE2) {
|
||||
}
|
||||
else if (soundMenuFlags & SOUND_MENU_FLAG_PINCHMARIOFACE2)
|
||||
{
|
||||
play_sound(SOUND_MENU_PINCH_MARIO_FACE, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_LETGOMARIOFACE) {
|
||||
}
|
||||
else if (soundMenuFlags & SOUND_MENU_FLAG_LETGOMARIOFACE)
|
||||
{
|
||||
play_sound(SOUND_MENU_LET_GO_MARIO_FACE, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_CAMERAZOOMIN) {
|
||||
}
|
||||
else if (soundMenuFlags & SOUND_MENU_FLAG_CAMERAZOOMIN)
|
||||
{
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_CAMERAZOOMOUT) {
|
||||
}
|
||||
else if (soundMenuFlags & SOUND_MENU_FLAG_CAMERAZOOMOUT)
|
||||
{
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
if (soundMenuFlags & 0x100) {
|
||||
if (soundMenuFlags & 0x100)
|
||||
{
|
||||
play_menu_sounds_extra(20, NULL);
|
||||
}
|
||||
#if ENABLE_RUMBLE
|
||||
if (soundMenuFlags & SOUND_MENU_FLAG_LETGOMARIOFACE) {
|
||||
// #if ENABLE_RUMBLE
|
||||
if (soundMenuFlags & SOUND_MENU_FLAG_LETGOMARIOFACE)
|
||||
{
|
||||
queue_rumble_data(10, 60);
|
||||
}
|
||||
#endif
|
||||
// #endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,7 +275,8 @@ void play_menu_sounds(s16 soundMenuFlags) {
|
||||
/**
|
||||
* Called from threads: thread3_main, thread5_game_loop
|
||||
*/
|
||||
void fadeout_music(s16 fadeOutTime) {
|
||||
void fadeout_music(s16 fadeOutTime)
|
||||
{
|
||||
func_803210D4(fadeOutTime);
|
||||
sCurrentMusic = MUSIC_NONE;
|
||||
sCurrentShellMusic = MUSIC_NONE;
|
||||
@@ -255,7 +286,8 @@ void fadeout_music(s16 fadeOutTime) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void fadeout_level_music(s16 fadeTimer) {
|
||||
void fadeout_level_music(s16 fadeTimer)
|
||||
{
|
||||
seq_player_fade_out(SEQ_PLAYER_LEVEL, fadeTimer);
|
||||
sCurrentMusic = MUSIC_NONE;
|
||||
sCurrentShellMusic = MUSIC_NONE;
|
||||
@@ -265,7 +297,8 @@ void fadeout_level_music(s16 fadeTimer) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void play_cutscene_music(u16 seqArgs) {
|
||||
void play_cutscene_music(u16 seqArgs)
|
||||
{
|
||||
play_music(SEQ_PLAYER_LEVEL, seqArgs, 0);
|
||||
sCurrentMusic = seqArgs;
|
||||
}
|
||||
@@ -273,7 +306,8 @@ void play_cutscene_music(u16 seqArgs) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void play_shell_music(void) {
|
||||
void play_shell_music(void)
|
||||
{
|
||||
play_music(SEQ_PLAYER_LEVEL, SEQUENCE_ARGS(4, SEQ_EVENT_POWERUP | SEQ_VARIATION), 0);
|
||||
sCurrentShellMusic = SEQUENCE_ARGS(4, SEQ_EVENT_POWERUP | SEQ_VARIATION);
|
||||
}
|
||||
@@ -281,8 +315,10 @@ void play_shell_music(void) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void stop_shell_music(void) {
|
||||
if (sCurrentShellMusic != MUSIC_NONE) {
|
||||
void stop_shell_music(void)
|
||||
{
|
||||
if (sCurrentShellMusic != MUSIC_NONE)
|
||||
{
|
||||
stop_background_music(sCurrentShellMusic);
|
||||
sCurrentShellMusic = MUSIC_NONE;
|
||||
}
|
||||
@@ -291,9 +327,11 @@ void stop_shell_music(void) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void play_cap_music(u16 seqArgs) {
|
||||
void play_cap_music(u16 seqArgs)
|
||||
{
|
||||
play_music(SEQ_PLAYER_LEVEL, seqArgs, 0);
|
||||
if (sCurrentCapMusic != MUSIC_NONE && sCurrentCapMusic != seqArgs) {
|
||||
if (sCurrentCapMusic != MUSIC_NONE && sCurrentCapMusic != seqArgs)
|
||||
{
|
||||
stop_background_music(sCurrentCapMusic);
|
||||
}
|
||||
sCurrentCapMusic = seqArgs;
|
||||
@@ -302,8 +340,10 @@ void play_cap_music(u16 seqArgs) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void fadeout_cap_music(void) {
|
||||
if (sCurrentCapMusic != MUSIC_NONE) {
|
||||
void fadeout_cap_music(void)
|
||||
{
|
||||
if (sCurrentCapMusic != MUSIC_NONE)
|
||||
{
|
||||
fadeout_background_music(sCurrentCapMusic, 600);
|
||||
}
|
||||
}
|
||||
@@ -311,8 +351,10 @@ void fadeout_cap_music(void) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void stop_cap_music(void) {
|
||||
if (sCurrentCapMusic != MUSIC_NONE) {
|
||||
void stop_cap_music(void)
|
||||
{
|
||||
if (sCurrentCapMusic != MUSIC_NONE)
|
||||
{
|
||||
stop_background_music(sCurrentCapMusic);
|
||||
sCurrentCapMusic = MUSIC_NONE;
|
||||
}
|
||||
@@ -321,7 +363,8 @@ void stop_cap_music(void) {
|
||||
/**
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void play_menu_sounds_extra(s32 a, void *b) {
|
||||
void play_menu_sounds_extra(s32 a, void *b)
|
||||
{
|
||||
play_sound(sMenuSoundsExtra[a], b);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,23 +19,38 @@
|
||||
#define SOUND_MENU_MODE_HEADSET 2
|
||||
|
||||
void reset_volume(void);
|
||||
|
||||
void raise_background_noise(s32 a);
|
||||
|
||||
void lower_background_noise(s32 a);
|
||||
|
||||
void disable_background_sound(void);
|
||||
|
||||
void enable_background_sound(void);
|
||||
|
||||
void set_sound_mode(u16 soundMode);
|
||||
|
||||
void play_menu_sounds(s16 soundMenuFlags);
|
||||
|
||||
//void play_painting_eject_sound(void);
|
||||
//void play_infinite_stairs_music(void);
|
||||
//void set_background_music(u16 a, u16 seqArgs, s16 fadeTimer);
|
||||
void fadeout_music(s16 fadeOutTime);
|
||||
|
||||
void fadeout_level_music(s16 fadeTimer);
|
||||
|
||||
void play_cutscene_music(u16 seqArgs);
|
||||
|
||||
void play_shell_music(void);
|
||||
|
||||
void stop_shell_music(void);
|
||||
|
||||
void play_cap_music(u16 seqArgs);
|
||||
|
||||
void fadeout_cap_music(void);
|
||||
|
||||
void stop_cap_music(void);
|
||||
|
||||
//void audio_game_loop_tick(void);
|
||||
//void thread4_sound(UNUSED void *arg);
|
||||
|
||||
|
||||
@@ -3,22 +3,26 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../obj_pool.h"
|
||||
|
||||
struct GlobalState *g_state = 0;
|
||||
|
||||
struct GlobalState *global_state_create(void)
|
||||
{
|
||||
struct GlobalState *state = malloc( sizeof( struct GlobalState ));
|
||||
memset( state, 0, sizeof( struct GlobalState ));
|
||||
state->msSwimStrength = MIN_SWIM_STRENGTH;
|
||||
return state;
|
||||
struct GlobalState *state = malloc(sizeof(struct GlobalState));
|
||||
memset(state, 0, sizeof(struct GlobalState));
|
||||
state->msSwimStrength = MIN_SWIM_STRENGTH;
|
||||
state->mgMarioId = -1;
|
||||
return state;
|
||||
}
|
||||
|
||||
void global_state_bind(struct GlobalState *state)
|
||||
{
|
||||
g_state = state;
|
||||
g_state = state;
|
||||
}
|
||||
|
||||
void global_state_delete(struct GlobalState *state)
|
||||
{
|
||||
free( state );
|
||||
obj_pool_free_all(&state->mgFakeObjects);
|
||||
free(state);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "include/types.h"
|
||||
#include "game/area.h"
|
||||
#include "../obj_pool.h"
|
||||
|
||||
struct GlobalState
|
||||
{
|
||||
@@ -35,11 +36,13 @@ struct GlobalState
|
||||
s8 mgShowDebugText;
|
||||
s8 mgDebugLevelSelect;
|
||||
s16 mgCurrSaveFileNum;
|
||||
s32 mgMarioId;
|
||||
struct Controller mgController;
|
||||
struct SpawnInfo mgMarioSpawnInfoVal;
|
||||
struct Area *mgCurrentArea;
|
||||
struct Object *mgCurrentObject;
|
||||
struct Object *mgMarioObject;
|
||||
struct ObjPool mgFakeObjects;
|
||||
struct MarioAnimation mD_80339D10;
|
||||
struct MarioState mgMarioStateVal;
|
||||
};
|
||||
@@ -50,5 +53,7 @@ struct GlobalState
|
||||
extern struct GlobalState *g_state;
|
||||
|
||||
extern struct GlobalState *global_state_create(void);
|
||||
|
||||
extern void global_state_bind(struct GlobalState *state);
|
||||
|
||||
extern void global_state_delete(struct GlobalState *state);
|
||||
+136
-116
@@ -98,168 +98,188 @@
|
||||
* Data Structures.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int gain:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int gain: 16;
|
||||
unsigned int addr;
|
||||
} Aadpcm;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int gain:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int gain: 16;
|
||||
unsigned int addr;
|
||||
} Apolef;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pad1:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int pad1: 16;
|
||||
unsigned int addr;
|
||||
} Aenvelope;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int dmem:16;
|
||||
unsigned int pad2:16;
|
||||
unsigned int count:16;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 8;
|
||||
unsigned int dmem: 16;
|
||||
unsigned int pad2: 16;
|
||||
unsigned int count: 16;
|
||||
} Aclearbuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int pad2:16;
|
||||
unsigned int inL:16;
|
||||
unsigned int inR:16;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 8;
|
||||
unsigned int pad2: 16;
|
||||
unsigned int inL: 16;
|
||||
unsigned int inR: 16;
|
||||
} Ainterleave;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:24;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 24;
|
||||
unsigned int addr;
|
||||
} Aloadbuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pad1:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int pad1: 16;
|
||||
unsigned int addr;
|
||||
} Aenvmixer;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int gain:16;
|
||||
unsigned int dmemi:16;
|
||||
unsigned int dmemo:16;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int gain: 16;
|
||||
unsigned int dmemi: 16;
|
||||
unsigned int dmemo: 16;
|
||||
} Amixer;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int dmem2:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int dmem2: 16;
|
||||
unsigned int addr;
|
||||
} Apan;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pitch:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int pitch: 16;
|
||||
unsigned int addr;
|
||||
} Aresample;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int pad1:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int pad1: 16;
|
||||
unsigned int addr;
|
||||
} Areverb;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:24;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 24;
|
||||
unsigned int addr;
|
||||
} Asavebuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:24;
|
||||
unsigned int pad2:2;
|
||||
unsigned int number:4;
|
||||
unsigned int base:24;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 24;
|
||||
unsigned int pad2: 2;
|
||||
unsigned int number: 4;
|
||||
unsigned int base: 24;
|
||||
} Asegment;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int dmemin:16;
|
||||
unsigned int dmemout:16;
|
||||
unsigned int count:16;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int dmemin: 16;
|
||||
unsigned int dmemout: 16;
|
||||
unsigned int count: 16;
|
||||
} Asetbuff;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int flags:8;
|
||||
unsigned int vol:16;
|
||||
unsigned int voltgt:16;
|
||||
unsigned int volrate:16;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int flags: 8;
|
||||
unsigned int vol: 16;
|
||||
unsigned int voltgt: 16;
|
||||
unsigned int volrate: 16;
|
||||
} Asetvol;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int dmemin:16;
|
||||
unsigned int dmemout:16;
|
||||
unsigned int count:16;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 8;
|
||||
unsigned int dmemin: 16;
|
||||
unsigned int dmemout: 16;
|
||||
unsigned int count: 16;
|
||||
} Admemmove;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int count:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 8;
|
||||
unsigned int count: 16;
|
||||
unsigned int addr;
|
||||
} Aloadadpcm;
|
||||
|
||||
typedef struct {
|
||||
unsigned int cmd:8;
|
||||
unsigned int pad1:8;
|
||||
unsigned int pad2:16;
|
||||
unsigned int addr;
|
||||
typedef struct
|
||||
{
|
||||
unsigned int cmd: 8;
|
||||
unsigned int pad1: 8;
|
||||
unsigned int pad2: 16;
|
||||
unsigned int addr;
|
||||
} Asetloop;
|
||||
|
||||
/*
|
||||
* Generic Acmd Packet
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
uintptr_t w0;
|
||||
uintptr_t w1;
|
||||
} Awords;
|
||||
|
||||
typedef union {
|
||||
Awords words;
|
||||
typedef union
|
||||
{
|
||||
Awords words;
|
||||
#if IS_BIG_ENDIAN && !IS_64_BIT
|
||||
Aadpcm adpcm;
|
||||
Apolef polef;
|
||||
Aclearbuff clearbuff;
|
||||
Aenvelope envelope;
|
||||
Ainterleave interleave;
|
||||
Aloadbuff loadbuff;
|
||||
Aenvmixer envmixer;
|
||||
Aresample resample;
|
||||
Areverb reverb;
|
||||
Asavebuff savebuff;
|
||||
Asegment segment;
|
||||
Asetbuff setbuff;
|
||||
Asetvol setvol;
|
||||
Admemmove dmemmove;
|
||||
Aloadadpcm loadadpcm;
|
||||
Amixer mixer;
|
||||
Asetloop setloop;
|
||||
Aadpcm adpcm;
|
||||
Apolef polef;
|
||||
Aclearbuff clearbuff;
|
||||
Aenvelope envelope;
|
||||
Ainterleave interleave;
|
||||
Aloadbuff loadbuff;
|
||||
Aenvmixer envmixer;
|
||||
Aresample resample;
|
||||
Areverb reverb;
|
||||
Asavebuff savebuff;
|
||||
Asegment segment;
|
||||
Asetbuff setbuff;
|
||||
Asetvol setvol;
|
||||
Admemmove dmemmove;
|
||||
Aloadadpcm loadadpcm;
|
||||
Amixer mixer;
|
||||
Asetloop setloop;
|
||||
#endif
|
||||
long long int force_union_align; /* dummy, force alignment */
|
||||
long long int force_union_align; /* dummy, force alignment */
|
||||
} Acmd;
|
||||
|
||||
/*
|
||||
|
||||
+337
-297
File diff suppressed because it is too large
Load Diff
@@ -6,18 +6,29 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 *offset __attribute__((aligned (8)));
|
||||
s32 len __attribute__((aligned (8)));
|
||||
u8 *offset __attribute__((aligned (8)
|
||||
|
||||
)
|
||||
);
|
||||
|
||||
s32 len __attribute__((aligned (8)
|
||||
|
||||
)
|
||||
);
|
||||
} ALSeqData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short revision;
|
||||
unsigned short seqCount;
|
||||
unsigned int pad;
|
||||
unsigned short revision;
|
||||
unsigned short seqCount;
|
||||
unsigned int pad;
|
||||
ALSeqData seqArray[1];
|
||||
} __attribute__((aligned (16))) ALSeqFile;
|
||||
} __attribute__((aligned (16)
|
||||
|
||||
void alSeqFileNew(ALSeqFile *f, u8 *base);
|
||||
)
|
||||
)
|
||||
ALSeqFile;
|
||||
|
||||
void alSeqFileNew(ALSeqFile * f, u8 * base);
|
||||
|
||||
#endif
|
||||
|
||||
+201
-192
@@ -32,7 +32,10 @@
|
||||
#define _OS_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -49,15 +52,17 @@ extern "C" {
|
||||
/*
|
||||
* Structure for device manager block
|
||||
*/
|
||||
typedef struct {
|
||||
s32 active; /* Status flag */
|
||||
OSThread *thread; /* Calling thread */
|
||||
OSMesgQueue *cmdQueue; /* Command queue */
|
||||
OSMesgQueue *evtQueue; /* Event queue */
|
||||
OSMesgQueue *acsQueue; /* Access queue */
|
||||
/* Raw DMA routine */
|
||||
s32 (*dma)(s32, u32, void *, u32);
|
||||
s32 (*edma)(OSPiHandle *, s32, u32, void *, u32);
|
||||
typedef struct
|
||||
{
|
||||
s32 active; /* Status flag */
|
||||
OSThread *thread; /* Calling thread */
|
||||
OSMesgQueue *cmdQueue; /* Command queue */
|
||||
OSMesgQueue *evtQueue; /* Event queue */
|
||||
OSMesgQueue *acsQueue; /* Access queue */
|
||||
/* Raw DMA routine */
|
||||
s32 (*dma)(s32, u32, void *, u32);
|
||||
|
||||
s32 (*edma)(OSPiHandle *, s32, u32, void *, u32);
|
||||
} OSDevMgr;
|
||||
|
||||
/*
|
||||
@@ -65,40 +70,42 @@ typedef struct {
|
||||
*/
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
int status;
|
||||
OSMesgQueue *queue;
|
||||
int channel;
|
||||
u8 id[32];
|
||||
u8 label[32];
|
||||
int version;
|
||||
int dir_size;
|
||||
int inode_table; /* block location */
|
||||
int minode_table; /* mirrioring inode_table */
|
||||
int dir_table; /* block location */
|
||||
int inode_start_page; /* page # */
|
||||
u8 banks;
|
||||
u8 activebank;
|
||||
typedef struct
|
||||
{
|
||||
int status;
|
||||
OSMesgQueue *queue;
|
||||
int channel;
|
||||
u8 id[32];
|
||||
u8 label[32];
|
||||
int version;
|
||||
int dir_size;
|
||||
int inode_table; /* block location */
|
||||
int minode_table; /* mirrioring inode_table */
|
||||
int dir_table; /* block location */
|
||||
int inode_start_page; /* page # */
|
||||
u8 banks;
|
||||
u8 activebank;
|
||||
} OSPfs;
|
||||
|
||||
|
||||
typedef struct {
|
||||
u32 file_size; /* bytes */
|
||||
u32 game_code;
|
||||
u16 company_code;
|
||||
char ext_name[4];
|
||||
char game_name[16];
|
||||
typedef struct
|
||||
{
|
||||
u32 file_size; /* bytes */
|
||||
u32 game_code;
|
||||
u16 company_code;
|
||||
char ext_name[4];
|
||||
char game_name[16];
|
||||
} OSPfsState;
|
||||
|
||||
/*
|
||||
* Structure for Profiler
|
||||
*/
|
||||
typedef struct {
|
||||
u16 *histo_base; /* histogram base */
|
||||
u32 histo_size; /* histogram size */
|
||||
u32 *text_start; /* start of text segment */
|
||||
u32 *text_end; /* end of text segment */
|
||||
typedef struct
|
||||
{
|
||||
u16 *histo_base; /* histogram base */
|
||||
u32 histo_size; /* histogram size */
|
||||
u32 *text_start; /* start of text segment */
|
||||
u32 *text_end; /* end of text segment */
|
||||
} OSProf;
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
@@ -431,7 +438,7 @@ typedef struct {
|
||||
|
||||
#define PFS_ERR_NOPACK 1 /* no memory card is plugged or */
|
||||
#define PFS_ERR_NEW_PACK 2 /* ram pack has been changed to a */
|
||||
/* different one */
|
||||
/* different one */
|
||||
#define PFS_ERR_INCONSISTENT 3 /* need to run Pfschecker */
|
||||
#define PFS_ERR_CONTRFAIL CONT_OVERRUN_ERROR
|
||||
#define PFS_ERR_INVALID 5 /* invalid parameter or file not exist*/
|
||||
@@ -514,66 +521,65 @@ extern u64 osClockRate;
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
extern OSViMode osViModeTable[]; /* Global VI mode table */
|
||||
extern OSViMode osViModeTable[]; /* Global VI mode table */
|
||||
|
||||
extern OSViMode osViModeNtscLpn1; /* Individual VI NTSC modes */
|
||||
extern OSViMode osViModeNtscLpf1;
|
||||
extern OSViMode osViModeNtscLan1;
|
||||
extern OSViMode osViModeNtscLaf1;
|
||||
extern OSViMode osViModeNtscLpn2;
|
||||
extern OSViMode osViModeNtscLpf2;
|
||||
extern OSViMode osViModeNtscLan2;
|
||||
extern OSViMode osViModeNtscLaf2;
|
||||
extern OSViMode osViModeNtscHpn1;
|
||||
extern OSViMode osViModeNtscHpf1;
|
||||
extern OSViMode osViModeNtscHan1;
|
||||
extern OSViMode osViModeNtscHaf1;
|
||||
extern OSViMode osViModeNtscHpn2;
|
||||
extern OSViMode osViModeNtscHpf2;
|
||||
extern OSViMode osViModeNtscLpn1; /* Individual VI NTSC modes */
|
||||
extern OSViMode osViModeNtscLpf1;
|
||||
extern OSViMode osViModeNtscLan1;
|
||||
extern OSViMode osViModeNtscLaf1;
|
||||
extern OSViMode osViModeNtscLpn2;
|
||||
extern OSViMode osViModeNtscLpf2;
|
||||
extern OSViMode osViModeNtscLan2;
|
||||
extern OSViMode osViModeNtscLaf2;
|
||||
extern OSViMode osViModeNtscHpn1;
|
||||
extern OSViMode osViModeNtscHpf1;
|
||||
extern OSViMode osViModeNtscHan1;
|
||||
extern OSViMode osViModeNtscHaf1;
|
||||
extern OSViMode osViModeNtscHpn2;
|
||||
extern OSViMode osViModeNtscHpf2;
|
||||
|
||||
extern OSViMode osViModePalLpn1; /* Individual VI PAL modes */
|
||||
extern OSViMode osViModePalLpf1;
|
||||
extern OSViMode osViModePalLan1;
|
||||
extern OSViMode osViModePalLaf1;
|
||||
extern OSViMode osViModePalLpn2;
|
||||
extern OSViMode osViModePalLpf2;
|
||||
extern OSViMode osViModePalLan2;
|
||||
extern OSViMode osViModePalLaf2;
|
||||
extern OSViMode osViModePalHpn1;
|
||||
extern OSViMode osViModePalHpf1;
|
||||
extern OSViMode osViModePalHan1;
|
||||
extern OSViMode osViModePalHaf1;
|
||||
extern OSViMode osViModePalHpn2;
|
||||
extern OSViMode osViModePalHpf2;
|
||||
extern OSViMode osViModePalLpn1; /* Individual VI PAL modes */
|
||||
extern OSViMode osViModePalLpf1;
|
||||
extern OSViMode osViModePalLan1;
|
||||
extern OSViMode osViModePalLaf1;
|
||||
extern OSViMode osViModePalLpn2;
|
||||
extern OSViMode osViModePalLpf2;
|
||||
extern OSViMode osViModePalLan2;
|
||||
extern OSViMode osViModePalLaf2;
|
||||
extern OSViMode osViModePalHpn1;
|
||||
extern OSViMode osViModePalHpf1;
|
||||
extern OSViMode osViModePalHan1;
|
||||
extern OSViMode osViModePalHaf1;
|
||||
extern OSViMode osViModePalHpn2;
|
||||
extern OSViMode osViModePalHpf2;
|
||||
|
||||
extern OSViMode osViModeMpalLpn1; /* Individual VI MPAL modes */
|
||||
extern OSViMode osViModeMpalLpf1;
|
||||
extern OSViMode osViModeMpalLan1;
|
||||
extern OSViMode osViModeMpalLaf1;
|
||||
extern OSViMode osViModeMpalLpn2;
|
||||
extern OSViMode osViModeMpalLpf2;
|
||||
extern OSViMode osViModeMpalLan2;
|
||||
extern OSViMode osViModeMpalLaf2;
|
||||
extern OSViMode osViModeMpalHpn1;
|
||||
extern OSViMode osViModeMpalHpf1;
|
||||
extern OSViMode osViModeMpalHan1;
|
||||
extern OSViMode osViModeMpalHaf1;
|
||||
extern OSViMode osViModeMpalHpn2;
|
||||
extern OSViMode osViModeMpalHpf2;
|
||||
extern OSViMode osViModeMpalLpn1; /* Individual VI MPAL modes */
|
||||
extern OSViMode osViModeMpalLpf1;
|
||||
extern OSViMode osViModeMpalLan1;
|
||||
extern OSViMode osViModeMpalLaf1;
|
||||
extern OSViMode osViModeMpalLpn2;
|
||||
extern OSViMode osViModeMpalLpf2;
|
||||
extern OSViMode osViModeMpalLan2;
|
||||
extern OSViMode osViModeMpalLaf2;
|
||||
extern OSViMode osViModeMpalHpn1;
|
||||
extern OSViMode osViModeMpalHpf1;
|
||||
extern OSViMode osViModeMpalHan1;
|
||||
extern OSViMode osViModeMpalHaf1;
|
||||
extern OSViMode osViModeMpalHpn2;
|
||||
extern OSViMode osViModeMpalHpf2;
|
||||
|
||||
extern s32 osRomType; /* Bulk or cartridge ROM. 0=cartridge 1=bulk */
|
||||
extern u32 osRomBase; /* Rom base address of the game image */
|
||||
extern u32 osTvType; /* 0 = PAL, 1 = NTSC, 2 = MPAL */
|
||||
extern u32 osResetType; /* 0 = cold reset, 1 = NMI */
|
||||
extern s32 osCicId;
|
||||
extern s32 osVersion;
|
||||
extern u32 osMemSize; /* Memory Size */
|
||||
extern s32 osAppNMIBuffer[];
|
||||
|
||||
extern OSIntMask __OSGlobalIntMask; /* global interrupt mask */
|
||||
extern OSPiHandle *__osPiTable; /* The head of OSPiHandle link list */
|
||||
extern OSPiHandle *__osDiskHandle; /* For exceptasm to get disk info*/
|
||||
extern s32 osRomType; /* Bulk or cartridge ROM. 0=cartridge 1=bulk */
|
||||
extern u32 osRomBase; /* Rom base address of the game image */
|
||||
extern u32 osTvType; /* 0 = PAL, 1 = NTSC, 2 = MPAL */
|
||||
extern u32 osResetType; /* 0 = cold reset, 1 = NMI */
|
||||
extern s32 osCicId;
|
||||
extern s32 osVersion;
|
||||
extern u32 osMemSize; /* Memory Size */
|
||||
extern s32 osAppNMIBuffer[];
|
||||
|
||||
extern OSIntMask __OSGlobalIntMask; /* global interrupt mask */
|
||||
extern OSPiHandle *__osPiTable; /* The head of OSPiHandle link list */
|
||||
extern OSPiHandle *__osDiskHandle; /* For exceptasm to get disk info*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
@@ -584,58 +590,59 @@ extern OSPiHandle *__osDiskHandle; /* For exceptasm to get disk info*/
|
||||
|
||||
/* Thread operations */
|
||||
|
||||
extern void osCreateThread(OSThread *, OSId, void (*)(void *),
|
||||
void *, void *, OSPri);
|
||||
extern void osDestroyThread(OSThread *);
|
||||
extern void osYieldThread(void);
|
||||
extern void osStartThread(OSThread *);
|
||||
extern void osStopThread(OSThread *);
|
||||
extern OSId osGetThreadId(OSThread *);
|
||||
extern void osSetThreadPri(OSThread *, OSPri);
|
||||
extern OSPri osGetThreadPri(OSThread *);
|
||||
extern void osCreateThread(
|
||||
OSThread *, OSId, void (*)(void *),
|
||||
void *, void *, OSPri);
|
||||
extern void osDestroyThread(OSThread *);
|
||||
extern void osYieldThread(void);
|
||||
extern void osStartThread(OSThread *);
|
||||
extern void osStopThread(OSThread *);
|
||||
extern OSId osGetThreadId(OSThread *);
|
||||
extern void osSetThreadPri(OSThread *, OSPri);
|
||||
extern OSPri osGetThreadPri(OSThread *);
|
||||
|
||||
/* Message operations */
|
||||
|
||||
extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32);
|
||||
extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32);
|
||||
extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32);
|
||||
extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32);
|
||||
|
||||
/* Event operations */
|
||||
|
||||
extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg);
|
||||
extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg);
|
||||
|
||||
/* Interrupt operations */
|
||||
|
||||
extern OSIntMask osGetIntMask(void);
|
||||
extern OSIntMask osSetIntMask(OSIntMask);
|
||||
extern OSIntMask osGetIntMask(void);
|
||||
extern OSIntMask osSetIntMask(OSIntMask);
|
||||
|
||||
/* RDB port operations */
|
||||
|
||||
extern void osInitRdb(u8 *sendBuf, u32 sendSize);
|
||||
extern void osInitRdb(u8 *sendBuf, u32 sendSize);
|
||||
|
||||
/* Cache operations and macros */
|
||||
|
||||
extern void osInvalDCache(void *, size_t);
|
||||
extern void osInvalICache(void *, size_t);
|
||||
extern void osWritebackDCache(void *, size_t);
|
||||
extern void osWritebackDCacheAll(void);
|
||||
extern void osInvalDCache(void *, size_t);
|
||||
extern void osInvalICache(void *, size_t);
|
||||
extern void osWritebackDCache(void *, size_t);
|
||||
extern void osWritebackDCacheAll(void);
|
||||
|
||||
#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10))
|
||||
#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10))
|
||||
|
||||
/* TLB management routines */
|
||||
|
||||
extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32);
|
||||
extern void osMapTLBRdb(void);
|
||||
extern void osUnmapTLB(s32);
|
||||
extern void osUnmapTLBAll(void);
|
||||
extern void osSetTLBASID(s32);
|
||||
extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32);
|
||||
extern void osMapTLBRdb(void);
|
||||
extern void osUnmapTLB(s32);
|
||||
extern void osUnmapTLBAll(void);
|
||||
extern void osSetTLBASID(s32);
|
||||
|
||||
/* Address translation routines and macros */
|
||||
|
||||
extern u32 osVirtualToPhysical(void *);
|
||||
extern void * osPhysicalToVirtual(u32);
|
||||
extern u32 osVirtualToPhysical(void *);
|
||||
extern void *osPhysicalToVirtual(u32);
|
||||
|
||||
#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000))
|
||||
#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000))
|
||||
@@ -646,66 +653,68 @@ extern void * osPhysicalToVirtual(u32);
|
||||
/* I/O operations */
|
||||
|
||||
/* Audio interface (Ai) */
|
||||
extern u32 osAiGetStatus(void);
|
||||
extern u32 osAiGetLength(void);
|
||||
extern s32 osAiSetFrequency(u32);
|
||||
extern s32 osAiSetNextBuffer(void *, u32);
|
||||
extern u32 osAiGetStatus(void);
|
||||
extern u32 osAiGetLength(void);
|
||||
extern s32 osAiSetFrequency(u32);
|
||||
extern s32 osAiSetNextBuffer(void *, u32);
|
||||
|
||||
/* Display processor interface (Dp) */
|
||||
extern u32 osDpGetStatus(void);
|
||||
extern void osDpSetStatus(u32);
|
||||
extern void osDpGetCounters(u32 *);
|
||||
extern s32 osDpSetNextBuffer(void *, u64);
|
||||
extern u32 osDpGetStatus(void);
|
||||
extern void osDpSetStatus(u32);
|
||||
extern void osDpGetCounters(u32 *);
|
||||
extern s32 osDpSetNextBuffer(void *, u64);
|
||||
|
||||
/* Peripheral interface (Pi) */
|
||||
extern u32 osPiGetStatus(void);
|
||||
extern s32 osPiGetDeviceType(void);
|
||||
extern s32 osPiRawWriteIo(u32, u32);
|
||||
extern s32 osPiRawReadIo(u32, u32 *);
|
||||
extern s32 osPiRawStartDma(s32, u32, void *, u32);
|
||||
extern s32 osPiWriteIo(u32, u32);
|
||||
extern s32 osPiReadIo(u32, u32 *);
|
||||
extern s32 osPiStartDma(OSIoMesg *, s32, s32, u32, void *, u32,
|
||||
OSMesgQueue *);
|
||||
extern void osCreatePiManager(OSPri, OSMesgQueue *, OSMesg *, s32);
|
||||
extern u32 osPiGetStatus(void);
|
||||
extern s32 osPiGetDeviceType(void);
|
||||
extern s32 osPiRawWriteIo(u32, u32);
|
||||
extern s32 osPiRawReadIo(u32, u32 *);
|
||||
extern s32 osPiRawStartDma(s32, u32, void *, u32);
|
||||
extern s32 osPiWriteIo(u32, u32);
|
||||
extern s32 osPiReadIo(u32, u32 *);
|
||||
extern s32 osPiStartDma(
|
||||
OSIoMesg *, s32, s32, u32, void *, u32,
|
||||
OSMesgQueue *);
|
||||
extern void osCreatePiManager(OSPri, OSMesgQueue *, OSMesg *, s32);
|
||||
|
||||
/* Video interface (Vi) */
|
||||
extern u32 osViGetStatus(void);
|
||||
extern u32 osViGetCurrentMode(void);
|
||||
extern u32 osViGetCurrentLine(void);
|
||||
extern u32 osViGetCurrentField(void);
|
||||
extern void *osViGetCurrentFramebuffer(void);
|
||||
extern void *osViGetNextFramebuffer(void);
|
||||
extern void osViSetXScale(f32);
|
||||
extern void osViSetYScale(f32);
|
||||
extern void osViSetSpecialFeatures(u32);
|
||||
extern void osViSetMode(OSViMode *);
|
||||
extern void osViSetEvent(OSMesgQueue *, OSMesg, u32);
|
||||
extern void osViSwapBuffer(void *);
|
||||
extern void osViBlack(u8);
|
||||
extern void osViFade(u8, u16);
|
||||
extern void osViRepeatLine(u8);
|
||||
extern void osCreateViManager(OSPri);
|
||||
extern u32 osViGetStatus(void);
|
||||
extern u32 osViGetCurrentMode(void);
|
||||
extern u32 osViGetCurrentLine(void);
|
||||
extern u32 osViGetCurrentField(void);
|
||||
extern void *osViGetCurrentFramebuffer(void);
|
||||
extern void *osViGetNextFramebuffer(void);
|
||||
extern void osViSetXScale(f32);
|
||||
extern void osViSetYScale(f32);
|
||||
extern void osViSetSpecialFeatures(u32);
|
||||
extern void osViSetMode(OSViMode *);
|
||||
extern void osViSetEvent(OSMesgQueue *, OSMesg, u32);
|
||||
extern void osViSwapBuffer(void *);
|
||||
extern void osViBlack(u8);
|
||||
extern void osViFade(u8, u16);
|
||||
extern void osViRepeatLine(u8);
|
||||
extern void osCreateViManager(OSPri);
|
||||
|
||||
/* Timer interface */
|
||||
|
||||
extern OSTime osGetTime(void);
|
||||
extern void osSetTime(OSTime);
|
||||
extern u32 osSetTimer(OSTimer *, OSTime, OSTime,
|
||||
OSMesgQueue *, OSMesg);
|
||||
extern int osStopTimer(OSTimer *);
|
||||
extern OSTime osGetTime(void);
|
||||
extern void osSetTime(OSTime);
|
||||
extern u32 osSetTimer(
|
||||
OSTimer *, OSTime, OSTime,
|
||||
OSMesgQueue *, OSMesg);
|
||||
extern int osStopTimer(OSTimer *);
|
||||
|
||||
/* Controller interface */
|
||||
|
||||
extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *);
|
||||
extern s32 osContReset(OSMesgQueue *, OSContStatus *);
|
||||
extern s32 osContStartQuery(OSMesgQueue *);
|
||||
extern s32 osContStartReadData(OSMesgQueue *);
|
||||
extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *);
|
||||
extern s32 osContReset(OSMesgQueue *, OSContStatus *);
|
||||
extern s32 osContStartQuery(OSMesgQueue *);
|
||||
extern s32 osContStartReadData(OSMesgQueue *);
|
||||
#ifndef _HW_VERSION_1
|
||||
extern s32 osContSetCh(u8);
|
||||
extern s32 osContSetCh(u8);
|
||||
#endif
|
||||
extern void osContGetQuery(OSContStatus *);
|
||||
extern void osContGetReadData(OSContPad *);
|
||||
extern void osContGetQuery(OSContStatus *);
|
||||
extern void osContGetReadData(OSContPad *);
|
||||
|
||||
/* file system interface */
|
||||
|
||||
@@ -746,50 +755,50 @@ extern OSPiHandle *osLeoDiskInit(void);
|
||||
extern OSPiHandle *osDriveRomInit(void);
|
||||
|
||||
extern s32 osEPiDeviceType(OSPiHandle *, OSPiInfo *);
|
||||
extern s32 osEPiRawWriteIo(OSPiHandle *, u32 , u32);
|
||||
extern s32 osEPiRawReadIo(OSPiHandle *, u32 , u32 *);
|
||||
extern s32 osEPiRawStartDma(OSPiHandle *, s32 , u32 , void *, u32 );
|
||||
extern s32 osEPiWriteIo(OSPiHandle *, u32 , u32 );
|
||||
extern s32 osEPiReadIo(OSPiHandle *, u32 , u32 *);
|
||||
extern s32 osEPiRawWriteIo(OSPiHandle *, u32, u32);
|
||||
extern s32 osEPiRawReadIo(OSPiHandle *, u32, u32 *);
|
||||
extern s32 osEPiRawStartDma(OSPiHandle *, s32, u32, void *, u32);
|
||||
extern s32 osEPiWriteIo(OSPiHandle *, u32, u32);
|
||||
extern s32 osEPiReadIo(OSPiHandle *, u32, u32 *);
|
||||
extern s32 osEPiStartDma(OSPiHandle *, OSIoMesg *, s32);
|
||||
extern s32 osEPiLinkHandle(OSPiHandle *);
|
||||
|
||||
/* Profiler Interface */
|
||||
|
||||
extern void osProfileInit(OSProf *, u32 profcnt);
|
||||
extern void osProfileStart(u32);
|
||||
extern void osProfileFlush(void);
|
||||
extern void osProfileStop(void);
|
||||
extern void osProfileInit(OSProf *, u32 profcnt);
|
||||
extern void osProfileStart(u32);
|
||||
extern void osProfileFlush(void);
|
||||
extern void osProfileStop(void);
|
||||
|
||||
/* Game <> Host data transfer functions */
|
||||
|
||||
extern s32 osTestHost(void);
|
||||
extern void osReadHost(void *, u32);
|
||||
extern void osWriteHost(void *, u32);
|
||||
extern void osAckRamromRead(void);
|
||||
extern void osAckRamromWrite(void);
|
||||
extern s32 osTestHost(void);
|
||||
extern void osReadHost(void *, u32);
|
||||
extern void osWriteHost(void *, u32);
|
||||
extern void osAckRamromRead(void);
|
||||
extern void osAckRamromWrite(void);
|
||||
|
||||
|
||||
/* byte string operations */
|
||||
|
||||
extern void bcopy(const void *, void *, size_t);
|
||||
extern int bcmp(const void *, const void *, int);
|
||||
extern void bzero(void *, size_t);
|
||||
extern void bcopy(const void *, void *, size_t);
|
||||
extern int bcmp(const void *, const void *, int);
|
||||
extern void bzero(void *, size_t);
|
||||
|
||||
/* Miscellaneous operations */
|
||||
|
||||
extern void osInitialize(void);
|
||||
extern u32 osGetCount(void);
|
||||
extern void osExit(void);
|
||||
extern u32 osGetMemSize(void);
|
||||
extern void osInitialize(void);
|
||||
extern u32 osGetCount(void);
|
||||
extern void osExit(void);
|
||||
extern u32 osGetMemSize(void);
|
||||
|
||||
/* Printf */
|
||||
|
||||
extern int sprintf(char *s, const char *fmt, ...);
|
||||
extern void osSyncPrintf(const char *fmt, ...);
|
||||
extern void osAsyncPrintf(const char *fmt, ...);
|
||||
extern int osSyncGetChars(char *buf);
|
||||
extern int osAsyncGetChars(char *buf);
|
||||
extern int sprintf(char *s, const char *fmt, ...);
|
||||
extern void osSyncPrintf(const char *fmt, ...);
|
||||
extern void osAsyncPrintf(const char *fmt, ...);
|
||||
extern int osSyncGetChars(char *buf);
|
||||
extern int osAsyncGetChars(char *buf);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_AI_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -77,10 +80,10 @@ extern "C" {
|
||||
*/
|
||||
|
||||
/* Audio interface (Ai) */
|
||||
extern u32 osAiGetStatus(void);
|
||||
extern u32 osAiGetLength(void);
|
||||
extern s32 osAiSetFrequency(u32);
|
||||
extern s32 osAiSetNextBuffer(void *, u32);
|
||||
extern u32 osAiGetStatus(void);
|
||||
extern u32 osAiGetLength(void);
|
||||
extern s32 osAiSetFrequency(u32);
|
||||
extern s32 osAiSetNextBuffer(void *, u32);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_CACHE_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -81,10 +84,10 @@ extern "C" {
|
||||
|
||||
/* Cache operations and macros */
|
||||
|
||||
extern void osInvalDCache(void *, size_t);
|
||||
extern void osInvalICache(void *, size_t);
|
||||
extern void osWritebackDCache(void *, size_t);
|
||||
extern void osWritebackDCacheAll(void);
|
||||
extern void osInvalDCache(void *, size_t);
|
||||
extern void osInvalICache(void *, size_t);
|
||||
extern void osWritebackDCache(void *, size_t);
|
||||
extern void osWritebackDCacheAll(void);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_CONT_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -50,25 +53,28 @@ extern "C" {
|
||||
* Structure for controllers
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
u16 type; /* Controller Type */
|
||||
u8 status; /* Controller status */
|
||||
u8 errnum;
|
||||
}OSContStatus;
|
||||
typedef struct
|
||||
{
|
||||
u16 type; /* Controller Type */
|
||||
u8 status; /* Controller status */
|
||||
u8 errnum;
|
||||
} OSContStatus;
|
||||
|
||||
typedef struct {
|
||||
u16 button;
|
||||
s8 stick_x; /* -80 <= stick_x <= 80 */
|
||||
s8 stick_y; /* -80 <= stick_y <= 80 */
|
||||
u8 errnum;
|
||||
typedef struct
|
||||
{
|
||||
u16 button;
|
||||
s8 stick_x; /* -80 <= stick_x <= 80 */
|
||||
s8 stick_y; /* -80 <= stick_y <= 80 */
|
||||
u8 errnum;
|
||||
} OSContPad;
|
||||
|
||||
typedef struct {
|
||||
void *address; /* Ram pad Address: 11 bits */
|
||||
u8 databuffer[32]; /* address of the data buffer */
|
||||
u8 addressCrc; /* CRC code for address */
|
||||
u8 dataCrc; /* CRC code for data */
|
||||
u8 errnum;
|
||||
typedef struct
|
||||
{
|
||||
void *address; /* Ram pad Address: 11 bits */
|
||||
u8 databuffer[32]; /* address of the data buffer */
|
||||
u8 addressCrc; /* CRC code for address */
|
||||
u8 dataCrc; /* CRC code for data */
|
||||
u8 errnum;
|
||||
} OSContRamIo;
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_EEPROM_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_EXCEPTION_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -106,8 +109,8 @@ typedef u32 OSHWIntr;
|
||||
|
||||
/* Interrupt operations */
|
||||
|
||||
extern OSIntMask osGetIntMask(void);
|
||||
extern OSIntMask osSetIntMask(OSIntMask);
|
||||
extern OSIntMask osGetIntMask(void);
|
||||
extern OSIntMask osSetIntMask(OSIntMask);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
// Old deprecated functions from strings.h, replaced by memcpy/memset.
|
||||
extern void bcopy(const void *, void *, size_t);
|
||||
|
||||
extern void bzero(void *, size_t);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_MESSAGE_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -50,20 +53,21 @@ typedef u32 OSEvent;
|
||||
/*
|
||||
* Structure for message
|
||||
*/
|
||||
typedef void * OSMesg;
|
||||
typedef void *OSMesg;
|
||||
|
||||
/*
|
||||
* Structure for message queue
|
||||
*/
|
||||
typedef struct OSMesgQueue_s {
|
||||
OSThread *mtqueue; /* Queue to store threads blocked
|
||||
typedef struct OSMesgQueue_s
|
||||
{
|
||||
OSThread *mtqueue; /* Queue to store threads blocked
|
||||
on empty mailboxes (receive) */
|
||||
OSThread *fullqueue; /* Queue to store threads blocked
|
||||
OSThread *fullqueue; /* Queue to store threads blocked
|
||||
on full mailboxes (send) */
|
||||
s32 validCount; /* Contains number of valid message */
|
||||
s32 first; /* Points to first valid message */
|
||||
s32 msgCount; /* Contains total # of messages */
|
||||
OSMesg *msg; /* Points to message buffer array */
|
||||
s32 validCount; /* Contains number of valid message */
|
||||
s32 first; /* Points to first valid message */
|
||||
s32 msgCount; /* Contains total # of messages */
|
||||
OSMesg *msg; /* Points to message buffer array */
|
||||
} OSMesgQueue;
|
||||
|
||||
|
||||
@@ -145,14 +149,14 @@ typedef struct OSMesgQueue_s {
|
||||
|
||||
/* Message operations */
|
||||
|
||||
extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32);
|
||||
extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32);
|
||||
extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32);
|
||||
extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32);
|
||||
extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32);
|
||||
|
||||
/* Event operations */
|
||||
|
||||
extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg);
|
||||
extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
/* Miscellaneous OS functions */
|
||||
|
||||
void osInitialize(void);
|
||||
|
||||
u32 osGetCount(void);
|
||||
|
||||
uintptr_t osVirtualToPhysical(void *);
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
|
||||
/* Types */
|
||||
|
||||
typedef struct {
|
||||
#if !defined(VERSION_EU)
|
||||
typedef struct
|
||||
{
|
||||
#if !defined(VERSION_EU)
|
||||
u32 errStatus;
|
||||
#endif
|
||||
#endif
|
||||
void *dramAddr;
|
||||
void *C2Addr;
|
||||
u32 sectorSize;
|
||||
@@ -17,21 +18,23 @@ typedef struct {
|
||||
u32 C1ErrSector[4];
|
||||
} __OSBlockInfo;
|
||||
|
||||
typedef struct {
|
||||
u32 cmdType; // 0
|
||||
u16 transferMode; // 4
|
||||
u16 blockNum; // 6
|
||||
s32 sectorNum; // 8
|
||||
typedef struct
|
||||
{
|
||||
u32 cmdType; // 0
|
||||
u16 transferMode; // 4
|
||||
u16 blockNum; // 6
|
||||
s32 sectorNum; // 8
|
||||
uintptr_t devAddr; // c
|
||||
#if defined(VERSION_EU)
|
||||
#if defined(VERSION_EU)
|
||||
u32 errStatus; //error status added moved to blockinfo
|
||||
#endif
|
||||
u32 bmCtlShadow; // 10
|
||||
u32 seqCtlShadow; // 14
|
||||
#endif
|
||||
u32 bmCtlShadow; // 10
|
||||
u32 seqCtlShadow; // 14
|
||||
__OSBlockInfo block[2]; // 18
|
||||
} __OSTranxInfo;
|
||||
|
||||
typedef struct OSPiHandle_s {
|
||||
typedef struct OSPiHandle_s
|
||||
{
|
||||
struct OSPiHandle_s *next;
|
||||
u8 type;
|
||||
u8 latency;
|
||||
@@ -44,26 +47,33 @@ typedef struct OSPiHandle_s {
|
||||
__OSTranxInfo transferInfo;
|
||||
} OSPiHandle;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
u8 type;
|
||||
uintptr_t address;
|
||||
} OSPiInfo;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
u16 type;
|
||||
u8 pri;
|
||||
u8 status;
|
||||
OSMesgQueue *retQueue;
|
||||
} OSIoMesgHdr;
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ OSIoMesgHdr hdr;
|
||||
/*0x08*/ void *dramAddr;
|
||||
/*0x0C*/ uintptr_t devAddr;
|
||||
/*0x10*/ size_t size;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
typedef struct
|
||||
{
|
||||
/*0x00*/
|
||||
OSIoMesgHdr hdr;
|
||||
/*0x08*/
|
||||
void *dramAddr;
|
||||
/*0x0C*/
|
||||
uintptr_t devAddr;
|
||||
/*0x10*/
|
||||
size_t size;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
OSPiHandle *piHandle; // from the official definition
|
||||
#endif
|
||||
#endif
|
||||
} OSIoMesg;
|
||||
|
||||
/* Definitions */
|
||||
@@ -76,13 +86,19 @@ typedef struct {
|
||||
|
||||
/* Functions */
|
||||
|
||||
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr,
|
||||
size_t nbytes, OSMesgQueue *mq);
|
||||
s32 osPiStartDma(
|
||||
OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr,
|
||||
size_t nbytes, OSMesgQueue *mq);
|
||||
|
||||
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt);
|
||||
|
||||
OSMesgQueue *osPiGetCmdQueue(void);
|
||||
|
||||
s32 osPiWriteIo(uintptr_t devAddr, u32 data);
|
||||
|
||||
s32 osPiReadIo(uintptr_t 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);
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_RDP_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -77,10 +80,10 @@ extern "C" {
|
||||
*/
|
||||
|
||||
/* Display processor interface (Dp) */
|
||||
extern u32 osDpGetStatus(void);
|
||||
extern void osDpSetStatus(u32);
|
||||
extern void osDpGetCounters(u32 *);
|
||||
extern s32 osDpSetNextBuffer(void *, u64);
|
||||
extern u32 osDpGetStatus(void);
|
||||
extern void osDpSetStatus(u32);
|
||||
extern void osDpGetCounters(u32 *);
|
||||
extern s32 osDpSetNextBuffer(void *, u64);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
@@ -23,20 +23,31 @@ typedef s32 OSId;
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct {f32 f_odd; f32 f_even;} f;
|
||||
struct
|
||||
{
|
||||
f32 f_odd;
|
||||
f32 f_even;
|
||||
} f;
|
||||
} __OSfp;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* registers */
|
||||
/*0x20*/ u64 at, v0, v1, a0, a1, a2, a3;
|
||||
/*0x58*/ u64 t0, t1, t2, t3, t4, t5, t6, t7;
|
||||
/*0x98*/ u64 s0, s1, s2, s3, s4, s5, s6, s7;
|
||||
/*0xD8*/ u64 t8, t9, gp, sp, s8, ra;
|
||||
/*0x108*/ u64 lo, hi;
|
||||
/*0x118*/ u32 sr, pc, cause, badvaddr, rcp;
|
||||
/*0x12C*/ u32 fpcsr;
|
||||
__OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14;
|
||||
/*0x20*/
|
||||
u64 at, v0, v1, a0, a1, a2, a3;
|
||||
/*0x58*/
|
||||
u64 t0, t1, t2, t3, t4, t5, t6, t7;
|
||||
/*0x98*/
|
||||
u64 s0, s1, s2, s3, s4, s5, s6, s7;
|
||||
/*0xD8*/
|
||||
u64 t8, t9, gp, sp, s8, ra;
|
||||
/*0x108*/
|
||||
u64 lo, hi;
|
||||
/*0x118*/
|
||||
u32 sr, pc, cause, badvaddr, rcp;
|
||||
/*0x12C*/
|
||||
u32 fpcsr;
|
||||
__OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14;
|
||||
__OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30;
|
||||
} __OSThreadContext;
|
||||
|
||||
@@ -49,27 +60,43 @@ typedef struct
|
||||
|
||||
typedef struct OSThread_s
|
||||
{
|
||||
/*0x00*/ struct OSThread_s *next;
|
||||
/*0x04*/ OSPri priority;
|
||||
/*0x08*/ struct OSThread_s **queue;
|
||||
/*0x0C*/ struct OSThread_s *tlnext;
|
||||
/*0x10*/ u16 state;
|
||||
/*0x12*/ u16 flags;
|
||||
/*0x14*/ OSId id;
|
||||
/*0x18*/ int fp;
|
||||
/*0x1C*/ __OSThreadprofile_s *thprof;
|
||||
/*0x20*/ __OSThreadContext context;
|
||||
/*0x00*/
|
||||
struct OSThread_s *next;
|
||||
/*0x04*/
|
||||
OSPri priority;
|
||||
/*0x08*/
|
||||
struct OSThread_s **queue;
|
||||
/*0x0C*/
|
||||
struct OSThread_s *tlnext;
|
||||
/*0x10*/
|
||||
u16 state;
|
||||
/*0x12*/
|
||||
u16 flags;
|
||||
/*0x14*/
|
||||
OSId id;
|
||||
/*0x18*/
|
||||
int fp;
|
||||
/*0x1C*/
|
||||
__OSThreadprofile_s *thprof;
|
||||
/*0x20*/
|
||||
__OSThreadContext context;
|
||||
} OSThread;
|
||||
|
||||
|
||||
/* Functions */
|
||||
|
||||
void osCreateThread(OSThread *thread, OSId id, void (*entry)(void *),
|
||||
void osCreateThread(
|
||||
OSThread *thread, OSId id, void (*entry)(void *),
|
||||
void *arg, void *sp, OSPri pri);
|
||||
|
||||
OSId osGetThreadId(OSThread *thread);
|
||||
|
||||
OSPri osGetThreadPri(OSThread *thread);
|
||||
|
||||
void osSetThreadPri(OSThread *thread, OSPri pri);
|
||||
|
||||
void osStartThread(OSThread *thread);
|
||||
|
||||
void osStopThread(OSThread *thread);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,9 @@ typedef u64 OSTime;
|
||||
/* Functions */
|
||||
|
||||
OSTime osGetTime(void);
|
||||
|
||||
void osSetTime(OSTime time);
|
||||
|
||||
u32 osSetTimer(OSTimer *, OSTime, OSTime, OSMesgQueue *, OSMesg);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,10 @@
|
||||
#define _OS_TLB_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include "ultratypes.h"
|
||||
@@ -91,11 +94,11 @@ typedef u32 OSPageMask;
|
||||
|
||||
/* TLB management routines */
|
||||
|
||||
extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32);
|
||||
extern void osMapTLBRdb(void);
|
||||
extern void osUnmapTLB(s32);
|
||||
extern void osUnmapTLBAll(void);
|
||||
extern void osSetTLBASID(s32);
|
||||
extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32);
|
||||
extern void osMapTLBRdb(void);
|
||||
extern void osUnmapTLB(s32);
|
||||
extern void osUnmapTLBAll(void);
|
||||
extern void osSetTLBASID(s32);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user